Definition 4: CSS Code #
A CSS (Calderbank-Shor-Steane) quantum code is defined by a chain complex (Def_1) of length
two over π½β: Cβ β[H_Z^T] Cβ β[H_X] C_{-1} where H_X β H_Z^T = 0.
The matrices H_X β π½β^{r_X Γ n} and H_Z β π½β^{r_Z Γ n} are the X-type and Z-type
parity check matrices, so that Cβ = π½β^n, C_{-1} = π½β^{r_X}, and Cβ = π½β^{r_Z}.
Code Parameters #
n = dim Cβ: number of physical qubitsk = dim Hβ(C) = dim(ker H_X / im H_Z^T): number of logical qubitsd_X: minimum Hamming weight of a nontrivial element ofHβ(C) = ker H_X / im H_Z^Td_Z: minimum Hamming weight of a nontrivial element ofHβ°(C) = ker H_Z / im H_X^Td = min(d_X, d_Z): overall distance
Main Definitions #
CSSCodeβ a CSS quantum code specified by parity check matricesH_XandH_ZCSSCode.complexβ the three-term chain complexCβ β[H_Z^T] Cβ β[H_X] C_{-1}CSSCode.numQubitsβ the number of physical qubitsnCSSCode.logicalQubitsβ the number of logical qubitsk = dim Hβ(C)CSSCode.dXβ the X-distanceCSSCode.dZβ the Z-distanceCSSCode.distanceβ the overall distanced = min(d_X, d_Z)CSSCode.IsNKDCodeβ the property of being an[[n, k, d]]-codeCSSCode.IsNKDXZCodeβ the property of being an[[n, k, d_X, d_Z]]-code
CSS Code Structure #
A CSS (Calderbank-Shor-Steane) quantum code is defined by parity check matrices
H_X : π½β^n β π½β^{r_X} and H_Z : π½β^n β π½β^{r_Z} satisfying the CSS condition
H_X β H_Z^T = 0. Here H_Z^T : π½β^{r_Z} β π½β^n is the transpose of H_Z,
which serves as the differential from degree 1 to degree 0 in the chain complex
Cβ β[H_Z^T] Cβ β[H_X] C_{-1}.
The X-type parity check matrix
H_X : π½β^n β π½β^{r_X}.The Z-type parity check matrix transpose
H_Z^T : π½β^{r_Z} β π½β^n. This is the differential from degree 1 to degree 0 in the chain complex.The CSS condition:
H_X β H_Z^T = 0, ensuringβΒ² = 0.
Instances For
Three-term chain complex #
We construct the three-term chain complex Cβ β[H_Z^T] Cβ β[H_X] C_{-1} directly
as a HomologicalComplex (ModuleCat π½β) (ComplexShape.down β€).
The objects are defined by an if-cascade on the degree:
- degree
0:ModuleCat.of π½β (Fin n β π½β) - degree
1:ModuleCat.of π½β (Fin rZ β π½β) - degree
-1:ModuleCat.of π½β (Fin rX β π½β) - otherwise:
0
The differentials use eqToHom to transport between the if-defined objects
and the concrete ModuleCat.of types, following the pattern of HomologicalComplex.double.
The three-term chain complex Cβ β[H_Z^T] Cβ β[H_X] C_{-1} associated to a CSS code.
The objects are π½β^{r_Z} in degree 1, π½β^n in degree 0, π½β^{r_X} in degree -1,
and 0 elsewhere. The differentials are H_Z^T from degree 1 to 0 and H_X from
degree 0 to -1.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Code parameters #
The number of physical qubits n = dim Cβ.
Equations
Instances For
The number of logical qubits k = dim Hβ(C) = dim(ker H_X / im H_Z^T).
The homology at degree 0 of the chain complex is ker H_X / im H_Z^T, which
counts the number of independent logical qubits.
Equations
- Q.logicalQubits = Module.finrank π½β (β₯Q.HX.ker β§Έ Submodule.comap Q.HX.ker.subtype Q.HZT.range)
Instances For
The X-distance d_X is the minimum Hamming weight of a representative of a
non-trivial element of Hβ(C) = ker H_X / im H_Z^T. Equivalently, this is the
minimum Hamming weight of any vector in ker H_X that is not in im H_Z^T.
By convention (following ClassicalCode.distance), d_X = 0 when the homology
is trivial (i.e., ker H_X = im H_Z^T).
Instances For
The Z-distance d_Z is the minimum Hamming weight of a representative of a
non-trivial element of Hβ°(C) = ker H_Z / im H_X^T (Def_2). Since H_Z = (H_Z^T)^T
and H_X^T is the transpose of H_X, we define this using dualMap:
ker H_Zcorresponds toker (dualMap H_Z^T)in the dual ofCβim H_X^Tcorresponds torange (dualMap H_X)in the dual ofCβ
Over π½β with canonical bases, Dual(π½β^n) β
π½β^n via dotProductEquiv.
We use this identification to define the Hamming weight of dual functionals.
By convention, d_Z = 0 when the cohomology is trivial.