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

#include <triqs/mesh/imtime.hpp>

Detailed Description

Imaginary time mesh type.

An imaginary time mesh is defined by its size \( N \geq 0 \), an inverse temperature \( \beta > 0 \) and its particle statistics. It contains \( N \) equally spaced mesh points on the interval \( [0, \beta] \) such that the distance between two consecutive mesh points (step size) is constant.

An imaginary time mesh has the following properties:

  • Each mesh point is identified by a unique index \( n \in \{0, 1, \ldots, N-1\} \).
  • An index \( n \) is mapped to the corresponding data index \( d \) by the identity function \( d(n) = n \) and vice versa.
  • An index \( n \) is mapped to the corresponding value \( \tau \) by the linear function \( \tau(n) = n \cdot \Delta \) such that \( \tau(0) = 0 \) and \( \tau(N-1) = \beta \). The step size of the mesh is \( \Delta = \frac{\beta}{N - 1} \) for \( N > 1 \), otherwise it is undefined. For implementation purposes, we set \( \Delta = 0 \) and \( \Delta^{-1} = 0 \) for \( N = 0 \) and \( \Delta = 0 \) and \( \Delta^{-1} = \infty \) for \( N = 1 \).
  • An arbitrary value \( \tau \in [0, \beta] \) is mapped to the closest mesh point with index \( n \) by the function \( n(\tau) = \left\lfloor \frac{\tau}{\Delta} + 0.5 \right\rfloor \).

Green's function containers that are based on an imaginary time mesh store the function values at the discrete time points \( \tau(n) \), i.e. \( f_n = f(\tau(n)) \), and use linear interpolation to evaluate the function at an arbitrary imaginary time \( \tau \in [0, \beta] \).

Definition at line 68 of file imtime.hpp.

Inheritance diagram for triqs::gfs::imtime:
triqs::mesh::detail::linear< imtime, double >

Public Types

using mesh_point_t = detail::linear<imtime, double>::mesh_point_t
 Mesh point type of a triqs::mesh::imtime mesh (see triqs::mesh::detail::linear::mesh_point_t).
Public Types inherited from triqs::mesh::detail::linear< imtime, double >
using data_index_t
 Data index type.
using index_t
 Index type.
using value_t
 Value type.

Public Member Functions

 imtime (double beta=1.0, statistic_enum statistic=Fermion, long n_tau=0)
 Construct an imaginary time mesh on the interval \( [0, \beta] \) with \( N \geq 0 \) equally spaced mesh points and the given particle statistics.
double beta () const noexcept
 Get the inverse temperature \( \beta \).
void deserialize (auto &ar)
 Deserialize the mesh from a generic archive.
bool operator== (imtime const &) const=default
 Equal-to comparison operator compares \( N \), \( \beta \) and the particle statistics.
void serialize (auto &ar) const
 Serialize the mesh to a generic archive.
statistic_enum statistic () const noexcept
 Get the particle statistics.
Public Member Functions inherited from triqs::mesh::detail::linear< imtime, double >
 linear ()=default
 Default construct an empty linear mesh of size \( N = 0 \).
auto begin () const
 Get an iterator to the beginning of the mesh.
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.
value_t delta () const noexcept
 Get the step size \( \Delta \) of the mesh, i.e. the distance between two consecutive mesh points.
value_t delta_inv () const noexcept
 Get the inverse of the step size of the mesh, i.e. \( 1 / \Delta \).
void deserialize (auto &ar)
 Deserialize the mesh from a generic archive.
auto end () const
 Get an iterator to the end of the mesh.
auto evaluate (auto const &f, double x) const
 Linear interpolation of a function \( f \) defined on a triqs::mesh::detail::linear mesh at a value \(x \in [a, b] \).
long first_index () const
 Get the first index of the mesh, i.e. \( 0 \).
bool is_index_valid (index_t n) const noexcept
 Check if an index \( n \) is valid.
long last_index () const
 Get the last index of the mesh, i.e. \( N - 1 \).
uint64_t mesh_hash () const noexcept
 Get the hash value of the mesh.
mesh_point_t operator() (index_t n) const noexcept
 Function call operator to access a mesh point by its index \( n \in \{0, 1, \ldots, N-1\} \).
bool operator== (linear const &rhs) const=default
 Equal-to comparison operator compares \( N \) and the interval \( [a, b] \).
mesh_point_t operator[] (long d) const noexcept
 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 number of mesh points.
data_index_t to_data_index (index_t n) const noexcept
 Map an index \( n \in \{0, 1, \ldots, N-1\} \) to its corresponding data index \( d(n) \).
index_t to_index (data_index_t d) const noexcept
 Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( n(d) \).
value_t to_value (index_t n) const noexcept
 Map an index \( n \in \{0, 1, \ldots, N-1\} \) to its corresponding value \( m(n) \).

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

Additional Inherited Members

Protected Member Functions inherited from triqs::mesh::detail::linear< imtime, double >
void h5_read_impl (h5::group g, std::string const &name, const char *exp_format)
 Read the mesh from HDF5.
void h5_write_impl (h5::group g, std::string const &name, const char *format) const
 Write the mesh to HDF5.

Constructor & Destructor Documentation

◆ imtime()

triqs::mesh::imtime::imtime ( double beta = 1.0,
statistic_enum statistic = Fermion,
long n_tau = 0 )
inline

Construct an imaginary time mesh on the interval \( [0, \beta] \) with \( N \geq 0 \) equally spaced mesh points and the given particle statistics.

Parameters
betaInverse temperature \( \beta > 0 \).
statisticParticle statistics.
n_tauSize of the mesh.

Definition at line 82 of file imtime.hpp.

Member Function Documentation

◆ deserialize()

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

Deserialize the mesh from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 106 of file imtime.hpp.

◆ serialize()

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

Serialize the mesh to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 97 of file imtime.hpp.

◆ h5_read

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

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

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

Definition at line 136 of file imtime.hpp.

◆ h5_write

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

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

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

Definition at line 121 of file imtime.hpp.

◆ operator<<

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

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

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

Definition at line 157 of file imtime.hpp.


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