diff --git a/src/ecc/ECC.jl b/src/ecc/ECC.jl index dc1704ab9..604316f10 100644 --- a/src/ecc/ECC.jl +++ b/src/ecc/ECC.jl @@ -102,8 +102,6 @@ function rate(c) return rate end -function generator end - """The distance of a code.""" function distance end diff --git a/src/ecc/codes/classical/recursivereedmuller.jl b/src/ecc/codes/classical/recursivereedmuller.jl index e745a5bf1..ae30ae578 100644 --- a/src/ecc/codes/classical/recursivereedmuller.jl +++ b/src/ecc/codes/classical/recursivereedmuller.jl @@ -19,7 +19,6 @@ Here, the matrix 0 denotes an all-zero matrix with dimensions matching `G(r - 1, In addition, the dimension of `RM(m - r - 1, m)` equals the dimension of the dual of `RM(r, m)`. Thus, `RM(m - r - 1, m) = RM(r, m)^⊥` shows that the [dual code](https://en.wikipedia.org/wiki/Dual_code) of `RM(r, m)` is `RM(m − r − 1, m)`, indicating the parity check matrix of `RM(r, m)` is the generator matrix for `RM(m - r - 1, m)`. See also: `ReedMuller` - """ struct RecursiveReedMuller <: ClassicalCode r::Int diff --git a/src/ecc/codes/quantumreedmuller.jl b/src/ecc/codes/quantumreedmuller.jl index f63323e18..57f26be62 100644 --- a/src/ecc/codes/quantumreedmuller.jl +++ b/src/ecc/codes/quantumreedmuller.jl @@ -9,7 +9,6 @@ The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/quan """ struct QuantumReedMuller <: AbstractECC m::Int - function QuantumReedMuller(m) if m < 3 || m > 11 throw(ArgumentError("Invalid parameters: m must be ≤ 3 and m ≤ 11 in order to valid code.")) @@ -23,8 +22,8 @@ function iscss(::Type{QuantumReedMuller}) end function parity_checks(c::QuantumReedMuller) - RM₁₋ₘ = generator(RecursiveReedMuller(1, c.m)) - RM₍ₘ₋₂₎₋ₘ₎ = generator(RecursiveReedMuller(c.m - 2, c.m)) + RM₁₋ₘ = generator(RecursiveReedMuller(1,c.m)) + RM₍ₘ₋₂₎₋ₘ₎ = generator(RecursiveReedMuller(c.m-2, c.m)) QRM = CSS(RM₁₋ₘ[2:end, 2:end], RM₍ₘ₋₂₎₋ₘ₎[2:end, 2:end]) Stabilizer(QRM) end diff --git a/test/test_ecc_base.jl b/test/test_ecc_base.jl index c7d8fee1a..315dbe9d2 100644 --- a/test/test_ecc_base.jl +++ b/test/test_ecc_base.jl @@ -18,11 +18,9 @@ const code_instance_args = Dict( Toric => [(3,3), (4,4), (3,6), (4,3), (5,5)], Surface => [(3,3), (4,4), (3,6), (4,3), (5,5)], Gottesman => [3, 4, 5], - CSS => (c -> (parity_checks_x(c), parity_checks_z(c))).([Shor9(), Steane7(), Toric(4,4)]), - Concat => [(Perfect5(), Perfect5()), (Perfect5(), Steane7()), (Steane7(), Cleve8()), (Toric(2,2), Shor9())], CSS => (c -> (parity_checks_x(c), parity_checks_z(c))).([Shor9(), Steane7(), Toric(4, 4)]), Concat => [(Perfect5(), Perfect5()), (Perfect5(), Steane7()), (Steane7(), Cleve8()), (Toric(2, 2), Shor9())], - CircuitCode => random_circuit_code_args + CircuitCode => random_circuit_code_args, QuantumReedMuller => [(3), (4), (5)] ) diff --git a/test/test_ecc_quantumreedmuller.jl b/test/test_ecc_quantumreedmuller.jl index 5e45a2bc7..79296d550 100644 --- a/test/test_ecc_quantumreedmuller.jl +++ b/test/test_ecc_quantumreedmuller.jl @@ -6,11 +6,11 @@ using QuantumClifford: canonicalize!, Stabilizer, stab_to_gf2 using QuantumClifford.ECC using QuantumClifford.ECC: AbstractECC, QuantumReedMuller, Steane7 -function designed_distance(matrix) - distance = 3 - for row in eachrow(matrix) +function designed_distance(mat) + dist = 3 + for row in eachrow(mat) count = sum(row) - if count < distance + if count < dist return false end end