3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 22:33:48 +01:00
dft_tools/test/triqs/gfs/gf_scalar.cpp
2013-10-21 15:12:53 +02:00

24 lines
594 B
C++

//#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK
#include <triqs/gfs.hpp>
using namespace triqs::gfs;
#define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) <<std::endl<<std::endl;
int main() {
try {
double beta =1;
auto G = gf<imfreq, scalar_valued> {{beta, Fermion}};
std::cout << G.singularity() << std::endl ;
triqs::clef::placeholder<0> om_;
G(om_) << 1/(om_ + 2.3);
// test hdf5
H5::H5File file("gf_scalar.h5", H5F_ACC_TRUNC);
h5_write(file, "g", G);
h5_write(file, "gm", reinterpret_scalar_valued_gf_as_matrix_valued(G));
}
TRIQS_CATCH_AND_ABORT;
}