SparseVectorStateFn¶
- class SparseVectorStateFn(*args, **kwargs)[source]¶
Bases :
StateFn
Deprecated: A class for sparse state functions and measurements in vector representation.
This class uses
scipy.sparse.spmatrix
for the internal representation.Obsolète depuis la version 0.24.0: The class
qiskit.opflow.state_fns.sparse_vector_state_fn.SparseVectorStateFn
is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit https://qisk.it/opflow_migration.- Paramètres
primitive – The underlying sparse vector.
coeff – A coefficient multiplying the state function.
is_measurement – Whether the StateFn is a measurement operator
- Lève
ValueError – If the primitive is not a column vector.
ValueError – If the number of elements in the primitive is not a power of 2.
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
~
.Evaluate Equality between Operators, overloaded by
==
.Evaluate the Operator's underlying function, either on a binary string or another Operator.
Return a set of strings describing the primitives contained in the Operator.
Sample the state function as a normalized probability distribution.
Convert this state function to a
CircuitStateFn
.Convert this state function to a
DictStateFn
.Return NumPy representation of the Operator.
Return a
VectorStateFn
for thisStateFn
.Return SciPy sparse matrix representation of the Operator.
Attributes
- INDENTATION = ' '¶
- coeff¶
A coefficient by which the state function is multiplied.
- instance_id¶
Return the unique instance id.
- is_measurement¶
Whether the StateFn object is a measurement Operator.
- num_qubits¶
- parameters¶
- primitive: spmatrix¶
The primitive which defines the behavior of the underlying State function.
- settings¶
Return settings.