Skip to content

Commit 70c8991

Browse files
Fe-r-ozKrastanov
andauthored
fix: broken doctests and typos (#438)
Co-authored-by: Stefan Krastanov <[email protected]> Co-authored-by: Stefan Krastanov <[email protected]>
1 parent 7b444e9 commit 70c8991

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

ext/QuantumCliffordHeckeExt/lifted_product.jl

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ During the construction, we do arithmetic operations to get the group algebra el
2828
Here `x` is the generator of the group algebra, i.e., offset-1 cyclic permutation, and `GA(1)` is the unit element.
2929
3030
```jldoctest
31-
julia> import Hecke: group_algebra, GF, abelian_group, gens; import LinearAlgebra: diagind;
31+
julia> import Hecke: group_algebra, GF, abelian_group, gens; import LinearAlgebra: diagind; using QuantumClifford.ECC;
3232
3333
julia> l = 63; GA = group_algebra(GF(2), abelian_group(l)); x = gens(GA)[];
3434
@@ -52,10 +52,12 @@ julia> code_n(c1), code_k(c1)
5252
(882, 24)
5353
```
5454
55-
A [[175, 19, d ≤ 0]] code from Eq. (18) in Appendix A of [raveendran2022finite](@cite),
55+
A [[175, 19, d ≤ 10]] code from Eq. (18) in Appendix A of [raveendran2022finite](@cite),
5656
following the 4th constructor.
5757
5858
```jldoctest
59+
julia> import Hecke; using QuantumClifford.ECC;
60+
5961
julia> base_matrix = [0 0 0 0; 0 1 2 5; 0 6 3 1]; l = 7;
6062
6163
julia> c2 = LPCode(base_matrix, l .- base_matrix', l);
@@ -162,15 +164,15 @@ Here is an example of a [[56, 28, 2]] 2BGA code from Table 2 of [lin2024quantum]
162164
with direct product of `C₄ x C₂`.
163165
164166
```jldoctest
165-
julia> import Hecke: group_algebra, GF, abelian_group, gens
167+
julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC;
166168
167169
julia> GA = group_algebra(GF(2), abelian_group([14,2]));
168170
169171
julia> x, s = gens(GA);
170172
171-
julia> A = 1 + x^7
173+
julia> A = 1 + x^7;
172174
173-
julia> B = 1 + x^7 + s + x^8 + s*x^7 + x
175+
julia> B = 1 + x^7 + s + x^8 + s*x^7 + x;
174176
175177
julia> c = two_block_group_algebra_codes(A,B);
176178
@@ -189,7 +191,7 @@ The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/qcga
189191
A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite):
190192
191193
```jldoctest
192-
julia> import Hecke: group_algebra, GF, abelian_group, gens
194+
julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC;
193195
194196
julia> l=21; m=18;
195197
@@ -215,10 +217,14 @@ where `𝐺ᵣ = ℤ/l₁ × ℤ/l₂ × ... × ℤ/lᵣ`.
215217
A [[48, 4, 6]] Weight-6 TB-QLDPC code from Appendix A Table 2 of [voss2024multivariatebicyclecodes](@cite).
216218
217219
```jldoctest
218-
julia> import Hecke: group_algebra, GF, abelian_group, gens; # hide
220+
julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC;
219221
220222
julia> l=4; m=6;
221223
224+
julia> GA = group_algebra(GF(2), abelian_group([l, m]));
225+
226+
julia> x, y = gens(GA);
227+
222228
julia> z = x*y;
223229
224230
julia> A = x^3 + y^5;
@@ -238,10 +244,10 @@ where `𝑙` and `𝑚` are coprime, and can be expressed as univariate polynomi
238244
with generator `𝜋 = 𝑥𝑦`. They can be viewed as a special case of Lifted Product construction
239245
based on abelian group `ℤₗ x ℤₘ` where `ℤⱼ` cyclic group of order `j`.
240246
241-
[108, 12, 6]] coprime-bivariate bicycle (BB) code from Table 2 of [wang2024coprime](@cite).
247+
[[108, 12, 6]] coprime-bivariate bicycle (BB) code from Table 2 of [wang2024coprime](@cite).
242248
243249
```jldoctest
244-
julia> import Hecke: group_algebra, GF, abelian_group, gens;
250+
julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC;
245251
246252
julia> l=2; m=27;
247253
@@ -252,6 +258,10 @@ julia> 𝜋 = gens(GA)[1];
252258
julia> A = 𝜋^2 + 𝜋^5 + 𝜋^44;
253259
254260
julia> B = 𝜋^8 + 𝜋^14 + 𝜋^47;
261+
262+
julia> c = two_block_group_algebra_codes(A, B);
263+
264+
julia> code_n(c), code_k(c)
255265
(108, 12)
256266
```
257267
@@ -271,6 +281,8 @@ See also: [`two_block_group_algebra_codes`](@ref), [`bicycle_codes`](@ref).
271281
A [[254, 28, 14 ≤ d ≤ 20]] code from (A1) in Appendix B of [panteleev2021degenerate](@cite).
272282
273283
```jldoctest
284+
julia> import Hecke; using QuantumClifford.ECC
285+
274286
julia> c = generalized_bicycle_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 127);
275287
276288
julia> code_n(c), code_k(c)
@@ -281,6 +293,8 @@ An [[70, 8, 10]] *abelian* 2BGA code from Table 1 of [lin2024quantum](@cite), wi
281293
order `l = 35`, illustrates that *abelian* 2BGA codes can be viewed as GB codes.
282294
283295
```jldoctest
296+
julia> import Hecke; using QuantumClifford.ECC
297+
284298
julia> l = 35;
285299
286300
julia> c1 = generalized_bicycle_codes([0, 15, 16, 18], [0, 1, 24, 27], l);
@@ -317,6 +331,8 @@ code with the group `G = ℤ₃ˣ³` corresponds to a cubic code.
317331
The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/haah_cubic).
318332
319333
```jldoctest
334+
julia> import Hecke; using QuantumClifford.ECC;
335+
320336
julia> c = haah_cubic_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 6);
321337
322338
julia> code_n(c), code_k(c)

test/test_doctests.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
@testitem "Doctests" tags=[:doctests] begin
22
using Documenter
33
using QuantumClifford
4+
using QuantumClifford.Experimental.NoisyCircuits
5+
using QuantumInterface
6+
7+
ENV["HECKE_PRINT_BANNER"] = "false"
8+
import Hecke
9+
const QuantumCliffordHeckeExt = Base.get_extension(QuantumClifford, :QuantumCliffordHeckeExt)
410

511
ENV["LINES"] = 80 # for forcing `displaysize(io)` to be big enough
612
ENV["COLUMNS"] = 80
713
DocMeta.setdocmeta!(QuantumClifford, :DocTestSetup, :(using QuantumClifford; using QuantumClifford.ECC); recursive=true)
14+
modules = [QuantumClifford, QuantumClifford.Experimental.NoisyCircuits, QuantumClifford.ECC, QuantumInterface, QuantumCliffordHeckeExt]
815
doctestfilters = [r"(QuantumClifford\.|)"]
9-
doctest(QuantumClifford;
16+
doctest(nothing, modules;
1017
doctestfilters
1118
#fix=true
1219
)

0 commit comments

Comments
 (0)