Functions

The State class comes with broad functionality to read and modify a state. The most important functions are listed here. To access specific sites of an instance of the State class, functions in Readout Functions can be used. Different functions to modify a state are defined in Modifying the State. Many information and the state itself can be printed using the functions in State Output. In many cases, two instances of the State class have to be compared. Greater, lesser, and equal are defined on the integer and qudit-level in State Comparison. Simple getter functions returning template parameters and further information are listed in Getter Functions.

Furthermore, the State class already provides a sufficient toolbox to enumerate basis states \(\vert \Psi_i\rangle\). The set functions are defined within a range start to end. These functions can – in pinciple – be used as a complete Basis with and without number conservation. However, the implementation is not as efficient as the Basis class.

  • Enumeration without number conservation:

    The first enumeration refers to the complete integer counting to basis \(Q\) defined within site start and end:

    (1)\[\textbf{index} = \sum_{i=\textbf{start}}^{\textbf{end}-1} \quad \sigma_i \cdot\textbf{Q}^{i-\textbf{start}}\]

    A complete set of functions is listed in State enumeration without number conservation. This includes iterators (forward and backward) and a mapping between an index, \(i\in\{0,\dots,Q^L-1\}\), and its physical State \(\vert\Psi_i\rangle\) and vice versa.

  • Enumeration with number conservation:

    The second enumeration procedure takes additionally the particle number between site start and end into account:

    (2)\[\textbf{n} = \sum_{i=\textbf{start}}^{\textbf{end}-1} \sigma_i\]

    The state with index i, \(\vert\Psi_i\rangle\), is the i th state in a given particle sector and all states are ordered by interger counting to the basis \(Q\). All functions can be found in State enumeration with number conservation.

  • Enumeration without number conservation and inhomogeneously distributed Q:

    We further provide the option to work with a different local Hilbert space dimensions per site. They are set by passing a std::vector containing all Q. The functions are listed here.

Warning

The enumeration is limited by the upper bound of uint64_t.