Pymablock: An algorithm and a package for quasi-degenerate perturbation theory
Isidora Araya Day, Sebastian Miles, Hugo K. Kerstens, Daniel Varjas, Anton R. Akhmerov
SciPost Phys. Codebases 50 (2025) · published 12 February 2025
- doi: 10.21468/SciPostPhysCodeb.50
- live repo (external)
- Submissions/Reports
-
This Publication is part of a bundle
When citing, cite all relevant items (e.g. for a Codebase, cite both the article and the release you used).
DOI | Type | |
---|---|---|
10.21468/SciPostPhysCodeb.50 | Article | |
10.21468/SciPostPhysCodeb.50-r2.1 | Codebase release |
Abstract
A common technique in the study of complex quantum-mechanical systems is to reduce the number of degrees of freedom in the Hamiltonian by using quasi-degenerate perturbation theory. While the Schrieffer-Wolff transformation achieves this and constructs an effective Hamiltonian, its scaling is suboptimal, it is limited to two subspaces, and implementing it efficiently is both challenging and error-prone. We introduce an algorithm for constructing an equivalent effective Hamiltonian as well as a Python package, Pymablock, that implements it. Our algorithm combines an optimal asymptotic scaling and the ability to handle any number of subspaces with a range of other improvements. The package supports numerical and analytical calculations of any order and it is designed to be interoperable with any other packages for specifying the Hamiltonian. We demonstrate how the package handles constructing a k.p model, analyses a superconducting qubit, and computes the low-energy spectrum of a large tight-binding model. We also compare its performance with reference calculations and demonstrate its efficiency.
Cited by 4

Authors / Affiliations: mappings to Contributors and Organizations
See all Organizations.- 1 Isidora Araya Day,
- 1 Sebastian Miles,
- 1 Hugo Kerstens,
- 2 3 Daniel Varjas,
- 1 Anton R. Akhmerov
- 1 Technische Universiteit Delft / Delft University of Technology [TU Delft]
- 2 Max-Planck-Institut für Physik komplexer Systeme / Max Planck Institute for the Physics of Complex Systems
- 3 Institute for Theoretical Solid State Physics