qiskit.quantum_info.SparsePauliOp.from_operator¶
- static SparsePauliOp.from_operator(obj, atol=None, rtol=None)[Quellcode]¶
Construct from an Operator objector.
Note that the cost of this construction is exponential as it involves taking inner products with every element of the N-qubit Pauli basis.
- Parameter
obj (Operator) – an N-qubit operator.
atol (float) – Optional. Absolute tolerance for checking if coefficients are zero (Default: 1e-8).
rtol (float) – Optional. relative tolerance for checking if coefficients are zero (Default: 1e-5).
- Rückgabe
the SparsePauliOp representation of the operator.
- Rückgabetyp
- Verursacht
QiskitError – if the input operator is not an N-qubit operator.