TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
Examples

This page collects compilable C++ examples that exercise the TRIQS library.

For the equivalent Python usage, see the Python user guide.

Example Description
Mesh types C++ mesh types — constructing each mesh and iterating its points
Green's functions Green's functions — creating and manipulating \(G(i\omega)\), \(G(\tau)\), \(G(t)\), ...

Compiling the examples

All examples have been compiled on a MacBook Pro with an Apple M2 Max chip with

installed via homebrew.

We further used clang 22.1.4 together with cmake 4.3.2.

Assuming that TRIQS has been installed locally (see the installation instructions) and that the actual example code is in a file main.cpp, the following generic CMakeLists.txt should work for all examples (see also Integration in C++ projects):

cmake_minimum_required(VERSION 3.20)
project(example CXX)
# set required standard
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# find TRIQS
find_package(triqs REQUIRED CONFIG)
# build the example
add_executable(ex main.cpp)
target_link_libraries(ex triqs)