SparsePauliOp¶
- class SparsePauliOp(data, coeffs=None, *, ignore_pauli_phase=False, copy=True)[소스]¶
기반 클래스:
qiskit.quantum_info.operators.linear_op.LinearOp
Sparse N-qubit operator in a Pauli basis representation.
This is a sparse representation of an N-qubit matrix
Operator
in terms of N-qubitPauliList
and complex coefficients.It can be used for performing operator arithmetic for hundred of qubits if the number of non-zero Pauli basis terms is sufficiently small.
The Pauli basis components are stored as a
PauliList
object and can be accessed using thepaulis
attribute. The coefficients are stored as a complex Numpy array vector and can be accessed using thecoeffs
attribute.Initialize an operator object.
- 매개변수
data (PauliList or SparsePauliOp or PauliTable or Pauli or list or str) – Pauli list of terms. A list of Pauli strings or a Pauli string is also allowed.
coeffs (np.ndarray) –
complex coefficients for Pauli terms.
참고
If
data
is aSparsePauliOp
andcoeffs
is notNone
, the value of theSparsePauliOp.coeffs
will be ignored, and only the passed keyword argumentcoeffs
will be used.ignore_pauli_phase (bool) – if true, any
phase
component of a givenPauliList
will be assumed to be zero. This is more efficient in cases where aPauliList
has been constructed purely for this object, and it is already known that the phases in the ZX-convention are zero. It only makes sense to pass this option when givingPauliList
data. (Default: False)copy (bool) – copy the input data if True, otherwise assign it directly, if possible. (Default: True)
- 예외 발생
QiskitError – If the input data or coeffs are invalid.
Methods
Return the adjoint of the Operator.
Set real and imaginary parts of the coefficients to 0 if
< tol
in magnitude.Return the operator composition with another SparsePauliOp.
Return the conjugate of the SparsePauliOp.
Make a deep copy of current operator.
Return the right multiplied operator self * other.
Check if two SparsePauliOp operators are equivalent.
Return the reverse-order tensor product with another SparsePauliOp.
Construct from a list of Pauli strings and coefficients.
Construct from an Operator objector.
Construct from a list of local Pauli strings and coefficients.
Return tuple of input dimension for specified subsystems.
Return True if operator is a unitary matrix.
Return a label representation iterator.
Return a matrix representation iterator.
Return tuple of output dimension for specified subsystems.
Return the compose of a operator with itself n times.
Return a shallow copy with reshaped input and output subsystem dimensions.
Simplify PauliList by combining duplicates and removing zeros.
Sum of SparsePauliOps.
Return the tensor product with another SparsePauliOp.
Convert to a list Pauli string labels and coefficients.
Convert to a dense or sparse matrix.
Convert to a matrix Operator object
Return the transpose of the SparsePauliOp.
Attributes
- atol = 1e-08¶
- coeffs¶
Return the Pauli coefficients.
- dim¶
Return tuple (input_shape, output_shape).
- num_qubits¶
Return the number of qubits if a N-qubit operator or None otherwise.
- paulis¶
Return the the PauliList.
- qargs¶
Return the qargs for the operator.
- rtol = 1e-05¶
- settings¶
Return settings.
- 반환 형식
Dict
- size¶
The number of Pauli of Pauli terms in the operator.
- table¶
DEPRECATED - Return the the PauliTable.