taylorize
Lazy truncated Taylor series for higher-order automatic differentiation and arbitrary-precision Taylor-method ODE integration.
taylorize represents a smooth function by its normalized Taylor coefficients
c[k] = x^(k)(0) / k! and computes them lazily, so you can build an
expression once and then ask for any order afterwards.
Status: 0.0.2 (pre-alpha seed), published on PyPI. The API is minimal and will change.
Install
pip install taylorize
# or
uv add taylorize
Quickstart
from fractions import Fraction
from taylorize import Taylor, derivative, taylor_series, variable, exp, sin, tan
from taylorize.functions import define_ode_function
def f(x):
return exp(sin(x))
# 5th derivative of exp(sin(x)) at 0
print(derivative(f, k=5)(0.0)) # -8.0
# Exact rational Taylor coefficients of tan(x) up to order 7
print(tan(variable(Fraction(0))).ensure(7).c)
# [Fraction(0, 1), Fraction(1, 1), Fraction(0, 1), Fraction(1, 3), ...]
# Define any function by the ODE it satisfies: y' = y(1 - y), y(0) = 1/2
logistic = define_ode_function(lambda x, y: y * (1 - y), lambda x0: 0.5)
print(taylor_series(logistic, order=5)(0.0))
# Integrate a coupled ODE system (simple pendulum: theta'' = -sin(theta))
theta = Taylor.pending(1.0)
omega = Taylor.pending(0.0)
theta.bind_ode(omega)
omega.bind_ode(-sin(theta))
print(theta.eval(0.1, order=16))
See examples/basic.py.
Architecture
The core object is a lazy truncated power series in a nilpotent direction h:
x(h) = c[0] + c[1] h + c[2] h^2 + ... + c[N] h^N
taylorize.core— Pure lazy power-series ring (+,-,*,/), Picard integration, andTaylor.pending/bind_odewiring. Zero knowledge of elementary functions or coefficient backends.taylorize.functions— Elementary and special functions (exp,sin,tan,erf, Airy, Bessel, Jacobi elliptic, Weierstrass $\wp$, Painlevé I/II) declared directly via the differential equations they satisfy (define_ode_function,define_ode_system).taylorize.backends— Resolves 0th-order initial values acrossfloat/complex(math/cmath/scipy.special), exactFraction, arbitrary-precisionmpmath, symbolicsympy, andnumpy.taylorize.transforms— Function transforms (derivative,taylor_series).taylorize.interop— Host-library protocol dispatch (__array_ufunc__,__torch_function__).
Roadmap
- Implicit / holonomic ODE layer for singular expansion points at the origin
- Adaptive-step Taylor ODE solver
- JAX
jvp/ jet interop
License
MIT
Metadata
Release files for taylorize 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| taylorize-0.0.2.tar.gz | 47.4 kB | With provenance | Details for taylorize-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| taylorize-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for taylorize-0.0.2-py3-none-any.whl |
Total release size: 60.9 kB
Release files / taylorize-0.0.2.tar.gz
| Download URL | taylorize-0.0.2.tar.gz |
|---|---|
| Size | 47.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3663d303d5bd50bb700834cf15f07f5ee733c03460cd4f444fea0810e23a6d3
|
|
BLAKE2b-256 checksum How to use checksums |
d2ce1b9c43517977f61760ada792037876ee9dc9606fb10888e98ca6ee7f022d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 12, 2026.
Transparency logRelease files / taylorize-0.0.2-py3-none-any.whl
| Download URL | taylorize-0.0.2-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8526acbe4a61388932bcfee44a3dfdcbf8dd9fb6a89626e9260fd749f1710c7
|
|
BLAKE2b-256 checksum How to use checksums |
2e7f758c0c27cc67e8134e2e0a0e70978083940d785a854cfd5bedf7b94c78b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 12, 2026.
Transparency logSecurity for taylorize 0.0.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for taylorize-0.0.2.tar.gz
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 Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.