German
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

CircuitOp

class CircuitOp(primitive, coeff=1.0)[Quellcode]

Bases: PrimitiveOp

Class for Operators backed by Terra’s QuantumCircuit module.

Parameter
  • primitive (Union[Instruction, QuantumCircuit]) – The QuantumCircuit which defines the

  • function. (behavior of the underlying) –

  • coeff (Union[complex, ParameterExpression]) – A coefficient multiplying the primitive

Verursacht

TypeError – Unsupported primitive, or primitive has ClassicalRegisters.

Methods Defined Here

add

Return Operator addition of self and other, overloaded by +.

adjoint

Return a new Operator equal to the Operator's adjoint (conjugate transpose), overloaded by ~.

assign_parameters

Binds scalar values to any Terra Parameters in the coefficients or primitives of the Operator, or substitutes one Parameter for another.

compose

Return Operator Composition between self and other (linear algebra-style: A@B(x) = A(B(x))), overloaded by @.

equals

Evaluate Equality between Operators, overloaded by ==.

eval

Evaluate the Operator's underlying function, either on a binary string or another Operator.

permute

Permute the qubits of the circuit.

primitive_strings

Return a set of strings describing the primitives contained in the Operator.

reduce

Try collapsing the Operator structure, usually after some type of conversion, e.g.

tensor

Return tensor product between self and other, overloaded by ^.

to_circuit

Returns a QuantumCircuit equivalent to this Operator.

to_circuit_op

Returns a CircuitOp equivalent to this Operator.

to_instruction

Returns an Instruction equivalent to this Operator.

to_matrix

Return NumPy representation of the Operator.

Attributes

INDENTATION = '  '
coeff

The scalar coefficient multiplying the Operator.

Rückgabetyp

Union[complex, ParameterExpression]

Rückgabe

The coefficient.

instance_id

Return the unique instance id.

Rückgabetyp

int

num_qubits
Rückgabetyp

int

parameters
primitive: QuantumCircuit

The primitive defining the underlying function of the Operator.

Rückgabetyp

Union[QuantumCircuit, Operator, Pauli, SparsePauliOp, OperatorBase]

Rückgabe

The primitive object.

settings

Return operator settings.

Rückgabetyp

Dict