TRIQS / triqs

a Toolbox for Research on Interacting Quantum Systems
https://triqs.github.io
GNU General Public License v3.0
142 stars 72 forks source link

Document Fourier transforms of Multivariable Green Functions #690

Open egcpvanloon opened 5 years ago

egcpvanloon commented 5 years ago

Dear TRIQS developers,

I am working with a Green's function that depends on iw and k. I wish to do a Fourier transform on k only, i.e. to a function of iw and r. I was wondering if there is a nice and convenient way to do this or if you have suggestions for how I can implement it. There is Fourier functionality in gfs/transform, but I do not really understand how to deal with Cartesian products there, i.e., to only transform the second component. There is also not so much documentation on this aspect, as far as I could see.

Sample code:

using iw_k_mesh_t      = cartesian_product<imfreq,brillouin_zone>;
using G_iw_k_t         = block_gf<iw_k_mesh_t, matrix_valued>;
using iw_r_mesh_t      = cartesian_product<imfreq,cyclic_lattice>;
using G_iw_r_t         = block_gf<iw_r_mesh_t, matrix_valued>;

...
matrix<int> periodization_matrix(3,3) ;
periodization_matrix() = 0;
periodization_matrix(0,0) = N_x;
periodization_matrix(1,1) = N_y;
periodization_matrix(2,2) = N_z;

gf_mesh<brillouin_zone> kmesh( bz, periodization_matrix);
g0 = G_iw_k_t{{ {beta,Fermion,n_iw} ,kmesh},gf_struct};

gf_mesh<cyclic_lattice> rmesh( lat, periodization_matrix);
auto g_real = G_iw_r_t{{ {beta,Fermion,n_iw} ,rmesh},gf_struct} ;

Now, how to get g_real from g0?

Best regards,

Erik

Wentzell commented 5 years ago

Hey @egcpvanloon This part is indeed not well documented.

auto g_real = make_gf_from_fourier<1>(g0);

should do what you want (i.e. Fourier transform only the mesh with idx 1).

egcpvanloon commented 5 years ago

@Wentzell Thanks, that was exactly what I was looking for!