# Geodesic¶

This module defines a base Geodesic class, and then extends it to define Time-like and Null-like Geodesics.

class einsteinpy.geodesic.geodesic.Geodesic(metric, metric_params, position, momentum, time_like=True, return_cartesian=True, **kwargs)[source]

Bases: object

Base Class for defining Geodesics Working in Geometrized Units (M-Units), with $$c = G = M = k_e = 1$$

Constructor

Parameters
• metric (str) – Name of the metric. 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

• position (array_like) – 3-Position 4-Position is initialized by taking t = 0.0

• momentum (array_like) – 3-Momentum 4-Momentum is calculated automatically, considering the value of time_like

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

• return_cartesian (bool, optional) – Whether to return calculated positions in Cartesian Coordinates This only affects the coordinates. Momenta are dimensionless quantities, and are returned in Spherical Polar Coordinates. Defaults to True

• kwargs (dict) – Keyword parameters for the Geodesic Integrator See ‘Other Parameters’ below.

Other Parameters
• 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

property trajectory

Returns the trajectory of the test particle

calculate_trajectory(**kwargs)[source]

Calculate trajectory in spacetime

Parameters

kwargs (dict) – Keyword parameters for the Geodesic Integrator See ‘Other Parameters’ below.

Returns

• ~numpy.ndarray – N-element numpy array, containing step count

• ~numpy.ndarray – Shape-(N, 8) numpy array, containing (4-Position, 4-Momentum) for each step

Other Parameters
• 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

class einsteinpy.geodesic.geodesic.Nulllike(metric, metric_params, position, momentum, return_cartesian=True, **kwargs)[source]

Class for defining Null-like Geodesics

Constructor

Parameters
• metric (str) – Name of the metric. 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

• position (array_like) – 3-Position 4-Position is initialized by taking t = 0.0

• momentum (array_like) – 3-Momentum 4-Momentum is calculated automatically, considering the value of time_like

• return_cartesian (bool, optional) – Whether to return calculated positions in Cartesian Coordinates This only affects the coordinates. The momenta dimensionless quantities, and are returned in Spherical Polar Coordinates. Defaults to True

• kwargs (dict) – Keyword parameters for the Geodesic Integrator See ‘Other Parameters’ below.

Other Parameters
• 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

class einsteinpy.geodesic.geodesic.Timelike(metric, metric_params, position, momentum, return_cartesian=True, **kwargs)[source]

Class for defining Time-like Geodesics

Constructor

Parameters
• metric (str) – Name of the metric. 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

• position (array_like) – 3-Position 4-Position is initialized by taking t = 0.0

• momentum (array_like) – 3-Momentum 4-Momentum is calculated automatically, considering the value of time_like

• return_cartesian (bool, optional) – Whether to return calculated positions in Cartesian Coordinates This only affects the coordinates. The momenta dimensionless quantities, and are returned in Spherical Polar Coordinates. Defaults to True

• kwargs (dict) – Keyword parameters for the Geodesic Integrator See ‘Other Parameters’ below.

Other Parameters
• 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