Skip to content

Repository files navigation

Part of the XAD ecosystem — the fastest automatic differentiation library for C++. If this is useful to you, please star the core XAD repository.

QuantLibAAD: Risk-enabled QuantLib for Python

Download source PyPI version


This repository builds QuantLib Python bindings with automatic differentiation, enabling fast risks calculation with QuantLib in Python. It wraps C++ QuantLibAAD in Python. It uses elements from QuantLib-SWIG and is kept in sync with it.

Getting Started

You can install it as:

pip install QuantLibAAD
import QuantLibAAD as ql

It links the XAD library that the xad package ships, so QuantLib and xad share one active tape per thread: a xad.adj_1st.Tape records QuantLib's calculations as well as your own.

Formerly QuantLib-Risks

This package was called QuantLib-Risks up to version 1.33.3. From 1.41, QuantLib-Risks is a deprecated alias that installs QuantLibAAD and keeps import QuantLib_Risks working with a DeprecationWarning. Please switch to pip install QuantLibAAD and import QuantLibAAD. Anyone pinned to QuantLib-Risks==1.33.3 must also pin xad<2.

Getting Help

For documentation and other resources, see https://auto-differentiation.github.io/quantlib-aad/python/ .

If you have found an issue, want to report a bug, or have a feature request, please raise a GitHub issue.

Related Projects

  • XAD Comprehensive automatic differentiation in Python and C++
  • QuantLibAAD: Fast risk evaluations in Python and C++

Contributing

Please read CONTRIBUTING for the process of contributing to this project. Please also obey our Code of Conduct in all communication.

Versioning

This repository follows the QuantLib versions closely. With each new QuantLib release, a new release of QuantLibAAD is prepared with the same version number.

License

This project is licensed under the GNU Affero General Public License - see the LICENSE.md file for details.

It contains code from QuantLib and QuantLib-SWIG, which are shipped with a different (compatible) license. Both licenses are included in LICENSE.md

Releases

Used by

Contributors

Languages