66 template <
typename G1,
typename G2>
71 static_assert(std::is_same_v<typename std::decay_t<G1>::target_t,
typename std::decay_t<G2>::target_t>,
72 "Arguments to legendre_matsubara_direct require same target_t");
77 for (
auto om : gw.mesh()) {
85 template <
typename G1,
typename G2>
90 static_assert(std::is_same_v<typename std::decay_t<G1>::target_t,
typename std::decay_t<G2>::target_t>,
91 "Arguments to legendre_matsubara_direct require same target_t");
96 for (
auto t : gt.mesh()) {
97 L.
reset(2 * t / gt.mesh().beta() - 1);
98 for (
auto l : gl.mesh()) { gt[t] += std::sqrt(2 * l.index() + 1) / gt.mesh().beta() * gl[l] * L.
next(); }
117 template <
typename G1,
typename G2>
122 static_assert(std::is_same_v<typename std::decay_t<G1>::target_t,
typename std::decay_t<G2>::target_t>,
123 "Arguments to legendre_matsubara_inverse require same target_t");
142 template <
typename G1,
typename G2>
147 static_assert(std::is_same_v<typename std::decay_t<G1>::target_t,
typename std::decay_t<G2>::target_t>,
148 "Arguments to legendre_matsubara_inverse require same target_t");
152 auto N = gt.mesh().size() - 1;
156 for (
auto t : gt.mesh()) {
157 if (t.index() == 0 || t.index() == N)
161 L.
reset(2 * t / gt.mesh().beta() - 1);
162 for (
auto l : gl.mesh()) { gl[l] += coef * std::sqrt(2 * l.index() + 1) * L.
next() * gt[t]; }
164 gl.data() *= gt.mesh().delta();
171 template <
typename Tag,
typename D,
typename Target>
struct gf_keeper {
172 gf_const_view<D, Target> g;
185 template <
typename G>
inline gf_keeper<tags::legendre, mesh::legendre, typename G::target_t>
legendre_to_imfreq(G
const &gl) {
200 template <
typename G>
inline gf_keeper<tags::legendre, mesh::legendre, typename G::target_t>
legendre_to_imtime(G
const &gl) {
215 template <
typename G>
inline gf_keeper<tags::legendre, mesh::imfreq, typename G::target_t>
imfreq_to_legendre(G
const &gw) {
230 template <
typename G>
inline gf_keeper<tags::legendre, mesh::imtime, typename G::target_t>
imtime_to_legendre(G
const >) {
240 template <
typename T>
void triqs_gf_view_assign_delegation(gf_view<mesh::imfreq, T> gw, gf_keeper<tags::legendre, mesh::legendre, T>
const &L) {
245 template <
typename T>
void triqs_gf_view_assign_delegation(gf_view<mesh::imtime, T> gt, gf_keeper<tags::legendre, mesh::legendre, T>
const &L) {
250 template <
typename T>
void triqs_gf_view_assign_delegation(
gf_view<mesh::legendre, T> gl, gf_keeper<tags::legendre, mesh::imfreq, T>
const &L) {
255 template <
typename T>
void triqs_gf_view_assign_delegation(
gf_view<mesh::legendre, T> gl, gf_keeper<tags::legendre, mesh::imtime, T>
const &L) {
A mutable, non-owning view of a Green's function.
The owning Green's function container.
Recursive generation of Legendre polynomials .
void reset(double x)
Reset the generator to 0th order and with a new value.
double next()
Increase the degree of the polynomial from to using .
Provides the Fourier transform factories and the lazy fourier(...) assignment for Green's functions.
Provides tail fitting, slicing, inversion, reality and matrix-multiplication functions for Green's fu...
Provides the triqs::gfs::gf_const_view container, a read-only non-owning view of a Green's function.
Provides a mutable non-owning view of a Green's function.
Provides the Green's function class.
void legendre_matsubara_direct(G1 &&gw, G2 const &gl)
Fill a Matsubara Green's function from a Legendre Green's function.
void legendre_matsubara_inverse(G1 &&gl, G2 const &gw)
Fill a Legendre Green's function from a Matsubara Green's function.
gf_keeper< tags::legendre, mesh::legendre, typename G::target_t > legendre_to_imtime(G const &gl)
Tag a Legendre Green's function for assignment to an imaginary-time Green's function.
gf_keeper< tags::legendre, mesh::legendre, typename G::target_t > legendre_to_imfreq(G const &gl)
Tag a Legendre Green's function for assignment to a Matsubara Green's function.
gf_keeper< tags::legendre, mesh::imtime, typename G::target_t > imtime_to_legendre(G const >)
Tag an imaginary-time Green's function for assignment to a Legendre Green's function.
gf_keeper< tags::legendre, mesh::imfreq, typename G::target_t > imfreq_to_legendre(G const &gw)
Tag a Matsubara Green's function for assignment to a Legendre Green's function.
auto fourier(block_gf< V, T, L, A > const &g)
Lazily apply the Fourier transform block by block to a block Green's function.
auto make_const_view(Gf const &g)
Make a const view of a Green's function.
constexpr bool is_gf_v
Trait to check whether a type models the Green's function concept.
std::complex< double > legendre_T(int n, int l)
Get the quantity from Eq.(E2) in the paper https://doi.org/10.1103/PhysRevB.84.075145.
Provides a mesh type on the imaginary frequency axis.
Provides a mesh type on the imaginary time axis.
Provides a mesh type for Legendre polynomials as basis functions.
Provides Legendre polynomials and related functions.