Skip to main content

adapol: Adaptive Pole Fitting for Quantum Many-Body Physics

CI

adapol ("add-a-pole") is a Python package for constructing compact pole approximations of Matsubara functions,

$$ G(\mathrm{i}\nu_n) \approx \sum_{k=1}^{M} \frac{R_k}{\mathrm{i}\nu_n - p_k}, $$

with real poles $p_k$ and scalar or matrix-valued residues $R_k$, using the AAA rational approximation algorithm and nonlinear optimization. Given Matsubara data, or an existing pole expansion (for example, a discretized spectral density or a discrete Lehmann representation), adapol finds an accurate approximation with a specified maximum number of poles, or as few poles as possible. A typical application is hybridization fitting: constructing a compact bath representation of a given hybridization function.

Installation

pip install adapol

The only dependencies are numpy and scipy.

Usage

adapol provides three main functions:

  • approx_freq_aaa(F, Z, ...) fits frequency data F, sampled at (typically Matsubara) points Z, with a sum of simple poles, using the AAA algorithm. The number of poles is controlled by a pole budget max_n_poles and/or a AAA error tolerance aaa_tol.
  • approx_sop_fast(poles, residues, beta, ...) approximates a given sum of poles by a (hopefully) smaller one in a single AAA pass. The number of poles is again controlled by max_n_poles and/or aaa_tol, and an optional nonlinear_optimization step refines the pole locations.
  • approx_sop_tol(poles, residues, tol, beta, ...) finds the smallest sum of poles whose actual error (in $L^2(\tau)$ and $l^2(i \omega_n)$) is below the tolerance tol.

Examples

Three example notebooks demonstrate the usage of these functions in detail. We recommend reading them in the following order.

  • semicircle.ipynb — fitting data with a continuous spectrum (semicircular density): the stopping criteria, the nonlinear optimization option, and the error metric.
  • discrete.ipynb — fitting multi-orbital data with a discrete spectrum, including an experiment on how the required number of poles scales with the number of orbitals.
  • hubbarddimer.ipynb — analytic continuation benchmark for the Hubbard dimer.

Documentation

The reference documentation for the three functions also describes in detail how to use them, as well as information on the algorithms they implement. The same information is contained in the docstrings, e.g. help(adapol.approx_freq_aaa).

Citation

If you use this package in your research, please include a reference to this GitHub repository, and cite the following references:

  1. Huang, Zhen, Emanuel Gull, and Lin Lin. "Robust analytic continuation of Green's functions via projection, pole estimation, and semidefinite relaxation," Phys. Rev. B 107, 075151 (2023).
  2. Huang, Zhen, Denis Golež, Hugo U. R. Strand, and Jason Kaye. "Automated evaluation of imaginary time strong coupling diagrams by sum-of-exponentials hybridization fitting," SciPost Phys. 19 (5), 121 (2025).

License

adapol is distributed under the GNU General Public License v3.0 (see LICENSE).

Release files for adapol 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adapol 0.2.0
File Size Uploaded
adapol-0.2.0.tar.gz 40.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adapol 0.2.0
File Interpreter ABI Platform
adapol-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.8 kB

Release files / adapol-0.2.0.tar.gz

Download URL adapol-0.2.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
988ee7ac2910140e7e2da7815ad0c5fc2d836bedb5035b77b9fd4077bfff78ad
BLAKE2b-256 checksum
How to use checksums
c1d27ed3ff683e7fbdf054b00371a6ff54410748401e7ab1afa680804a5d8e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / adapol-0.2.0-py3-none-any.whl

Download URL adapol-0.2.0-py3-none-any.whl
Size 42.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbc4583643c33fee15531ca3afa466682483d491a87581c50996d41be434fd13
BLAKE2b-256 checksum
How to use checksums
13349a3872a11dfadca7f01d74da17bb586955be7df6470930ef8712bd279248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page