2013-07-29 20:45:27 +02:00
|
|
|
//#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK
|
|
|
|
#include <triqs/gfs.hpp>
|
2014-01-20 15:31:02 +01:00
|
|
|
#include <triqs/gfs/local/functions.hpp>
|
2013-07-29 20:45:27 +02:00
|
|
|
using namespace triqs::gfs;
|
2014-06-08 21:47:32 +02:00
|
|
|
namespace h5 = triqs::h5;
|
|
|
|
|
2013-07-29 20:45:27 +02:00
|
|
|
#define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) <<std::endl<<std::endl;
|
|
|
|
|
|
|
|
int main() {
|
2013-10-16 23:55:26 +02:00
|
|
|
try {
|
|
|
|
double beta =1;
|
|
|
|
auto G = gf<imfreq, scalar_valued> {{beta, Fermion}};
|
2013-07-29 20:45:27 +02:00
|
|
|
|
2013-10-16 23:55:26 +02:00
|
|
|
std::cout << G.singularity() << std::endl ;
|
|
|
|
triqs::clef::placeholder<0> om_;
|
|
|
|
G(om_) << 1/(om_ + 2.3);
|
2013-07-29 20:45:27 +02:00
|
|
|
|
2014-01-20 15:31:02 +01:00
|
|
|
auto n = triqs::gfs::density(G);
|
|
|
|
TEST(n);
|
|
|
|
|
2013-10-16 23:55:26 +02:00
|
|
|
// test hdf5
|
2014-06-08 21:47:32 +02:00
|
|
|
h5::file file("gf_scalar.h5", H5F_ACC_TRUNC);
|
2013-10-16 23:55:26 +02:00
|
|
|
h5_write(file, "g", G);
|
2013-10-18 13:39:00 +02:00
|
|
|
h5_write(file, "gm", reinterpret_scalar_valued_gf_as_matrix_valued(G));
|
2013-07-29 20:45:27 +02:00
|
|
|
|
2013-10-16 23:55:26 +02:00
|
|
|
}
|
|
|
|
TRIQS_CATCH_AND_ABORT;
|
2013-07-29 20:45:27 +02:00
|
|
|
|
|
|
|
}
|