Skip to main content

Python

XAD is a library designed for automatic differentiation, aimed at both beginners and advanced users. It is intended for use in production environments, emphasizing performance and ease of use. The library facilitates the computation of derivatives within computer programs, making the process efficient and straightforward for a wide range of mathematical functions, from simple arithmetic to complex calculations, ensuring accurate and automatic derivative computations.

The Python bindings for XAD offer the following features:

  • Support for both forward and adjoint modes at the first order.
  • Strong exception-safety guarantees.
  • High performance, as demonstrated in extensive production use.

For more details and to integrate XAD into your projects, consult the comprehensive documentation.

Application Areas

Automatic differentiation has many application areas, for example:

  • Machine Learning and Deep Learning: Training neural networks or other machine learning models.
  • Optimization: Solving optimization problems in engineering and finance.
  • Numerical Analysis: Enhancing numerical solution methods for differential equations.
  • Scientific Computing: Simulating physical systems and processes.
  • Risk Management and Quantitative Finance: Assessing and hedging risk in financial models.
  • Computer Graphics: Optimizing rendering algorithms.
  • Robotics: Improving control and simulation of robotic systems.
  • Meteorology: Enhancing weather prediction models.
  • Biotechnology: Modeling biological processes and systems.

Getting Started

Install:

pip install xad

Calculate first-order derivatives in adjoint mode:

import xad.adj_1st as xadj


# set independent variables
x0_ad = xadj.Real(1.0)
x1_ad = xadj.Real(1.5)
x2_ad = xadj.Real(1.3)
x3_ad = xadj.Real(1.2)

with xadj.Tape() as tape:
    # and register them
    tape.registerInput(x0_ad)
    tape.registerInput(x1_ad)
    tape.registerInput(x2_ad)
    tape.registerInput(x3_ad)

    # start recording derivatives
    tape.newRecording()

    # calculate the output
    y = x0_ad + x1_ad - x2_ad * x3_ad

    # register and seed adjoint of output
    tape.registerOutput(y)
    y.derivative = 1.0

    # compute all other adjoints
    tape.computeAdjoints()

    # output results
    print(f"y = {y}")
    print(f"first order derivatives:\n")
    print(f"dy/dx0 = {x0_ad.derivative}")
    print(f"dy/dx1 = {x1_ad.derivative}")
    print(f"dy/dx2 = {x2_ad.derivative}")
    print(f"dy/dx3 = {x3_ad.derivative}")

For more information, see the Documentation.

  • XAD Comprehensive automatic differentiation in Python and C++
  • QuantLib-Risks: Fast risk evaluations in Python and C++

Release files for xad 1.5.2

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

Built distributions (wheels)

Table of built distributions (wheels) for xad 1.5.2
File
xad-1.5.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
xad-1.5.2-cp312-cp312-musllinux_1_1_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.1+ x86-64 Details
xad-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
xad-1.5.2-cp312-cp312-macosx_12_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 12.0+ x86-64 Details
xad-1.5.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
xad-1.5.2-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details
xad-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
xad-1.5.2-cp311-cp311-macosx_12_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 12.0+ x86-64 Details
xad-1.5.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
xad-1.5.2-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details
xad-1.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
xad-1.5.2-cp310-cp310-macosx_12_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 12.0+ x86-64 Details
xad-1.5.2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
xad-1.5.2-cp39-cp39-musllinux_1_1_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.1+ x86-64 Details
xad-1.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
xad-1.5.2-cp39-cp39-macosx_12_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 12.0+ x86-64 Details
xad-1.5.2-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
xad-1.5.2-cp38-cp38-musllinux_1_1_x86_64.whl CPython 3.8 CPython 3.8 Linux musl 1.1+ x86-64 Details
xad-1.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 8.0 MB

Release files / xad-1.5.2-cp312-cp312-win_amd64.whl

Download URL xad-1.5.2-cp312-cp312-win_amd64.whl
Size 370.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
216f945ad5449bbb3d9fd5ca4accbf85f6bf478a77be9658794f060fa7aa7ff9
BLAKE2b-256 checksum
How to use checksums
d3a8c2fae2245cb4fe77f6b73e92e5187a20db93a01c0fbaee3df4b043e4e334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp312-cp312-musllinux_1_1_x86_64.whl

Download URL xad-1.5.2-cp312-cp312-musllinux_1_1_x86_64.whl
Size 793.6 kB
Tags CPython 3.12 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
9a53f53dddd0d14295d19179f430caaa850eaca4e04d36e988f2699fc06250a2
BLAKE2b-256 checksum
How to use checksums
6814db8796d22aca64e5c29004d24f8ea59ff4be6278ea185be394c5a0731052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xad-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 268.9 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1aae7c74644142e6b5aa0b8b1f5bf7144a88b01d123fd3757708f3de9b8aded7
BLAKE2b-256 checksum
How to use checksums
ec674c179880f1a45e6eb5be5ccc63217b0a41f4391c4dd2c6f621dbdec5d91f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp312-cp312-macosx_12_0_x86_64.whl

Download URL xad-1.5.2-cp312-cp312-macosx_12_0_x86_64.whl
Size 234.2 kB
Tags CPython 3.12 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
f785b1ca120980871e2779ecaf88c63e2d5b4744f4d51a970c5bcfb493427feb
BLAKE2b-256 checksum
How to use checksums
68a77af209897be34d3293724296ed6def6643b055fee8a801a51d03e74d391a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp311-cp311-win_amd64.whl

Download URL xad-1.5.2-cp311-cp311-win_amd64.whl
Size 371.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a0c3abfaf0ea3a26edf74a9bcd8602f39dbdd4be055861558d866e62742cd9d3
BLAKE2b-256 checksum
How to use checksums
54cf78867743d0cfb78b163c9c6615d3f3b83e5385c5c7da4fd233d14919410d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL xad-1.5.2-cp311-cp311-musllinux_1_1_x86_64.whl
Size 790.5 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
c167c24b8f549b6ca070b6b9cfe6bf95484bd2e90690d97ff45f737fb93752b8
BLAKE2b-256 checksum
How to use checksums
88a77dfb356e01806160714d9780d1cf30a371131a2ce990c00c1d420842c3bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xad-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 266.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b59aa97b907b92c42feb2aa5fd1a33a05ada12abd548e94627a281058c002f1c
BLAKE2b-256 checksum
How to use checksums
c7ff5f09ebd40cd2e9f4e21849fd5462a4898900af020be2a751887a0fedfeee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp311-cp311-macosx_12_0_x86_64.whl

Download URL xad-1.5.2-cp311-cp311-macosx_12_0_x86_64.whl
Size 222.8 kB
Tags CPython 3.11 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
f609ec12a59f3edd1785ebf8e570f6f5c2650cc8206e02037e0586a288f835fe
BLAKE2b-256 checksum
How to use checksums
f6fde1de4348bcbfa6927fc2da00a8f4b03887d97c90f71aa5c56c382fd4051d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp310-cp310-win_amd64.whl

Download URL xad-1.5.2-cp310-cp310-win_amd64.whl
Size 369.6 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1335fb82f769b3fd2c4ff3dcd8e4baa816c3b691df10fcc677d14e2a23b187a4
BLAKE2b-256 checksum
How to use checksums
bf243379c5cfd288a77da9a35c6a8fb27002348bee61c5e453aa20d99ab7169a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL xad-1.5.2-cp310-cp310-musllinux_1_1_x86_64.whl
Size 789.4 kB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
6f6eda6f79d263147781507e10b54e27a15e30683a6d7ec8ccaf9409a58effab
BLAKE2b-256 checksum
How to use checksums
9fad5a5931bd51ad46c5182bdd70c87539588a6371ec8a693628e1c22ecf22ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xad-1.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 264.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b8c77fcec1ca9dc1d34900aa703fa05dd779feb10cb1f23643bc4d910d52c58f
BLAKE2b-256 checksum
How to use checksums
39b5fd6e514dd120319da762709aeb10cf09ce22d9218415ce5fea37b068e6da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp310-cp310-macosx_12_0_x86_64.whl

Download URL xad-1.5.2-cp310-cp310-macosx_12_0_x86_64.whl
Size 221.3 kB
Tags CPython 3.10 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
bccf6a13780632033b291598d3d52e05dba11ebca373b7dfcfc13cd9926b974f
BLAKE2b-256 checksum
How to use checksums
6cb9be1dc3fda0810dddca34d5ae797375604638171eb2ab01b29ff6654f2f0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp39-cp39-win_amd64.whl

Download URL xad-1.5.2-cp39-cp39-win_amd64.whl
Size 354.3 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
beaad7338325d2c1caad6752e14ce20f10c3c4ab715f4c8d48c2e9492e9e0473
BLAKE2b-256 checksum
How to use checksums
28bf71ca2a73f4550cbee80073fc8a58fce93ccef2b09870593c5dbd949a074b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp39-cp39-musllinux_1_1_x86_64.whl

Download URL xad-1.5.2-cp39-cp39-musllinux_1_1_x86_64.whl
Size 788.9 kB
Tags CPython 3.9 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
3cccd0478dabdc81a2cb7fece892e0195d4e0f11958e45bb79bffc4d21e5a14a
BLAKE2b-256 checksum
How to use checksums
8e773a01fcfa7d73d1cbdc5a22015b7d1853346b9506ba218df75e14ba02e957
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xad-1.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 264.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3d900d14f5c9cc06300c7696eccd71f4f4d650f2393899a7391de8366e3fe33f
BLAKE2b-256 checksum
How to use checksums
8c21e722e2e3c7aaebac30879e4e59b01cad1cf1486bf5781a7f1b1698cfa4ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp39-cp39-macosx_12_0_x86_64.whl

Download URL xad-1.5.2-cp39-cp39-macosx_12_0_x86_64.whl
Size 221.4 kB
Tags CPython 3.9 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
1d35dcf0dce9dab1c294e1364e07d32ead1d01ddff5dfc952e90a133691326a5
BLAKE2b-256 checksum
How to use checksums
e26edafaeacf4971fdca43e49fe562c4b3cbcd94fa26910493b819c69831651c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp38-cp38-win_amd64.whl

Download URL xad-1.5.2-cp38-cp38-win_amd64.whl
Size 369.6 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
8f43b75fba4b48f7204fbab60ce1957203f5188e330f6e4ea9cb374dd25d30f3
BLAKE2b-256 checksum
How to use checksums
8b2033d1e048cf94fc67d1f23e629b0d6fc25c5710e6a72d0ffc54b8ede4420a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp38-cp38-musllinux_1_1_x86_64.whl

Download URL xad-1.5.2-cp38-cp38-musllinux_1_1_x86_64.whl
Size 788.9 kB
Tags CPython 3.8 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
00a8f5ac391850879c68de4f3063cbf5f47f4f60395f6c9193ef14010592ab95
BLAKE2b-256 checksum
How to use checksums
a7f3a3e22ee4ac22fdbf5001b5731e3bf81bf4ab5b73cad3e2fed06c7312ce06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / xad-1.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xad-1.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 264.2 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7610f6b778585061dc7f88b086ec3e1d52369c8605b3043565230937415a29b3
BLAKE2b-256 checksum
How to use checksums
9f69fe3ac62354618f95b681ec47295cd477f002e898765d77c5b8963f606f3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.5.2 This release

19 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