quri_parts.core.operator.sparse module#

get_sparse_matrix(operator, n_qubits=None, format='csc')#

Convert PauliLabel and Operator into scipy sparse matrix.

Parameters:
  • operator (PauliLabel | Operator) –

  • n_qubits (int | None) –

  • format (core.operator.sparse.SparseMatrixName) –

Return type:

spmatrix