Skip to main content

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

Constructors

StateVector(const StateVector state_vector) -> StateVector

Copy constructor for StateVector objects.

Parameters

  • state_vector: The state vector to copy.

Symbols

NameDescription
+Adds two state vectors.
+=In-place addition of two state vectors.
-=In-place subtraction of two state vectors.
=Assignment operator for StateVector objects.

Members

NameDescription
coefficientsReturns the vector of coefficients stored by the state vector.
normalizeNormalizes the state vector.
set_constantSets all coefficients of the state vector to a constant value.
set_randomSets the state vector to random values.
set_zeroSets all coefficients of the state vector to zero.