These small programs demonstrate individual ALPS APIs. For complete simulation workflows and a recommended learning sequence, see the ALPS tutorials.
| Directory | Subject |
|---|---|
| alea | Statistical estimates and error analysis |
| hdf5 | Saving custom C++ types in HDF5 archives |
| ietl | Iterative eigenvalue methods |
| model | Symbolic and numerical model construction |
| parapack | Simulation workers and parameter scans |
| sampling | Sampling distributions |
| scheduler | Scheduled simulations |
| fortran | Calling Fortran simulation code through the C++ bridge |
These examples require CMake 3.27 or newer; see the CMake setup instructions if your system provides an older version.
From this directory, build the C++ examples together:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/path/to/alps
cmake --build build --parallel 2
ctest --test-dir build --output-on-failureFortran examples are a separate project and require a Fortran compiler:
cmake -S fortran -B build-fortran -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/path/to/alps
cmake --build build-fortran --parallel 2
ctest --test-dir build-fortran --output-on-failureBoth projects register tests by default; pass -DALPS_BUILD_TESTING=OFF to build without registering tests. These standalone builds replace the root ALPS_BUILD_EXAMPLES option. To use a local ALPS checkout, build and install its SDK first, then pass that installation prefix in the commands above.
CTest locates the SDK's XML resources. When running an executable directly, use the input files in its example directory; set ALPS_ROOT to the SDK prefix if the SDK has been relocated.