TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
Hilbert space

Detailed Description

Fock state representations and Hilbert space tools for many-body systems.

In the following, we introduce some basic concepts and notations used throughout the documentation.

Let us start by considering a single particle Hilbert space \( \mathcal{H}_1 \) of finite dimension \( N \) with a complete set of eigenstates \( \{ \lvert \alpha_i \rangle \}_{i=0}^{N-1} \).

We can construct the associated Fock space \( \mathcal{F} \) as the Hilbert space spanned by all possible occupation number configurations of the single particle states. Since we are only considering fermions, each single particle state \( \lvert \alpha_i \rangle \) can either be empty or singly occupied, i.e. \( n_{\alpha_i} \in \{0, 1\} \), which implies that \( \dim(\mathcal{F}) = 2^N \).

The occupation number basis states of the Fock space are therefore given by

\[ \lvert n_{\alpha_0}, n_{\alpha_1}, \dots, n_{\alpha_{N-1}} \rangle = \prod_{i=0}^{N-1} (c_{\alpha_i}^\dagger)^{n_{ \alpha_i}} \lvert 0 \rangle \; , \]

where \( c_{\alpha_i}^\dagger \) is the fermionic creation operator such that \( \lvert \alpha_i \rangle = c_{\alpha_i}^\dagger \lvert 0 \rangle \), and \( \lvert 0 \rangle \) is the vacuum state with no particles.

If we restrict ourselves to \( N < 64 \), we can 1-to-1 map each occupation number basis state \( \lvert n_{\alpha_0}, n_{\alpha_1}, \dots, n_{\alpha_{N-1}} \rangle \) to a single 64-bit integer

\[ f(n_{\alpha_0}, n_{\alpha_1}, \dots, n_{\alpha_{N-1}}) = \sum_{i=0}^{N-1} n_{\alpha_i} 2^i \; , \]

where the \( i \)-th bit of \( f \) is set if and only if the single particle state \( \lvert \alpha_i \rangle \) is occupied.

Classes

class  triqs::hilbert_space::fundamental_operator_set
 Class representing a fundamental operator set. More...
class  triqs::hilbert_space::hilbert_space
 Fermionic Hilbert (Fock) space generated by a fundamental operator set. More...
class  triqs::hilbert_space::imperative_operator< HS, T, UseMap >
 Representation of a many-body operator acting on many-body states. More...
class  triqs::hilbert_space::space_partition< S, OP >
 Automatic partitioning of a Hilbert (Fock) space into invariant subspaces of a Hermitian operator. More...
class  triqs::hilbert_space::state< HS, T, false >
 Many-body state based on nda::vector. More...
class  triqs::hilbert_space::state< HS, T, true >
 Many-body state based on std::unordered_map. More...
class  triqs::hilbert_space::sub_hilbert_space
 Subspace of a fermionic Hilbert (Fock) space. More...

Typedefs

using triqs::hilbert_space::fock_state_t = uint64_t
 Integer type representing a fermionic fock state \( \lvert f \rangle = \lvert n_{\alpha_0}, n_{\alpha_1}, \dots, n_{\alpha_{N-1}} \rangle \).
using triqs::hilbert_space::indices_t = std::vector<std::variant<long, std::string, double, std::array<long, 3>>>
 Index type for single particle state indices \( \alpha_i \).

Functions

std::string triqs::hilbert_space::format_indices (indices_t const &alpha, std::string_view sep=",", std::string_view prefix="", std::string_view suffix="")
 String representation of a single particle state index \( \alpha_i \).
template<typename HS, typename T, bool BasedOnMap>
auto triqs::hilbert_space::make_zero_state (state< HS, T, BasedOnMap > const &phi)
 Create a zero state in the same Hilbert (Fock) space as the given state.
template<typename HS, typename T, bool BasedOnMap>
std::ostream & triqs::hilbert_space::operator<< (std::ostream &sout, state< HS, T, BasedOnMap > const &psi)
 Write a triqs::hilbert_space::state<HS, T, true> or a triqs::hilbert_space::state<HS, T, false> to a std::ostream.
template<typename TargetState, typename OriginalState>
TargetState triqs::hilbert_space::project (OriginalState const &psi, hilbert_space const &proj_hs)
 Project a state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} \) to a new Hilbert (Fock) space \(\mathcal{F}' \).
template<typename TargetState, typename OriginalState>
TargetState triqs::hilbert_space::project (OriginalState const &psi, sub_hilbert_space const &proj_hs)
 Project a state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} \) to a new Hilbert (Fock) subspace \(\mathcal{F}'^{(m')} \).

Typedef Documentation

◆ fock_state_t

#include <triqs/hilbert_space/hilbert_space.hpp>

Integer type representing a fermionic fock state \( \lvert f \rangle = \lvert n_{\alpha_0}, n_{\alpha_1}, \dots, n_{\alpha_{N-1}} \rangle \).

The least significant bit encodes the occupation of \( \lvert \alpha_0 \rangle \) and the most significant bit of \( \lvert \alpha_{N-1} \rangle \).

Definition at line 53 of file hilbert_space.hpp.

Function Documentation

◆ format_indices()

std::string triqs::hilbert_space::format_indices ( indices_t const & alpha,
std::string_view sep = ",",
std::string_view prefix = "",
std::string_view suffix = "" )

#include <triqs/hilbert_space/fundamental_operator_set.cpp>

String representation of a single particle state index \( \alpha_i \).

The individual index elements of \( \alpha_i \) are first converted to strings (if necessary) and then concatenated using the given separator sep. String index elements are enclosed in single quotes.

Optional prefix and suffix strings can be added around the entire representation.

Parameters
alphaSingle particle state index \( \alpha_i \).
sepSeparator string inserted between individual index elements.
prefixOptional prefix string.
suffixOptional suffix string.
Returns
Formatted string representation of \( \alpha_i \).

Definition at line 93 of file fundamental_operator_set.cpp.

◆ make_zero_state()

template<typename HS, typename T, bool BasedOnMap>
auto triqs::hilbert_space::make_zero_state ( state< HS, T, BasedOnMap > const & phi)

#include <triqs/hilbert_space/state.hpp>

Create a zero state in the same Hilbert (Fock) space as the given state.

It simply returns the many-body state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} = 0 \), i.e. with all amplitudes \( a_{f_i} = 0 \).

See triqs::hilbert_space::state<HS, T, true> and triqs::hilbert_space::state<HS, T, false> for more details.

Template Parameters
HSHilbert space type.
TAmplitude type.
BasedOnMapWhether the amplitudes are stored in a map or a vector.
Parameters
phiReference state belonging to \( \mathcal{F}^{(m)} \).
Returns
\( \lvert \psi \rangle \in \mathcal{F}^{(m)} \) with all amplitudes set to zero.

Definition at line 62 of file state.hpp.

◆ operator<<()

template<typename HS, typename T, bool BasedOnMap>
std::ostream & triqs::hilbert_space::operator<< ( std::ostream & sout,
state< HS, T, BasedOnMap > const & psi )

#include <triqs/hilbert_space/state.hpp>

Write a triqs::hilbert_space::state<HS, T, true> or a triqs::hilbert_space::state<HS, T, false> to a std::ostream.

Template Parameters
HSHilbert space type.
TAmplitude type.
BasedOnMapWhether the amplitudes are stored in a map or a vector.
Parameters
soutstd::ostream object.
psiState to be written.
Returns
Reference to std::ostream object.

Definition at line 465 of file state.hpp.

◆ project() [1/2]

template<typename TargetState, typename OriginalState>
TargetState triqs::hilbert_space::project ( OriginalState const & psi,
hilbert_space const & proj_hs )

#include <triqs/hilbert_space/state.hpp>

Project a state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} \) to a new Hilbert (Fock) space \(\mathcal{F}' \).

The projection is done by creating the target state \( \lvert \psi' \rangle \in \mathcal{F}' = 0 \) and by copying amplitudes from the original to the target state, i.e. we set \( a'_{f_i} = a_{f_i} \) for all \(\lvert f_i \rangle \in B_{\mathcal{F}^{(m)}} \).

Note
The original Hilbert (Fock) space can either be a triqs::hilbert_space::hilbert_space or a triqs::hilbert_space::sub_hilbert_space. However, it is assumed that all the basis states \( \lvert f_i \rangle \in \mathcal{F}^{(m)} \) are also contained in \( \mathcal{F}' \).
Template Parameters
TargetStateType of the target state.
OriginalStateType of the original state.
Parameters
psiOriginal state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} \).
proj_hsHilbert (Fock) space \( \mathcal{F}' \) to project into.
Returns
Projected state \( \lvert \psi' \rangle \in \mathcal{F}' \).

Definition at line 500 of file state.hpp.

◆ project() [2/2]

template<typename TargetState, typename OriginalState>
TargetState triqs::hilbert_space::project ( OriginalState const & psi,
sub_hilbert_space const & proj_hs )

#include <triqs/hilbert_space/state.hpp>

Project a state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} \) to a new Hilbert (Fock) subspace \(\mathcal{F}'^{(m')} \).

The projection is done by creating the target state \( \lvert \psi' \rangle \in \mathcal{F}'^{(m')} = 0 \) and by copying amplitudes from the original to the target state for common basis states, i.e. we set \(a'_{f_i} = a_{f_i} \) for all \( \lvert f_i \rangle \in B_{\mathcal{F}^{(m)}} \cap B_{\mathcal{F}'^{(m')}} \).

Note
The original Hilbert (Fock) space can either be a triqs::hilbert_space::hilbert_space or a triqs::hilbert_space::sub_hilbert_space.
Template Parameters
TargetStateType of the target state.
OriginalStateType of the original state.
Parameters
psiOriginal state \( \lvert \psi \rangle \in \mathcal{F}^{(m)} \).
proj_hsHilbert (Fock) space \( \mathcal{F}' \) to project into.
Returns
Projected state \( \lvert \psi' \rangle \in \mathcal{F}' \).

Definition at line 524 of file state.hpp.