qecx.algebra.paulis_to_symplectic

qecx.algebra.paulis_to_symplectic(paulis, n)

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

Uses the standard Pauli-to-symplectic map I = (0, 0), X = (1, 0), Z = (0, 1), Y = (1, 1): the X-block occupies columns [0, n) and the Z-block occupies columns [n, 2n).

Parameters:
  • paulis (tuple[PauliProductOperator, ...]) – Length-m tuple of length-n Pauli products. Iteration is big-endian: the character at index 0 corresponds to qubit 0 (the leftmost column of the X- and Z-blocks).

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

Returns:

Fresh writeable array of shape (m, 2n). Returns a (0, 2n) array on an empty input tuple. Callers that store the matrix on an immutable container are responsible for sealing it via setflags(write=False).

Return type:

NDArray[np.uint8]