Known Quantum Codes

Named constructors return ordinary stabilizer or subsystem code objects and support the common quantum API.

CodingTheory.AugmentedBravyiBaconShorCode — Method
AugmentedBravyiBaconShorCode(
    A::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the local, augmented Bravyi–Bacon–Shor subsystem code associated with the binary matrix A.

source
CodingTheory.BaconShorCode — Method
BaconShorCode(
    m::Int64,
    n::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the Bacon-Shor subsystem code on a m x n lattice.

source
CodingTheory.BaconShorCode — Method
BaconShorCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the Bacon-Shor subsystem code on a d x d lattice.

source
CodingTheory.BravyiBaconShorCode — Method
BravyiBaconShorCode(
    A::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the generalied Bacon-Shor code defined by Bravyi in "Subsystem Codes With Spatially Local Generators", (2011).

source
CodingTheory.CleveGottesmanCode — Method
CleveGottesmanCode(

) -> Union{StabilizerCode, StabilizerCodeCSS}

Return the [[8, 3, 3]] Cleve-Gottesman (Eight-qubit) code. This is a small non-degenerate stabilizer code.

source
CodingTheory.ColorCode4612 — Method
ColorCode4612(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS}

Return the 4.6.12 Archimedean Color Code on a grid of size d. Stabilizers sit on the square (4), hexagonal (6), and dodecagonal (12) faces.

source
CodingTheory.GaugedShorCode — Method
GaugedShorCode() -> Union{SubsystemCode, SubsystemCodeCSS}

Return the $[[9, 1, 4, 3]]$ gauged Shor subsystem code with four gauge qubits and dressed distance three. Its gauge group is generated by the stabilizers together with the four anticommuting gauge-operator pairs.

source
CodingTheory.GeneralizedBaconShorCode — Method
GeneralizedBaconShorCode(
    A::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the generalized Bacon–Shor subsystem code associated with the support of the binary matrix A. Its gauge group is generated by weight-two $X$ operators joining consecutive occupied sites in each column and weight-two $Z$ operators joining consecutive occupied sites in each row.

source
CodingTheory.GrossCode — Method
GrossCode(

) -> BBCode{Oscar.MPolyQuoRing{Nemo.fpMPolyRingElem}, Oscar.MPolyQuoRingElem{Nemo.fpMPolyRingElem}, Oscar.MPolyQuoRingElem{Nemo.fpMPolyRingElem}}

Return the [[144, 12, 12]] gross code.

source
CodingTheory.HCode — Method
HCode(k::Int64) -> StabilizerCodeCSS

Return the [[k + 4, k, 2]] H code from https://errorcorrectionzoo.org/c/quantum_h.

source
CodingTheory.HaahsCubicCode — Method
HaahsCubicCode(L::Int64) -> StabilizerCodeCSS

Return Haah's Cubic Code (Type 15) on a 3D periodic lattice of size L. This is a CSS fracton model with 2 qubits per vertex. The dimension k fluctuates based on the number-theoretic properties of L.

source
CodingTheory.HeavyHexCode — Method
HeavyHexCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return a Heavy-Hex subsystem code on a periodic grid of size d. Data qubits sit on the vertices and edges of a hexagonal lattice.

source
CodingTheory.HeavySquareCode — Method
HeavySquareCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return a Heavy-Square subsystem code on a periodic grid of size d. Data qubits sit on the vertices and edges of a square lattice.

source
CodingTheory.LocalBravyiBaconShorCode — Method
LocalBravyiBaconShorCode(
    A::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the local Bravyi–Bacon–Shor subsystem code associated with the binary matrix A. Qubits fill the row and column intervals spanned by the support of A; the gauge group uses nearest-neighbor $XX$ and $ZZ$ generators and single-qubit generators at added zero entries.

source
CodingTheory.NappPreskill3DCode — Method
NappPreskill3DCode(
    m::Int64,
    n::Int64,
    k::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the Napp and Preskill 3D, modifed Bacon-Shor code.

source
CodingTheory.NappPreskill4DCode — Method
NappPreskill4DCode(
    x::Int64,
    y::Int64,
    z::Int64,
    w::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the Napp and Preskill 4D, modifed Bacon-Shor code.

source
CodingTheory.PlanarSurfaceCode — Method
PlanarSurfaceCode(d_x::Int, d_z::Int)
PlanarSurfaceCode(d::Int)

Return the [[d_x * d_z + (d_x - 1) * (d_z - 1), 1, d_x/d_z]] planar surface code.

The top and bottom boundaries are "smooth" (Z) and the left and right are "rough" (X).

source
CodingTheory.Q1513 — Method
Q1513() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[15, 1, 3]]$ quantum Reed–Muller code.

source
CodingTheory.Q1573 — Method
Q1573() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the [[15, 7, 3]] quantum Hamming code.

source
CodingTheory.Q15RM — Method
Q15RM() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[15, 1, 3]]$ quantum Reed–Muller code.

source
CodingTheory.Q412 — Method
Q412() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[4, 1, 2]]$ CSS stabilizer code generated by $XXXX$, $ZZII$, and $IIZZ$.

source
CodingTheory.Q422 — Method
Q422() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[4, 2, 2]]$ stabilizer code $C_4$ defined by Knill.

source
CodingTheory.Q511 — Method
Q511() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[5, 1, 1]]$ stabilizer code generated by translates of $ZXIII$.

source
CodingTheory.Q513 — Method
Q513() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[5, 1, 3]]$ perfect qubit stabilizer code.

source
CodingTheory.Q713 — Method
Q713() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[7, 1, 3]]$ Steane code.

source
CodingTheory.Q823 — Method
Q823() -> Union{StabilizerCode, StabilizerCodeCSS}

Return an $[[8, 2, 3]]$ qubit stabilizer code.

source
CodingTheory.Q832 — Method
Q832() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[8, 3, 2]]$ qubit stabilizer code known as the smallest interesting color code.

source
CodingTheory.Q913 — Method
Q913() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[9, 1, 3]]$ Shor code.

source
CodingTheory.Q9143 — Method
Q9143() -> Union{SubsystemCode, SubsystemCodeCSS}

Return the $[[9, 1, 4, 3]]$ gauged Shor subsystem code.

source
CodingTheory.QC4 — Method
QC4() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the $[[4, 2, 2]]$ stabilizer code $C_4$ defined by Knill.

source
CodingTheory.QC6 — Method
QC6() -> Union{StabilizerCode, StabilizerCodeCSS}

Return the C_6 stabilizer code defined by Knill.

source
CodingTheory.QuantumRepetitionCode — Method
QuantumRepetitionCode(
    d::Int64;
    error_type
) -> Union{StabilizerCode, StabilizerCodeCSS}

Return the [[d, 1, d]] quantum repetition code. error_type can be :phase_flip (X stabilizers) or :bit_flip (Z stabilizers).

source
CodingTheory.RotatedSurfaceCode — Method
RotatedSurfaceCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS}

Return the [[d^2, 1, d]] rotated surface code.

This is the surface-13/17 configuration found in "Low-distance surface codes under realistic quantum noise" by Tomita and Svore. The standard planar surface code is equivalent to their surface-25 configuration, which can be seen by viewing the stabilizers of PlanarSurfaceCode as an adjacency matrix.

source
CodingTheory.SubsystemSurfaceCode — Method
SubsystemSurfaceCode(
    m::Int64,
    n::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the subsystem surface code on a rectangular lattice with m rows and n columns of squares.

source
CodingTheory.SubsystemSurfaceCode — Method
SubsystemSurfaceCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the subsystem surface code on a square lattice with d rows and d columns of squares.

source
CodingTheory.SubsystemToricCode — Method
SubsystemToricCode(
    m::Int64,
    n::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the subsystem toric code on a rectangular lattice with m rows and n columns of squares.

source
CodingTheory.SubsystemToricCode — Method
SubsystemToricCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}

Return the subsystem toric code on a square lattice with d rows and d columns of squares.

source
CodingTheory.ToricCode — Method
ToricCode(d::Int64) -> StabilizerCodeCSS

Return the [[2d^2, 2, d]] toric code.

The lattice orientation used here follows the picture at https://errorcorrectionzoo.org/c/surface.

source
CodingTheory.ToricCode4D — Method
Function returning the stabilizers and logicals of periodic 4d surface codes of linear size l >= 2. Constructions taken from J. Math. Phys. 43, 4452-4505 (2002).
source
CodingTheory.ToricColorCode666 — Method
ToricColorCode666(L::Int64) -> StabilizerCodeCSS

Return the Toric 6.6.6 Color Code on a periodic lattice of size L. L must be a multiple of 3 for the lattice to be 3-colorable. Generates a [[2L^2, 4, d]] CSS code.

source
CodingTheory.TriangularSurfaceCode — Method
TriangularSurfaceCode(L::Int64) -> StabilizerCodeCSS

Return the periodic triangular-lattice CSS code obtained from the generated $X$ and $Z$ check matrices after omitting the final row of each.

source
CodingTheory.TwistDefectSurfaceCode — Method
TwistDefectSurfaceCode(
    d::Int64
) -> Union{StabilizerCode, StabilizerCodeCSS}

Return a distance d planar surface code containing a single twist defect in the bulk. The defect increases the logical dimension k by merging an X and Z stabilizer.

source
CodingTheory.XCubeModel — Method
XCubeModel(L::Int64) -> StabilizerCodeCSS

Return the X-Cube model on a cubic lattice of linear size L with periodic boundaries. The X-Cube model is a 3D fracton stabilizer code with parameters [[3L^3, 6L - 3, L]].

source
CodingTheory.XYSurfaceCode — Method
XYSurfaceCode(d_x::Int, d_z::Int)
XYSurfaceCode(d::Int)

Return the [[d_x * d_y + (d_x - 1) * (d_y - 1), 1, d_x/d_y]] XY surface code of "Ultrahigh Error Threshold for Surface Codes with Biased Noise" by Tuckett, Bartlett, and Flammia.

The top and bottom boundaries are "smooth" (Y) and the left and right are "rough" (X).

source

Stored lattices

The following constructors read stabilizers, logicals, and metachecks from data files shipped with the package, so their qubit numbering is fixed and, for the color codes, chosen to give a small trellis. Run using JLD2 to activate them.

CodingTheory.TriangularColorCode488 — Function
TriangularColorCode488(d::Int)

Return the 4.8.8 triangular color code of distance d, whose qubits are numbered in trellis order.

Note

  • Run using JLD2 to activate this extension. The stabilizers and logicals are loaded from stored data, which currently covers odd $3 \leq d \leq 19$.
source
CodingTheory.TriangularColorCode666 — Function
TriangularColorCode666(d::Int)

Return the 6.6.6 triangular color code of distance d, whose qubits are numbered in trellis order.

Note

  • Run using JLD2 to activate this extension. The stabilizers and logicals are loaded from stored data, which currently covers odd $3 \leq d \leq 21$.
source
CodingTheory.PlanarSurfaceCode3D_X — Function
PlanarSurfaceCode3D_X(d::Int)

Return the $X$-check, $X$-logical, and $X$-metacheck matrices of the three-dimensional planar surface code of distance d.

Note

  • Run using JLD2 to activate this extension. The matrices are loaded from stored data, which currently covers $3 \leq d \leq 9$.
source
CodingTheory.ToricCode3D_X — Function
ToricCode3D_X(d::Int)

Return the $X$-check, $X$-logical, and $X$-metacheck matrices of the three-dimensional toric code of distance d.

Note

  • Run using JLD2 to activate this extension. The matrices are loaded from stored data, which currently covers $2 \leq d \leq 13$.
source