Pauli.to_spmatrix

Pauli.to_spmatrix()[source]

Convert Pauli to a sparse matrix representation (CSR format).

Order is q_{n-1} …. q_0, i.e., $P_{n-1} otimes … P_0$

Returns

a sparse matrix with CSR format that represents the pauli.

Return type

scipy.sparse.csr_matrix