Skip to content
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
2 changes: 2 additions & 0 deletions src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ include("codes/util.jl")
include("codes/concat.jl")
include("codes/random_circuit.jl")
include("codes/classical/bch.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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A see also to Gottesman and an explanation about the different would be useful.

"""
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
9 changes: 5 additions & 4 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Test
using QuantumClifford.ECC.QECCore
using QuantumClifford
using QuantumClifford.ECC
using QuantumClifford.ECC: check_repr_commutation_relation, check_repr_regular_linear
using QuantumClifford.ECC:
using QuantumClifford.ECC: check_repr_commutation_relation, check_repr_regular_linear, Gottesman4

using InteractiveUtils
using SparseArrays

Expand Down Expand Up @@ -325,9 +326,9 @@ const code_instance_args = Dict(
:QuantumTannerGraphProduct => [(H1, H2),(H2, H2), (H1, H1), (H2, H1)],
:CyclicQuantumTannerGraphProduct => [1, 2, 3, 4, 5],
:DDimensionalSurfaceCode => [(2, 2), (2, 3), (3, 2), (3, 3), (4, 2)],
:DDimensionalToricCode => [(2, 2), (2, 3), (3, 2), (3, 3), (4, 2)]
:DDimensionalToricCode => [(2, 2), (2, 3), (3, 2), (3, 3), (4, 2)],
:Gottesman4 => [4, 5, 6, 7, 8]
)

function all_testablable_code_instances(;maxn=nothing)
codeinstances = []
i = 1
Expand Down
Loading