3
0
mirror of https://github.com/triqs/dft_tools synced 2025-01-13 14:29:01 +01:00

41 lines
1018 B
C++
Raw Normal View History

#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK
#include <triqs/gfs.hpp>
namespace h5 = triqs::h5;
using namespace triqs::gfs;
using namespace triqs::clef;
using namespace triqs::arrays;
#define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> " << (X) << std::endl << std::endl;
int main() {
try {
double beta = 1;
2014-09-12 16:21:55 +02:00
auto G = gf<cartesian_product<imfreq, imfreq>, tensor_valued<4>>{{{beta, Fermion, 100}, {beta, Fermion, 100}}, {2, 2, 2, 2},
make_memory_layout(0, 2, 3, 1, 4, 5)};
// try to assign to expression
placeholder<0> nu_;
placeholder<1> nup_;
G(nu_, nup_) << 1 / (nu_ + nup_ + 1);
2014-09-12 16:21:55 +02:00
//for (auto w : G.mesh())
// std::cerr << G[w](0,0,0,0) <<std::endl;
// Check print the memory_layout
std::cerr << G.data().indexmap().get_memory_layout()<<std::endl;
// inverse
2014-09-12 16:21:55 +02:00
//auto Ginv = inverse(G);
// hdf5
h5::file file("ess_g_nu_nup.h5", H5F_ACC_TRUNC );
h5_write(file, "g", G);
2014-09-12 16:21:55 +02:00
}
TRIQS_CATCH_AND_ABORT;
}