Skip to content

Commit c52fe61

Browse files
authored
Merge pull request #42 from Fe-r-oz/new
Coprime Bivariate Bicycle Codes via Univariate Polynomial Ring
2 parents f65d3eb + ffbbb97 commit c52fe61

File tree

6 files changed

+132
-3
lines changed

6 files changed

+132
-3
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1313
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1515
Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
16+
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
1617
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
1718
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1819
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

docs/src/Quantum/product_codes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- [Generealized bicycle](https://errorcorrectionzoo.org/c/generalized_bicycle): [pryadko2013quantum](@cite), [Kovalev_2013](@cite), [panteleev2021degenerate](@cite)
77
- Generalized hypergraph product: [panteleev2021degenerate](@cite)
88
- Bias-tailored lifted product: [roffe2023bias](@cite)
9+
- Bivariate bicycle: [wang2024coprime](@cite)
10+
- Coprime bivarate bicycle: [wang2024coprime](@cite)
911

1012

1113
```@autodocs

docs/src/references.bib

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,21 @@ @inproceedings{yao2024belief
183183
year={2024},
184184
organization={IEEE}
185185
}
186+
187+
@article{bravyi2024high,
188+
title={High-threshold and low-overhead fault-tolerant quantum memory},
189+
author={Bravyi, Sergey and Cross, Andrew W and Gambetta, Jay M and Maslov, Dmitri and Rall, Patrick and Yoder, Theodore J},
190+
journal={Nature},
191+
volume={627},
192+
number={8005},
193+
pages={778--782},
194+
year={2024},
195+
publisher={Nature Publishing Group UK London}
196+
}
197+
198+
@article{wang2024coprime,
199+
title={Coprime Bivariate Bicycle Codes and their Properties},
200+
author={Wang, Ming and Mueller, Frank},
201+
journal={arXiv preprint arXiv:2408.10001},
202+
year={2024}
203+
}

src/CodingTheory.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ export HypergraphProductCode, GeneralizedShorCode, BaconCasaccinoConstruction,
376376
GeneralizedHypergraphProductCode, LiftedProductCode, bias_tailored_lifted_product_matrices,
377377
BiasTailoredLiftedProductCode, SPCDFoldProductCode, SingleParityCheckDFoldProductCode,
378378
Quintavalle_basis, asymmetric_product, symmetric_product, random_homological_product_code,
379-
homological_product, , BivariateBicycleCode
379+
homological_product, , BivariateBicycleCode, CoprimeBivariateBicycleCode
380380

381381
#############################
382382
# Quantum/simulation.jl

src/Quantum/product_codes.jl

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ function BivariateBicycleCode(a::T, b::T) where T <: Union{MPolyQuoRingElem{FqMP
917917
l = exps[1][1]
918918
end
919919
end
920-
920+
921921
x = matrix(F, [mod1(i + 1, l) == j ? 1 : 0 for i in 1:l, j in 1:l]) identity_matrix(F, m)
922922
y = identity_matrix(F, l) matrix(F, [mod1(i + 1, m) == j ? 1 : 0 for i in 1:m, j in 1:m])
923923

@@ -943,5 +943,56 @@ function BivariateBicycleCode(a::T, b::T) where T <: Union{MPolyQuoRingElem{FqMP
943943
end
944944
end
945945

946+
947+
return CSSCode(hcat(A, B), hcat(transpose(B), transpose(A)))
948+
end
949+
950+
"""
951+
CoPrimeBivariateBicycleCode(a::MPolyQuoRingElem{FqMPolyRingElem}, b::MPolyQuoRingElem{FqMPolyRingElem})
952+
953+
Return the coprime bivariate bicycle code defined by the residue ring elements `a` and `b`.
954+
955+
# Note
956+
- This is defined in https://arxiv.org/pdf/2408.10001v1.
957+
"""
958+
function CoprimeBivariateBicycleCode(a::T, b::T) where T <: Union{MPolyQuoRingElem{FqMPolyRingElem}, MPolyQuoRingElem{fpMPolyRingElem}}
959+
R = parent(a)
960+
R == parent(b) || throw(DomainError("Polynomials must have the same parent."))
961+
F = base_ring(base_ring(a))
962+
order(F) == 2 || throw(DomainError("This code family is currently only defined over binary fields."))
963+
length(symbols(parent(a))) == 1 || throw(DomainError("Polynomials must be over one variable."))
964+
g = gens(modulus(R))
965+
966+
m = -1
967+
l = -1
968+
969+
exps = collect(exponents(g[1]))[1][1]
970+
length(exps) == 1 || throw(ArgumentError("Moduli of the incorrect form."))
971+
facs = factor(ZZ(exps)).fac
972+
pfacs = collect(keys(facs))
973+
pexps = collect(values(facs))
974+
975+
l = Int(pfacs[1]^pexps[1])
976+
m = Int(pfacs[2]^pexps[2])
977+
978+
length(pfacs) == 2 ? (gcd([l, m]) == 1 ?
979+
nothing : throw(ArgumentError("l and m must be coprime numbers."))) : throw(ArgumentError("Moduli of the incorrect form."))
980+
981+
x = matrix(F, [mod1(i + 1, l) == j ? 1 : 0 for i in 1:l, j in 1:l]) identity_matrix(F, m)
982+
y = identity_matrix(F, l) matrix(F, [mod1(i + 1, m) == j ? 1 : 0 for i in 1:m, j in 1:m])
983+
984+
P = x*y
985+
A = zero_matrix(F, exps, exps)
986+
for ex in exponents(lift(a))
987+
power, _ = findmax(ex)
988+
A += P^power
989+
end
990+
991+
B = zero_matrix(F, exps, exps)
992+
for ex in exponents(lift(b))
993+
power, _ = findmax(ex)
994+
B += P^power
995+
end
996+
946997
return CSSCode(hcat(A, B), hcat(transpose(B), transpose(A)))
947998
end

test/Quantum/product_codes_test.jl

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,5 +606,62 @@
606606
@test length(Q) == 196
607607
@test dimension(Q) == 12
608608
@test_broken minimum_distance(S) == 8
609-
end
609+
610+
# Coprime Bivariate Bicycle codes
611+
# Table 2 of https://arxiv.org/pdf/2408.10001v1
612+
# [[30, 4, 6]]
613+
S, (P) = polynomial_ring(Oscar.Nemo.Native.GF(2), [:P])
614+
l = 3
615+
m = 5
616+
R, _ = quo(S, ideal(S, [P[1]^(l*m)]))
617+
a = R(1 + P[1] + P[1]^2)
618+
b = R(P[1] + P[1]^3 + P[1]^8)
619+
Q = CoprimeBivariateBicycleCode(a, b)
620+
@test length(Q) == 30
621+
@test dimension(Q) == 4
622+
@test_broken minimum_distance(Q) == 6
623+
624+
# [[42, 6, 6]]
625+
l = 3
626+
m = 7
627+
R, _ = quo(S, ideal(S, [P[1]^(l*m)]))
628+
a = R(1 + P[1]^2 + P[1]^3)
629+
b = R(P[1] + P[1]^3 + P[1]^11)
630+
Q = CoprimeBivariateBicycleCode(a, b)
631+
@test length(Q) == 42
632+
@test dimension(Q) == 6
633+
@test_broken minimum_distance(Q) == 6
634+
635+
# [[70, 6, 8]]
636+
l = 5
637+
m = 7
638+
R, _ = quo(S, ideal(S, [P[1]^(l*m)]))
639+
a = R(1 + P[1] + P[1]^5)
640+
b = R(1 + P[1] + P[1]^12)
641+
Q = CoprimeBivariateBicycleCode(a, b)
642+
@test length(Q) == 70
643+
@test dimension(Q) == 6
644+
@test_broken minimum_distance(Q) == 8
645+
646+
# [[108, 12, 6]]
647+
l = 2
648+
m = 27
649+
R, _ = quo(S, ideal(S, [P[1]^(l*m)]))
650+
a = R(P[1]^2 + P[1]^5 + P[1]^44)
651+
b = R(P[1]^8 + P[1]^14 + P[1]^47)
652+
Q = CoprimeBivariateBicycleCode(a, b)
653+
@test length(Q) == 108
654+
@test dimension(Q) == 12
655+
@test_broken minimum_distance(Q) == 6
656+
657+
# [126, 12, 10]]
658+
l = 7
659+
m = 9
660+
R, _ = quo(S, ideal(S, [P[1]^(l*m)]))
661+
a = R(1 + P[1] + P[1]^58)
662+
b = R(P[1]^3 + P[1]^16 + P[1]^44)
663+
Q = CoprimeBivariateBicycleCode(a, b)
664+
@test length(Q) == 126
665+
@test dimension(Q) == 12
666+
@test_broken minimum_distance(Q) == 10
610667
end

0 commit comments

Comments
 (0)