[Paper Review] Pymablock: an algorithm and a package for quasi-degenerate perturbation theory
This paper introduces Pymablock, a Python package and an algorithm for quasi-degenerate perturbation theory that achieves optimal asymptotic scaling by using recursive series with polynomial constraints. It constructs effective Hamiltonians with high-order perturbative corrections more efficiently than traditional Schrieffer–Wolff methods, enabling accurate low-energy spectra for large systems like tight-binding models and superconducting qubits with minimal computational cost.
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.
Motivation & Objective
- To develop an algorithm that constructs effective Hamiltonians for quasi-degenerate quantum systems with optimal computational scaling.
- To address the high computational cost and complexity of existing Schrieffer–Wolff transformation implementations in high-dimensional Hilbert spaces.
- To provide a scalable, open-source software package that supports both numerical and symbolic perturbative calculations up to arbitrary order.
- To enable accurate low-energy effective models for complex systems such as k.p models, superconducting qubits, and large tight-binding lattices.
- To ensure interoperability with existing quantum physics software stacks like QuTiP, scqubits, and dft2kp.
Proposed method
- The algorithm uses recurrence relations to compute series of operators that satisfy polynomial constraints, minimizing matrix multiplications per perturbative order.
- It reformulates the Schrieffer–Wolff transformation via a unitary transformation parameterized as $\mathcal{U} = e^{-\mathcal{S}}$, but with optimized recursive evaluation of $\mathcal{S}$.
- The method employs common subexpression elimination to reduce redundant computations in higher-order terms.
- An implicit method is implemented for large sparse Hamiltonians, avoiding full matrix diagonalization by using LU decompositions at each eigenenergy.
- The core data structure is the BlockSeries class, which handles arbitrary algebraic objects supporting standard operations.
- The package supports both numerical and symbolic computation, with seamless integration into existing scientific Python ecosystems.

Experimental results
Research questions
- RQ1Can a perturbative algorithm for quasi-degenerate systems achieve optimal scaling while maintaining equivalence to the Schrieffer–Wolff transformation?
- RQ2How can recursive perturbation theory be optimized to reduce matrix multiplications in high-order expansions?
- RQ3To what extent can the new algorithm outperform standard Schrieffer–Wolff implementations in terms of computational cost for large systems?
- RQ4Can the method accurately reproduce low-energy spectra of complex models like k.p models and superconducting qubits with only third-order corrections?
- RQ5How efficiently can the algorithm scale to systems with millions of degrees of freedom using sparse matrix techniques?
Key findings
- The Pymablock algorithm achieves optimal linear scaling per perturbative order, significantly outperforming standard Schrieffer–Wolff implementations.
- Third-order perturbative corrections in the double quantum dot model fully reproduce the exact spectrum from sparse diagonalization.
- The entire cost of computing the perturbative band structure over a range of parameters is lower than a single sparse diagonalization, demonstrating computational efficiency.
- The implicit method reduces computational cost by focusing LU decompositions only on the low-energy subspace, avoiding full diagonalization.
- The package's 94% test coverage and interoperability with QuTiP, scqubits, and dft2kp confirm its reliability and broad applicability.
- The framework supports extension to time-dependent problems and nonlinear response theories in quantum materials.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.