Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

ADPY is a Python library for algorithmic differentiation

Project Description


ADPY is a Python library for algorithmic differentiation (
It aims to provide an easy way to extract partial derivatives of vector valued function (Jacobian matrix). In addition it allows to created callable function for obtaining function values using computational graphs.


* optimize numerical evaluation by using computational graph
* create callable function from Sympy expressions (calls lambdify once and creates a computational graph)
* extract partial derivatives using forward or reverse algorithmic differentiation
* bonus: a small nonlinear solver using all advantages mentioned above

##How to use

Due the small amount of features the handling is quite easy.

For the easiest use you need a callable function which takes a list of float numbers and returns a list.

def f(x):
return [x[0]**2,2*x[1]]

You need a valid values for x which cause no singularities while evaluating the function.

x1 = [1.,2.]

Initialize the ADFUN object.

from ADPY import adfun
adpy_test = adfun(f,x1)

Now you have a callable function with computational graph optimization.

y1 = adpy_test(x1)

If you want to use derivatives just do




Now you can evaluate them using

J_forward = adpy_test.jac_reverse(x1)


J_forward = adpy_test.jac_forward(x1)

For more information see the attached examples.


clone git

git clone
and run

python install

or use easy_install

easy_install ADPY

##How it works

Without going in to detail. It uses an overloaded class "adfloat" to record a list of the mathematical operations required to obtain the result. This list is then translated in to python expressions and made executable. The list is also used to perform automatic differentiation.

##To do
* more testing
* add more operations
* maybe add Hessian matrix?
* add Taylor arithmetic?
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ADPY-0.12.alpha-py2.7.egg (23.2 kB) Copy SHA256 Checksum SHA256 2.7 Egg Nov 26, 2013
ADPY-0.12.alpha.tar.gz (8.2 kB) Copy SHA256 Checksum SHA256 Source Nov 26, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting