TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
GF basis conversions

Detailed Description

Conversions between basis representations of a Green's function.

Conversions to and from compact basis representations such as Legendre polynomials and the discrete Lehmann representation (DLR).

Functions

void triqs::gfs::enforce_discontinuity (gf_view< mesh::legendre > gl, nda::array_const_view< double, 2 > disc)
 Enforce a prescribed jump at \( \tau = 0 \) for a Legendre Green's function.
template<int = 0, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
double triqs::gfs::find_w_max (G const &g, double eps=1e-10, bool symmetrize=true, double w_max_init=1.0, double w_max_max=200.0)
 Find a DLR energy cutoff \( \omega_{\mathrm{max}} \) that reproduces an imfreq Green's function within tolerance eps after a DLR round-trip.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::fit_gf_dlr (G const &g, double w_max, double eps, bool symmetrize=true)
 Fit an imaginary-time Green's function with a Discrete Lehmann Representation.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::fit_gf_dlr (G const &g, mesh::dlr const &dlr_mesh)
 Fit an imaginary-time Green's function on a given DLR coefficient mesh.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr (G const &g)
 Transform a DLR imaginary-time or DLR Matsubara Green's function to its DLR-coefficient representation.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr_imfreq (G const &g)
 Build a DLR Matsubara Green's function from a DLR-coefficient or DLR-imaginary-time input.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr_imfreq (G const &g, double w_max, double eps, bool symmetrize=true)
 Sample an imaginary frequency Green's function on the DLR Matsubara frequency nodes defined by (w_max, eps, symmetrize).
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr_imtime (G const &g)
 Build a DLR imaginary-time Green's function from a DLR-coefficient or DLR-Matsubara input.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_imfreq (G const &g, long n_iw)
 Build a uniform Matsubara Green's function from any DLR representation.
template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_imtime (G const &g, long n_tau)
 Build a uniform imaginary-time Green's function from any DLR representation.
template<typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::tau_L2_norm (G const &g)
 Calculate the \( L^2 \) norm of a DLR Green's function.

Function Documentation

◆ enforce_discontinuity()

void triqs::gfs::enforce_discontinuity ( gf_view< mesh::legendre > gl,
nda::array_const_view< double, 2 > disc )

#include <triqs/gfs/functions/legendre.cpp>

Enforce a prescribed jump at \( \tau = 0 \) for a Legendre Green's function.

The Legendre coefficients are adjusted in place so that the corresponding imaginary-time Green's function has the specified discontinuity \( G(0^+) - G(0^-) \) at \( \tau = 0 \) (which equals \( -1 \) for a fermionic propagator). Coefficients above the constrained subspace are left unchanged.

Parameters
glLegendre Green's function modified in place.
discTarget discontinuity at \( \tau = 0 \).

Definition at line 57 of file legendre.cpp.

◆ find_w_max()

template<int = 0, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
double triqs::gfs::find_w_max ( G const & g,
double eps = 1e-10,
bool symmetrize = true,
double w_max_init = 1.0,
double w_max_max = 200.0 )

#include <triqs/gfs/functions/dlr.hpp>

Find a DLR energy cutoff \( \omega_{\mathrm{max}} \) that reproduces an imfreq Green's function within tolerance eps after a DLR round-trip.

Starting from w_max_init, the cutoff is grown by a factor of 1.5 per iteration. For each candidate \( \omega_{\mathrm{max}} \) the function

  • builds a triqs::mesh::dlr_imfreq mesh from ( \( \omega_{\mathrm{max}} \), eps, symmetrize),
  • samples g on that DLR mesh,
  • reconstructs the Gf on the original imfreq mesh of g via the DLR coefficients, and
  • measures the element-wise round-trip error

    \[ e = \max_{i\omega_n, \mathrm{indices}} \left| g(i\omega_n) - g_{\mathrm{rec}}(i\omega_n) \right| \;. \]

    The smallest \( \omega_{\mathrm{max}} \le \) w_max_max with \( e < \) eps is returned.

Candidate cutoffs whose DLR frequency range exceeds the range of the input imfreq mesh of g are skipped (they would produce an invalid DLR mesh).

For a block_gf, the error reported per iteration is the worst-case error across all blocks.

It throws an exception if w_max_init exceeds w_max_max, or if no candidate cutoff \( \le \) w_max_max achieves \( e < \) eps.

Template Parameters
GAn imfreq MemoryGf or block_gf type.
Parameters
gInput Green's function on an imfreq mesh.
epsTarget DLR accuracy and round-trip error tolerance.
symmetrizeIf true, use particle-hole symmetric DLR meshes.
w_max_initInitial value of the DLR cutoff to try (must be \( \le \) w_max_max).
w_max_maxMaximum DLR cutoff to try before giving up.
Returns
The smallest \( \omega_{\mathrm{max}} \le \) w_max_max for which the round-trip error is below eps.

Definition at line 335 of file dlr.hpp.

◆ fit_gf_dlr() [1/2]

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::fit_gf_dlr ( G const & g,
double w_max,
double eps,
bool symmetrize = true )

#include <triqs/gfs/functions/dlr.hpp>

Fit an imaginary-time Green's function with a Discrete Lehmann Representation.

Builds a DLR coefficient Green's function by least-squares fitting the input Green's function (on a uniform imaginary-time mesh) on a DLR grid specified by the spectral cutoff \( \omega_{\max} \) and tolerance \( \epsilon \).

Template Parameters
NIndex of the mesh component to fit (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gThe imaginary-time Green's function to fit.
w_maxMaximum real frequency captured by the DLR basis.
epsTarget accuracy of the DLR representation.
symmetrizeIf true, the DLR grid is symmetric about \( \omega = 0 \).
Returns
A Green's function on the DLR coefficient mesh.

Definition at line 163 of file dlr.hpp.

◆ fit_gf_dlr() [2/2]

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::fit_gf_dlr ( G const & g,
mesh::dlr const & dlr_mesh )

#include <triqs/gfs/functions/dlr.hpp>

Fit an imaginary-time Green's function on a given DLR coefficient mesh.

Builds a DLR coefficient Green's function by least-squares fitting the input Green's function (on a uniform imaginary-time mesh) onto the supplied DLR grid dlr_mesh.

Template Parameters
NIndex of the mesh component to fit (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gThe imaginary-time Green's function to fit.
dlr_meshThe DLR coefficient mesh to fit onto.
Returns
A Green's function on the DLR coefficient mesh.

Definition at line 129 of file dlr.hpp.

◆ make_gf_dlr()

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr ( G const & g)

#include <triqs/gfs/functions/dlr.hpp>

Transform a DLR imaginary-time or DLR Matsubara Green's function to its DLR-coefficient representation.

The input must live on an imaginary-time or frequency DLR mesh. The output lives on the corresponding DLR (coefficient) mesh.

For block Green's functions the transform is applied block-wise.

Template Parameters
NIndex of the mesh component to transform (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gThe DLR imaginary-time or DLR Matsubara Green's function.
Returns
The same Green's function expressed in DLR coefficients.

Definition at line 94 of file dlr.hpp.

◆ make_gf_dlr_imfreq() [1/2]

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr_imfreq ( G const & g)

#include <triqs/gfs/functions/dlr.hpp>

Build a DLR Matsubara Green's function from a DLR-coefficient or DLR-imaginary-time input.

The output lives on the Matsubara DLR mesh associated with the input's DLR grid. Block and product meshes are handled recursively.

Template Parameters
NIndex of the mesh component to transform (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gA Green's function on an imaginary-time or coefficient DLR mesh.
Returns
The Green's function evaluated on the Matsubara DLR mesh.

Definition at line 216 of file dlr.hpp.

◆ make_gf_dlr_imfreq() [2/2]

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr_imfreq ( G const & g,
double w_max,
double eps,
bool symmetrize = true )

#include <triqs/gfs/functions/dlr.hpp>

Sample an imaginary frequency Green's function on the DLR Matsubara frequency nodes defined by (w_max, eps, symmetrize).

Constructs a fresh triqs::mesh::dlr_imfreq mesh from w_max, eps and symmetrize (using the same beta and statistic as g) and returns a Gf on that mesh whose values are read off g at the corresponding Matsubara indices.

For a block_gf, the DLR mesh is built once and reused across blocks (the underlying cppdlr SVD is not cheap). For a product mesh, the operation is applied to the imfreq axis selected by the template parameter pack <N, Ns...>.

It throws an exception if the input imfreq mesh of g does not cover the Matsubara frequency range of the constructed DLR mesh.

Template Parameters
NIndex of the imfreq axis to transform when g has a product mesh. Must be 0 for non-product meshes.
NsAdditional axis indices for nested product-mesh transformations.
GA MemoryGf or block_gf type with an imfreq mesh on the selected axis.
Parameters
gInput Green's function on an imfreq mesh (or product mesh containing one).
w_maxDLR energy cutoff used to build the dlr_imfreq mesh.
epsDLR accuracy used to build the dlr_imfreq mesh.
symmetrizeIf true, build a particle-hole symmetric DLR mesh.
Returns
A Gf on a freshly built dlr_imfreq mesh, sampled from g.

Definition at line 291 of file dlr.hpp.

◆ make_gf_dlr_imtime()

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_dlr_imtime ( G const & g)

#include <triqs/gfs/functions/dlr.hpp>

Build a DLR imaginary-time Green's function from a DLR-coefficient or DLR-Matsubara input.

The output lives on the imaginary-time DLR mesh associated with the input's DLR grid. Block and product meshes are handled recursively.

Template Parameters
NIndex of the mesh component to transform (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gA Green's function on a Matsubara or coefficient DLR mesh.
Returns
The Green's function evaluated on the imaginary-time DLR mesh.

Definition at line 185 of file dlr.hpp.

◆ make_gf_imfreq()

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_imfreq ( G const & g,
long n_iw )

#include <triqs/gfs/functions/dlr.hpp>

Build a uniform Matsubara Green's function from any DLR representation.

Evaluates the DLR Green's function on a regular Matsubara mesh with \( n_{i\omega} \) positive Matsubara frequencies. Input on imaginary-time or Matsubara DLR meshes are first converted to DLR coefficients internally.

Template Parameters
NIndex of the mesh component to transform (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gA Green's function on any DLR mesh.
n_iwNumber of positive Matsubara frequencies in the output mesh.
Returns
The Green's function evaluated on a uniform Matsubara mesh.

Definition at line 407 of file dlr.hpp.

◆ make_gf_imtime()

template<int N = 0, int... Ns, typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::make_gf_imtime ( G const & g,
long n_tau )

#include <triqs/gfs/functions/dlr.hpp>

Build a uniform imaginary-time Green's function from any DLR representation.

Evaluates the DLR Green's function on a regular imaginary-time mesh of size \( n_{\tau} \). Inputs on imaginary-time or Matsubara DLR meshes are first converted to DLR coefficients internally.

Template Parameters
NIndex of the mesh component to transform (default \( 0 \)).
NsAdditional mesh component indices for product meshes.
GThe type of the input Green's function.
Parameters
gA Green's function on any DLR mesh.
n_tauNumber of points of the output imaginary-time mesh.
Returns
The Green's function evaluated on a uniform imaginary-time mesh.

Definition at line 375 of file dlr.hpp.

◆ tau_L2_norm()

template<typename G>
requires (MemoryGf<G> or is_block_gf_v<G>)
auto triqs::gfs::tau_L2_norm ( G const & g)

#include <triqs/gfs/functions/dlr.hpp>

Calculate the \( L^2 \) norm of a DLR Green's function.

Template Parameters
GThe type of the input Green's function.
Parameters
gA Green's function on any DLR mesh.
Returns
The \( L^2 \) norm of the input Green's function, either as a scalar (if target rank is 0) or as an array of norms for each element in the target domain (if target rank is greater than 0).

Definition at line 434 of file dlr.hpp.