Tools for GFs

pytriqs.gf.tools.conjugate(x)[source]

Return the conjugate of a Green’s function

pytriqs.gf.tools.delta(g)[source]

Compute Delta_iw from G0_iw. CAUTION: This function assumes the following properties of g

  • The diagonal components of g should decay as 1/iOmega
  • g should fullfill the property g[iw][i,j] = conj(g[-iw][j,i])
Parameters:g (BlockGf (of GfImFreq) or GfImFreq) – Non-interacting Green’s function.
Returns:delta_iw – Hybridization function.
Return type:BlockGf (of GfImFreq) or GfImFreq
pytriqs.gf.tools.dyson(**kwargs)[source]

Solve Dyson’s equation for given two of G0_iw, G_iw and Sigma_iw to yield the third.

Parameters:
  • G0_iw (Gf, optional) – Non-interacting Green’s function.
  • G_iw (Gf, optional) – Interacting Green’s function.
  • Sigma_iw (Gf, optional) – Self-energy.
pytriqs.gf.tools.fit_legendre(g_t, order=10)[source]

General fit of a noisy imaginary time Green’s function to a low order Legendre expansion in imaginary time.

Only Hermiticity is imposed on the fit, so discontinuities has to be fixed separately (see the method enforce_discontinuity)

Author: Hugo U.R. Strand

Parameters:
  • g_t (TRIQS imaginary time Green's function (matrix valued)) – Imaginary time Green’s function to fit (possibly noisy binned data)
  • order (int) – Maximal order of the fitted Legendre expansion
Returns:

g_l – Fitted Legendre Green’s function with order order

Return type:

TRIQS Legendre polynomial Green’s function (matrix valued)

pytriqs.gf.tools.inverse(x)[source]

Return the inverse of a Green’s function

pytriqs.gf.tools.make_zero_tail(g, n_moments=10)[source]

Return a container for the high-frequency coefficients of a given Green function initialized to zero.

Parameters:
  • g (GfImFreq or GfReFreq or GfImTime or GfReTime) – The real/imaginary frequency/time Green’s function that we create the tail-array for.
  • [default=10] (n_moments) –
pytriqs.gf.tools.read_gf_from_txt(block_txtfiles, block_name)[source]

Read a GfReFreq from text files with the format (w, Re(G), Im(G)) for a single block.

Notes

A BlockGf must be constructed from multiple GfReFreq objects if desired. The mesh must be the same for all files read in. Non-uniform meshes are not supported.

Parameters:
  • block_txtfiles (Rank 2 square np.array(str) or list[list[str]]) –

    The text files containing the GF data that need to read for the block. e.g. [[‘up_eg1.dat’]] for a one-dimensional block and

    [[‘up_eg1_1.dat’,’up_eg2_1.dat’],
    [‘up_eg1_2.dat’,’up_eg2_2.dat’]] for a 2x2 block.
  • block_name (str) – Name of the block.
Returns:

g – The real frequency Green’s function read in.

Return type:

GfReFreq

pytriqs.gf.tools.transpose(x)[source]

Return the transpose of a Green’s function

pytriqs.gf.tools.write_gf_to_txt(g)[source]

Write a GfReFreq or GfImFreq to in the format (w/iw, Re(G), Im(G)) for a single block.

Parameters:g (GfReFreq or GfImFreq) – The real/imaginary frequency Green’s function to be written out.