qecx.algebra.binary_rows_to_paulis

qecx.algebra.binary_rows_to_paulis(matrix, char)

Convert each binary row to a length-n Pauli product with char at 1-positions.

Columns containing 0 emit "I"; columns containing 1 emit char. The intended char is "X" for X-type CSS generators and "Z" for Z-type CSS generators.

Parameters:
  • matrix (NDArray[np.uint8]) – Binary matrix of shape (m, n).

  • char (str) – Character emitted at columns with value 1.

Returns:

Length-m tuple of length-n Pauli products in big-endian form.

Return type:

tuple[PauliProductOperator, …]