Skip to content

Commit bee4325

Browse files
authored
split out the ECC tests (#536)
1 parent 9e7879d commit bee4325

22 files changed

+38
-38
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ env:
33
JULIA_NUM_THREADS: auto
44
PYTHON: ""
55
PYCALL_DEBUG_BUILD: yes
6-
6+
77
steps:
88
- label: "Package Tests"
99
plugins:
@@ -33,7 +33,7 @@ steps:
3333
- julia --project='~' -e '
3434
using Pkg;
3535
pkg"dev .";'
36-
- label: "Slow Tests"
36+
- label: "ECC Tests"
3737
plugins:
3838
- JuliaCI/julia#v1:
3939
version: "1"
@@ -42,7 +42,7 @@ steps:
4242
- JuliaCI/julia-coverage#v1:
4343
codecov: true
4444
env:
45-
SLOW_TEST: true
45+
ECC_TEST: true
4646
command:
4747
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
4848
- julia --project='~' -e '

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ testfilter = ti -> begin
2626
return :jet in ti.tags
2727
end
2828

29-
if get(ENV, "SLOW_TEST", "") != "true"
30-
push!(exclude, :slow)
29+
if get(ENV, "ECC_TEST", "") != "true"
30+
push!(exclude, :ecc)
3131
else
32-
return :slow in ti.tags
32+
return :ecc in ti.tags
3333
end
3434

3535
if get(ENV, "GPU_TESTS", "") != "true"

test/test_ecc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC" begin
1+
@testitem "ECC" tags=[:ecc] begin
22
using QuantumClifford.ECC
33
using QuantumClifford.ECC: AbstractECC
44

test/test_ecc_2bga.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC 2BGA" begin
1+
@testitem "ECC 2BGA" tags=[:ecc] begin
22
using Hecke
33
using JuMP
44
using HiGHS

test/test_ecc_bch.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
@testitem "ECC BCH" begin
1+
@testitem "ECC BCH" tags=[:ecc] begin
22
using LinearAlgebra
33
using QuantumClifford.ECC
44
using QuantumClifford.ECC: AbstractECC, BCH, generator_polynomial
55
using Nemo: ZZ, residue_ring, matrix, finite_field, GF, minpoly, coeff, lcm, FqPolyRingElem, FqFieldElem, is_zero, degree, defining_polynomial, is_irreducible
6-
using QuantumClifford.ECC.QECCore: code_k, code_n, distance, rate
6+
using QuantumClifford.ECC.QECCore: code_k, code_n, distance, rate
77

88
"""
9-
- To prove that `t`-bit error correcting BCH code indeed has minimum distance of at least `2 * t + 1`, it is shown that no `2 * t` or fewer columns of its binary parity check matrix `H` sum to zero. A formal mathematical proof can be found on pages 168 and 169 of Ch6 of Error Control Coding by Lin, Shu and Costello, Daniel.
9+
- To prove that `t`-bit error correcting BCH code indeed has minimum distance of at least `2 * t + 1`, it is shown that no `2 * t` or fewer columns of its binary parity check matrix `H` sum to zero. A formal mathematical proof can be found on pages 168 and 169 of Ch6 of Error Control Coding by Lin, Shu and Costello, Daniel.
1010
- The parameter `2 * t + 1` is usually called the designed distance of the `t`-bit error correcting BCH code.
1111
"""
1212
function check_designed_distance(matrix, t)
@@ -37,7 +37,7 @@
3737
@test code_k(BCH(m, t)) == n - degree(generator_polynomial(BCH(m, t)))
3838
# BCH code is cyclic as its generator polynomial, `g(x)` divides `xⁿ - 1`, so `mod (xⁿ - 1, g(x))` = 0.
3939
gx = generator_polynomial(BCH(m, t))
40-
GF2x, x = GF(2)["x"]
40+
GF2x, x = GF(2)["x"]
4141
@test mod(x ^ n - 1, gx) == 0
4242
end
4343
end
@@ -61,12 +61,12 @@
6161
@test generator_polynomial(BCH(4, 2)) == x ^ 8 + x ^ 7 + x ^ 6 + x ^ 4 + 1
6262
@test generator_polynomial(BCH(4, 3)) == x ^ 10 + x ^ 8 + x ^ 5 + x ^ 4 + x ^ 2 + x + 1
6363

64-
# Nemo.jl uses [Conway polynomial](https://en.wikipedia.org/wiki/Conway_polynomial_(finite_fields)), a standard way to represent the primitive polynomial for finite Galois fields `GF(pᵐ)` of degree `m`, where `p` is a prime number.
64+
# Nemo.jl uses [Conway polynomial](https://en.wikipedia.org/wiki/Conway_polynomial_(finite_fields)), a standard way to represent the primitive polynomial for finite Galois fields `GF(pᵐ)` of degree `m`, where `p` is a prime number.
6565
# The `GF(2⁶)`'s Conway polynomial is `p(z) = z⁶ + z⁴ + z³ + z + 1`. In contrast, the polynomial given in https://web.ntpu.edu.tw/~yshan/BCH_code.pdf is `p(z) = z⁶ + z + 1`. Because both polynomials are irreducible, they are also primitive polynomials for `GF(2⁶)`.
6666

6767
test_cases = [(6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6), (6, 7), (6, 10), (6, 11), (6, 13), (6, 15)]
6868
@test defining_polynomial(GF2x, GF2⁶) == x ^ 6 + x ^ 4 + x ^ 3 + x + 1
69-
@test is_irreducible(defining_polynomial(GF2x, GF2⁶)) == true
69+
@test is_irreducible(defining_polynomial(GF2x, GF2⁶)) == true
7070
for i in 1:length(test_cases)
7171
m, t = test_cases[i]
7272
if t == 1

test/test_ecc_bivaraite_bicycle_as_twobga.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC Bivaraite Bicycle as 2BGA" begin
1+
@testitem "ECC Bivaraite Bicycle as 2BGA" tags=[:ecc] begin
22
using Hecke
33
using HiGHS
44
using JuMP

test/test_ecc_codeproperties.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC code properties" begin
1+
@testitem "ECC code properties" tags=[:ecc] begin
22
using QuantumClifford.ECC
33
using QuantumClifford.ECC: AbstractECC
44

test/test_ecc_color_codes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC Color Codes" begin
1+
@testitem "ECC Color Codes" tags=[:ecc] begin
22
using Hecke
33
using JuMP
44
using HiGHS

test/test_ecc_coprime_bivaraite_bicycle.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC coprime Bivaraite Bicycle" begin
1+
@testitem "ECC coprime Bivaraite Bicycle" tags=[:ecc] begin
22
using Nemo
33
using Nemo: gcd
44
using Hecke

test/test_ecc_decoder_all_setups.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "ECC Decoder" begin
1+
@testitem "ECC Decoder" tags=[:ecc] begin
22
using QuantumClifford.ECC
33

44
import PyQDecoders

0 commit comments

Comments
 (0)