Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Fourier transforms of Multivariable Green Functions #690

Open
egcpvanloon opened this issue Mar 22, 2019 · 2 comments
Open

Document Fourier transforms of Multivariable Green Functions #690

egcpvanloon opened this issue Mar 22, 2019 · 2 comments
Assignees

Comments

@egcpvanloon
Copy link

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
Copy link
Member

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
Copy link
Author

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

@Wentzell Wentzell self-assigned this Mar 25, 2019
@Wentzell Wentzell changed the title Cartesian products of meshes and Fourier transforms Document Fourier transforms of Multivariable Green Functions Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants