Quantum Code API
Quantum code constructors accept symplectic matrices, CSS check pairs, or Pauli strings. They validate commutation and return the most specific supported code type, so a constructor given data with no gauge operators returns a stabilizer code, and a stabilizer code whose checks split by type returns a CSS code. Use the accessors rather than reaching into struct fields, and prefer dispatching on the traits (LogicalTrait, GaugeTrait, CSSTrait) over testing concrete types.
For a guided introduction, see Quantum Codes.
Because every stabilizer code is a subsystem code with no gauge qubits, the bulk of the shared accessors are documented on the subsystem code page; this page covers the type hierarchy, the traits, and the stabilizer-specific constructors and solvers.
CodingTheory.AbstractEAStabilizerCode — Type
abstract type AbstractEAStabilizerCode <: AbstractStabilizerCodeSupertype for entanglement-assisted stabilizer codes.
CodingTheory.AbstractEAStabilizerCodeCSS — Type
abstract type AbstractEAStabilizerCodeCSS <: AbstractEAStabilizerCodeSupertype for CSS entanglement-assisted stabilizer codes.
CodingTheory.AbstractEASubsystemCode — Type
abstract type AbstractEASubsystemCode <: AbstractSubsystemCodeSupertype for entanglement-assisted subsystem codes.
CodingTheory.AbstractEASubsystemCodeCSS — Type
abstract type AbstractEASubsystemCodeCSS <: AbstractEASubsystemCodeSupertype for CSS entanglement-assisted subsystem codes.
CodingTheory.AbstractGraphStateStabilizer — Type
abstract type AbstractGraphStateStabilizer <: AbstractStabilizerCodeSupertype for graph-state stabilizer-code representations.
CodingTheory.AbstractGraphStateStabilizerCSS — Type
abstract type AbstractGraphStateStabilizerCSS <: AbstractStabilizerCodeCSSSupertype for CSS graph-state stabilizer-code representations.
CodingTheory.AbstractGraphStateSubsystem — Type
abstract type AbstractGraphStateSubsystem <: AbstractSubsystemCodeSupertype for graph-state subsystem-code representations.
CodingTheory.AbstractGraphStateSubsystemCSS — Type
abstract type AbstractGraphStateSubsystemCSS <: AbstractSubsystemCodeCSSSupertype for CSS graph-state subsystem-code representations.
CodingTheory.AbstractHypergraphProductCode — Type
abstract type AbstractHypergraphProductCode <: AbstractStabilizerCodeCSSSupertype for CSS stabilizer codes obtained from the hypergraph-product construction.
CodingTheory.AbstractStabilizerCode — Type
abstract type AbstractStabilizerCode <: AbstractSubsystemCodeSupertype for stabilizer codes, represented in this hierarchy as subsystem codes without gauge qubits.
CodingTheory.AbstractStabilizerCodeCSS — Type
abstract type AbstractStabilizerCodeCSS <: AbstractStabilizerCodeSupertype for CSS stabilizer codes with separate $X$- and $Z$-type stabilizer data.
CodingTheory.AbstractSubsystemCode — Type
abstract type AbstractSubsystemCode <: AbstractAdditiveCodeSupertype for additive quantum subsystem codes, including stabilizer codes as the gauge-free specialization.
CodingTheory.AbstractSubsystemCodeCSS — Type
abstract type AbstractSubsystemCodeCSS <: AbstractSubsystemCodeSupertype for CSS subsystem codes with separate $X$- and $Z$-type stabilizer data.
CodingTheory.BBCode — Type
mutable struct BBCode{T, U, V} <: AbstractStabilizerCodeCSSA finite bivariate-bicycle CSS stabilizer code.
Representation-specific information (a standard quotient, a twisted Laurent lattice, or a coprime univariate quotient) is retained in R, a1, a2, and N. Derived matrices and code metadata live in cache.
CodingTheory.BiasTailoredLiftedProductCode — Type
mutable struct BiasTailoredLiftedProductCode{T} <: AbstractStabilizerCodeA bias-tailored lifted-product stabilizer code defined by matrices A and B.
CodingTheory.CSSTrait — Type
abstract type CSSTraitHoly-trait function and root trait type that map a quantum code type to IsCSS or IsNotCSS. Dispatch on this trait instead of testing concrete code types.
CodingTheory.FiniteGeneralized3DToricCode — Type
mutable struct FiniteGeneralized3DToricCode{T, U, V} <: AbstractStabilizerCodeCSSA finite three-dimensional generalized toric CSS stabilizer code.
CodingTheory.GaugeTrait — Type
abstract type GaugeTraitHoly-trait function and root trait type that map a quantum code type to HasGauges or HasNoGauges. Dispatch on this trait instead of testing concrete code types.
CodingTheory.Generalized3DToricCode — Type
struct Generalized3DToricCode{T, U, V}An algebraic three-dimensional generalized toric-code datum.
CodingTheory.GeneralizedShorCode — Type
mutable struct GeneralizedShorCode <: AbstractSubsystemCodeA generalized Shor subsystem code constructed from two classical linear codes.
CodingTheory.HasGauges — Type
struct HasGauges <: GaugeTraitSingleton trait returned by GaugeTrait for subsystem-code types with gauge operators.
CodingTheory.HasLogicals — Type
struct HasLogicals <: LogicalTraitSingleton trait returned by LogicalTrait for code types that carry logical operators.
CodingTheory.HasNoGauges — Type
struct HasNoGauges <: GaugeTraitSingleton trait returned by GaugeTrait for stabilizer-code types without gauge operators.
CodingTheory.HasNoLogicals — Type
struct HasNoLogicals <: LogicalTraitSingleton trait returned by LogicalTrait for graph-state code types, which do not carry logical operators.
CodingTheory.InfiniteBBCode — Type
struct InfiniteBBCode{T, U, V}An algebraic bivariate-bicycle datum before a finite lattice is chosen.
This is deliberately not an AbstractSubsystemCode: it has no finite block length or stabilizer matrix.
CodingTheory.IsCSS — Type
struct IsCSS <: CSSTraitSingleton trait returned by CSSTrait for code types in CSSTypes.
CodingTheory.IsNotCSS — Type
struct IsNotCSS <: CSSTraitSingleton trait returned by CSSTrait for non-CSS subsystem-code types.
CodingTheory.LiftedProductCode — Type
mutable struct LiftedProductCode{T} <: AbstractStabilizerCodeCSSA CSS stabilizer code defined by a lifted-product construction from matrices A and B.
CodingTheory.LogicalTrait — Type
abstract type LogicalTraitHoly-trait function and root trait type that map a quantum code type to HasLogicals or HasNoLogicals. Dispatch on this trait instead of testing concrete code types.
CodingTheory.QuantumConcatenatedCode — Type
mutable struct QuantumConcatenatedCode <: AbstractStabilizerCodeA stabilizer code formed by concatenating an outer stabilizer code with an inner stabilizer code.
CodingTheory.StabilizerCode — Method
StabilizerCode(
C::AbstractLinearCode,
F::AbstractAlgebra.FinField;
basis,
char_vec,
logs_alg
) -> Union{StabilizerCode, StabilizerCodeCSS}
Return the symplectic stabilizer code over F associated with a Hermitian self-orthogonal linear code over the quadratic extension of F. The optional basis is an ordered extension basis; a primitive basis is used by default.
CodingTheory.StabilizerCode — Method
StabilizerCode(
S::AbstractSubsystemCode
) -> Union{StabilizerCode, StabilizerCodeCSS}
CodingTheory.StabilizerCode — Method
StabilizerCode(
S::AbstractStabilizerCode;
logs_alg
) -> Union{StabilizerCode, StabilizerCodeCSS}
CodingTheory.StabilizerCode — Method
StabilizerCode(
stabs::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC};
char_vec,
logs_alg
) -> Union{StabilizerCode, StabilizerCodeCSS}
Return the stabilizer code whose stabilizers is determined by stabs.
CodingTheory.StabilizerCode — Method
StabilizerCode(
S_Pauli::Array{T<:Union{String, Vector{Char}}, 1};
char_vec,
logs_alg
) -> Union{StabilizerCode, StabilizerCodeCSS}
CodingTheory.StabilizerCodeCSS — Method
StabilizerCodeCSS(C1::AbstractLinearCode, C2::AbstractLinearCode; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm)
CSSCode(C1::AbstractLinearCode, C2::AbstractLinearCode; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm)CodingTheory.StabilizerCodeCSS — Method
StabilizerCodeCSS(
S::AbstractStabilizerCode;
logs_alg
) -> StabilizerCodeCSS
CodingTheory.StabilizerCodeCSS — Method
StabilizerCodeCSS(C::AbstractLinearCode; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm)
CSSCode(C::AbstractLinearCode; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm)CodingTheory.StabilizerCodeCSS — Method
StabilizerCodeCSS(X_matrix::CTMatrixTypes, Z_matrix::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm)
CSSCode(X_matrix::CTMatrixTypes, Z_matrix::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing}= missing, logs_alg::Symbol = :stnd_frm)Return a CSS code whose X-stabilizers are given by X_matrix, Z-stabilizers by Z_matrix.
CodingTheory.StabilizerCodeCSS — Method
StabilizerCodeCSS(
S_Pauli::Array{T<:Union{String, Vector{Char}}, 1};
char_vec,
logs_alg
) -> Union{StabilizerCode, StabilizerCodeCSS}
CodingTheory.CSSCode — Method
CSSCode(
X_matrix::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
Z_matrix::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC};
char_vec,
logs_alg
) -> StabilizerCodeCSS
Return the CSS stabilizer code whose trimmed X- and Z-stabilizer matrices are X_matrix and Z_matrix. This is an alias for StabilizerCodeCSS.
CodingTheory.X_minimum_distance_lower_bound — Method
X_minimum_distance_lower_bound(
S::AbstractStabilizerCode
) -> Any
Return the currently stored lower bound on the minimum X-distance.
CodingTheory.X_minimum_distance_upper_bound — Method
X_minimum_distance_upper_bound(
S::AbstractStabilizerCode
) -> Any
Return the currently stored upper bound on the minimum X-distance.
CodingTheory.Z_minimum_distance_lower_bound — Method
Z_minimum_distance_lower_bound(
S::AbstractStabilizerCode
) -> Any
Return the currently stored lower bound on the minimum Z-distance.
CodingTheory.Z_minimum_distance_upper_bound — Method
Z_minimum_distance_upper_bound(
S::AbstractStabilizerCode
) -> Any
Return the currently stored upper bound on the minimum Z-distance.
CodingTheory.is_CSS_T_code — Method
is_CSS_T_code(S::AbstractStabilizerCode; verbose) -> Bool
Return true if S is a CSS-T code.
CodingTheory.is_triorthogonal — Method
is_triorthogonal(
S::AbstractStabilizerCodeCSS;
verbose
) -> Any
Return true if the CSS code S is triorthogonal. Cached to avoid recomputing on subsequent checks.
CodingTheory.minimum_distance_lower_bound — Method
minimum_distance_lower_bound(
S::AbstractStabilizerCode
) -> Any
Return the currently stored lower bound on the minimum distance.
CodingTheory.minimum_distance_upper_bound — Method
minimum_distance_upper_bound(
S::AbstractStabilizerCode
) -> Any
Return the currently stored upper bound on the minimum distance.
CodingTheory.random_CSS_code — Method
random_CSS_code(n::Int64, k::Int64) -> StabilizerCodeCSS
Return a random CSS code with an equal number of X and Z stabilizers.
CodingTheory.random_stabilizer_code — Method
random_stabilizer_code(
rng::Random.AbstractRNG,
F::AbstractAlgebra.FinField,
n::Int64,
k::Union{Int64, Rational};
char_vec
) -> Union{StabilizerCode, StabilizerCodeCSS}
Return a random, not necessarily uniformly sampled, $[[n, k]]$ stabilizer code over F.
CodingTheory.set_X_minimum_distance! — Method
set_X_minimum_distance!(S::AbstractStabilizerCode, d::Int64)
Set the minimum X-distance of the code to d.
CodingTheory.set_Z_minimum_distance! — Method
set_Z_minimum_distance!(S::AbstractStabilizerCode, d::Int64)
Set the minimum Z-distance of the code to d.
CodingTheory.set_minimum_distance! — Method
set_minimum_distance!(S::AbstractStabilizerCode, d::Int64)
Set the minimum distance of the code to d.