Skip to content

Commit

Permalink
ci: fix Oscar dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Oct 21, 2024
1 parent 7696899 commit edcae33
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 57 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on:
push:
branches: [master, main]
branches: [master, main, Ext]
tags: ["*"]
pull_request:
env:
Expand Down Expand Up @@ -44,6 +44,11 @@ jobs:
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: "Inject Oscar as test dependency (if not Windows and not threaded)"
if: ${{ matrix.os != 'windows-latest' && matrix.threads == 1 }}
continue-on-error: true
run: |
sed -i -e "s/\[deps\]/[deps]\nOscar = \"f1435218-dba5-11e9-1e4d-f1a5fab5fc13\"/" test/Project.toml
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: ${{ matrix.threads }}
Expand Down
1 change: 0 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
PyQDecoders = "17f5de1a-9b79-4409-a58d-4d45812840f7"
Quantikz = "b0d11df0-eea3-4d79-b4a5-421488cbf74b"
QuantumInterface = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5"
Expand Down
123 changes: 68 additions & 55 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using InteractiveUtils
import Nemo: GF
import LinearAlgebra
import Hecke: group_algebra, abelian_group, gens, quo, one
import Oscar: free_group

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

Expand Down Expand Up @@ -44,60 +43,74 @@ test_gb_codes = [

other_lifted_product_codes = []

# [[882, 24, d≤24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite)
l = 63
GA = group_algebra(GF(2), abelian_group(l))
A = zeros(GA, 7, 7)
x = gens(GA)[]
A[LinearAlgebra.diagind(A)] .= x^27
A[LinearAlgebra.diagind(A, -1)] .= x^54
A[LinearAlgebra.diagind(A, 6)] .= x^54
A[LinearAlgebra.diagind(A, -2)] .= GA(1)
A[LinearAlgebra.diagind(A, 5)] .= GA(1)
B = reshape([1 + x + x^6], (1, 1))
push!(other_lifted_product_codes, LPCode(A, B))

# [[72, 8, 9]] 2BGA code taken from Table I Block 1 of [lin2024quantum](@cite)
F = free_group(["r"])
r = gens(F)[1]
G, = quo(F, [r^36])
GA = group_algebra(GF(2), G)
r = gens(G)[1]
a = [one(G), r^28]
b = [one(G), r, r^18, r^12, r^29, r^14]
t1b1 = twobga_from_fp_group(a, b, GA)

# [[54, 6, 9]] 2BGA code taken from Table I Block 3 of [lin2024quantum](@cite)
F = free_group(["r"])
r = gens(F)[1]
G, = quo(F, [r^27])
GA = group_algebra(GF(2), G)
r = gens(G)[1]
a = [one(G), r, r^3, r^7]
b = [one(G), r, r^12, r^19]
t1b3 = twobga_from_fp_group(a, b, GA)

# [[16, 4, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
F = free_group(["x", "s"])
x, s = gens(F)
G, = quo(F, [x^4, s^2, x * s * x^-1 * s^-1])
GA = group_algebra(GF(2), G)
x, s = gens(G)
a = [one(G), x]
b = [one(G), x, s, x^2, s*x, x^3]
tb21 = twobga_from_fp_group(a, b, GA)

# [[32, 8, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
F = free_group(["x", "s"])
x, s = gens(F)
G, = quo(F, [x^8, s^2, x * s * x^-1 * s^-1])
GA = group_algebra(GF(2), G)
x, s = gens(G)
a = [one(G), x^6]
b = [one(G), s * x^7, s * x^4, x^6, s * x^5, s * x^2]
tb22 = twobga_from_fp_group(a, b, GA)

test_twobga_codes = [t1b1, t1b3, tb21, tb22]
# Add some codes that require Oscar, hence do not work on Windows

test_twobga_codes = []

@static if !Sys.iswindows()
try
import Oscar: free_group
@info "Add group theoretic codes"
# [[882, 24, d≤24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite)
l = 63
GA = group_algebra(GF(2), abelian_group(l))
A = zeros(GA, 7, 7)
x = gens(GA)[]
A[LinearAlgebra.diagind(A)] .= x^27
A[LinearAlgebra.diagind(A, -1)] .= x^54
A[LinearAlgebra.diagind(A, 6)] .= x^54
A[LinearAlgebra.diagind(A, -2)] .= GA(1)
A[LinearAlgebra.diagind(A, 5)] .= GA(1)
B = reshape([1 + x + x^6], (1, 1))
push!(other_lifted_product_codes, LPCode(A, B))

# [[72, 8, 9]] 2BGA code taken from Table I Block 1 of [lin2024quantum](@cite)
F = free_group(["r"])
r = gens(F)[1]
G, = quo(F, [r^36])
GA = group_algebra(GF(2), G)
r = gens(G)[1]
a = [one(G), r^28]
b = [one(G), r, r^18, r^12, r^29, r^14]
t1b1 = twobga_from_fp_group(a, b, GA)

# [[54, 6, 9]] 2BGA code taken from Table I Block 3 of [lin2024quantum](@cite)
F = free_group(["r"])
r = gens(F)[1]
G, = quo(F, [r^27])
GA = group_algebra(GF(2), G)
r = gens(G)[1]
a = [one(G), r, r^3, r^7]
b = [one(G), r, r^12, r^19]
t1b3 = twobga_from_fp_group(a, b, GA)

# [[16, 4, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
F = free_group(["x", "s"])
x, s = gens(F)
G, = quo(F, [x^4, s^2, x * s * x^-1 * s^-1])
GA = group_algebra(GF(2), G)
x, s = gens(G)
a = [one(G), x]
b = [one(G), x, s, x^2, s*x, x^3]
tb21 = twobga_from_fp_group(a, b, GA)

# [[32, 8, 4]] 2BGA taken from Appendix C, Table II of [lin2024quantum](@cite)
F = free_group(["x", "s"])
x, s = gens(F)
G, = quo(F, [x^8, s^2, x * s * x^-1 * s^-1])
GA = group_algebra(GF(2), G)
x, s = gens(G)
a = [one(G), x^6]
b = [one(G), s * x^7, s * x^4, x^6, s * x^5, s * x^2]
tb22 = twobga_from_fp_group(a, b, GA)

append!(test_twobga_codes, [t1b1, t1b3, tb21, tb22])
catch e
@warn(e)
end
end

@info "length(test_twobga_codes): $(length(test_twobga_codes))"

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

0 comments on commit edcae33

Please sign in to comment.