StateVector
Base class for all state vector representations.
Factories
state_vector(as_complex info, const Map options) -> StateVector
State vector factory.
Provides a way to construct a state vector by providing a StateInfo object and a map of options.
Parameters
- info: Information about the state vector to be created.
- options: Options for the state vector creation.
Example
var options = as_fermion | as_number | as_complex
var state = state_vector(options, ["num_sites" : 10, "number" : 5])
state_vector(const StateInfo info, const Map options) -> StateVector
State vector factory.
Provides a way to construct a state vector by providing a StateInfo object and a map of options.
Parameters
- info: Information about the state vector to be created.
- options: Options for the state vector creation.
Example
var options = as_fermion | as_number | as_complex
var state = state_vector(options, ["num_sites" : 10, "number" : 5])
state_vector(as_real info, const Map options) -> StateVector
State vector factory.
Provides a way to construct a state vector by providing a StateInfo object and a map of options.
Parameters
- info: Information about the state vector to be created.
- options: Options for the state vector creation.
Example
var options = as_fermion | as_number | as_complex
var state = state_vector(options, ["num_sites" : 10, "number" : 5])
Constructors
StateVector(const StateVector state_vector) -> StateVector
Copy constructor for StateVector objects.
Parameters
- state_vector: The state vector to copy.
Symbols
| Name | Description |
|---|---|
+ | Adds two state vectors. |
+= | In-place addition of two state vectors. |
-= | In-place subtraction of two state vectors. |
Members
| Name | Description |
|---|---|
| coefficients | Returns the vector of coefficients stored by the state vector. |
| normalize | Normalizes the state vector. |
| set_constant | Sets all coefficients of the state vector to a constant value. |
| set_random | Sets the state vector to random values. |
| set_zero | Sets all coefficients of the state vector to zero. |