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

#include <triqs/mesh/chebyshev.hpp>

Detailed Description

Chebyshev imaginary time mesh type.

A Chebyshev imaginary time mesh is defined by its size \( N \geq 0 \), an inverse temperature \( \beta > 0 \) and its particle statistics. It stores function values at Chebyshev collocation points and uses barycentric interpolation for evaluation at arbitrary imaginary times, providing exponential convergence for smooth functions.

A Chebyshev 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 function \( \tau(n) = \frac{\beta}{2} (x_n + 1) \) where \( x_n = \cos\left(\frac{(2n + 1) \pi}{2N}\right) \) is the Chebyshev point of the first kind.

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

\[ f(\tau) \approx \frac{\sum_{n=0}^{N-1} \frac{w_n}{x - x_n} f_n}{\sum_{n=0}^{N-1} \frac{w_n}{x - x_n}} \]

where \( x = 2\tau/\beta - 1 \) is the scaled coordinate and \( w_n \) are the barycentric weights.

Definition at line 71 of file chebyshev.hpp.

Classes

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

Public Types

using data_index_t = long
 Data index type.
using index_t = long
 Index type.
using value_t = double
 Value type (imaginary time tau).

Public Member Functions

 chebyshev ()=default
 Default constructor constructs an empty mesh.
 chebyshev (double beta, statistic_enum stat, long N)
 Construct a Chebyshev mesh on \( [0, \beta] \) with \( N \) collocation points.
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 end () const
 Get an iterator to the end of the mesh.
double inv_beta_x2 () const noexcept
 Get the precomputed \( 2 / \beta \) for fast tau -> [-1, 1] mapping.
bool is_index_valid (index_t n) const noexcept
 Check if an index \( n \) is valid.
uint64_t mesh_hash () const
 Get the hash value of the mesh.
mesh_point_t operator() (long n) const
 Function call operator to access a mesh point by its index \( n \in \{0, 1, \ldots, N-1\} \).
bool operator== (chebyshev const &) const=default
 Equal-to comparison operator compares \( N \), \( \beta \) and the particle statistics.
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\} \).
nda::vector_const_view< double > points () const
 Access to Chebyshev points scaled to [0, beta].
nda::vector_const_view< double > points_standard () const
 Access to Chebyshev points on [-1, 1].
void serialize (auto &ar) const
 Serialize the mesh to a generic archive.
long size () const
 Get the size \( N \) of the mesh, i.e. the number of mesh points.
statistic_enum statistic () const noexcept
 Get the particle statistics.
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 \) to its corresponding value \( \tau_n \).
nda::vector_const_view< double > weights () const
 Access to barycentric weights.

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

Constructor & Destructor Documentation

◆ chebyshev()

triqs::mesh::chebyshev::chebyshev ( double beta,
statistic_enum stat,
long N )
inline

Construct a Chebyshev mesh on \( [0, \beta] \) with \( N \) collocation points.

Parameters
betaInverse temperature \( \beta > 0 \).
statParticle statistics.
NNumber of Chebyshev points \( N > 0 \).

Definition at line 152 of file chebyshev.hpp.

Member Function Documentation

◆ deserialize()

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

Deserialize the mesh from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 276 of file chebyshev.hpp.

◆ is_index_valid()

bool triqs::mesh::chebyshev::is_index_valid ( index_t n) const
inlinenodiscardnoexcept

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

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

Definition at line 167 of file chebyshev.hpp.

◆ operator()()

mesh_point_t triqs::mesh::chebyshev::operator() ( long n) const
inlinenodiscard

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

Parameters
nIndex \( n \) of the mesh point.
Returns
mesh_point_t with the index \( n \), data index \( d(n) = n \), hash value and value \( \tau_n \).

Definition at line 216 of file chebyshev.hpp.

◆ operator[]()

mesh_point_t triqs::mesh::chebyshev::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 \( n(d) = d \), data index \( d \), hash value and value \( \tau_d \).

Definition at line 208 of file chebyshev.hpp.

◆ serialize()

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

Serialize the mesh to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 270 of file chebyshev.hpp.

◆ to_data_index()

data_index_t triqs::mesh::chebyshev::to_data_index ( index_t n) const
inlinenodiscardnoexcept

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

Parameters
nIndex \( n \) to map.
Returns
Data index \( d(n) = n \).

Definition at line 175 of file chebyshev.hpp.

◆ to_index()

index_t triqs::mesh::chebyshev::to_index ( data_index_t d) const
inlinenodiscardnoexcept

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

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

Definition at line 186 of file chebyshev.hpp.

◆ to_value()

value_t triqs::mesh::chebyshev::to_value ( index_t n) const
inlinenodiscardnoexcept

Map an index \( n \) to its corresponding value \( \tau_n \).

Parameters
nIndex \( n \) to map.
Returns
Value \( \tau_n \) (Chebyshev point scaled to \( [0, \beta] \)).

Definition at line 197 of file chebyshev.hpp.

◆ h5_read

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

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

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

Definition at line 306 of file chebyshev.hpp.

◆ h5_write

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

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

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

Definition at line 291 of file chebyshev.hpp.

◆ operator<<

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

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

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

Definition at line 261 of file chebyshev.hpp.


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