3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 19:53:45 +01:00
dft_tools/pytriqs/wrap_test/g.hpp

47 lines
835 B
C++
Raw Normal View History

2014-05-21 23:01:27 +02:00
#include <triqs/gfs.hpp>
using namespace triqs::gfs;
using namespace triqs;
block_gf_view<imfreq> make_bgf(double a) {
double beta = 1;
auto G1 = gf<imfreq>({beta, Fermion}, {2, 2});
auto B1 = make_block_gf<imfreq>(3, G1);
{
H5::H5File file("ess_test_g1.h5", H5F_ACC_TRUNC);
h5_write(file, "g", B1);
}
return B1;
}
void pass_bgf(block_gf_view<imfreq> g) {
{
H5::H5File file("ess_test_g2.h5", H5F_ACC_TRUNC);
h5_write(file, "g", g);
}
}
// scalar gf
gf_view<imfreq,scalar_valued> make_sgf(double a) {
double beta = 1;
auto G1 = gf<imfreq, scalar_valued>({beta, Fermion});
{
H5::H5File file("ess_test_g3a.h5", H5F_ACC_TRUNC);
h5_write(file, "g", G1);
}
return G1;
}
void pass_sgf(gf_view<imfreq,scalar_valued> g) {
{
H5::H5File file("ess_test_g3b.h5", H5F_ACC_TRUNC);
h5_write(file, "g", g);
}
}