Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Sep 20, 2024
1 parent 9c2770d commit dd62b7b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ function rate(c)
return rate
end

function generator end

"""The distance of a code."""
function distance end

Expand Down
1 change: 0 additions & 1 deletion src/ecc/codes/classical/recursivereedmuller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/ecc/codes/quantumreedmuller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
)

Expand Down
8 changes: 4 additions & 4 deletions test/test_ecc_quantumreedmuller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd62b7b

Please sign in to comment.