CircuitOp¶
-
class
CircuitOp
(primitive, coeff=1.0)[source]¶ Bases:
qiskit.opflow.primitive_ops.primitive_op.PrimitiveOp
Class for Operators backed by Terra’s
QuantumCircuit
module.- Parameters
primitive (
Union
[Instruction
,QuantumCircuit
]) – The QuantumCircuit which defines theof the underlying function. (behavior) –
coeff (
Union
[complex
,ParameterExpression
]) – A coefficient multiplying the primitive
- Raises
TypeError – Unsupported primitive, or primitive has ClassicalRegisters.
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.
Permute the qubits of the circuit.
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
^
.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.
Attributes
-
INDENTATION
= ' '¶
-
coeff
¶ The scalar coefficient multiplying the Operator.
- Return type
Union
[complex
,ParameterExpression
]- Returns
The coefficient.
-
instance_id
¶ Return the unique instance id.
- Return type
int
-
num_qubits
¶ - Return type
int
-
parameters
¶
-
primitive
: qiskit.circuit.quantumcircuit.QuantumCircuit¶ The primitive defining the underlying function of the Operator.
- Return type
Union
[QuantumCircuit
,Operator
,Pauli
,SparsePauliOp
,OperatorBase
]- Returns
The primitive object.
-
settings
¶ Return operator settings.
- Return type
Dict