Xdiag
C++ library for Exact Diagonalization of quantum many-body systems
Install / Use
/learn @awietek/XdiagREADME
XDiag
A C++ library to perform efficient Exact Diagonalizations of quantum many body systems.
| Documentation | Citation | License |
|:------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------|
| |
|
|
Features:
- Basic algebra of operators in quantum many-body systems
- Iterative linear algebra for computing eigendecompositions and time-evolutions (e.g. Lanczos algorithm)
- Local spin, t-J, or fermionic models
- Full support of generic space group symmetries
- parallelization both with OpenMP and MPI
- modern C++17 impementation simplifying usage
- wrapped in a convenient Julia library: XDiag.jl
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 nsites = 16;
int nup = nsites / 2;
Spinhalf block(nsites, nup);
// Define the nearest-neighbor Heisenberg model
OpSum ops;
for (int i = 0; i < nsites; ++i) {
ops += "J" * Op("SdotS", {i, (i + 1) % nsites});
}
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
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
