3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-02 12:13:46 +01:00
dft_tools/doc/reference/c++/gf/fourier_0.cpp
Olivier Parcollet 8d7dd34aeb fourier. Add one overload to make_gf_from_fourier API.
- To be able to give explicitely the number of point.
- two functions : if the number of points is not given, take as before.
- updated the doc.
2014-07-03 19:50:16 +02:00

19 lines
476 B
C++

#include <triqs/gfs.hpp>
using namespace triqs::gfs;
int main() {
double beta = 1, a = 1;
int N = 10000;
auto gw = gf<imfreq>{{beta, Fermion, N/2}, {1, 1}};
auto gt = gf<imtime>{{beta, Fermion, N}, {1, 1}};
triqs::clef::placeholder<0> om_;
gw(om_) << 1 / (om_ - a);
// fills a full *view* of gt with the contents of the FFT
gt() = inverse_fourier(gw);
// make a new fresh gf from the FFT of gt with a mesh of size N/2
auto gw2 = make_gf_from_fourier(gt, N/2);
}