|
12 | 12 | HypergraphProductCode(A::CTMatrixTypes, B::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing}= missing, logs_alg::Symbol = :stnd_frm) |
13 | 13 |
|
14 | 14 | Return the hypergraph product code of matrices `A` and `B`. |
| 15 | +
|
| 16 | +# Example |
| 17 | +
|
| 18 | +```jldoctest |
| 19 | +[1922, 50, 16]] Hypergraph Product Code from Appendix B, Example C1 of [panteleev2021degenerate](@cite). |
| 20 | +
|
| 21 | +julia> F, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x); |
| 22 | +
|
| 23 | +julia> l = 31; |
| 24 | +
|
| 25 | +julia> R, = residue_ring(F, x^l -1); |
| 26 | +
|
| 27 | +julia> h = R(1 + x^2 + x^5); |
| 28 | +
|
| 29 | +julia> A = residue_polynomial_to_circulant_matrix(h); |
| 30 | +
|
| 31 | +julia> code = HypergraphProductCode(A, A); |
| 32 | +
|
| 33 | +julia> length(code), dimension(code) |
| 34 | +(1922, 50) |
| 35 | +``` |
15 | 36 | """ |
16 | 37 | function HypergraphProductCode(A::CTMatrixTypes, B::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, |
17 | 38 | Missing} = missing, logs_alg::Symbol = :stnd_frm) |
|
258 | 279 | GeneralizedBicycleCode(A::CTMatrixTypes, B::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) |
259 | 280 |
|
260 | 281 | Return the generealized bicycle code given by `A` and `B`. |
| 282 | +
|
| 283 | +# Example |
| 284 | +
|
| 285 | +[[254, 28, 14 ≤ d ≤ 20]] Generalized Bicycle Code from Appendix B, Example A1 of [panteleev2021degenerate](@cite). |
| 286 | +
|
| 287 | +```jldoctest |
| 288 | +julia> F = Oscar.Nemo.Native.GF(2); |
| 289 | +
|
| 290 | +julia> S, x = polynomial_ring(F, :x); |
| 291 | +
|
| 292 | +julia> l = 127; |
| 293 | +
|
| 294 | +julia> R, _ = residue_ring(S, x^l - 1); |
| 295 | +
|
| 296 | +julia> a = 1 + x^15 + x^20 + x^28 + x^66; |
| 297 | +
|
| 298 | +julia> b = 1 + x^58 + x^59 + x^100 + x^121; |
| 299 | +
|
| 300 | +julia> code = GeneralizedBicycleCode(R(a), R(b)); |
| 301 | +
|
| 302 | +julia> length(code), dimension(code) |
| 303 | +(254, 28) |
| 304 | +``` |
261 | 305 | """ |
262 | 306 | function GeneralizedBicycleCode(A::T, B::T; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, |
263 | 307 | logs_alg::Symbol = :stnd_frm) where T <: CTMatrixTypes |
|
508 | 552 | LiftedProductCode(A::MatElem{T}, B::MatElem{T}; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: Union{ResElem, CTGroupAlgebra} |
509 | 553 |
|
510 | 554 | Return the lifted product code given by the matrices `A` and `B`. |
| 555 | +
|
| 556 | +# Example |
| 557 | +
|
| 558 | +[[882, 24, 18 ≤ d ≤ 24]] Lifted Product Code from Appendix B, Example B1 of [panteleev2021degenerate](@cite). |
| 559 | +
|
| 560 | +```jldoctest |
| 561 | +julia> F = Oscar.Nemo.Native.GF(2); |
| 562 | +
|
| 563 | +julia> S, x = polynomial_ring(F, :x) |
| 564 | +(Univariate polynomial ring in x over F, x) |
| 565 | +
|
| 566 | +julia> l = 63; |
| 567 | +
|
| 568 | +julia> R, _ = residue_ring(S, x^l - 1); |
| 569 | +
|
| 570 | +julia> A = matrix(R, 7, 7, |
| 571 | + [x^27, 0 , 0 , 0 , 0 , 1 , x^54, |
| 572 | + x^54, x^27, 0 , 0 , 0 , 0 , 1 , |
| 573 | + 1 , x^54, x^27, 0 , 0 , 0 , 0 , |
| 574 | + 0 , 1 , x^54, x^27, 0 , 0 , 0 , |
| 575 | + 0 , 0 , 1 , x^54, x^27, 0 , 0 , |
| 576 | + 0 , 0 , 0 , 1 , x^54, x^27, 0 , |
| 577 | + 0 , 0 , 0 , 0 , 1 , x^54, x^27]); |
| 578 | +
|
| 579 | +julia> b = R(1 + x + x^6); |
| 580 | +
|
| 581 | +julia> code = LiftedProductCode(A, b); |
| 582 | +┌ Warning: Commutativity of A and b required but not yet enforced. |
| 583 | +└ @ CodingTheory ~/Desktop/ct/doctests/CodingTheory/src/Quantum/product_codes.jl:340 |
| 584 | +
|
| 585 | +julia> length(code), dimension(code) |
| 586 | +(882, 24) |
| 587 | +``` |
511 | 588 | """ |
512 | 589 | function LiftedProductCode(A::MatElem{T}, B::MatElem{T}; char_vec::Union{Vector{zzModRingElem}, Missing} = |
513 | 590 | missing, logs_alg::Symbol = :stnd_frm) where T <: Union{ResElem, CTGroupAlgebra} |
@@ -894,6 +971,29 @@ Return the bivariate bicycle code defined by the residue ring elements `a` and ` |
894 | 971 |
|
895 | 972 | # Note |
896 | 973 | - This is defined in https://arxiv.org/pdf/2308.07915 |
| 974 | +
|
| 975 | +# Example |
| 976 | +
|
| 977 | +[[360, 12, ≤24]] Bivariate Bicycle Code from Table 3 of [bravyi2024high](@cite). |
| 978 | +
|
| 979 | +```jldoctest |
| 980 | +julia> using CodingTheory, Oscar; |
| 981 | +
|
| 982 | +julia> S, (x, y) = polynomial_ring(Oscar.Nemo.Native.GF(2), [:x, :y]); |
| 983 | +
|
| 984 | +julia> l = 30; m = 6; |
| 985 | +
|
| 986 | +julia> R, _ = quo(S, ideal(S, [x^l - 1, y^m - 1])); |
| 987 | +
|
| 988 | +julia> a = R(x^9 + y + y^2); |
| 989 | +
|
| 990 | +julia> b = R(y^3 + x^25 + x^26); |
| 991 | +
|
| 992 | +julia> code = BivariateBicycleCode(a, b); |
| 993 | +
|
| 994 | +julia> length(code), dimension(code) |
| 995 | +(360, 12) |
| 996 | +``` |
897 | 997 | """ |
898 | 998 | function BivariateBicycleCode(a::T, b::T) where T <: Union{MPolyQuoRingElem{FqMPolyRingElem}, MPolyQuoRingElem{fpMPolyRingElem}} |
899 | 999 | R = parent(a) |
@@ -954,6 +1054,29 @@ Return the coprime bivariate bicycle code defined by the residue ring elements ` |
954 | 1054 |
|
955 | 1055 | # Note |
956 | 1056 | - This is defined in https://arxiv.org/pdf/2408.10001v1. |
| 1057 | +
|
| 1058 | +# Example |
| 1059 | +
|
| 1060 | +[126, 12, 10]] Coprime Bivariate Bicycle Code from Table 2 of [wang2024coprime](@cite). |
| 1061 | +
|
| 1062 | +```jldoctest |
| 1063 | +julia> using CodingTheory, Oscar; |
| 1064 | +
|
| 1065 | +julia> S, (P) = polynomial_ring(Oscar.Nemo.Native.GF(2), [:P]); |
| 1066 | +
|
| 1067 | +julia> l = 7; m = 9; |
| 1068 | +
|
| 1069 | +julia> R, _ = quo(S, ideal(S, [P[1]^(l*m)])); |
| 1070 | +
|
| 1071 | +julia> a = R(1 + P[1] + P[1]^58); |
| 1072 | +
|
| 1073 | +julia> b = R(P[1]^3 + P[1]^16 + P[1]^44); |
| 1074 | +
|
| 1075 | +julia> code = CoprimeBivariateBicycleCode(a, b); |
| 1076 | +
|
| 1077 | +julia> length(code), dimension(code) |
| 1078 | +(126, 12) |
| 1079 | +``` |
957 | 1080 | """ |
958 | 1081 | function CoprimeBivariateBicycleCode(a::T, b::T) where T <: Union{MPolyQuoRingElem{FqMPolyRingElem}, MPolyQuoRingElem{fpMPolyRingElem}} |
959 | 1082 | R = parent(a) |
|
0 commit comments