Skip to content

Commit 9c0767f

Browse files
committed
ci: fix Oscar dependency
1 parent 7696899 commit 9c0767f

File tree

3 files changed

+60
-43
lines changed

3 files changed

+60
-43
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
arch: ${{ matrix.arch }}
4545
- uses: julia-actions/cache@v2
4646
- uses: julia-actions/julia-buildpkg@v1
47+
- name: "Inject Oscar as test dependency (if not Windows and not threaded)"
48+
if: ${{ matrix.os != 'windows-latest' && matrix.threads == 1 }}
49+
continue-on-error: true
50+
run: |
51+
sed -i -e "s/\[deps\]/[deps]\nOscar = \"f1435218-dba5-11e9-1e4d-f1a5fab5fc13\"/" test/Project.toml
4752
- uses: julia-actions/julia-runtest@v1
4853
env:
4954
JULIA_NUM_THREADS: ${{ matrix.threads }}

test/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb"
1616
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1717
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1818
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
19-
Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
2019
PyQDecoders = "17f5de1a-9b79-4409-a58d-4d45812840f7"
2120
Quantikz = "b0d11df0-eea3-4d79-b4a5-421488cbf74b"
2221
QuantumInterface = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5"

test/test_ecc_base.jl

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ using InteractiveUtils
66
import Nemo: GF
77
import LinearAlgebra
88
import Hecke: group_algebra, abelian_group, gens, quo, one
9-
import Oscar: free_group
109

1110
# generate instances of all implemented codes to make sure nothing skips being checked
1211

@@ -44,6 +43,10 @@ test_gb_codes = [
4443

4544
other_lifted_product_codes = []
4645

46+
# Add some codes that require Oscar, hence do not work on Windows
47+
48+
test_twobga_codes = []
49+
4750
# [[882, 24, d≤24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite)
4851
l = 63
4952
GA = group_algebra(GF(2), abelian_group(l))
@@ -57,47 +60,57 @@ A[LinearAlgebra.diagind(A, 5)] .= GA(1)
5760
B = reshape([1 + x + x^6], (1, 1))
5861
push!(other_lifted_product_codes, LPCode(A, B))
5962

60-
# [[72, 8, 9]] 2BGA code taken from Table I Block 1 of [lin2024quantum](@cite)
61-
F = free_group(["r"])
62-
r = gens(F)[1]
63-
G, = quo(F, [r^36])
64-
GA = group_algebra(GF(2), G)
65-
r = gens(G)[1]
66-
a = [one(G), r^28]
67-
b = [one(G), r, r^18, r^12, r^29, r^14]
68-
t1b1 = twobga_from_fp_group(a, b, GA)
69-
70-
# [[54, 6, 9]] 2BGA code taken from Table I Block 3 of [lin2024quantum](@cite)
71-
F = free_group(["r"])
72-
r = gens(F)[1]
73-
G, = quo(F, [r^27])
74-
GA = group_algebra(GF(2), G)
75-
r = gens(G)[1]
76-
a = [one(G), r, r^3, r^7]
77-
b = [one(G), r, r^12, r^19]
78-
t1b3 = twobga_from_fp_group(a, b, GA)
79-
80-
# [[16, 4, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
81-
F = free_group(["x", "s"])
82-
x, s = gens(F)
83-
G, = quo(F, [x^4, s^2, x * s * x^-1 * s^-1])
84-
GA = group_algebra(GF(2), G)
85-
x, s = gens(G)
86-
a = [one(G), x]
87-
b = [one(G), x, s, x^2, s*x, x^3]
88-
tb21 = twobga_from_fp_group(a, b, GA)
89-
90-
# [[32, 8, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
91-
F = free_group(["x", "s"])
92-
x, s = gens(F)
93-
G, = quo(F, [x^8, s^2, x * s * x^-1 * s^-1])
94-
GA = group_algebra(GF(2), G)
95-
x, s = gens(G)
96-
a = [one(G), x^6]
97-
b = [one(G), s * x^7, s * x^4, x^6, s * x^5, s * x^2]
98-
tb22 = twobga_from_fp_group(a, b, GA)
99-
100-
test_twobga_codes = [t1b1, t1b3, tb21, tb22]
63+
@static if !Sys.iswindows()
64+
try
65+
import Oscar: free_group
66+
@info "Add group theoretic codes requiring Oscar"
67+
# [[72, 8, 9]] 2BGA code taken from Table I Block 1 of [lin2024quantum](@cite)
68+
F = free_group(["r"])
69+
r = gens(F)[1]
70+
G, = quo(F, [r^36])
71+
GA = group_algebra(GF(2), G)
72+
r = gens(G)[1]
73+
a = [one(G), r^28]
74+
b = [one(G), r, r^18, r^12, r^29, r^14]
75+
t1b1 = twobga_from_fp_group(a, b, GA)
76+
77+
# [[54, 6, 9]] 2BGA code taken from Table I Block 3 of [lin2024quantum](@cite)
78+
F = free_group(["r"])
79+
r = gens(F)[1]
80+
G, = quo(F, [r^27])
81+
GA = group_algebra(GF(2), G)
82+
r = gens(G)[1]
83+
a = [one(G), r, r^3, r^7]
84+
b = [one(G), r, r^12, r^19]
85+
t1b3 = twobga_from_fp_group(a, b, GA)
86+
87+
# [[16, 4, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
88+
F = free_group(["x", "s"])
89+
x, s = gens(F)
90+
G, = quo(F, [x^4, s^2, x * s * x^-1 * s^-1])
91+
GA = group_algebra(GF(2), G)
92+
x, s = gens(G)
93+
a = [one(G), x]
94+
b = [one(G), x, s, x^2, s*x, x^3]
95+
tb21 = twobga_from_fp_group(a, b, GA)
96+
97+
# [[32, 8, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
98+
F = free_group(["x", "s"])
99+
x, s = gens(F)
100+
G, = quo(F, [x^8, s^2, x * s * x^-1 * s^-1])
101+
GA = group_algebra(GF(2), G)
102+
x, s = gens(G)
103+
a = [one(G), x^6]
104+
b = [one(G), s * x^7, s * x^4, x^6, s * x^5, s * x^2]
105+
tb22 = twobga_from_fp_group(a, b, GA)
106+
107+
append!(test_twobga_codes, [t1b1, t1b3, tb21, tb22])
108+
catch e
109+
@warn(e)
110+
end
111+
end
112+
113+
@info "length(test_twobga_codes): $(length(test_twobga_codes))"
101114

102115
const code_instance_args = Dict(
103116
:Toric => [(3,3), (4,4), (3,6), (4,3), (5,5)],

0 commit comments

Comments
 (0)