PauliOp¶
- class PauliOp(primitive=None, coeff=1.0)[source]¶
Class for Operators backed by Terra’s
Pauli
module.- Parameters
primitive (
Optional
[Pauli
]) – The Pauli which defines the behavior of the underlying function.coeff (
Union
[int
,float
,complex
,ParameterExpression
,None
]) – A coefficient multiplying the primitive.
- Raises
TypeError – invalid parameters.
Attributes
The scalar coefficient multiplying the Operator.
The number of qubits over which the Operator is defined.
The primitive defining the underlying function of the Operator.
Methods
PauliOp.__mul__
(other)Overload
*
for Operator scalar multiplication.PauliOp.add
(other)Return Operator addition of self and other, overloaded by
+
.Return a new Operator equal to the Operator’s adjoint (conjugate transpose), overloaded by
~
.PauliOp.assign_parameters
(param_dict)Binds scalar values to any Terra
Parameters
in the coefficients or primitives of the Operator, or substitutes oneParameter
for another.PauliOp.bind_parameters
(param_dict)Same as assign_parameters, but maintained for consistency with QuantumCircuit in Terra (which has both assign_parameters and bind_parameters).
PauliOp.commutes
(other_op)Returns whether self commutes with other_op.
PauliOp.compose
(other)Return Operator Composition between self and other (linear algebra-style: A@B(x) = A(B(x))), overloaded by
@
.PauliOp.equals
(other)Evaluate Equality between Operators, overloaded by
==
.PauliOp.eval
([front])Evaluate the Operator’s underlying function, either on a binary string or another Operator.
Return a
CircuitOp
equivalent to e^-iH for this operator H.PauliOp.log_i
([massive])Return a
MatrixOp
equivalent to log(H)/-i for this operator H.PauliOp.mul
(scalar)Returns the scalar multiplication of the Operator, overloaded by
*
, including support for Terra’sParameters
, which can be bound to values later (viabind_parameters
).Return the Operator’s negation, effectively just multiplying by -1.0, overloaded by
-
.PauliOp.power
(exponent)Return Operator composed with self multiple times, overloaded by
**
.Return a set of strings describing the primitives contained in the Operator.
Try collapsing the Operator structure, usually after some type of conversion, e.g.
PauliOp.tensor
(other)Return tensor product between self and other, overloaded by
^
.PauliOp.tensorpower
(other)Return tensor product with self multiple times, overloaded by
^
.Returns a
QuantumCircuit
equivalent to this Operator.Returns a
CircuitOp
equivalent to this Operator.Returns an
Instruction
equivalent to this Operator.PauliOp.to_legacy_op
([massive])Attempt to return the Legacy Operator representation of the Operator.
PauliOp.to_matrix
([massive])Return NumPy representation of the Operator.
PauliOp.to_matrix_op
([massive])Returns a
MatrixOp
equivalent to this Operator.PauliOp.to_pauli_op
([massive])Returns a sum of
PauliOp
s equivalent to this Operator.Returns SciPy sparse matrix representation of the Operator.
PauliOp.__mul__
(other)Overload
*
for Operator scalar multiplication.