qecx.algebra.paulis_to_symplectic¶
- qecx.algebra.paulis_to_symplectic(paulis, n)¶
Encode a tuple of length-
nPauli 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-
mtuple of length-nPauli products. Iteration is big-endian: the character at index0corresponds to qubit0(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 viasetflags(write=False).- Return type: