TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
prod.cpp
1#include <fmt/ranges.h>
2#include <triqs/mesh.hpp>
3
4#include <numbers>
5
6int main() {
7 using std::numbers::pi;
8
9 // initialize a mesh on a bravais lattice with a = 1 and a 2x2x1 meshpoints
10 auto bl = triqs::mesh::bravais_lattice{nda::eye<double>(3)};
11 auto bl_m = triqs::mesh::cyclat{bl, {2, 2, 1}};
12
13 // initialize a bosonic imaginary frequency mesh with 2 positive frequencies and beta = 10
14 triqs::mesh::imfreq iw_m{10, triqs::mesh::Boson, 2};
15
16 // combine the two meshes into a product mesh
17 auto m = triqs::mesh::prod{bl_m, iw_m};
18
19 // loop over all mesh points and print their index and data index tuples
20 for (int i = 0; auto mp : m) { fmt::println("mesh point #{}: index = {}, data index = {}", i++, mp.index(), mp.data_index()); }
21}
Cyclic lattice mesh type for Bravais lattices with Born-von Karman periodic boundary conditions.
Definition cyclat.hpp:88
Imaginary frequency mesh type.
Definition imfreq.hpp:102
Product mesh type for combining multiple meshes.
Definition prod.hpp:138
Umbrella header for the TRIQS mesh types.