Skip to content

Commit f15c13c

Browse files
authored
Merge pull request #44 from Fe-r-oz/doctests
fix documentation build, misc bugs and add doctests
2 parents ed3e65d + 4339de2 commit f15c13c

File tree

11 files changed

+321
-51
lines changed

11 files changed

+321
-51
lines changed

docs/Project.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
[deps]
2+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
23
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
4+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
5+
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
36
CodingTheory = "7ca085cf-10e4-43da-ad7d-8f62f68877b3"
7+
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
8+
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
49
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
10+
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
511
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
12+
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
13+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
14+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
15+
Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
16+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Documenter.makedocs(;
99
modules = Module[CodingTheory],
1010
repo = "",
1111
highlightsig = true,
12-
sitename = "Coding Theory Documentation",
12+
sitename = "CodingTheory.jl",
1313
expandfirst = [],
1414
warnonly = [:missing_docs],
1515
pages = ["Introduction" => "index.md",

docs/src/Tutorials/Weight Reduction.md

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -678,42 +678,27 @@ Dict(78 => 28, 56 => 2894, 16 => 13428, 20 => 24654, 58 => 15616, 52 => 7728, 60
678678
## Lifted Products
679679
Classical weight reduction also applies to other types of inputs, although with the current function, the row and column indices must be specified explicitly either as a vector or a range.
680680
```
681-
julia> F = GF(2);
682-
683-
julia> S, x = PolynomialRing(F, "x");
681+
julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), "x");
684682
685683
julia> l = 63;
686684
687-
julia> R = ResidueRing(S, x^l - 1);
685+
julia> R, = residue_ring(S, x^l - 1);
688686
689687
julia> A = matrix(R, 7, 7,
690-
[x^27, 0, 0, 1, x^18, x^27, 1,
691-
1, x^27, 0, 0, 1, x^18, x^27,
692-
x^27, 1, x^27, 0, 0, 1, x^18,
693-
x^18, x^27, 1, x^27, 0, 0, 1,
694-
1, x^18, x^27, 1, x^27, 0, 0,
695-
0, 1, x^18, x^27, 1, x^27, 0,
696-
0, 0, 1, x^18, x^27, 1, x^27])
697-
[x^27 0 0 1 x^18 x^27 1]
698-
[ 1 x^27 0 0 1 x^18 x^27]
699-
[x^27 1 x^27 0 0 1 x^18]
700-
[x^18 x^27 1 x^27 0 0 1]
701-
[ 1 x^18 x^27 1 x^27 0 0]
702-
[ 0 1 x^18 x^27 1 x^27 0]
703-
[ 0 0 1 x^18 x^27 1 x^27]
704-
705-
julia> b = R(1 + x + x^6)
706-
x^6 + x + 1
707-
708-
julia> LiftedProductCode(A, b)
709-
┌ Warning: Commutativity of A and b required but not yet enforced.
710-
└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:354
711-
[[882, 48]]_2 CSS stabilizer code
688+
[x^27, 0 , 0 , 1 , x^18, x^27, 1 ,
689+
1 , x^27, 0 , 0 , 1 , x^18, x^27,
690+
x^27, 1 , x^27, 0 , 0 , 1 , x^18,
691+
x^18, x^27, 1 , x^27, 0 , 0 , 1 ,
692+
1 , x^18, x^27, 1 , x^27, 0 , 0 ,
693+
0 , 1 , x^18, x^27, 1 , x^27, 0 ,
694+
0 , 0 , 1 , x^18, x^27, 1 , x^27]);
712695
713-
julia> A_wtred = weight_reduction(A, row_indices = 1:4, column_indices = 1:4, permute_rows = false, permute_columns = false);
696+
julia> b = R(1 + x + x^6);
714697
715-
julia> LiftedProductCode(A_wtred, b)
698+
julia> code = LiftedProductCode(A, b);
716699
┌ Warning: Commutativity of A and b required but not yet enforced.
717-
└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:354
718-
[[4914, 48]]_2 CSS stabilizer code
700+
└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:340
701+
702+
julia> length(code), dimension(code)
703+
(882, 48)
719704
```

docs/src/references.bib

Lines changed: 21 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,
@@ -202,6 +213,16 @@ @article{wang2024coprime
202213
year={2024}
203214
}
204215

216+
@article{ostrev2024classical,
217+
title={Classical product code constructions for quantum Calderbank-Shor-Steane codes},
218+
author={Ostrev, Dimiter and Orsucci, Davide and L{\'a}zaro, Francisco and Matuz, Balazs},
219+
journal={Quantum},
220+
volume={8},
221+
pages={1420},
222+
year={2024},
223+
publisher={Verein zur F{\"o}rderung des Open Access Publizierens in den Quantenwissenschaften}
224+
}
225+
205226
@book{kreher1999combinatorial,
206227
title={Combinatorial algorithms: generation, enumeration, and search},
207228
author={Kreher, Donald L and Stinson, Douglas R},

ext/MakieExt/Classical/Tanner.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
"""
8-
Tanner_graph_plot(H::Union{CTMatrixTypes, Matrix{Int}})
8+
$TYPEDSIGNATURES
99
1010
Return the Tanner graph of the matrix `H` as a `Figure` object.
1111

ext/MakieExt/Classical/weight_dist.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#############################
1010

1111
"""
12-
weight_plot(C::AbstractLinearCode; alg::Symbol = :auto)
12+
$TYPEDSIGNATURES
1313
1414
Return a bar graph of the weight distribution of `C`.
1515

ext/MakieExt/LDPC/analysis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#############################
1010

1111
"""
12-
EXIT_chart_plot(E::LDPCEnsemble, Ch::AbstractClassicalNoiseChannel; tol::Float64 = 1e-9)
12+
$TYPEDSIGNATURES
1313
1414
Return a plot of the EXIT chart for the ensemble given the channel up to a numerical tolerance of `tol`.
1515

ext/MakieExt/LDPC/codes.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#############################
1010

1111
"""
12-
degree_distributions_plot(C::AbstractLDPCCode)
12+
$TYPEDSIGNATURES
1313
1414
Return a bar plot of the column and row degree distributions of `C`.
1515
@@ -44,7 +44,7 @@ function CodingTheory.degree_distributions_plot(C::AbstractLDPCCode)
4444
end
4545

4646
"""
47-
count_short_cycles_plot(C::AbstractLDPCCode)
47+
$TYPEDSIGNATURES
4848
4949
Return a bar graph and a dictionary of (length, count) pairs for unique short
5050
cycles in the Tanner graph of `C`. An empty graph and dictionary are returned
@@ -82,7 +82,7 @@ function CodingTheory.count_short_cycles_plot(C::AbstractLDPCCode)
8282
end
8383

8484
"""
85-
count_elementary_cycles_plot(C::AbstractLDPCCode)
85+
$TYPEDSIGNATURES
8686
8787
Return a bar graph and a dictionary of (length, count) pairs for unique elementary
8888
cycles in the Tanner graph of `C`. An empty graph and dictionary are returned
@@ -120,7 +120,7 @@ function CodingTheory.count_elementary_cycles_plot(C::AbstractLDPCCode)
120120
end
121121

122122
"""
123-
ACE_spectrum(C::AbstractLDPCCode)
123+
$TYPEDSIGNATURES
124124
125125
Return an interactive figure and data for the ACE spectrum of the Tanner graph of `C`.
126126
@@ -171,7 +171,7 @@ end
171171
# doesn't seem to be a point in making this dynamic with a slider, as it simply
172172
# continues in the same tree shape and no useful information is gained from watching it
173173
"""
174-
computation_graph(C::AbstractLDPCCode, lvl::Int, v::Int, v_type::Symbol=:v)
174+
$TYPEDSIGNATURES
175175
176176
Return a figure representing the expansion of the Tanner graph of `C` to level `lvl`
177177
for node `v`. If `v_type` is `:v`, `v` is interpreted as a variable node; otherwise,

ext/MakieExt/Quantum/weight_dist.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#############################
1010

1111
"""
12-
weight_plot(S::AbstractStabilizerCode; alg::Symbol = :auto, type::Symbol = :stabilizer)
12+
$TYPEDSIGNATURES
1313
1414
Return a bar graph of the weight distribution related to `S`.
1515
@@ -49,7 +49,7 @@ function CodingTheory.weight_plot(S::AbstractStabilizerCode; alg::Symbol = :auto
4949
end
5050

5151
"""
52-
weight_plot_CSS_X(S::AbstractStabilizerCodeCSS; alg::Symbol = :auto)
52+
$TYPEDSIGNATURES
5353
5454
Return a bar graph of the weight distribution of the `X` stabilizers.
5555
@@ -73,7 +73,7 @@ function CodingTheory.weight_plot_CSS_X(S::AbstractStabilizerCodeCSS; alg::Symbo
7373
end
7474

7575
"""
76-
weight_plot_CSS_Z(S::AbstractStabilizerCodeCSS; alg::Symbol = :auto)
76+
$TYPEDSIGNATURES
7777
7878
Return a bar graph of the weight distribution of the `Z` stabilizers.
7979
@@ -97,7 +97,7 @@ function CodingTheory.weight_plot_CSS_Z(S::AbstractStabilizerCodeCSS; alg::Symbo
9797
end
9898

9999
"""
100-
weight_plot_CSS(S::AbstractStabilizerCodeCSS; alg::Symbol = :auto)
100+
$TYPEDSIGNATURES
101101
102102
Return bar graphs of the weight distribution of both the `X` and 'Z' stabilizers, separately.
103103

0 commit comments

Comments
 (0)