Skip to content

Commit

Permalink
change to DelfosseReichardt after community feedback, there is a gene…
Browse files Browse the repository at this point in the history
…ralized reed-muller code and the second author name is now included in the code similar to Reed-Muller
  • Loading branch information
Fe-r-oz committed Jan 23, 2025
1 parent 74dd3df commit 4b49e50
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export parity_checks, parity_checks_x, parity_checks_z, iscss,
Shor9, Steane7, Cleve8, Perfect5, Bitflip3,
Toric, Gottesman, Surface, Concat, CircuitCode, QuantumReedMuller,
LPCode, two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes,
haah_cubic_codes, DelfosseGeneralizedReedMuller,
haah_cubic_codes, DelfosseReichardt,
random_brickwork_circuit_code, random_all_to_all_circuit_code,
evaluate_decoder,
CommutationCheckECCSetup, NaiveSyndromeECCSetup, ShorSyndromeECCSetup,
Expand Down Expand Up @@ -385,7 +385,7 @@ include("codes/surface.jl")
include("codes/concat.jl")
include("codes/random_circuit.jl")
include("codes/quantumreedmuller.jl")
include("codes/delfossegeneralized_reedmuller.jl")
include("codes/delfosse_reichardt_code.jl")
include("codes/classical/reedmuller.jl")
include("codes/classical/recursivereedmuller.jl")
include("codes/classical/bch.jl")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""
The `[[8rp, (8r − 2)p − 2m, 4]]` Delfosse Genneralized Reed-Muller code is derived from
the classical Reed-Muller code and is used to construct quantum stabilizer code.
The `[[8rp, (8r − 2)p − 2m, 4]]` Delfosse-Reichardt code is derived from the classical
Reed-Muller code and is used to construct quantum stabilizer code.
Delfosse and Reichardt utilize the `[8, 4, 4]` Reed-Muller code to construct `[[8p, 6(p−1), 4]]`
self-dual CSS quantum codes for `p≥2`, and the `[16, 11, 4]` Reed-Muller code to construct
`[[16p, 14p − 8, 4]]` self-dual CSS quantum codes for `p≥1`. To improve the generality of
the code construction, we proposed that these codes be generalized using the Reed-Muller code
as the base matrix. Rather than hardcoding the `[8, 4, 4]` or `[16, 11, 4]` Reed-Muller codes,
users should be able to input parameters `r` and `m`, thus enhancing the versatility of the
code. This leads to the following generalized code: `[[8rp, (8r − 2)p − 2m, 4]]` Delfosse
Generalized Reed-Muller code.
code. This leads to the following generalized code: `[[8rp, (8r − 2)p − 2m, 4]]` Delfosse-Reichardt
code.
The `[[8p, 6(p − 1), 4]]` and `[[16p, 14p − 8, 4]]` codes were introduced by Delfosse and
Reichardt in the paper *Short Shor-style syndrome sequences* [delfosse2020short](@cite). The
Expand All @@ -24,7 +24,7 @@ julia> using QuantumClifford; using QuantumClifford.ECC; # hide
julia> p = 2; r = 1; m = 3;
julia> c = parity_checks(DelfosseGeneralizedReedMuller(p,r,m))
julia> c = parity_checks(DelfosseReichardt(p,r,m))
+ XXXXXXXX________
+ ________XXXXXXXX
+ XXXX____XXXX____
Expand All @@ -49,7 +49,7 @@ julia> using QuantumClifford; using QuantumClifford.ECC; # hide
julia> p = 2; r = 2; m = 4;
julia> c = parity_checks(DelfosseGeneralizedReedMuller(p,r,m))
julia> c = parity_checks(DelfosseReichardt(p,r,m))
+ XXXXXXXXXXXXXXXX________________
+ ________________XXXXXXXXXXXXXXXX
+ XXXXXXXX________XXXXXXXX________
Expand All @@ -67,11 +67,11 @@ julia> code_n(c), code_k(c)
(32, 20)
```
"""
struct DelfosseGeneralizedReedMuller <: AbstractECC
struct DelfosseReichardt <: AbstractECC
blocks::Int
r::Int
m::Int
function DelfosseGeneralizedReedMuller(blocks,r,m)
function DelfosseReichardt(blocks,r,m)
blocks < 2 && throw(ArgumentError("The number of blocks must be at least 2 to construct a valid code."))
if r < 0 || r > m
throw(ArgumentError("Invalid parameters: r must be non-negative and r ≤ m in order to valid code."))

Check warning on line 77 in src/ecc/codes/delfosse_reichardt_code.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/codes/delfosse_reichardt_code.jl#L77

Added line #L77 was not covered by tests
Expand All @@ -80,11 +80,11 @@ struct DelfosseGeneralizedReedMuller <: AbstractECC
end
end

function iscss(::Type{DelfosseGeneralizedReedMuller})
function iscss(::Type{DelfosseReichardt})
return true

Check warning on line 84 in src/ecc/codes/delfosse_reichardt_code.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/codes/delfosse_reichardt_code.jl#L83-L84

Added lines #L83 - L84 were not covered by tests
end

function _generalize_ReedMuller_code(blocks::Int, r::Int, m::Int)
function _generalize_delfosse_reichardt_code(blocks::Int, r::Int, m::Int)
# base matrix: Reed-Muller paritycheck matrix
H = parity_checks(ReedMuller(r,m))
r, c = size(H)
Expand All @@ -111,17 +111,17 @@ function _generalize_ReedMuller_code(blocks::Int, r::Int, m::Int)
return extended_H
end

function parity_checks(c::DelfosseGeneralizedReedMuller)
extended_mat = _generalize_ReedMuller_code(c.blocks, c.r, c.m)
function parity_checks(c::DelfosseReichardt)
extended_mat = _generalize_delfosse_reichardt_code(c.blocks, c.r, c.m)
hx, hz = extended_mat, extended_mat
code = CSS(hx, hz)
Stabilizer(code)
end

code_n(c::DelfosseGeneralizedReedMuller) = 8*c.blocks*c.r
code_n(c::DelfosseReichardt) = 8*c.blocks*c.r

Check warning on line 121 in src/ecc/codes/delfosse_reichardt_code.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/codes/delfosse_reichardt_code.jl#L121

Added line #L121 was not covered by tests

code_k(c::DelfosseGeneralizedReedMuller) = (8*c.r 2)*c.blocks 2*c.m
code_k(c::DelfosseReichardt) = (8*c.r 2)*c.blocks 2*c.m

Check warning on line 123 in src/ecc/codes/delfosse_reichardt_code.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/codes/delfosse_reichardt_code.jl#L123

Added line #L123 was not covered by tests

parity_checks_x(c::DelfosseGeneralizedReedMuller) = _generalize_ReedMuller_code(c.blocks, c.r, c.m)
parity_checks_x(c::DelfosseReichardt) = _generalize_delfosse_reichardt_code(c.blocks, c.r, c.m)

Check warning on line 125 in src/ecc/codes/delfosse_reichardt_code.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/codes/delfosse_reichardt_code.jl#L125

Added line #L125 was not covered by tests

parity_checks_z(c::DelfosseGeneralizedReedMuller) = _generalize_ReedMuller_code(c.blocks, c.r, c.m)
parity_checks_z(c::DelfosseReichardt) = _generalize_delfosse_reichardt_code(c.blocks, c.r, c.m)

Check warning on line 127 in src/ecc/codes/delfosse_reichardt_code.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/codes/delfosse_reichardt_code.jl#L127

Added line #L127 was not covered by tests
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@testitem "ECC [[8rp, (8r − 2)p − 2m, 4]] Delfosse Generalized ReedMuller code" begin
@testitem "ECC [[8rp, (8r − 2)p − 2m, 4]] Delfosse-Reichardt code" begin

using LinearAlgebra
using QuantumClifford
using QuantumClifford.ECC
using QuantumClifford.ECC: DelfosseGeneralizedReedMuller, _generalize_ReedMuller_code
using QuantumClifford.ECC: DelfosseReichardt, _generalize_delfosse_reichardt_code
using Nemo: matrix, GF, echelon_form

@testset "Testing [[8rp, (8r − 2)p − 2m, 4]] DelfosseRepCode properties" begin
Expand All @@ -15,7 +15,7 @@
p = i
n = 8*r*p
k = (8*r-2)*p-2*m
stab = parity_checks(DelfosseGeneralizedReedMuller(p,r,m))
stab = parity_checks(DelfosseReichardt(p,r,m))
H = stab_to_gf2(stab)
mat = matrix(GF(2), H)
computed_rank = rank(mat)
Expand All @@ -31,7 +31,7 @@
p = i
n = 8*r*p
k = (8*r-2)*p-2*m
stab = parity_checks(DelfosseGeneralizedReedMuller(p,r,m))
stab = parity_checks(DelfosseReichardt(p,r,m))
H = stab_to_gf2(stab)
mat = matrix(GF(2), H)
computed_rank = rank(mat)
Expand All @@ -49,6 +49,6 @@
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1;
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1;
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
@test echelon_form(matrix(GF(2), Matrix{Int}(_generalize_ReedMuller_code(blocks,r,m)))) == echelon_form(matrix(GF(2), mat_paper))
@test echelon_form(matrix(GF(2), Matrix{Int}(_generalize_delfosse_reichardt_code(blocks,r,m)))) == echelon_form(matrix(GF(2), mat_paper))
end
end

0 comments on commit 4b49e50

Please sign in to comment.