TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::hilbert_space::hilbert_space

#include <triqs/hilbert_space/hilbert_space.hpp>

Detailed Description

Fermionic Hilbert (Fock) space generated by a fundamental operator set.

The Hilbert (Fock) space \( \mathcal{F} \) is fully defined by its underlying fundamental operator set \( A = \{ \alpha_i \}_{i=0}^{N-1} \) (see triqs::hilbert_space::fundamental_operator_set). Its dimension is \(\dim(\mathcal{F}) = 2^N \).

As explained in Operators, we can map each occupation number basis state \( \lvert n_{\alpha_0}, n_{\alpha_1}, \dots, n_{\alpha_{N-1}} \rangle = \lvert f \rangle \in \mathcal{F} \) to an integer \( f \in \{ 0, \dots, 2^N - 1 \} \) and back. This allows us to write the complete set of basis states of \( \mathcal{F} \) as \( B_{\mathcal{F}} = \{ \lvert f \rangle \}_{f=0}^{2^N - 1} \). Furthermore, it imposes a natural order on \(B_{\mathcal{F}} \) such that \( \lvert f \rangle < \lvert f' \rangle \) if \( f < f' \).

Note
This class is a minimal implementation of a Hilbert space. It only stores its dimension and relies completely on the encoding of occupation number basis states as integers.

Definition at line 71 of file hilbert_space.hpp.

Public Member Functions

 hilbert_space ()
 Default constructor constructs an empty Hilbert (Fock) space of dimension \( 0 \).
 hilbert_space (fundamental_operator_set const &fops)
 Construct a Hilbert (Fock) space from a given triqs::hilbert_space::fundamental_operator_set object.
fock_state_t get_fock_state (fundamental_operator_set const &fops, std::set< fundamental_operator_set::indices_t > const &alphas) const
 Get the Fock state \( \lvert f \rangle = \prod_{j=1}^k \hat{c}^\dagger_{\alpha_{i_j}} \lvert 0 \rangle \).
fock_state_t get_fock_state (int f) const
 Get the Fock state \( \lvert f \rangle \) corresponding to a given integer \( f \).
auto get_state_index (fock_state_t f) const
 Get the integer \( f \) corresponding to a given Fock state \( \lvert f \rangle \).
bool has_state (fock_state_t f) const
 Check if a given Fock state belongs to the Hilbert (Fock) space.
bool operator== (hilbert_space const &hs) const
 Equal-to operator compares the dimensions of the two Hilbert (Fock) spaces.
auto size () const
 Get the dimension \( \dim(\mathcal{F}) \) of the Hilbert (Fock) space \( \mathcal{F} \).

Static Public Member Functions

static std::string hdf5_format ()
 Get the HDF5 format tag.

Friends

void h5_read (h5::group g, std::string const &name, hilbert_space &hs)
 Read a triqs::hilbert_space::hilbert_space from HDF5.
void h5_write (h5::group g, std::string const &name, hilbert_space const &hs)
 Write a triqs::hilbert_space::hilbert_space to HDF5.

Constructor & Destructor Documentation

◆ hilbert_space()

triqs::hilbert_space::hilbert_space::hilbert_space ( fundamental_operator_set const & fops)
inline

Construct a Hilbert (Fock) space from a given triqs::hilbert_space::fundamental_operator_set object.

If the size of the fundamental operator set is \( N \), then the dimension of the constructed Hilbert (Fock) space is \( \dim(\mathcal{F}) = 2^N \).

Parameters
fopsFundamental operator set that generates the Hilbert (Fock) space.

Definition at line 84 of file hilbert_space.hpp.

Member Function Documentation

◆ get_fock_state() [1/2]

fock_state_t triqs::hilbert_space::hilbert_space::get_fock_state ( fundamental_operator_set const & fops,
std::set< fundamental_operator_set::indices_t > const & alphas ) const
inlinenodiscard

Get the Fock state \( \lvert f \rangle = \prod_{j=1}^k \hat{c}^\dagger_{\alpha_{i_j}} \lvert 0 \rangle \).

Parameters
fopstriqs::hilbert_space::fundamental_operator_set object that defines the Hilbert (Fock) space \(\mathcal{F} \).
alphasSet of indices \( \{ \alpha_{i_1}, \dots, \alpha_{i_k} \} \) specifying the creation operators.
Returns
Fock state \( \lvert f \rangle \).

Definition at line 136 of file hilbert_space.hpp.

◆ get_fock_state() [2/2]

fock_state_t triqs::hilbert_space::hilbert_space::get_fock_state ( int f) const
inlinenodiscard

Get the Fock state \( \lvert f \rangle \) corresponding to a given integer \( f \).

It throws an exception if \( f \geq 2^N = \dim{\mathcal{F}} \).

Parameters
fInteger \( f \) representing the Fock state \( \lvert f \rangle \).
Returns
Fock state \( \lvert f \rangle \).

Definition at line 122 of file hilbert_space.hpp.

◆ get_state_index()

auto triqs::hilbert_space::hilbert_space::get_state_index ( fock_state_t f) const
inlinenodiscard

Get the integer \( f \) corresponding to a given Fock state \( \lvert f \rangle \).

It throws an exception if the given Fock state is not in the Hilbert (Fock) space, i.e. if \( f \geq 2^N = \dim{\mathcal{F}} \).

Parameters
fFock state \( \lvert f \rangle \).
Returns
Integer \( f \).

Definition at line 109 of file hilbert_space.hpp.

◆ has_state()

bool triqs::hilbert_space::hilbert_space::has_state ( fock_state_t f) const
inlinenodiscard

Check if a given Fock state belongs to the Hilbert (Fock) space.

Parameters
fFock state \( \lvert f \rangle \).
Returns
True if \( f < 2^N = \dim{\mathcal{F}} \), false otherwise.

Definition at line 98 of file hilbert_space.hpp.

◆ h5_read

void h5_read ( h5::group g,
std::string const & name,
hilbert_space & hs )
friend

Read a triqs::hilbert_space::hilbert_space from HDF5.

Parameters
gh5::group to be read from.
nameName of the subgroup.
hsHilbert (Fock) space to be read into.

Definition at line 165 of file hilbert_space.hpp.

◆ h5_write

void h5_write ( h5::group g,
std::string const & name,
hilbert_space const & hs )
friend

Write a triqs::hilbert_space::hilbert_space to HDF5.

Parameters
gh5::group to be written to.
nameName of the subgroup.
hsHilbert (Fock) space to be written.

Definition at line 153 of file hilbert_space.hpp.


The documentation for this class was generated from the following file: