qecx.CSSCodeData

class qecx.CSSCodeData(n, k, d, H_X, H_Z, logical_operators_X, logical_operators_Z)

Bases: CodeData

Algebraic surface for a CSS code.

Instances compare and hash by value over the declared field contents; comparison is type-strict across code-data classes. Certain coset-representative invariants are verified on first access of the derived pure_logical_operators_X / pure_logical_operators_Z properties 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.

  • H_X (NDArray[np.uint8]) – CSS X-stabilizer parity-check matrix, shape (m_X, n).

  • H_Z (NDArray[np.uint8]) – CSS Z-stabilizer parity-check matrix, shape (m_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.

  • 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, shape (m_X + m_Z, 2n).

  • 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_X (NDArray[np.uint8]) – Trivial-gauge alias of H_X.

  • gauge_Z (NDArray[np.uint8]) – Trivial-gauge alias of H_Z.

  • gauge_generators (tuple[PauliProductOperator, ...]) – Trivial-gauge alias of stabilizer_generators.

  • gauge_matrix (NDArray[np.uint8]) – Trivial-gauge alias of stabilizer_matrix.

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, shape (m_X + m_Z, 2n).

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_X: NDArray[uint8]

Trivial-gauge alias returning self.H_X.

property gauge_Z: NDArray[uint8]

Trivial-gauge alias returning self.H_Z.

property gauge_generators: tuple[PauliProductOperator, ...]

Trivial-gauge alias returning self.stabilizer_generators.

property gauge_matrix: NDArray[uint8]

Trivial-gauge alias returning self.stabilizer_matrix.