3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 22:33:48 +01:00
dft_tools/test/pytriqs/wrap_test/g.hpp
Olivier Parcollet 4af1afbdaf hdf5 : clean up
- For users : only change is :
   H5::H5File in apps. to be replaced by triqs::h5::file, same API.

- using only the C API because :
   - it is cleaner, better documented, more examples.
   - it is the native hdf5 interface.
   - simplify the installation e.g. on mac. Indeed, hdf5 is
     usually installed without C++ interface, which is optional.
     E.g. EPD et al., brew by default.
     Also the infamous mpi+ hdf5_cpp bug, for which we have no clean solution.

- clean the notion of parent of a group. Not needed, better iterate function in C LT API.
- modified doc : no need for C++ bindings any more.
- modified cmake to avoid requiring CPP bindings.
2014-06-22 13:57:47 +02:00

51 lines
831 B
C++

#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::file file("ess_test_g1.h5", H5F_ACC_TRUNC);
h5_write(file, "g", B1);
}
return B1;
}
void pass_bgf(block_gf_view<imfreq> g) {
{
h5::file 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::file 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::file file("ess_test_g3b.h5", H5F_ACC_TRUNC);
h5_write(file, "g", g);
}
}