.. Generated automatically by cpp2rst .. highlight:: c .. role:: red .. role:: green .. role:: param .. _triqs__gfs__fit_hermitian_tail: triqs::gfs::fit_hermitian_tail ============================== *#include * **Synopsis** .. rst-class:: cppsynopsis 1. | :green:`template` | std::pair :red:`fit_hermitian_tail` (G const & :param:`g`, | A const & :param:`known_moments` = {}) 2. | :green:`template` | std::pair, double> :red:`fit_hermitian_tail` (BG const & :param:`bg`, | A const & :param:`known_moments` = {}) Documentation **1)** Fit the tail of a Green function using a least-squares fitting procedure imposing the symmetry :math:`G[i\omega](i,j) = G[-i\omega](j,i)^*` **2)** Fit the tail of a Block Green function using a least-squares fitting procedure imposing the symmetry :math:`G[i\omega](i,j) = G[-i\omega](j,i)^*` for each block Template parameters ^^^^^^^^^^^^^^^^^^^ * :param:`N` The position of the frequency mesh in case of a product mesh [default: 0] * :param:`G` The type of the Green function object * :param:`A` The type of the high-frequency moments * :param:`BG` The type of the Block Green function (block_gf, block_gf_view, block_gf_const_view) * :param:`AG` The type of the high-frequecy moments for Block Green functions (e.g. std::vector) Parameters ^^^^^^^^^^ * :param:`g` The Green function object to fit the tail for * :param:`known_moments` The object containing the known high-frequency moments * :param:`bg` The Block Green function object to fit the tail for Returns ^^^^^^^ A pair of the tail object and the fitting error Example ^^^^^^^ .. Included automatically from /src/triqs/doc/documentation/examples/triqs/gfs/fit_hermitian_tail.cpp .. code-block:: cpp #include #include #include using namespace triqs::gfs; using namespace triqs; nda::clef::placeholder<0> iw_; int main() { double beta = 1.0; int n_iw = 100; auto g = gf{{beta, Fermion, n_iw}, {1, 1}}; g[iw_] << 1.0 / iw_; auto [tail, err] = fit_hermitian_tail(g); std::cout << std::setprecision(2) << "Error: " << err << "\nTail: " << tail; } *Output* .. code-block:: text Error: 4.8e-19 Tail: [(6e-17,0),(1,0),(5.5e-11,0),(3.9e-09,0),(1.7e-05,0),(-3.2e-05,0),(1.7,0)]