qecx.SubsystemStabilizerCodeData

class qecx.SubsystemStabilizerCodeData(n, k, d, gauge_generators, logical_operators_X, logical_operators_Z, declared_stabilizer_generators=None)

Bases: CodeData

Algebraic surface for a subsystem stabilizer code.

Instances compare and hash by value over the declared field contents, with authored stabilizer_generators distinguished from derived: two codes with equal gauge data but differing on whether they declare the stabilizer generators are unequal. Comparison is type-strict across code-data classes. The gauge-combination consistency of the stabilizer basis is verified on first access of stabilizer_gauge_combinations 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_generators (tuple[PauliProductOperator, ...]) – Pauli-product gauge generators of length n each.

  • logical_operators_X (tuple[PauliProductOperator, ...]) – Length-k tuple of length-n Pauli products.

  • logical_operators_Z (tuple[PauliProductOperator, ...]) – Symmetric tuple for the Z-logicals.

  • declared_stabilizer_generators (tuple[PauliProductOperator, ...] | None) – Authored stabilizer generators of length n each, or None to derive them from the gauge group.

  • stabilizer_generators (tuple[PauliProductOperator, ...]) – Effective stabilizer generators: declared_stabilizer_generators when authored, else the derived center-of-gauge basis.

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

  • gauge_matrix (NDArray[np.uint8]) – Symplectic-form view of gauge_generators.

  • stabilizer_gauge_combinations (NDArray[np.uint8]) – F2 coefficient matrix expressing each row of the derived stabilizer_matrix as a linear combination of gauge_generators (in their symplectic representation), shape (m, g).

property stabilizer_generators: tuple[PauliProductOperator, ...]

Pauli-product basis for the center of the gauge group, length n each.

Returns declared_stabilizer_generators when authored; otherwise the canonical symplectic-RREF basis.

property stabilizer_matrix: NDArray[uint8]

Symplectic-form view of stabilizer_generators.

property gauge_matrix: NDArray[uint8]

Symplectic-form view of gauge_generators.

property stabilizer_gauge_combinations: NDArray[uint8]

F2 coefficient matrix expressing each row of stabilizer_matrix as a combination of gauge_generators rows.

gauge_generators is taken in its symplectic representation. Shape (m, g).