mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 06:14:14 +01:00
gf: add gf_scalar test
This commit is contained in:
parent
e707cd8754
commit
c5c016aa79
22
test/triqs/gf/gf_scalar.cpp
Normal file
22
test/triqs/gf/gf_scalar.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//#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() {
|
||||||
|
|
||||||
|
|
||||||
|
double beta =1;
|
||||||
|
auto G = make_gf<imfreq, scalar_valued> (beta, Fermion);
|
||||||
|
|
||||||
|
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));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user