TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
gf_tutorial_1.cpp
1#include <triqs/gfs.hpp>
2#include <triqs/mesh.hpp>
3using namespace triqs;
4using namespace triqs::gfs;
5
6int main() {
7 // Create a real-time mesh on interval [tmin, tmax]
8 double tmin = 0, tmax = 10;
9 int n_times = 101; // number of time-points
10 auto t_mesh = mesh::retime{tmin, tmax, n_times};
11
12 // Create a scalar-valued Green function on the t_mesh
13 auto g = gf<retime, scalar_valued>{t_mesh};
14
15 // Create a nxm matrix-valued Green function on the t_mesh
16 const int n = 2, m = 2;
17 auto gm = gf<retime, matrix_valued>{t_mesh, {n, m}};
18}
The owning Green's function container.
Definition gf.hpp:194
Real time mesh type.
Definition retime.hpp:70
Umbrella header for the Green's function library.
many_body_operator_generic< T > n(IndexTypes... indices)
Create a number operator .
Umbrella header for the TRIQS mesh types.