Skip to main content

state_vector

Overloads

NameDescription
state_vector(integer num_sites) -> StateState vector factory.
state_vector(const RealMatrix vector) -> StateState vector factory.
state_vector(const ComplexMatrix vector) -> StateState vector factory.
state_vector(integer num_sites, as_real options) -> StateState vector factory.
state_vector(integer num_sites, as_complex options) -> StateState vector factory.
state_vector(integer num_sites, const StateInfo options) -> StateState vector factory.
state_vector(as_complex info, const Map options) -> StateVectorState vector factory.
state_vector(as_real info, const Map options) -> StateVectorState vector factory.
state_vector(const StateInfo info, const Map options) -> StateVectorState vector factory.
state_vector(const RealMatrix vector, as_complex options) -> StateState vector factory.
state_vector(const RealMatrix vector, as_real options) -> StateState vector factory.
state_vector(const RealMatrix vector, const StateInfo options) -> StateState vector factory.
state_vector(const ComplexMatrix vector, as_complex options) -> StateState vector factory.
state_vector(const ComplexMatrix vector, const StateInfo options) -> StateState vector factory.

state_vector(integer num_sites) -> State

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(10, as_real | as_spinhalf) // 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(const RealMatrix vector) -> State

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]), as_spinhalf) // 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) -> State

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]), as_spinhalf) // 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, as_real options) -> State

State vector factory.

Provides a way to construct a state vector by providing a number of sites and a StateInfo option.

Parameters

  • num_sites: The number of sites that compose the Hilbert space of the state vector.
  • options: State vector options.

Example

var options = as_spinhalf | as_real  // Returns a StateInfo option.
var state = state_vector(10, options) // Returns a real spinhalf state vector that stores $2^{10}$ coefficients.

state_vector(integer num_sites, as_complex options) -> State

State vector factory.

Provides a way to construct a state vector by providing a number of sites and a StateInfo option.

Parameters

  • num_sites: The number of sites that compose the Hilbert space of the state vector.
  • options: State vector options.

Example

var options = as_spinhalf | as_real  // Returns a StateInfo option.
var state = state_vector(10, options) // Returns a real spinhalf state vector that stores $2^{10}$ coefficients.

state_vector(integer num_sites, const StateInfo options) -> State

State vector factory.

Provides a way to construct a state vector by providing a number of sites and a StateInfo option.

Parameters

  • num_sites: The number of sites that compose the Hilbert space of the state vector.
  • options: State vector options.

Example

var options = as_spinhalf | as_real  // Returns a StateInfo option.
var state = state_vector(10, options) // Returns a real spinhalf state vector that stores $2^{10}$ coefficients.

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(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])

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(const RealMatrix vector, as_complex options) -> State

State vector factory.

Provides a way to construct a state vector by providing a vector of coefficients and a StateInfo option.

Parameters

  • vector: Vector of coefficients.
  • options: State vector options.

Example

var options = as_spinhalf | as_complex  // Returns a StateInfo option.
var state = state_vector(vector([0,0,0,0]), options) // Returns a complex spinhalf state vector that stores 4 coefficients identically equal to zero.

state_vector(const RealMatrix vector, as_real options) -> State

State vector factory.

Provides a way to construct a state vector by providing a vector of coefficients and a StateInfo option.

Parameters

  • vector: Vector of coefficients.
  • options: State vector options.

Example

var options = as_spinhalf | as_complex  // Returns a StateInfo option.
var state = state_vector(vector([0,0,0,0]), options) // Returns a complex spinhalf state vector that stores 4 coefficients identically equal to zero.

state_vector(const RealMatrix vector, const StateInfo options) -> State

State vector factory.

Provides a way to construct a state vector by providing a vector of coefficients and a StateInfo option.

Parameters

  • vector: Vector of coefficients.
  • options: State vector options.

Example

var options = as_spinhalf | as_complex  // Returns a StateInfo option.
var state = state_vector(vector([0,0,0,0]), options) // Returns a complex spinhalf state vector that stores 4 coefficients identically equal to zero.

state_vector(const ComplexMatrix vector, as_complex options) -> State

State vector factory.

Provides a way to construct a state vector by providing a vector of coefficients and a StateInfo option.

Parameters

  • vector: Vector of coefficients.
  • options: State vector options.

Example

var options = as_spinhalf | as_complex  // Returns a StateInfo option.
var state = state_vector(vector([0,0,0,0]), options) // Returns a complex spinhalf state vector that stores 4 coefficients identically equal to zero.

state_vector(const ComplexMatrix vector, const StateInfo options) -> State

State vector factory.

Provides a way to construct a state vector by providing a vector of coefficients and a StateInfo option.

Parameters

  • vector: Vector of coefficients.
  • options: State vector options.

Example

var options = as_spinhalf | as_complex  // Returns a StateInfo option.
var state = state_vector(vector([0,0,0,0]), options) // Returns a complex spinhalf state vector that stores 4 coefficients identically equal to zero.