Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[[2ʲ, 2ʲ - 2j - 2, 4]] Gottesman code #282

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ include("codes/classical/reedmuller.jl")
include("codes/classical/recursivereedmuller.jl")
include("codes/classical/bch.jl")
include("codes/quantumreedmuller.jl")
include("codes/gottesman4.jl")

# qLDPC
include("codes/classical/lifted.jl")
Expand Down
25 changes: 25 additions & 0 deletions src/ecc/codes/gottesman4.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""The family of `[[2ʲ, 2ʲ - 2j - 2, 4]]` Gottesman codes, also known as a 'Class of Distance Four Codes', as described in [Gottesman's 1997 PhD thesis](@cite gottesman1997stabilizer) and in [gottesman1996class](@cite).

The stabilizer generators of the original `[[2ʲ, 2ʲ - j - 2, 3]]` Gottesman codes are incorporated to create a set of generators for this distance-four code. The resulting stabilizer set, denoted by S, incorporates the following elements: The first two generators are the Pauli-`X` and Pauli-`Z` operators acting on all qubits, represented by `Mₓ` and `Mz`, respectively. The next `j` generators correspond to `M₁` through `Mⱼ`, which are directly inherited from the `[[2ʲ, 2ʲ - j - 2, 3]]` Gottesman code's stabilizers. This inclusion ensures that `S` retains the inherent distance-three property of the original Gottesman code. The final `j` generators are defined as `Nᵢ = RMᵢR`, where `i` ranges from `1` to `j`. Here, `R` signifies a Hadamard Rotation operation applied to all `2ʲ` qubits, and `Mᵢ` refers to one of the existing generators from the second set `(M₁ to Mⱼ)`. By incorporating the stabilizers of a distance-three code, the constructed set `S` inherently guarantees a minimum distance of three for the resulting distance-four Gottesman code.
"""
struct Gottesman4 <: AbstractECC
j::Int
function Gottesman4(j)
(j >= 3 && j < 21) || error("In `Gottesman4(j)`, `j` must be ≥ 3 in order to obtain a valid code and < 21 to remain tractable")
new(j)
end
end

code_n(c::Gottesman4) = 2^c.j
code_k(c::Gottesman4) = 2^c.j - 2*c.j - 2
distance(c::Gottesman4) = 4

function parity_checks(c::Gottesman4)
H₁ = parity_checks(Gottesman(c.j))
Hⱼ = H₁[3:end]
for qᵢ in 1:nqubits(Hⱼ)
apply!(Hⱼ, sHadamard(qᵢ))
end
H = vcat(H₁, Hⱼ)
Stabilizer(H)
end
6 changes: 4 additions & 2 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using QuantumClifford
using QuantumClifford.ECC
using QuantumClifford.ECC: Gottesman4
using InteractiveUtils

import Nemo: GF
Expand Down Expand Up @@ -60,11 +60,13 @@ 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)]),
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,
LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, other_lifted_product_codes)),
QuantumReedMuller => [3, 4, 5]
QuantumReedMuller => [3, 4, 5],
Gottesman4 => [4, 5, 6, 7, 8]
)

function all_testablable_code_instances(;maxn=nothing)
Expand Down
Loading