Spacetimes

The spacetimes are represented by types that contain the information needed to compute geodesics and other geometric properties. Most spacetimes have parameters, such as mass and spin, that are set at construction time. The core function defining the spacetimes is metric, which returns the metric tensor at a given position in the spacetime. Additionally, metric_inverse returns the inverse metric tensor, volume_element returns the volume element, and christoffel returns the Christoffel symbols. Other functions are available to compute the radius of a position, the event horizon radius, the innermost stable circular orbit (ISCO) radius, the marginally bound circular orbit (MBCO) radius, and the circular geodesic angular speed, when applicable. See the API for more details.

Examples

The following code snippet demonstrates how to compute the metric tensor and the Christoffel symbols at a given position in the Schwarzschild spacetime in spherical coordinates:

using Skylight

# Define the Schwarzschild spacetime with mass M = 1
spacetime = SchwarzschildSpacetimeSphericalCoordinates(M=1.0)
position = [0.0, 4.0, π/2, 0.0]  #t=0.0, r = 4.0, θ = π/2, φ = 0.0
g = metric(position, spacetime)
Γ = christoffel(position, spacetime)

The example uses the metric and christoffel functions, which allocate the output arrays each time they are called. For performance-critical applications, especially within tight loops, use the non-allocating methods metric! and christoffel!. These methods use preallocated arrays and auxiliary caches to store results and intermediate variables. The caches can be constructed with allocate_cache and allocate_christoffel_cache, respectively.

g = zeros(4, 4)
cache = allocate_cache(spacetime)
metric!(g, position, spacetime, cache)
Γ = zeros(4, 4, 4)
christoffel_cache = allocate_christoffel_cache(spacetime)
christoffel!(Γ, position, spacetime, christoffel_cache)

For simpler spacetimes that do not require caches, the cache constructors return nothing, and the cache argument can be omitted in the non-allocating methods. These methods are more efficient than their allocating counterparts as they avoid cretaing an array for the output.

metric!(g, position, spacetime)
christoffel!(Γ, position, spacetime)

Catalogue

Below are the currently implemented spacetimes:

Minkowski spacetime

Schwarzschild spacetime

Skylight.SchwarzschildSpacetimeKerrSchildCoordinatesType
SchwarzschildSpacetimeKerrSchildCoordinates <: AbstractSchwarzschildSpacetime

Schwarzschild spacetime in Kerr-Schild coordinates. The parameter $M$ is the mass. The metric is

$g_{\mu \nu} = \eta_{\mu \nu} + H l_{\mu} l_{\nu}$

where $\eta_{\mu \nu}$ is the flat metric, $H=2M/r$, and $l_{\mu}=(1,x,y,z)/r$.

Constructor

SchwarzschildSpacetimeKerrSchildCoordinates(M=1.0)
source

Kerr spacetime

Skylight.KerrSpacetimeKerrSchildCoordinatesType
KerrSpacetimeKerrSchildCoordinates <: AbstractKerrSpacetime

Kerr spacetime in Kerr-Schild coordinates. The parameter are the mass $M$ and the dimensionless spin $a$. The metric is

$g_{\mu \nu} = \eta_{\mu \nu} + H l_{\mu} l_{\nu}$

where $\eta_{\mu \nu}$ is the flat metric, $H=2Mr^3/(r^4+a^2 z^2$, and

$l_{\mu}=(1,\frac{rx+ay}{r^2+a^2},\frac{ry-ax}{r^2+a^2},z/r)$

where $r$ satisfies the equation

$\frac{x^2+y^2}{r^2+a^2} + \frac{z^2}{r^2} = 1$

Constructor

KerrSpacetimeKerrSchildCoordinates(M=1.0, a=0.99)
source

Johannsen spacetime

Skylight.JohannsenSpacetimeType
JohannsenSpacetime <: AbstractBlackHoleSpacetime

Johannsen spacetime to lowest order in the deformation parameters with respect to the Kerr metric

Constructor

JohannsenSpacetime(M=1.0, a=0.99, α13=0.5, α22=0.0, α52=0.01, ϵ3=0.0)
source

f(R)-Kerr spacetime

Charged wormhole spacetime

RAR spacetime

Skylight.RARSpacetimeType
RARSpacetime <: AbstractRegularCompactObjectSpacetime

Spacetimes for Ruffini-Arguelles-Rueda dark matter distributions. The spacetime is constructed by interpolating given data files. The numerical data must include the $g_{tt}$, $g_{rr}$, $\partial_r \nu$, $M(r)$ and $\partial_r M$ as two-column ($r$-value) files named gtt.txt, grr.txt, dnu.txt, M.txt and dM.txt, respectively. Here $\nu = \log(-g_{tt})$, notice that $d\nu/dr$ can be extracted directly from the right-hand side of the RAR equilibrium equations, to avoid unnecessary numerical errors.

The data must be in geometrized units.

Constructor

RARSpacetime("./rar_data")
source

Boson star spacetime

Skylight.BosonStarSpacetimeType
BosonStarSpacetime <: AbstractRegularCompactObjectSpacetime

Boson star spacetime in spherical coordinates. It uses analyical fits. Either the fit parameters can be provided as vectors, or any of the symbols :LBS1, :LBS2, :LBS3, :SBS1, :SBS2 or :SBS3 as constructor arguments

Constructors

BosonStarSpacetime(a=aparams, b=bparams) 
BosonStarSpacetime(:LBS1)
source

Coordinates topology

The spacetimes in Skylight.jl are defined in various coordinate systems. Most coordinates used in practice have either Cartesian or spherical topology. For instance, Boyer-Lindquist coordinates for Kerr spacetime have spherical topology, whereas Kerr-Schild coordinates have Cartesian topology. The coordinates_topology function returns the topology of spacetime's coordinates. The following coordinate topologies are currently supported:

Abstract types

The spacetimes in Skylight.jl are organized in a hierarchy of types leveraging Julia's type system and multiple dispatch to define common behaviors. All Skylight.jl spacetimes are subtypes of the abstract type AbstractSpacetime. For example, AbstractBlackHoleSpacetime is a subtype of AbstractSpacetime and is used to define spacetimes with an event horizon. This common feature among all black hole spacetimes is used, for example, to define a common callback for all of them which prevents geodesic integration getting too close to the event horizon, thus avoiding numerical instabilities. AbstractKerrSpacetime is a subtype of AbstractBlackHoleSpacetime and represents a Kerr spacetime, with various concrete Kerr spacetimes in different coordinate systems as subtypes. The following are the abstract spacetime types defined in Skylight.jl: