Skip to content

Commit 2694d44

Browse files
Fe-r-ozKrastanov
andauthored
tests: more tests for mip distance solver (#528)
--------- Co-authored-by: Stefan Krastanov <[email protected]>
1 parent 93e4bec commit 2694d44

File tree

5 files changed

+131
-5
lines changed

5 files changed

+131
-5
lines changed

.buildkite/pipeline.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ steps:
3333
- julia --project='~' -e '
3434
using Pkg;
3535
pkg"dev .";'
36+
- label: "Slow Tests"
37+
plugins:
38+
- JuliaCI/julia#v1:
39+
version: "1"
40+
- QuantumSavory/julia-xvfb#v1:
41+
- JuliaCI/julia-test#v1: ~
42+
- JuliaCI/julia-coverage#v1:
43+
codecov: true
44+
env:
45+
SLOW_TEST: true
46+
command:
47+
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
48+
- julia --project='~' -e '
49+
using Pkg;
50+
pkg"dev .";'
3651
- label: "Downstream QuantumSavory"
3752
plugins:
3853
- JuliaCI/julia#v1:

docs/src/references.bib

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,16 @@ @misc{cain2025correlateddecodinglogicalalgorithms
291291
url={https://arxiv.org/abs/2403.03272},
292292
}
293293

294+
@misc{wang2022distanceboundsgeneralizedbicycle,
295+
title={Distance bounds for generalized bicycle codes},
296+
author={Renyu Wang and Leonid P. Pryadko},
297+
year={2022},
298+
eprint={2203.17216},
299+
archivePrefix={arXiv},
300+
primaryClass={quant-ph},
301+
url={https://arxiv.org/abs/2203.17216},
302+
}
303+
294304
% non-Clifford formalism
295305
296306
@misc{Yoder2012AGO,

docs/src/references.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ For minimum distance calculation of quantum codes:
7373
- [makhorin2008glpk](@cite)
7474
- [Lubin2023](@cite)
7575
- [huangfu2018parallelizing](@cite)
76+
- [wang2022distanceboundsgeneralizedbicycle](@cite)
7677

7778
# References
7879

test/runtests.jl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,27 @@ using QuantumClifford
2020
testfilter = ti -> begin
2121
exclude = Symbol[]
2222

23-
if get(ENV, "JET_TEST", "")!="true"
23+
if get(ENV, "JET_TEST", "") != "true"
2424
push!(exclude, :jet)
2525
else
2626
return :jet in ti.tags
2727
end
2828

29-
if !(VERSION >= v"1.10")
30-
push!(exclude, :doctests)
31-
push!(exclude, :aqua)
29+
if get(ENV, "SLOW_TEST", "") != "true"
30+
push!(exclude, :slow)
31+
else
32+
return :slow in ti.tags
3233
end
3334

34-
if get(ENV, "GPU_TESTS", "")!="true"
35+
if get(ENV, "GPU_TESTS", "") != "true"
3536
push!(exclude, :gpu)
37+
else
38+
return :gpu in ti.tags
39+
end
40+
41+
if !(VERSION >= v"1.10")
42+
push!(exclude, :doctests)
43+
push!(exclude, :aqua)
3644
end
3745

3846
if !(Base.Sys.islinux() & (Int===Int64))
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
@testitem "ECC GB Codes - slow" tags=[:slow] begin
2+
using Hecke
3+
using HiGHS
4+
using JuMP
5+
using QuantumClifford.ECC.QECCore: code_k, code_n, distance, rate
6+
using QuantumClifford.ECC: generalized_bicycle_codes, code_k, code_n, DistanceMIPAlgorithm
7+
8+
@testset "generalized bicycle codes from arXiv:2203.17216" begin
9+
# codes taken from https://github.com/QEC-pages/GB-codes
10+
c = generalized_bicycle_codes([0, 2], [0, 1], 5)
11+
@test code_n(c) == 10
12+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 3
13+
c = generalized_bicycle_codes([0, 3], [0, 1], 11)
14+
@test code_n(c) == 22
15+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 4
16+
c = generalized_bicycle_codes([0, 5], [0, 1], 13)
17+
@test code_n(c) == 26
18+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 5
19+
c = generalized_bicycle_codes([0, 4], [0, 1], 19)
20+
@test code_n(c) == 38
21+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 5
22+
c = generalized_bicycle_codes([0, 8], [0, 1], 29)
23+
@test code_n(c) == 58
24+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 7
25+
c = generalized_bicycle_codes([0, 8], [0, 1], 37)
26+
@test code_n(c) == 74
27+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 8
28+
c = generalized_bicycle_codes([0, 8], [0, 1], 53)
29+
@test code_n(c) == 106
30+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 9
31+
32+
c = generalized_bicycle_codes([0, 1, 2, 3], [0, 1], 5)
33+
@test code_n(c) == 10
34+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 3
35+
c = generalized_bicycle_codes([0, 1, 2, 5], [0, 1], 11)
36+
@test code_n(c) == 22
37+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 5
38+
c = generalized_bicycle_codes([0, 1, 2, 5], [0, 1], 13)
39+
@test code_n(c) == 26
40+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 5
41+
c = generalized_bicycle_codes([0, 2, 3, 7], [0, 1], 19)
42+
@test code_n(c) == 38
43+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 7
44+
c = generalized_bicycle_codes([0, 1, 3, 10], [0, 1], 29)
45+
@test code_n(c) == 58
46+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 9
47+
c = generalized_bicycle_codes([0, 1, 4, 14], [0, 1], 37)
48+
@test code_n(c) == 74
49+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 11
50+
51+
c = generalized_bicycle_codes([0, 1, 2, 3], [0, 1], 5)
52+
@test code_n(c) == 10
53+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 3
54+
c = generalized_bicycle_codes([0, 1, 2, 3], [0, 1], 7)
55+
@test code_n(c) == 14
56+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 3
57+
c = generalized_bicycle_codes([0, 1, 2, 5], [0, 1], 11)
58+
@test code_n(c) == 22
59+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 5
60+
c = generalized_bicycle_codes([0, 1, 2, 5], [0, 1], 13)
61+
@test code_n(c) == 26
62+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 5
63+
c = generalized_bicycle_codes([0, 1, 3, 9], [0, 1], 17)
64+
@test code_n(c) == 34
65+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 7
66+
c = generalized_bicycle_codes([0, 1, 2, 8], [0, 1], 19)
67+
@test code_n(c) == 38
68+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 7
69+
c = generalized_bicycle_codes([0, 1, 3, 9], [0, 1], 23)
70+
@test code_n(c) == 46
71+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 8
72+
c = generalized_bicycle_codes([0, 1, 3, 10], [0, 1], 29)
73+
@test code_n(c) == 58
74+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 9
75+
c = generalized_bicycle_codes([0, 5, 11,17], [0, 1], 31)
76+
@test code_n(c) == 62
77+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 10
78+
c = generalized_bicycle_codes([0, 1, 4, 14], [0, 1], 37)
79+
@test code_n(c) == 74
80+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 11
81+
82+
c = generalized_bicycle_codes([0, 1, 2, 4, 5, 8], [0, 1], 11)
83+
@test code_n(c) == 22
84+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 6
85+
c = generalized_bicycle_codes([0, 2, 3, 6, 7, 9], [0, 1], 13)
86+
@test code_n(c) == 26
87+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 6
88+
c = generalized_bicycle_codes([0, 1, 2, 3, 4, 8], [0, 1], 19)
89+
@test code_n(c) == 38
90+
@test distance(c, DistanceMIPAlgorithm(solver=HiGHS)) == 7
91+
end
92+
end

0 commit comments

Comments
 (0)