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: CodeData

Algebraic surface for a subsystem CSS code.

Instances compare and hash by value over the declared field contents, with an authored H_X / H_Z distinguished 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-k tuple of length-n Pauli 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-k tuple of length-n Pauli 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), or None to derive it from the gauge group.

  • declared_H_Z (NDArray[np.uint8] | None) – Authored Z-stabilizer parity-check matrix, shape (m_Z, n), or None to derive it from the gauge group.

  • H_X (NDArray[np.uint8]) – Effective X-stabilizer parity-check matrix: declared_H_X when authored, else the derived basis, shape (m_X, n).

  • H_Z (NDArray[np.uint8]) – Effective Z-stabilizer parity-check matrix: declared_H_Z when authored, else the derived basis, shape (m_Z, n).

  • stabilizer_generators (tuple[PauliProductOperator, ...]) – X-type Paulis from H_X rows followed by Z-type Paulis from H_Z rows.

  • stabilizer_matrix (NDArray[np.uint8]) – Symplectic-form view of stabilizer_generators.

  • pure_logical_operators_X (tuple[PauliProductOperator, ...]) – Canonical pure-X representatives of logical_operators_X within the stabilizer coset; each row purely {"I", "X"}.

  • pure_logical_operators_Z (tuple[PauliProductOperator, ...]) – Canonical pure-Z representatives of logical_operators_Z within the stabilizer coset; each row purely {"I", "Z"}.

  • gauge_generators (tuple[PauliProductOperator, ...]) – X-type Paulis from gauge_X rows followed by Z-type Paulis from gauge_Z rows.

  • 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_X as a linear combination of gauge_X rows, shape (m_X, g_X).

  • H_Z_gauge_combinations (NDArray[np.uint8]) – F2 coefficient matrix expressing each row of H_Z as a linear combination of gauge_Z rows, 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_X when 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_Z when authored; otherwise the canonical RREF basis in qubit-index column ordering.

property stabilizer_generators: tuple[PauliProductOperator, ...]

X-type Paulis from H_X rows followed by Z-type Paulis from H_Z rows.

property stabilizer_matrix: NDArray[uint8]

Symplectic-form view of stabilizer_generators.

property pure_logical_operators_X: tuple[PauliProductOperator, ...]

Canonical pure-X representatives of logical_operators_X within the stabilizer coset.

Each row is purely {"I", "X"}.

property pure_logical_operators_Z: tuple[PauliProductOperator, ...]

Canonical pure-Z representatives of logical_operators_Z within the stabilizer coset.

Each row is purely {"I", "Z"}.

property gauge_generators: tuple[PauliProductOperator, ...]

X-type Paulis from gauge_X rows followed by Z-type Paulis from gauge_Z rows.

property gauge_matrix: NDArray[uint8]

Symplectic-form view of gauge_generators.

property H_X_gauge_combinations: NDArray[uint8]

F2 coefficient matrix expressing each row of H_X as a linear combination of gauge_X rows.

Shape (m_X, g_X).

property H_Z_gauge_combinations: NDArray[uint8]

F2 coefficient matrix expressing each row of H_Z as a linear combination of gauge_Z rows.

Shape (m_Z, g_Z).