CircuitStateFn(primitive=None, coeff=1.0, is_measurement=False)¶
A class for state functions and measurements which are defined by the action of a QuantumCircuit starting from |0⟩, and stored using Terra’s
None]) – The
Instruction, which will be converted) which defines the behavior of the underlying function.
ParameterExpression]) – A coefficient multiplying the state function.
bool) – Whether the StateFn is a measurement operator.
TypeError – Unsupported primitive, or primitive has ClassicalRegisters.
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
Parametersin the coefficients or primitives of the Operator, or substitutes one
Same as assign_parameters, but maintained for consistency with QuantumCircuit in Terra (which has both assign_parameters and bind_parameters).
Composition (Linear algebra-style: A@B(x) = A(B(x))) is not well defined for states in the binary function model, but is well defined for measurements.
Evaluate Equality between Operators, overloaded by
Evaluate the Operator’s underlying function, either on a binary string or another Operator.
Construct the CircuitStateFn from a dict mapping strings to probability densities.
Construct the CircuitStateFn from a vector representing the statevector.
Returns the scalar multiplication of the Operator, overloaded by
*, including support for Terra’s
Parameters, which can be bound to values later (via
Return the Operator’s negation, effectively just multiplying by -1.0, overloaded by
Permute the qubits of the circuit.
Compose with Self Multiple Times, undefined for StateFns.
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.
Sample the state function as a normalized probability distribution.
Return tensor product between self and other, overloaded by
Return tensor product with self multiple times, overloaded by
Return QuantumCircuit representing StateFn
StateFnCircuitcorresponding to this StateFn.
Return numpy matrix of density operator, warn if more than 16 qubits to force the user to set massive=True if they want such a large matrix.
Return Instruction corresponding to primitive.
Attempt to return the Legacy Operator representation of the Operator.
Return NumPy representation of the Operator.
Apply the convert_fn to the internal primitive if the primitive is an Operator (as in the case of
INDENTATION= ' '¶
A coefficient by which the state function is multiplied.
Whether the StateFn object is a measurement Operator.
The primitive which defines the behavior of the underlying State function.