Catalog PyPI
PACKAGE EXPLORERView in registry

aaa-approx

PyPI

A Python implementation of the AAA algorithm for rational approximation

Versions collected1
Direct dependencies2From release 1.0.2
Last observed20 Oct, 16:46 UTC

README

Version 1.0.2 documentation

The AAA algorithm for rational approximation Build Status

This is a Python implementation of the AAA algorithm for rational approximation described in the paper "The AAA Algorithm for Rational Approximation" by Yuji Nakatsukasa, Olivier Sète, and Lloyd N. Trefethen, SIAM Journal on Scientific Computing 2018 40:3, A1494-A1522. (doi)

A MATLAB implementation of this algorithm is contained in Chebfun. The present Python version is a more or less direct port of the MATLAB version.

The "cleanup" feature for spurious poles and zeros is not currently implemented.

Installation

The implementation is in pure Python and requires only numpy and scipy as dependencies. Install it using pip:

pip install aaa-approx

Usage

Here's an example of how to approximate a function in the interval [0,1]:

import numpy as np
from aaa import aaa

Z = np.linspace(0.0, 1.0, 1000)
F = np.exp(Z) * np.sin(2*np.pi*Z)

r = aaa(F, Z, mmax=10)

Instead of the maximum number of terms mmax, it's also possible to specify the error tolerance tol. Both arguments work exactly as in the MATLAB version.

The returned object r is an instance of the class aaa.BarycentricRational and can be called like a function. For instance, you can compute the error on Z like this:

err = F - r(Z)
print(np.linalg.norm(err, np.inf))

If you are interested in the poles and residues of the computed rational function, you can query them like

pol,res = r.polres()

and the zeroes using

zer = r.zeros()

Finally, the nodes, values and weights used for interpolation (called zj, fj and wj in the original implementation) can be accessed as properties:

r.nodes
r.values
r.weights

Downloads & popularity

1downloads
1-day window · source-reported counts19 Oct 2026
36180
2026-07-22: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-07-22–2026-07-222026-07-23: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-07-23–2026-07-232026-07-24: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-07-24–2026-07-242026-07-27: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-07-27–2026-07-272026-07-29: 14 · observed 2026-10-20T19:39:26.6407797Z · period 2026-07-29–2026-07-292026-07-31: 7 · observed 2026-10-20T19:39:26.6407797Z · period 2026-07-31–2026-07-312026-08-01: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-01–2026-08-012026-08-02: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-02–2026-08-022026-08-03: 13 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-03–2026-08-032026-08-04: 5 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-04–2026-08-042026-08-05: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-05–2026-08-052026-08-06: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-06–2026-08-062026-08-09: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-09–2026-08-092026-08-11: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-11–2026-08-112026-08-13: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-13–2026-08-132026-08-14: 7 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-14–2026-08-142026-08-16: 16 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-16–2026-08-162026-08-17: 8 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-17–2026-08-172026-08-18: 36 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-18–2026-08-182026-08-20: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-20–2026-08-202026-08-23: 4 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-23–2026-08-232026-08-24: 12 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-24–2026-08-242026-08-31: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-08-31–2026-08-312026-09-01: 4 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-01–2026-09-012026-09-03: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-03–2026-09-032026-09-04: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-04–2026-09-042026-09-05: 4 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-05–2026-09-052026-09-06: 4 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-06–2026-09-062026-09-07: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-07–2026-09-072026-09-09: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-10–2026-09-102026-09-11: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-11–2026-09-112026-09-12: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-12–2026-09-122026-09-13: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-13–2026-09-132026-09-21: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-21–2026-09-212026-09-22: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-22–2026-09-222026-09-23: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-23–2026-09-232026-09-24: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-24–2026-09-242026-09-25: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-25–2026-09-252026-09-26: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-26–2026-09-262026-09-27: 4 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-27–2026-09-272026-09-28: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-28–2026-09-282026-09-30: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-09-30–2026-09-302026-10-01: 4 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-01–2026-10-012026-10-05: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-05–2026-10-052026-10-06: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-06–2026-10-062026-10-07: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-07–2026-10-072026-10-08: 6 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-08–2026-10-082026-10-09: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-09–2026-10-092026-10-10: 3 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-10–2026-10-102026-10-12: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-12–2026-10-122026-10-13: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-13–2026-10-132026-10-16: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-16–2026-10-162026-10-17: 2 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-17–2026-10-172026-10-19: 1 · observed 2026-10-20T19:39:26.6407797Z · period 2026-10-19–2026-10-19
22 Jul19 Oct

pypistats · 55 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1912026-10-20T19:39:26.6407797Z
2026-10-17 – 2026-10-1722026-10-20T19:39:26.6407797Z
2026-10-16 – 2026-10-1622026-10-20T19:39:26.6407797Z
2026-10-13 – 2026-10-1312026-10-20T19:39:26.6407797Z
2026-10-12 – 2026-10-1212026-10-20T19:39:26.6407797Z
2026-10-10 – 2026-10-1032026-10-20T19:39:26.6407797Z
2026-10-09 – 2026-10-0922026-10-20T19:39:26.6407797Z
2026-10-08 – 2026-10-0862026-10-20T19:39:26.6407797Z
2026-10-07 – 2026-10-0712026-10-20T19:39:26.6407797Z
2026-10-06 – 2026-10-0622026-10-20T19:39:26.6407797Z
2026-10-05 – 2026-10-0512026-10-20T19:39:26.6407797Z
2026-10-01 – 2026-10-0142026-10-20T19:39:26.6407797Z
2026-09-30 – 2026-09-3022026-10-20T19:39:26.6407797Z
2026-09-28 – 2026-09-2832026-10-20T19:39:26.6407797Z
2026-09-27 – 2026-09-2742026-10-20T19:39:26.6407797Z
2026-09-26 – 2026-09-2622026-10-20T19:39:26.6407797Z
2026-09-25 – 2026-09-2512026-10-20T19:39:26.6407797Z
2026-09-24 – 2026-09-2432026-10-20T19:39:26.6407797Z
2026-09-23 – 2026-09-2312026-10-20T19:39:26.6407797Z
2026-09-22 – 2026-09-2212026-10-20T19:39:26.6407797Z
2026-09-21 – 2026-09-2122026-10-20T19:39:26.6407797Z
2026-09-13 – 2026-09-1312026-10-20T19:39:26.6407797Z
2026-09-12 – 2026-09-1222026-10-20T19:39:26.6407797Z
2026-09-11 – 2026-09-1112026-10-20T19:39:26.6407797Z
2026-09-10 – 2026-09-1012026-10-20T19:39:26.6407797Z
2026-09-09 – 2026-09-0932026-10-20T19:39:26.6407797Z
2026-09-07 – 2026-09-0712026-10-20T19:39:26.6407797Z
2026-09-06 – 2026-09-0642026-10-20T19:39:26.6407797Z
2026-09-05 – 2026-09-0542026-10-20T19:39:26.6407797Z
2026-09-04 – 2026-09-0412026-10-20T19:39:26.6407797Z
2026-09-03 – 2026-09-0332026-10-20T19:39:26.6407797Z
2026-09-01 – 2026-09-0142026-10-20T19:39:26.6407797Z
2026-08-31 – 2026-08-3132026-10-20T19:39:26.6407797Z
2026-08-24 – 2026-08-24122026-10-20T19:39:26.6407797Z
2026-08-23 – 2026-08-2342026-10-20T19:39:26.6407797Z
2026-08-20 – 2026-08-2022026-10-20T19:39:26.6407797Z
2026-08-18 – 2026-08-18362026-10-20T19:39:26.6407797Z
2026-08-17 – 2026-08-1782026-10-20T19:39:26.6407797Z
2026-08-16 – 2026-08-16162026-10-20T19:39:26.6407797Z
2026-08-14 – 2026-08-1472026-10-20T19:39:26.6407797Z
2026-08-13 – 2026-08-1322026-10-20T19:39:26.6407797Z
2026-08-11 – 2026-08-1122026-10-20T19:39:26.6407797Z
2026-08-09 – 2026-08-0932026-10-20T19:39:26.6407797Z
2026-08-06 – 2026-08-0612026-10-20T19:39:26.6407797Z
2026-08-05 – 2026-08-0522026-10-20T19:39:26.6407797Z
2026-08-04 – 2026-08-0452026-10-20T19:39:26.6407797Z
2026-08-03 – 2026-08-03132026-10-20T19:39:26.6407797Z
2026-08-02 – 2026-08-0232026-10-20T19:39:26.6407797Z
2026-08-01 – 2026-08-0112026-10-20T19:39:26.6407797Z
2026-07-31 – 2026-07-3172026-10-20T19:39:26.6407797Z
2026-07-29 – 2026-07-29142026-10-20T19:39:26.6407797Z
2026-07-27 – 2026-07-2722026-10-20T19:39:26.6407797Z
2026-07-24 – 2026-07-2412026-10-20T19:39:26.6407797Z
2026-07-23 – 2026-07-2322026-10-20T19:39:26.6407797Z
2026-07-22 – 2026-07-2222026-10-20T19:39:26.6407797Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.231 Jan 20192

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
c-f-h/aaa

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:46 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:21ef5f052bc75fc0825e2651d09a07c8e1e677ee3dd9247b804adfdd608234a9