SciPost logo

SciPost Submission Page

XDiag: Exact Diagonalization for Quantum Many-Body Systems

by Alexander Wietek, Luke Staszewski, Martin Ulaga, Paul L. Ebert, Hannes Karlsson, Siddhartha Sarkar, Henry Shackleton, Aritra Sinha, Rafael D. Soares

Submission summary

Authors (as registered SciPost users): Alexander Wietek
Submission information
Preprint Link: https://arxiv.org/abs/2505.02901v2  (pdf)
Code repository: https://github.com/awietek/xdiag
Code version: v0.3.2
Code license: Apache 2.0
Date submitted: May 27, 2025, 8:22 a.m.
Submitted by: Alexander Wietek
Submitted to: SciPost Physics Codebases
Ontological classification
Academic field: Physics
Specialties:
  • Condensed Matter Physics - Computational
  • Quantum Physics
Approach: Computational

Abstract

Exact diagonalization (ED) is a cornerstone technique in quantum many-body physics, enabling precise solutions to the Schr\"odinger equation for interacting quantum systems. Despite its utility in studying ground states, excited states, and dynamical behaviors, the exponential growth of the Hilbert space with system size presents significant computational challenges. We introduce XDiag, an open-source software package designed to combine advanced and efficient algorithms for ED with and without symmetry-adapted bases with user-friendly interfaces. Implemented in C++ for computational efficiency and wrapped in Julia for ease of use, XDiag provides a comprehensive toolkit for ED calculations. Key features of XDiag include the first publicly accessible implementation of sublattice coding algorithms for large-scale spin system diagonalizations, efficient Lin table algorithms for symmetry lookups, and random-hashing techniques for distributed memory parallelization. The library supports various Hilbert space types (e.g., spin-1/2, electron, and t-J models), facilitates symmetry-adapted block calculations, and automates symmetry considerations. The package is complemented by extensive documentation, a user guide, reproducible benchmarks demonstrating near-linear scaling on thousands of CPU cores, and over 20 examples covering ground-state calculations, spectral functions, time evolution, and thermal states. By integrating high-performance computing with accessible scripting capabilities, XDiag allows researchers to perform state-of-the-art ED simulations and explore quantum many-body phenomena with unprecedented flexibility and efficiency.

Current status:
Awaiting resubmission

Reports on this Submission

Report #1 by Anonymous (Referee 1) on 2025-7-9 (Invited Report)

Strengths

(1) The authors are recognized experts in the field and provide a state-of-the-art ED package.
(2) The integration with Julia offers an accessible, user-friendly interface without sacrificing performance (for shared memory).
(3) The software is thoughtfully structured, and both the paper and documentation are well-organized, providing a clear overview of the layout and underlying principles.
(4) A broad set of physical examples demonstrates the library’s flexibility across a wide range of problems.

Weaknesses

(1) The paper lacks benchmarking comparisons with other ED libraries mentioned in the manuscript. Including such benchmarks would help quantify XDiag’s performance.
(2) The current Hilbert space encoding is limited to 64-bit representations, restricting simulations of large, dilute systems.
(3) Sparse matrix multiplication is not supported (e.g., via precomputed storage rather than on-the-fly application). Where memory constraints allow, sparse matrix representations offer superior performance compared to on-the-fly computation methods. This advantage becomes particularly valuable when simulating time evolution to late time scales. An interface with PETSc/SLEPc could be a valuable future addition.
(4) Some important features remain planned for future development, such as MPI support for symmetry-resolved sectors and support for bosonic or higher-spin bases. The authors acknowledge these limitations, and the suggestion to reuse C++ infrastructure from DanceQ (https://scipost.org/SciPostPhysCodeb.48) appears promising. Additionally, implementing Lindbladians to include dissipative systems would be valuable, as ED is the only reliable method for such problems.


**Minor Comments and Questions:**

(m1) Since the authors mention symmetries for the generic interaction graph, it would be appropriate to also cite Phys. Rev. B 102, 054408 (2020).
(m2) The matrix type used to define custom operators (beyond the predefined set) should be highlighted more prominently in the main text, as it significantly enhances the software’s flexibility for diverse use cases.
(m3) When a user defines multiple operators with the same support (e.g., SdotS and Exchange on sites {0, 1}), are these combined internally into a single operator, or are they applied individually to the state?
(m4) Are symmetry options available for operators acting on more than two sites? A note on this in the documentation or paper would be useful.
(m5) Is the absence of a Julia code block on page 12 intentional?
(m6) Stot is not defined when first mentioned on page 21.
(m7) "Tower of states" appears without hyphens on page 20, whereas earlier occurrences include them. Additionally, the abbreviation is introduced only after multiple uses in the main text.

Report

The authors present XDiag, an open-source software package for exact diagonalization (ED) of quantum many-body systems. The library combines high-performance C++ code with a user-friendly Julia wrapper. This enables straightforward application to small-scale problems while efficiently scaling to large supercomputing environments. The authors bring considerable experience to the design and implementation of the software. It is clearly designed with extensibility in mind, giving it the potential to become a widely adopted tool in the community. I recommend publication, but including a comparison to other ED libraries would better assess its capabilities.

Requested changes

(1) Comparison to other ED libraries.

Recommendation

Publish (surpasses expectations and criteria for this Journal; among top 10%)

  • validity: top
  • significance: high
  • originality: high
  • clarity: top
  • formatting: perfect
  • grammar: perfect

Login to report or comment