rqutils.paulis.general.paulis
- rqutils.paulis.general.paulis(dim: int | integer | Sequence[int | integer], sparse: bool = False) NDArray[complex128] | tuple[csr_array]
Return an array of generalized Pauli matrices or matrix products of given dimension(s).
- Parameters:
dim – Dimension(s) of the Pauli matrices.
sparse – Whether to return the matrices as an array (dtype=object) of CSR arrays.
- Returns:
An array of Pauli (product) matrices as an array. For dim=(d1, d2, …), the shape of the array is (d1**2, d2**2, …, d1*d2*…, d1*d2*…).