state_vector
Overloads
| Name | Description |
|---|---|
state_vector(const RealMatrix vector) -> StateVector | State vector factory. |
state_vector(const ComplexMatrix vector) -> StateVector | State vector factory. |
state_vector(integer num_sites) -> StateVector | State vector factory. |
state_vector(as_complex info, const Map options) -> StateVector | State vector factory. |
state_vector(const StateInfo info, const Map options) -> StateVector | State vector factory. |
state_vector(as_real info, const Map options) -> StateVector | State vector factory. |
state_vector(const RealMatrix vector) -> StateVector
State vector factory.
Provides a way to construct a state vector by specifying a vector of coefficients.
Parameters
- vector: Vector of coefficients.
Example
// A state vector may be constructed as follows:
var state = state_vector(vector([0,0,0,0])) // Returns a default state vector that stores 4 coefficients identically equal to zero. The default StateInfo option is as_complex | as_dense | as_abstract | as_complete
state_vector(const ComplexMatrix vector) -> StateVector
State vector factory.
Provides a way to construct a state vector by specifying a vector of coefficients.
Parameters
- vector: Vector of coefficients.
Example
// A state vector may be constructed as follows:
var state = state_vector(vector([0,0,0,0])) // Returns a default state vector that stores 4 coefficients identically equal to zero. The default StateInfo option is as_complex | as_dense | as_abstract | as_complete
state_vector(integer num_sites) -> StateVector
State vector factory.
Provides a way to construct a state vector by providing a number of sites.
Parameters
- num_sites: The number of sites that compose the Hilbert space of the state vector.
Example
var state = state_vector(16) // Returns a default state vector that stores $2^{10}$ coefficients identically set to zero. The default StateInfo option is as_complex | as_dense | as_abstract | as_complete
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])