PrimitiveOp¶
- class PrimitiveOp(primitive, coeff=1.0)[소스]¶
기반 클래스:
OperatorBase
A class for representing basic Operators, backed by Operator primitives from Terra. This class (and inheritors) primarily serves to allow the underlying primitives to 《flow》 - i.e. interoperability and adherence to the Operator formalism - while the core computational logic mostly remains in the underlying primitives. For example, we would not produce an interface in Terra in which
QuantumCircuit1 + QuantumCircuit2
equaled the Operator sum of the circuit unitaries, rather than simply appending the circuits. However, within the Operator flow summing the unitaries is the expected behavior.Note that all mathematical methods are not in-place, meaning that they return a new object, but the underlying primitives are not copied.
- 매개변수
primitive (
Union
[QuantumCircuit
,Operator
,Pauli
,SparsePauliOp
,OperatorBase
]) – The operator primitive being wrapped.coeff (
Union
[complex
,ParameterExpression
]) – A coefficient multiplying the primitive.
Methods Defined Here
Return Operator addition of self and other, overloaded by
+
.Return a new Operator equal to the Operator's adjoint (conjugate transpose), overloaded by
~
.Binds scalar values to any Terra
Parameters
in the coefficients or primitives of the Operator, or substitutes oneParameter
for another.Return Operator Composition between self and other (linear algebra-style: A@B(x) = A(B(x))), overloaded by
@
.Evaluate Equality between Operators, overloaded by
==
.Evaluate the Operator's underlying function, either on a binary string or another Operator.
Return Operator exponentiation, equaling e^(-i * op)
Return a
MatrixOp
equivalent to log(H)/-i for this operator H.Returns the scalar multiplication of the Operator, overloaded by
*
, including support for Terra'sParameters
, which can be bound to values later (viabind_parameters
).Permutes the qubits of the operator.
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.
Return tensor product between self and other, overloaded by
^
.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.Return NumPy representation of the Operator.
Returns a
MatrixOp
equivalent to this Operator.Returns a sum of
PauliOp
s equivalent to this Operator.Attributes
- INDENTATION = ' '¶
- coeff¶
The scalar coefficient multiplying the Operator.
- 반환 형식
Union
[complex
,ParameterExpression
]- 반환
The coefficient.
- instance_id¶
Return the unique instance id.
- 반환 형식
int
- num_qubits¶
- 반환 형식
int
- parameters¶
- primitive¶
The primitive defining the underlying function of the Operator.
- 반환 형식
Union
[QuantumCircuit
,Operator
,Pauli
,SparsePauliOp
,OperatorBase
]- 반환
The primitive object.
- settings¶
Return operator settings.
- 반환 형식
Dict