qecx.SubsystemCSSCodeData¶
- class qecx.SubsystemCSSCodeData(n, k, d, gauge_X, gauge_Z, logical_operators_X, logical_operators_Z, declared_H_X=None, declared_H_Z=None)¶
Bases:
CodeDataAlgebraic surface for a subsystem CSS code.
Instances compare and hash by value over the declared field contents, with an authored
H_X/H_Zdistinguished from a derived one: two codes with equal gauge data but differing on whether they declare a stabilizer matrix are unequal. Comparison is type-strict across code-data classes. Certain algebraic invariants, over coset representatives and gauge-combination consistency, are verified on first access of the corresponding derived property rather than at construction.- Variables:
code_type (ClassVar[str]) – Code type the serialized form declares the class under.
syndrome_sources (ClassVar[frozenset[SyndromeSource]]) – Syndrome sources a code of the type carries.
declared_seed_fields (ClassVar[frozenset[str]]) – Code fields the serialized form admits as authored seeds of derived surfaces.
n (int) – Physical-qubit count.
k (int) – Logical-qubit count.
d (int | AsymmetricDistance) – Code distance: a symmetric integer of at least 1, or split X/Z via
AsymmetricDistance.gauge_X (NDArray[np.uint8]) – CSS-shape X-gauge generators, shape
(g_X, n).gauge_Z (NDArray[np.uint8]) – CSS-shape Z-gauge generators, shape
(g_Z, n).logical_operators_X (tuple[PauliProductOperator, ...]) – Length-
ktuple of length-nPauli products. The canonical CSS choice is purely{"I", "X"}per row; other coset representatives obtained by multiplication with elements of the stabilizer group are also admitted.logical_operators_Z (tuple[PauliProductOperator, ...]) – Length-
ktuple of length-nPauli products. The canonical CSS choice is purely{"I", "Z"}per row; other coset representatives are also admitted.declared_H_X (NDArray[np.uint8] | None) – Authored X-stabilizer parity-check matrix, shape
(m_X, n), orNoneto derive it from the gauge group.declared_H_Z (NDArray[np.uint8] | None) – Authored Z-stabilizer parity-check matrix, shape
(m_Z, n), orNoneto derive it from the gauge group.H_X (NDArray[np.uint8]) – Effective X-stabilizer parity-check matrix:
declared_H_Xwhen authored, else the derived basis, shape(m_X, n).H_Z (NDArray[np.uint8]) – Effective Z-stabilizer parity-check matrix:
declared_H_Zwhen authored, else the derived basis, shape(m_Z, n).stabilizer_generators (tuple[PauliProductOperator, ...]) – X-type Paulis from
H_Xrows followed by Z-type Paulis fromH_Zrows.stabilizer_matrix (NDArray[np.uint8]) – Symplectic-form view of
stabilizer_generators.pure_logical_operators_X (tuple[PauliProductOperator, ...]) – Canonical pure-X representatives of
logical_operators_Xwithin the stabilizer coset; each row purely{"I", "X"}.pure_logical_operators_Z (tuple[PauliProductOperator, ...]) – Canonical pure-Z representatives of
logical_operators_Zwithin the stabilizer coset; each row purely{"I", "Z"}.gauge_generators (tuple[PauliProductOperator, ...]) – X-type Paulis from
gauge_Xrows followed by Z-type Paulis fromgauge_Zrows.gauge_matrix (NDArray[np.uint8]) – Symplectic-form view of
gauge_generators.H_X_gauge_combinations (NDArray[np.uint8]) – F2 coefficient matrix expressing each row of
H_Xas a linear combination ofgauge_Xrows, shape(m_X, g_X).H_Z_gauge_combinations (NDArray[np.uint8]) – F2 coefficient matrix expressing each row of
H_Zas a linear combination ofgauge_Zrows, shape(m_Z, g_Z).
- property H_X: NDArray[uint8]¶
X-stabilizer subspace basis within the gauge group, shape
(m_X, n).Returns
declared_H_Xwhen authored; otherwise the canonical RREF basis in qubit-index column ordering.
- property H_Z: NDArray[uint8]¶
Z-stabilizer subspace basis within the gauge group, shape
(m_Z, n).Returns
declared_H_Zwhen authored; otherwise the canonical RREF basis in qubit-index column ordering.
- property stabilizer_generators: tuple[PauliProductOperator, ...]¶
X-type Paulis from
H_Xrows followed by Z-type Paulis fromH_Zrows.
- property pure_logical_operators_X: tuple[PauliProductOperator, ...]¶
Canonical pure-X representatives of
logical_operators_Xwithin the stabilizer coset.Each row is purely
{"I", "X"}.
- property pure_logical_operators_Z: tuple[PauliProductOperator, ...]¶
Canonical pure-Z representatives of
logical_operators_Zwithin the stabilizer coset.Each row is purely
{"I", "Z"}.
- property gauge_generators: tuple[PauliProductOperator, ...]¶
X-type Paulis from
gauge_Xrows followed by Z-type Paulis fromgauge_Zrows.