From e3ea2097757945e1075a3298dd2dd388afe1b3cb Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Mon, 9 Feb 2026 18:09:08 -0500 Subject: [PATCH 1/5] recover all quantum Tanner codes from 2601.15446 --- test/test_quantum_tanner_codes.jl | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/test_quantum_tanner_codes.jl b/test/test_quantum_tanner_codes.jl index 3f77b47..331af5b 100644 --- a/test/test_quantum_tanner_codes.jl +++ b/test/test_quantum_tanner_codes.jl @@ -715,4 +715,41 @@ end end end + + @testset "Quantum Tanner codes from https://www.arxiv.org/pdf/2601.15446" begin + # [[72, 16, 4]] + F = free_group([:s, :r]) + s, r = gens(F) + rels = [s^2, r^8, s*r*s*r] + G, epimorphism = quo(F, rels) + s = epimorphism(s) + r = epimorphism(r) + A = [s, s*r^4, r^4] + B = [s*r, s*r^3, s*r^7] + H_A = Matrix{Int}(parity_matrix(RepCode(3))) + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = [1 1 1 1]; + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((H_A, G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + end + + @testset "Quantum Tanner codes from https://www.arxiv.org/pdf/2601.15446" begin + # [[96, 30, 4]] + G = dihedral_group(12) + rng = MersenneTwister(1); + A, B = find_random_generating_sets(G, 4, 4, rng=rng) + H_A = Matrix{Int}(parity_matrix(RepCode(4))) + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = Matrix{Int}(parity_matrix(ReedMuller(1,2))) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((H_A, G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + @test code_n(c) == 96 + @test code_k(c) == 30 + @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 8 + end end From be28a962d7a2e01a48685fc58a657650928e58bc Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Mon, 9 Feb 2026 18:10:13 -0500 Subject: [PATCH 2/5] polish --- test/test_quantum_tanner_codes.jl | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/test_quantum_tanner_codes.jl b/test/test_quantum_tanner_codes.jl index 331af5b..2841ec7 100644 --- a/test/test_quantum_tanner_codes.jl +++ b/test/test_quantum_tanner_codes.jl @@ -716,24 +716,6 @@ end end - @testset "Quantum Tanner codes from https://www.arxiv.org/pdf/2601.15446" begin - # [[72, 16, 4]] - F = free_group([:s, :r]) - s, r = gens(F) - rels = [s^2, r^8, s*r*s*r] - G, epimorphism = quo(F, rels) - s = epimorphism(s) - r = epimorphism(r) - A = [s, s*r^4, r^4] - B = [s*r, s*r^3, s*r^7] - H_A = Matrix{Int}(parity_matrix(RepCode(3))) - G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) - H_B = [1 1 1 1]; - G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) - classical_code_pair = ((H_A, G_A), (H_B, G_B)) - c = QuantumTannerCode(G, A, B, classical_code_pair) - end - @testset "Quantum Tanner codes from https://www.arxiv.org/pdf/2601.15446" begin # [[96, 30, 4]] G = dihedral_group(12) From 3d6b58511f57ff5deade26cb2c29e8cfa3be0ee1 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Mon, 9 Feb 2026 18:16:06 -0500 Subject: [PATCH 3/5] recover [[72, 19, 4]] from reference --- test/test_quantum_tanner_codes.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test_quantum_tanner_codes.jl b/test/test_quantum_tanner_codes.jl index 2841ec7..1ee869d 100644 --- a/test/test_quantum_tanner_codes.jl +++ b/test/test_quantum_tanner_codes.jl @@ -717,6 +717,23 @@ end @testset "Quantum Tanner codes from https://www.arxiv.org/pdf/2601.15446" begin + # [[72, 19, 4]] + G = dihedral_group(12) + rng = MersenneTwister(7); + A, B = find_random_generating_sets(G, 3, 4, rng=rng) + H_A = Matrix{Int}(parity_matrix(RepCode(3))) + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = Matrix{Int}(parity_matrix(ReedMuller(1,2))) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((H_A, G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + @test code_n(c) == 72 + @test code_k(c) == 19 + @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 6 + # [[96, 30, 4]] G = dihedral_group(12) rng = MersenneTwister(1); From cdc2d55bf4fe7de845c9f01cb94ad6979d012da7 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Mon, 9 Feb 2026 23:01:13 -0500 Subject: [PATCH 4/5] polish\ --- test/test_quantum_tanner_codes.jl | 55 +++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/test/test_quantum_tanner_codes.jl b/test/test_quantum_tanner_codes.jl index 1ee869d..a3fcd59 100644 --- a/test/test_quantum_tanner_codes.jl +++ b/test/test_quantum_tanner_codes.jl @@ -731,7 +731,7 @@ @test code_n(c) == 72 @test code_k(c) == 19 @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 - @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 6 # [[96, 30, 4]] @@ -748,7 +748,58 @@ @test code_n(c) == 96 @test code_k(c) == 30 @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 - @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 8 + + # [[96, 24, 4]] + G = direct_product(cyclic_group(8), cyclic_group(2)) + rng = MersenneTwister(15); + A, B = find_random_generating_sets(G, 3, 4, rng=rng) + H_A = Matrix{Int}(parity_matrix(RepCode(3))) + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = Matrix{Int}(parity_matrix(ReedMuller(1,2))) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((H_A, G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + @test code_n(c) == 96 + @test code_k(c) == 24 + @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 6 + + # [[128, 40, 4]] + G = cyclic_group(16) + rng = MersenneTwister(27); + A, B = find_random_generating_sets(G, 4, 4, rng=rng) + H_A = Matrix{Int}(parity_matrix(RepCode(4))) + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = Matrix{Int}(parity_matrix(ReedMuller(1,2))) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((H_A, G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + @test code_n(c) == 128 + @test code_k(c) == 40 + @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 + @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 8 + + # [[120, 34, 4]] + G = cyclic_group(15) + rng = MersenneTwister(27); + A, B = find_random_generating_sets(G, 4, 4, rng=rng) + H_A = Matrix{Int}(parity_matrix(RepCode(4))) + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = Matrix{Int}(parity_matrix(ReedMuller(1,2))) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((H_A, G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + @test code_n(c) == 120 + @test code_k(c) == 34 + @test distance(c, DistanceMIPAlgorithm(solver=HiGHS, time_limit=120)) == 4 + @test maximum(sum(Matrix(parity_matrix_x(c)), dims=2)) == 8 @test maximum(sum(Matrix(parity_matrix_z(c)), dims=2)) == 8 end end From 43f228f2720f66a673bbe22eb8889743b1ba66a4 Mon Sep 17 00:00:00 2001 From: Feroz Ahmed Mian Date: Wed, 11 Mar 2026 09:06:50 -0400 Subject: [PATCH 5/5] refactor test cases for Quantum Tanner codes --- test/test_quantum_tanner_codes.jl | 55 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/test/test_quantum_tanner_codes.jl b/test/test_quantum_tanner_codes.jl index 62993f3..7d1530b 100644 --- a/test/test_quantum_tanner_codes.jl +++ b/test/test_quantum_tanner_codes.jl @@ -717,35 +717,34 @@ end @testset "Test Puncture" begin - for seed in 1:50 - G = small_group(12,1) - rng = MersenneTwister(seed) - A, B = find_random_generating_sets(G, 6, 5; rng=rng) - H_A = [1 0 0 0 1 1; - 0 1 0 1 0 1; - 0 0 1 1 1 0]; - G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) - H_B = puncture(H_A, [6]) - G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) - classical_code_pair = ((Matrix{Int}(H_A), G_A), (H_B, G_B)) - c = QuantumTannerCode(G, A, B, classical_code_pair) - @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) - end - end + for seed in 1:50 + G = small_group(12,1) + rng = MersenneTwister(seed) + A, B = find_random_generating_sets(G, 6, 5; rng=rng) + H_A = [1 0 0 0 1 1; + 0 1 0 1 0 1; + 0 0 1 1 1 0]; + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = puncture(H_A, [6]) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((Matrix{Int}(H_A), G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + end - # Here is an example of novel [[180, 2, 8]] code - G = small_group(12,1) - rng = MersenneTwister(1) - A, B = find_random_generating_sets(G, 6, 5; rng=rng) - H_A = [1 0 0 0 1 1; - 0 1 0 1 0 1; - 0 0 1 1 1 0]; - G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) - H_B = puncture(H_A, [6]) - G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) - classical_code_pair = ((Matrix{Int}(H_A), G_A), (H_B, G_B)) - c = QuantumTannerCode(G, A, B, classical_code_pair) - @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) + # Here is an example of novel [[180, 2, 8]] code + G = small_group(12,1) + rng = MersenneTwister(1) + A, B = find_random_generating_sets(G, 6, 5; rng=rng) + H_A = [1 0 0 0 1 1; + 0 1 0 1 0 1; + 0 0 1 1 1 0]; + G_A = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_A)))) + H_B = puncture(H_A, [6]) + G_B = Matrix{Int}(lift.(dual_code(matrix(ZZ, H_B)))) + classical_code_pair = ((Matrix{Int}(H_A), G_A), (H_B, G_B)) + c = QuantumTannerCode(G, A, B, classical_code_pair) + @test stab_looks_good(parity_checks(c), remove_redundant_rows=true) end @testset "Quantum Tanner codes from https://www.arxiv.org/pdf/2601.15446" begin