Skip to content

Commit a6607d3

Browse files
committed
add doctests for gaugeShorcode
1 parent 7d7b89a commit a6607d3

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

docs/src/references.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ @misc{Vasmer_2020
109109
year={2020}
110110
}
111111

112+
@article{poulin2005stabilizer,
113+
title={Stabilizer formalism for operator quantum error correction},
114+
author={Poulin, David},
115+
journal={Physical review letters},
116+
volume={95},
117+
number={23},
118+
pages={230504},
119+
year={2005},
120+
publisher={APS}
121+
}
122+
112123
% Product Codes
113124
114125
@article{bacon2006quantum,

src/Quantum/misc_known_codes.jl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,46 @@
88
# Subsystem codes
99
#############################
1010

11+
"""
12+
[[9, 1, 4, 3]] gauged Shor code from [poulin2005stabilizer](@cite)
13+
14+
```jldoctest
15+
julia> using CodingTheory, Oscar;
16+
17+
julia> code = GaugedShorCode();
18+
19+
julia> length(code), dimension(code), code.r
20+
(9, 1, 4)
21+
22+
julia> code.stabs_stand
23+
[1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0]
24+
[0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0]
25+
[0 0 0 0 0 0 0 0 0 1 1 1 0 1 0 1 1 0]
26+
[0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 1]
27+
28+
julia> code.logicals
29+
1-element Vector{Tuple{fpMatrix, fpMatrix}}:
30+
([0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1], [1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0])
31+
32+
julia> code.X_stabs
33+
[1 1 1 1 1 1 0 0 0]
34+
[1 1 1 0 0 0 1 1 1]
35+
36+
julia> code.Z_stabs
37+
[1 1 0 1 1 0 1 1 0]
38+
[0 1 1 0 1 1 0 1 1]
39+
40+
julia> code.g_ops_mat
41+
[0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0]
42+
[0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0]
43+
[0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0]
44+
[0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0]
45+
[0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0]
46+
[1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]
47+
[0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0]
48+
[0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0]
49+
```
50+
"""
1151
function GaugedShorCode()
1252
# Poulin, "Stabilizer Formalism for Operator Quantum Error Correction", (2008)
1353
# [[9, 1, 4, 3]] gauged Shor code

src/Quantum/product_codes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ julia> R, _ = residue_ring(S, x^l - 1);
666666
julia> A1 = matrix(R, 1, 1, [1 + x^1 + x^6]);
667667
668668
julia> A2 = matrix(R, 7, 7,
669-
[x^36, 0 , 0 , 0 , 0 , 1 , x^9,
669+
[x^36, 0 , 0 , 0 , 0 , 1 , x^9 ,
670670
x^9 , x^36, 0 , 0 , 0 , 0 , 1 ,
671671
1 , x^9 , x^36, 0 , 0 , 0 , 0 ,
672672
0 , 1 , x^9 , x^36, 0 , 0 , 0 ,

test/Quantum/product_codes_test.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,13 @@
670670

671671
@testset "BiasTailoredLiftedProductCode" begin
672672
# [[882, 24, d ≤ 24]] from Appendix B of https://arxiv.org/pdf/2202.01702
673+
F = Oscar.Nemo.Native.GF(2)
673674
S, x = polynomial_ring(F, :x)
674675
l = 63
675676
R, _ = residue_ring(S, x^l - 1)
676677
A1 = matrix(R, 1, 1, [1 + x^1 + x^6])
677678
A2 = matrix(R, 7, 7,
678-
[x^36, 0 , 0 , 0 , 0 , 1 , x^9,
679+
[x^36, 0 , 0 , 0 , 0 , 1 , x^9 ,
679680
x^9 , x^36, 0 , 0 , 0 , 0 , 1 ,
680681
1 , x^9 , x^36, 0 , 0 , 0 , 0 ,
681682
0 , 1 , x^9 , x^36, 0 , 0 , 0 ,

0 commit comments

Comments
 (0)