2013-07-17 19:24:07 +02:00
|
|
|
//#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK
|
|
|
|
|
2013-07-29 09:57:07 +02:00
|
|
|
#include <triqs/gfs/refreq.hpp>
|
|
|
|
#include <triqs/gfs/retime.hpp>
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
namespace tql= triqs::clef;
|
|
|
|
namespace tqa= triqs::arrays;
|
|
|
|
using tqa::range;
|
|
|
|
using triqs::arrays::make_shape;
|
2013-07-28 13:28:19 +02:00
|
|
|
using triqs::gfs::scalar_valued;
|
|
|
|
using triqs::gfs::Fermion;
|
|
|
|
using triqs::gfs::refreq;
|
|
|
|
using triqs::gfs::retime;
|
|
|
|
using triqs::gfs::make_gf;
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
#define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) <<std::endl<<std::endl;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
|
|
|
double beta =1;
|
2013-07-22 17:37:39 +02:00
|
|
|
double tmax=10;
|
|
|
|
int N=1000;
|
|
|
|
auto Gw = make_gf<refreq> (-10, 10, N, make_shape(2,2));
|
|
|
|
auto Gt = make_gf<retime> (0, tmax, N, make_shape(2,2));
|
|
|
|
auto Gw2 = make_gf<refreq,scalar_valued> (-10, 10, N);
|
|
|
|
auto Gt2 = make_gf<retime,scalar_valued> (0, tmax, N);
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
int i =0;
|
2013-07-28 13:47:42 +02:00
|
|
|
for (auto & t : Gt.mesh()) Gt[t] = 1.0*t;
|
|
|
|
for (auto & w : Gw.mesh()) Gw[w] = 1.0*w;
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
triqs::clef::placeholder<0> t_;
|
2013-07-22 17:37:39 +02:00
|
|
|
triqs::clef::placeholder<1> w_;
|
|
|
|
Gt2( t_) << 1.0*t_;
|
|
|
|
Gw2( w_) << 1.0*w_;
|
|
|
|
|
|
|
|
std::cout << Gt(3.255)(0,0) << std::endl;
|
|
|
|
std::cout << Gt2(3.255) << std::endl;
|
|
|
|
std::cout << Gw(3.255)(0,0) << std::endl;
|
|
|
|
std::cout << Gw2(3.255) << std::endl;
|
|
|
|
|
2013-07-17 19:24:07 +02:00
|
|
|
// test hdf5
|
|
|
|
H5::H5File file("ess_gfre.h5", H5F_ACC_TRUNC );
|
2013-07-22 17:37:39 +02:00
|
|
|
h5_write(file, "gt", Gt);
|
|
|
|
h5_write(file, "gw", Gw);
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
}
|