qiskit.quantum_info.SparsePauliOp.to_matrix¶
- SparsePauliOp.to_matrix(sparse=False)[Quellcode]¶
Convert to a dense or sparse matrix.
- Parameter
sparse (bool) – if True return a sparse CSR matrix, otherwise return dense Numpy array (Default: False).
- Rückgabe
A dense matrix if sparse=False. csr_matrix: A sparse matrix in CSR format if sparse=True.
- Rückgabetyp
array