45 lines
4.4 KiB
Plaintext
45 lines
4.4 KiB
Plaintext
---
|
||
title: state_fns (v0.31)
|
||
description: API reference for qiskit.opflow.state_fns in qiskit v0.31
|
||
in_page_toc_min_heading_level: 2
|
||
python_api_type: module
|
||
python_api_name: qiskit.opflow.state_fns
|
||
---
|
||
|
||
<span id="module-qiskit.opflow.state_fns" />
|
||
|
||
<span id="qiskit-opflow-state-fns" />
|
||
|
||
# qiskit.opflow\.state\_fns
|
||
|
||
<span id="state-functions-qiskit-opflow-state-fns" />
|
||
|
||
## State Functions
|
||
|
||
`qiskit.opflow.state_fns`
|
||
|
||
State functions are defined to be complex functions over a single binary string (as compared to an operator, which is defined as a function over two binary strings, or a function taking a binary function to another binary function). This function may be called by the eval() method.
|
||
|
||
Measurements are defined to be functionals over StateFns, taking them to real values. Generally, this real value is interpreted to represent the probability of some classical state (binary string) being observed from a probabilistic or quantum system represented by a StateFn. This leads to the equivalent definition, which is that a measurement m is a function over binary strings producing StateFns, such that the probability of measuring a given binary string b from a system with StateFn f is equal to the inner product between f and m(b).
|
||
|
||
<Admonition title="Note" type="note">
|
||
All mathematical methods between StateFns are not in-place, meaning that they return a new object, but the underlying primitives are not copied.
|
||
</Admonition>
|
||
|
||
<Admonition title="Note" type="note">
|
||
State functions here are not restricted to wave functions, as there is no requirement of normalization.
|
||
</Admonition>
|
||
|
||
### State Functions
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
| [`StateFn`](qiskit.opflow.state_fns.StateFn "qiskit.opflow.state_fns.StateFn")(\[primitive, coeff, is\_measurement]) | A class for representing state functions and measurements. |
|
||
| [`CircuitStateFn`](qiskit.opflow.state_fns.CircuitStateFn "qiskit.opflow.state_fns.CircuitStateFn")(\[primitive, coeff, …]) | A class for state functions and measurements which are defined by the action of a QuantumCircuit starting from \|0⟩, and stored using Terra’s `QuantumCircuit` class. |
|
||
| [`DictStateFn`](qiskit.opflow.state_fns.DictStateFn "qiskit.opflow.state_fns.DictStateFn")(\[primitive, coeff, …]) | A class for state functions and measurements which are defined by a lookup table, stored in a dict. |
|
||
| [`VectorStateFn`](qiskit.opflow.state_fns.VectorStateFn "qiskit.opflow.state_fns.VectorStateFn")(\[primitive, coeff, is\_measurement]) | A class for state functions and measurements which are defined in vector representation, and stored using Terra’s `Statevector` class. |
|
||
| [`SparseVectorStateFn`](qiskit.opflow.state_fns.SparseVectorStateFn "qiskit.opflow.state_fns.SparseVectorStateFn")(primitive\[, coeff, …]) | A class for sparse state functions and measurements in vector representation. |
|
||
| [`OperatorStateFn`](qiskit.opflow.state_fns.OperatorStateFn "qiskit.opflow.state_fns.OperatorStateFn")(primitive\[, coeff, …]) | A class for state functions and measurements which are defined by a density Operator, stored using an `OperatorBase`. |
|
||
| [`CVaRMeasurement`](qiskit.opflow.state_fns.CVaRMeasurement "qiskit.opflow.state_fns.CVaRMeasurement")(\[primitive, alpha, coeff]) | A specialized measurement class to compute CVaR expectation values. |
|
||
|