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

#include <triqs/mesh/dlr.hpp>

Detailed Description

Discrete Lehmann representation (DLR) mesh type.

A DLR mesh is defined by the inverse temperature \( \beta > 0 \), the particle statistics, a DLR energy cutoff \( \omega_{\text{max}} \), an error tolerance \( \epsilon \) and a boolean flag specifying if the mesh should be symmetric around \( \omega = 0 \).

A DLR mesh has the following properties:

  • Each mesh point is identified by a unique index \( l \in \{0, 1, \ldots, N-1\} \).
  • The size of the mesh \( N \) depends on \( \beta \) and the choice of \( \omega_{\text{max}} \) and \( \epsilon \). It is equal to the DLR rank \( r \) and the number of DLR basis functions \( K(\tau, \omega_l) \) or \( K(i\omega_n, \omega_l) \).
  • An index \( l \) is mapped to the corresponding data index \( d \) by the identity function \( d(l) = l \) and vice versa.
  • An index \( l \) is mapped to the corresponding value \( \omega_l \), where \( \omega_l \) is the l-th DLR frequency.

Green's function containers that are based on a DLR mesh store the coefficients \( f_l \) of the discrete Lehmann representation of a function \( f(\tau) \) or \( f(i\omega_n) \). To evaluate the function at an arbitrary imaginary time \( \tau \in [0, \beta] \) or at a specific Matsubara frequency \( i\omega_n \), the GF container calculates the DLR approximation of the function via

\[ f(\tau) \approx \sum_{l=0}^{N-1} \frac{e^{-\omega_l \tau}}{1 + e^{-\omega_l \beta}} f_l \; , \]

or

\[ f(i\omega_n) \approx \sum_{l=0}^{N-1} \frac{1}{i\omega_n + \omega_l} f_l \; . \]

Definition at line 96 of file dlr.hpp.

Classes

class  mesh_point_t
 Mesh point of a triqs::mesh::dlr mesh. More...

Public Types

using data_index_t = long
 Data index type.
using index_t = long
 Index type.
using value_t = double
 Value type.

Public Member Functions

 dlr ()=default
 Default constructor constructs an empty mesh.
 dlr (double beta, statistic_enum statistic, double w_max, double eps, bool symmetrize=true)
 Construct a DLR mesh with a given energy cutoff \( \omega_{\text{max}} \) and error tolerance \(\epsilon \).
template<nda::AnyOf< dlr_imtime, dlr_imfreq > M>
 dlr (M const &m)
 Construct a DLR mesh from another DLR type mesh.
auto begin () const
 Get an iterator to the beginning of the mesh.
double beta () const noexcept
 Get the inverse temperature \( \beta \).
auto cbegin () const
 Get a const iterator to the beginning of the mesh.
auto cend () const
 Get a const iterator to the end of the mesh.
void deserialize (auto &ar)
 Deserialize the mesh from a generic archive.
auto const & dlr_freq () const
 Get the array of DLR frequencies \( \omega_l \).
auto const & dlr_if () const
 Get the Matsubara frequency DLR operations object (see also cppdlr::imfreq_ops).
auto const & dlr_it () const
 Get the imaginary time DLR operations object (see also cppdlr::imtime_ops).
auto end () const
 Get an iterator to the end of the mesh.
double eps () const noexcept
 Get the DLR error tolerance \( \epsilon \).
bool is_index_valid (long l) const noexcept
 Check if an index \( l \) is valid.
uint64_t mesh_hash () const noexcept
 Get the hash value of the mesh.
mesh_point_t operator() (long l) const
 Function call operator to access a mesh point by its index \( l \in \{0, 1, \ldots, N-1\} \).
bool operator== (dlr const &m) const
 Equal-to comparison operator compares the hash values.
mesh_point_t operator[] (long d) const
 Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).
void serialize (auto &ar) const
 Serialize the mesh to a generic archive.
long size () const noexcept
 Get the size \( N \) of the mesh, i.e. the DLR rank \( r \).
statistic_enum statistic () const noexcept
 Get the particle statistics.
bool symmetrize () const noexcept
 Is the mesh symmetric around \( \omega = 0 \)?
long to_data_index (long l) const noexcept
 Map an index \( l \in \{0, 1, \ldots, N-1\} \) to its corresponding data index \( d(l) \).
long to_index (long d) const noexcept
 Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( l(d) \).
double to_value (long l) const noexcept
 Map an index \( l \in \{0, 1, \ldots, N-1\} \) to its corresponding value \( \omega_l \).
double w_max () const noexcept
 Get the DLR energy cutoff \( \omega_{\text{max}} = \Lambda / \beta \).

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, dlr &m)
 Read a triqs::mesh::dlr mesh from HDF5.
void h5_write (h5::group g, std::string const &name, dlr const &m)
 Write a triqs::mesh::dlr mesh to HDF5.
std::ostream & operator<< (std::ostream &sout, dlr const &m)
 Write a triqs::mesh::dlr mesh to a std::ostream.

Constructor & Destructor Documentation

◆ dlr() [1/2]

triqs::mesh::dlr::dlr ( double beta,
statistic_enum statistic,
double w_max,
double eps,
bool symmetrize = true )
inline

Construct a DLR mesh with a given energy cutoff \( \omega_{\text{max}} \) and error tolerance \(\epsilon \).

It builds the DLR frequencies \( \omega_l \) from \( \Lambda = \omega_{\text{max}} \beta \) and the error tolerance \( \epsilon \), then constructs the imaginary-time and imaginary-frequency DLR operator tables from them.

Parameters
betaInverse temperature \( \beta > 0 \).
statisticParticle statistics.
w_maxDLR energy cutoff \( \omega_{\text{max}} = \Lambda / \beta \).
epsError tolerance \( \epsilon \).
symmetrizeWhether to choose the DLR frequencies symmetrically around \( \omega = 0 \).

Definition at line 190 of file dlr.hpp.

◆ dlr() [2/2]

template<nda::AnyOf< dlr_imtime, dlr_imfreq > M>
triqs::mesh::dlr::dlr ( M const & m)
inlineexplicit

Construct a DLR mesh from another DLR type mesh.

Template Parameters
Mtriqs::mesh::dlr_imtime or triqs::mesh::dlr_imfreq type.
Parameters
mOther mesh.

Definition at line 200 of file dlr.hpp.

Member Function Documentation

◆ deserialize()

void triqs::mesh::dlr::deserialize ( auto & ar)
inline

Deserialize the mesh from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 341 of file dlr.hpp.

◆ is_index_valid()

bool triqs::mesh::dlr::is_index_valid ( long l) const
inlinenodiscardnoexcept

Check if an index \( l \) is valid.

Parameters
lIndex \( l \) to check.
Returns
True if \( 0 \leq l < N \), false otherwise.

Definition at line 218 of file dlr.hpp.

◆ operator()()

mesh_point_t triqs::mesh::dlr::operator() ( long l) const
inlinenodiscard

Function call operator to access a mesh point by its index \( l \in \{0, 1, \ldots, N-1\} \).

Parameters
lIndex \( l \) of the mesh point.
Returns
mesh_point_t with the index \( l \), data index \( d(l) = l \), hash value of the current mesh and the DLR frequency \( \omega_l \) as its value.

Definition at line 258 of file dlr.hpp.

◆ operator[]()

mesh_point_t triqs::mesh::dlr::operator[] ( long d) const
inlinenodiscard

Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).

Parameters
dData index \( d \) of the mesh point.
Returns
mesh_point_t with the index \( l(d) = d \), data index \( d \), hash value of the current mesh and the DLR frequency \( \omega_l \) as its value.

Definition at line 249 of file dlr.hpp.

◆ serialize()

void triqs::mesh::dlr::serialize ( auto & ar) const
inline

Serialize the mesh to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 330 of file dlr.hpp.

◆ to_data_index()

long triqs::mesh::dlr::to_data_index ( long l) const
inlinenodiscardnoexcept

Map an index \( l \in \{0, 1, \ldots, N-1\} \) to its corresponding data index \( d(l) \).

Parameters
lIndex \( l \) to map.
Returns
Data index \( d(l) = l \).

Definition at line 226 of file dlr.hpp.

◆ to_index()

long triqs::mesh::dlr::to_index ( long d) const
inlinenodiscardnoexcept

Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( l(d) \).

Parameters
dData index \( d \) to map.
Returns
Index \( l(d) = d \).

Definition at line 237 of file dlr.hpp.

◆ to_value()

double triqs::mesh::dlr::to_value ( long l) const
inlinenodiscardnoexcept

Map an index \( l \in \{0, 1, \ldots, N-1\} \) to its corresponding value \( \omega_l \).

Parameters
lIndex \( l \) to map.
Returns
Value of the l-th DLR frequency \( \omega_l \).

Definition at line 266 of file dlr.hpp.

◆ h5_read

void h5_read ( h5::group g,
std::string const & name,
dlr & m )
friend

Read a triqs::mesh::dlr mesh from HDF5.

Parameters
gh5::group to be read from.
nameName of the subgroup.
mMesh object to be read into.

Definition at line 381 of file dlr.hpp.

◆ h5_write

void h5_write ( h5::group g,
std::string const & name,
dlr const & m )
friend

Write a triqs::mesh::dlr mesh to HDF5.

Parameters
gh5::group to be written to.
nameName of the subgroup.
mMesh object to be written.

Definition at line 361 of file dlr.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & sout,
dlr const & m )
friend

Write a triqs::mesh::dlr mesh to a std::ostream.

Parameters
soutstd::ostream object.
mMesh to be written.
Returns
Reference to std::ostream object.

Definition at line 320 of file dlr.hpp.


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