awietek / xdiag

C++ library for Exact Diagonalization of quantum many-body systems
https://awietek.github.io/xdiag
Apache License 2.0
21 stars 5 forks source link
computational-physics condensed-matter-physics exact-diagonalization numerical-simulations quantum-physics

license cpp docs Linux CI Mac OSX CI Intel MPI CI DOI

XDiag

High-performance Yxact Diagonalization Routines and Algorithms

A C++ library to perform efficient Exact Diagonalizations of quantum many body systems.

Features:

Installation:

Clone this repository first. Afterwards, the xdiag library can be compiled using the standard CMake instructions

cmake -S . -B build
cmake --build build
cmake --install build

Example Code:

#include <xdiag/all.hpp>

using namespace xdiag;

int main() try {

  int n_sites = 16;
  int nup = n_sites / 2;
  Spinhalf block(n_sites, nup);

  // Define the nearest-neighbor Heisenberg model
  OpSum ops;
  for (int i = 0; i < n_sites; ++i) {
    ops += Op("HB", "J", {i, (i + 1) % n_sites});
  }
  ops["J"] = 1.0;

  set_verbosity(2);                // set verbosity for monitoring progress
  double e0 = eigval0(ops, block); // compute ground state energy

  Log("Ground state energy: {:.12f}", e0);

} catch (Error e) {
  error_trace(e);
}

Documentation

The full documentation is available at awietek.github.io/xdiag.

About

author: Alexander Wietek license: Apache License 2.0