Heyoka.py Versions Save

Python library for ODE integration via Taylor's method and LLVM

v4.0.0

1 month ago

Breaking changes

Version 4 of heyoka.py introduces several backwards-incompatible changes, most of which have been prompted by user feedback. The updated heyoka.py API should be more streamlined, easier to use and more difficult to misuse.

The detailed list of breaking changes is available at the following page, along with instructions on how to update your code for the API modifications:

https://bluescarni.github.io/heyoka.py/breaking_changes.html#bchanges-4-0-0

If you have questions, please do not hesitate to ask.

Parallel compiled functions

The compiled function class cfunc has gained the ability to parallelise batch evaluations via multithreading. The tutorial has been updated accordingly:

https://bluescarni.github.io/heyoka.py/notebooks/compiled_functions.html

Support for Lagrangian and Hamiltonian mechanics

heyoka.py is now able to automatically generate (and solve) the equations of motion from user-supplied Lagrangians and Hamiltonians. Here is a tutorial illustrating this new feature:

https://bluescarni.github.io/heyoka.py/notebooks/lagrangian.html#lagham-tut

Enhancements to the step callback API

It is now possible to pass a list of step callbacks as an optional argument to the propagate_*() functions. The callbacks will be automatically composed into a callback set and they will be executed at the end of each integration step.

Performance improvements

The substitution primitive subs() has been substantially sped up. The compilation time of compiled functions has also been improved.

New example/tutorial

A tutorial on gravity gradient stabilisation has been added:

https://bluescarni.github.io/heyoka.py/notebooks/gg_stab.html

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

v3.2.0

4 months ago

This new release of heyoka.py comes packed with several new features and enhancements.

New AI/ML examples

Thanks to great work by @Sceki and @darioizzo, two new examples have been added to the documentation. The first one explains how to interface pytorch and heyoka.py:

https://bluescarni.github.io/heyoka.py/notebooks/torch_and_heyoka.html

The second one presents an innovative, differentiable model for the Earth's atmospheric density implemented via a neural network:

https://bluescarni.github.io/heyoka.py/notebooks/differentiable_atmosphere.html

Support for single-precision computations

In addition to extended and arbitrary precision computations, heyoka.py now supports also single-precision computations via the NumPy float32 type. Single-precision computations can lead to substantial performance benefits, especially in batch mode and/or low-accuracy applications. See the single-precision tutorial for a usage example.

ELP2000 model

heyoka.py now includes an implementation of the ELP2000 lunar theory. It is thus now possible to formulate systems of differential equations with the time-dependent geocentric lunar position appearing in the right-hand side. See the tutorial for an introduction.

Low-precision vector math

When the fast_math option is active, heyoka.py now employs lower-precision vector implementations of elementary functions, which can lead to substantial speedups in low-accuracy applications. The speedup is particularly visible when using single precision in AI and ML applications.

Miscellanea

  • manylinux wheels for Python 3.12 have been added
  • Fix wrong truncation to double precision in the dtime setter for the scalar integrator

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

v3.1.0

5 months ago

This new release of heyoka.py comes packed with several new features and enhancements.

Neural networks

It is now possible to create feed-forward neural networks in the expression system, and use them in the definition of ODEs. See the machine learning section in the documentation for more information and examples.

Complementary to the introduction of neural networks is the addition of the (leaky) ReLU and its derivative to the expression system.

New anomalies

The eccentric longitude F and the delta eccentric anomaly DE have been added to the expression system. These transcendental functions are used in celestial mechanics and astrodynamics to implement Lagrangian propagation and in the definition of equinoctial orbital elements.

Thanks to the introduction of the eccentric longitude F, the analytical ephemeris VSOP2013 should now be more numerically stable for orbits with low eccentricity/inclination.

Performance improvements

Several operations involving the manipulation and differentiation of large symbolic expressions are now substantially faster, often by more than an order of magnitude.

Other

  • New example notebook on the continuation of periodic orbits in the CR3BP.
  • New example notebook implementing Lagrange propagation.

Fixes

  • Improve the behaviour of the in-memory cache.
  • Improve the numerical stability of the Kepler solvers.
  • Fix slow performance when creating very large compiled functions.
  • Fix building against Python 3.12

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

v3.0.0

6 months ago

NOTE: despite the major version bump, there are no public API changes with respect to heyoka.py 2.0.0.

This is a maintenance release which brings heyoka.py in sync with version 3.0.0 of the heyoka C++ library. There are no API changes or new functionality with respect to heyoka.py 3.0.0 (apart from the fact that heyoka.py 3.0.0 inherits bugfixes from version 3.0.0 of the heyoka C++ library).

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

The changelog of the heyoka C++ library is available here:

https://bluescarni.github.io/heyoka/changelog.html

v2.0.0

7 months ago

NOTE: the major version number has been bumped from 1 to 2 because heyoka.py now requires version 2.0.0 of the heyoka library. However, there are no public API changes with respect to heyoka.py 1.0.0.

This new release of heyoka.py focuses on several LLVM-related improvements fixes.

In-memory cache

heyoka.py now features an in-memory cache which avoids re-optimisation and re-compilation of code that was already optimised and compiled during program execution. See this tutorial for a detailed explanation and a couple of examples where this new feature leads to noticeable speedups.

Support for the SLP vectoriser

heyoka.py can now optionally take advantage of the LLVM SLP vectoriser. The vectoriser can be enabled via the boolean keyword argument slp_vectorize (False by default), which can be passed to any heyoka.py function/class that uses JIT compilation (e.g., the Taylor adaptive integrators).

Although the SLP vectoriser can lead to noticeable speedups in the performance of JIT-compiled code, it is disabled by default because it can considerably increase the cost of JIT compilation.

Automatic vectorisation of math functions

On recent LLVM versions, heyoka.py has gained the ability to automatically vectorise scalar calls to math functions. This includes not only math functions implemented as LLVM builtins (e.g., sqrt, sin/cos, etc.), but also external math functions from the C++ math library.

This feature is automatically enabled on recent LLVM versions when SLP vectorisation is turned on and if the heyoka library was built with support for the SLEEF library.

New CR3BP model

An implementation of the circular restricted three-body problem has been added to the model submodule. The new model provides the non-dimensional equations of motion and the formula for the Jacobi constant.

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

v1.0.0

8 months ago

Version 1.0.0 of heyoka.py is here, and it brings several new features and important changes.

Semantic versioning

Starting from this release, heyoka.py adopts the semantic versioning numbering scheme. In particular:

  • the MAJOR version will be increased in case of backwards-incompatible changes in the public API,
  • the MINOR version will be increased in case of backwards-compatible additions to the public API,
  • the PATCH version will be increased in case of backwards-compatible bugfixes.

Note that, due to the lack of API docs at the present time, heyoka.py's public API is somewhat fuzzily defined by the C++ and Python tutorials.

Overhaul of the expression system

The biggest user-facing change in this release is a comprehensive internal overhaul of the expression system, including:

  • the removal of several ad-hoc primitives with somewhat redundant functionality (e.g., square(), sqrt(), sum_sq(), etc.);
  • the implementation of several automated simplifications/normalisations, mostly inspired by the behaviour of SymPy;
  • the re-implementation of sums and products as multivariate functions.

Users are encouraged to read this tutorial in order to understand how to best take advantage of the revamped expression system.

New API to compute high-order derivatives

A new function called diff_tensors() is available to compute efficiently high-order derivative tensors. Please see this tutorial for an introduction to this new feature.

Improvements to step callbacks

Step callbacks can now optionally implement a pre_hook() method that will be invoked once before the first step in a time-limited propagation is performed. This feature can be useful to implement an init/setup phase in the callback before the numerical integration starts. The tutorial has been updated to include this new feature.

Additionally, in multi-threaded ensemble propagations the step callback is now copied for each iteration of the ensemble, rather than being shared among all the iterations. This behaviour should reduce the risk of data races.

New model submodule

A new model submodule has been introduced, which includes functions to generate the dynamics for several commonly-used dynamical models (e.g., pendulum, N-body, etc.). The make_nbody_sys() helper has been replaced by an equivalent function in the model submodule. More models are planned to be added in the near future.

Miscellanea

  • Substitution of generic subexpressions has been implemented;
  • the screen output of expressions is now truncated for very large expressions;
  • several other quality-of-life improvements.

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

v0.21.8

9 months ago

This is a bugfix release that fixes building against NumPy 1.25.

v0.21.7

1 year ago

This latest release of heyoka.py adds prebuilt pip packages for linux. Additionally, time-dependent functions can now be compiled.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka.py/changelog.html

v0.21.6

1 year ago

v0.21.5

1 year ago