Metrics API
Overview
The metrics module provides implementations of various spacetime metrics used in general relativity research.
Available Metrics
get_alcubierre_metric
Creates an Alcubierre warp drive spacetime metric.
Parameters:
grid_size(Tuple[int, int, int, int]): Grid dimensions (t, x, y, z)world_center(Tuple[float, float, float, float]): Center coordinatesv(float): Warp bubble velocity (in units of c)R(float): Bubble radiussigma(float): Bubble wall thickness parameterdevice(torch.device): Target device (cuda/cpu)
Returns:
Metric: Object containing metric tensor and derivatives
Example:
from core.metrics.alcubierre import get_alcubierre_metric
metric = get_alcubierre_metric(
grid_size=(1, 64, 64, 64),
world_center=(0.0, 16.0, 16.0, 16.0),
v=1.5,
R=6.0,
sigma=4.0,
device=torch.device("cuda")
)
get_lentz_metric
Creates a Lentz positive energy soliton metric.
Parameters:
grid_size(Tuple[int, int, int, int]): Grid dimensionsv(float): Soliton velocityR(float): Soliton radiusdevice(torch.device): Target device
Returns:
Metric: Lentz spacetime metric object
get_schwarzschild_metric
Creates a Schwarzschild black hole metric.
Parameters:
grid_size(Tuple[int, int, int, int]): Grid dimensionsM(float): Black hole massdevice(torch.device): Target device
Returns:
Metric: Schwarzschild metric object
get_vandenbroeck_metric
Creates a Van Den Broeck modified micro-bubble metric.
Parameters:
grid_size(Tuple[int, int, int, int]): Grid dimensionsv(float): Bubble velocityR(float): Bubble radiusdevice(torch.device): Target device
Returns:
Metric: Van Den Broeck metric object
Metric Object
All metric functions return a Metric object containing:
g_uv(torch.Tensor): Metric tensor (4×4×grid_size)derivatives: Dict of first and second derivativescoordinates: Coordinate grid arraysparameters: Original simulation parametersdevice(torch.device): Computation device