qecx.algebra.symplectic_to_paulis

qecx.algebra.symplectic_to_paulis(matrix, n)

Decode an (m, 2n) symplectic matrix to a tuple of length-n Pauli products.

Inverse of paulis_to_symplectic(). Reads each row position i as the pair (matrix[r, i], matrix[r, n + i]) and maps (0, 0) -> "I", (1, 0) -> "X", (0, 1) -> "Z", (1, 1) -> "Y".

Parameters:
  • matrix (NDArray[np.uint8]) – Symplectic matrix of shape (m, 2n). X-block in columns [0, n) and Z-block in columns [n, 2n).

  • n (int) – Pauli-product length (equivalently, physical-qubit count).

Returns:

Length-m tuple of length-n Pauli products in big-endian form. Returns () on an input with zero rows.

Return type:

tuple[PauliProductOperator, …]