This module uses Forward Mode Automatic Differentiation to calculate metric derivatives. Currently, integrators of orders 2, 4, 6 and 8 have been implemented.

class einsteinpy.integrators.fantasy.GeodesicIntegrator(metric, metric_params, q0, p0, time_like=True, steps=100, delta=0.5, rtol=0.01, atol=0.01, order=2, omega=1.0, suppress_warnings=False)[source]

Bases: object

Geodesic Integrator, based on [1]. This module uses Forward Mode Automatic Differentiation to calculate metric derivatives to machine precision leading to stable simulations.



  • metric (callable) – Metric Function. Currently, these metrics are supported: 1. Schwarzschild 2. Kerr 3. KerrNewman

  • metric_params (array_like) – Tuple of parameters to pass to the metric E.g., (a,) for Kerr

  • q0 (array_like) – Initial 4-Position

  • p0 (array_like) – Initial 4-Momentum

  • time_like (bool, optional) – Determines type of Geodesic True for Time-like geodesics False for Null-like geodesics Defaults to True

  • steps (int) – Number of integration steps Defaults to 50

  • delta (float) – Initial integration step-size Defaults to 0.5

  • rtol (float) – Relative Tolerance Defaults to 1e-2

  • atol (float) – Absolute Tolerance Defaults to 1e-2

  • order (int) – Integration Order Defaults to 2

  • omega (float) – Coupling between Hamiltonian Flows Smaller values imply smaller integration error, but too small values can make the equation of motion non-integrable. For non-capture trajectories, omega = 1.0 is recommended. For trajectories, that either lead to a capture or a grazing geodesic, a decreased value of 0.01 or less is recommended. Defaults to 1.0

  • suppress_warnings (bool) – Whether to suppress warnings during simulation Warnings are shown for every step, where numerical errors exceed specified tolerance (controlled by rtol and atol) Defaults to False


NotImplementedError – If order is not in [2, 4, 6, 8]


Advances integration by one step