Skip to content

Commit 307aa10

Browse files
committed
doctests for CSS and non-CSS HyperBicycleCode
1 parent a6607d3 commit 307aa10

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/Quantum/product_codes.jl

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,31 @@ Return the hyperbicycle CSS code of `a` and `b` given `χ`.
176176
- b: A vector of length `c` of binary matrices of the same dimensions,
177177
potentially different from those of `a`.
178178
- χ: A strictly positive integer coprime with `c`.
179+
180+
# Example
181+
182+
[[900, 50, 14]] CSS Hyperbicycle Code from Example 6 of [Kovalev_2013](@cite).
183+
184+
```jldoctest
185+
julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x);
186+
187+
julia> l = 30; χ = 1;
188+
189+
julia> R, = residue_ring(S, x^l - 1);
190+
191+
julia> h = R(1 + x + x^3 + x^5);
192+
193+
julia> A = residue_polynomial_to_circulant_matrix(h);
194+
195+
julia> a1 = A[1:15, 1:15];
196+
197+
julia> a2 = A[1:15, 16:30];
198+
199+
julia> code = HyperBicycleCodeCSS([a1, a2], [a1, a2], χ);
200+
201+
julia> length(code), dimension(code)
202+
(900, 50)
203+
```
179204
"""
180205
function HyperBicycleCodeCSS(a::Vector{T}, b::Vector{T}, χ::Int; char_vec::Union{Vector{zzModRingElem},
181206
Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: CTMatrixTypes
@@ -232,6 +257,29 @@ Return the hyperbicycle non-CSS code of `a` and `b` given `χ`.
232257
- b: A vector of length `c` of binary matrices of the same dimensions,
233258
potentially different from those of `a`.
234259
- χ: A strictly positive integer coprime with `c`.
260+
261+
# Example
262+
263+
[[289, 81, 5]] non-CSS Hyperbicycle Code from Example 13 of [Kovalev_2013](@cite).
264+
265+
```jldoctest
266+
julia> using CodingTheory, Oscar;
267+
268+
julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x);
269+
270+
julia> l = 17; χ = 1;
271+
272+
julia> R, = residue_ring(S, x^l - 1);
273+
274+
julia> h = R(x^4 * (1 + x + x^3 + x^6 + x^8 + x^9));
275+
276+
julia> A = residue_polynomial_to_circulant_matrix(h);
277+
278+
julia> code = HyperBicycleCode([A], [A], χ);
279+
280+
julia> length(code), dimension(code)
281+
(289, 81)
282+
```
235283
"""
236284
function HyperBicycleCode(a::Vector{T}, b::Vector{T}, χ::Int, char_vec::Union{Vector{zzModRingElem},
237285
Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: CTMatrixTypes

0 commit comments

Comments
 (0)