ad 1.3.2
Fast, transparent first and secondorder automatic differentiation
Overview
The ad package allows you to easily and transparently perform first and secondorder automatic differentiation. Advanced math involving trigonometric, logarithmic, hyperbolic, etc. functions can also be evaluated directly using the admath submodule.
All base numeric types are supported (int, float, complex, etc.). This package is designed so that the underlying numeric types will interact with each other as they normally do when performing any calculations. Thus, this package acts more like a “wrapper” that simply helps keep track of derivatives while maintaining the original functionality of the numeric calculations.
From the Wikipedia entry on Automatic differentiation (AD):
“AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives of arbitrary order can be computed automatically, and accurate to working precision.”
See the package documentation for details and examples.
Main Features
 Transparent calculations with derivatives: no or little modification of existing code is needed, including when using the Numpy module.
 Almost all mathematical operations are supported, including functions from the standard math module (sin, cos, exp, erf, etc.) and cmath module (phase, polar, etc.) with additional convenience trigonometric, hyperbolic, and logarithmic functions (csc, acoth, ln, etc.). Comparison operators follow the same rules as the underlying numeric types.
 Real and complex arithmetic handled seamlessly. Treat objects as you normally would using the math and cmath functions, but with their new admath counterparts.
 Automatic gradient and hessian function generator for optimization studies using scipy.optimize routines with gh(your_func_here).
 Compatible Linear Algebra Routines in the ad.linalg submodule,
similar to those found in NumPy’s linalg submodule, that are not
dependent on LAPACK. There are currently:
 Decompositions
 chol: Cholesky Decomposition
 lu: LU Decomposition
 qr: QR Decomposition
 Solving equations and inverting matrices
 solve: General solver for linear systems of equations
 lstsq: Leastsquares solver for linear systems of equations
 inv: Solve for the (multiplicative) inverse of a matrix
 Decompositions
Installation
You have several easy, convenient options to install the ad package (administrative privileges may be required):
 Download the package files below, unzip to any directory, and run python setup.py install from the commandline.
 Simply copy the unzipped adXYZ directory to any other location that python can find it and rename it ad.
 If setuptools is installed, run easy_install upgrade ad from the commandline.
 If pip is installed, run pip install upgrade ad from the commandline.
 Download the bleedingedge version on GitHub
Contact
Please send feature requests, bug reports, or feedback to Abraham Lee.
Acknowledgements
The author expresses his thanks to :
 Eric O. LEBIGOT (EOL), author of the uncertainties package, for providing code insight and inspiration
 Stephen Marks, professor at Pomona College, for useful feedback concerning the interface with optimization routines in scipy.optimize.
 Wendell Smith, for updating testing functionality and numerous other useful function updates
 Jonathan Terhorst, for catching a bug that made derivatives of logarithmic functions (base != e) give the wrong answers.
 GitHub user fhgd for catching a miscalculation in admath.atan2
File  Type  Py Version  Uploaded on  Size  

ad1.3.2.zip (md5)  Source  20150820  26KB  
 Downloads (All Versions):
 34 downloads in the last day
 354 downloads in the last week
 1863 downloads in the last month
 Author: Abraham Lee
 Documentation: ad package documentation
 Home Page: http://pythonhosted.org/ad
 Keywords: automatic differentiation,first order,second order,derivative,algorithmic differentiation,computational differentiation,optimization,linear algebra
 License: BSD License

Categories
 Development Status :: 5  Production/Stable
 Intended Audience :: Education
 Intended Audience :: Science/Research
 License :: OSI Approved :: BSD License
 Operating System :: OS Independent
 Programming Language :: Python
 Programming Language :: Python :: 2.6
 Programming Language :: Python :: 2.7
 Programming Language :: Python :: 3.0
 Programming Language :: Python :: 3.1
 Programming Language :: Python :: 3.2
 Programming Language :: Python :: 3.3
 Topic :: Education
 Topic :: Scientific/Engineering
 Topic :: Scientific/Engineering :: Mathematics
 Topic :: Scientific/Engineering :: Physics
 Topic :: Software Development
 Topic :: Software Development :: Libraries
 Topic :: Software Development :: Libraries :: Python Modules
 Topic :: Utilities
 Package Index Owner: tisimst.myopenid.com
 DOAP record: ad1.3.2.xml