aurel.core

core.py

This module is the main event. It contains:
  • descriptions, a dictionary of all the variables used in the aurel project

  • AurelCore, the main class responsible for managing the AurelCore.data dictionary. For an input spacetime and matter distribution, AurelCore can automatically retrieve any relativistic variable listed in the descriptions dictionary. This class has many attributes and functions, a large part of which are listed in the descriptions dictionary, but also many other tensor calculus functions. The descriptions functions are called as:

    • AurelCore.variable_name() for the function itself

    • AurelCore.data[“variable_name”] for the dictionary element, which is the same as calling the function but then saves it in the AurelCore.data dictionary.

descriptions

Assumed quantities

If not defined, vacuum Minkowski is assumed for the definition of the following quantities:

alpha: \(\alpha = 1\), the lapse, to change this do AurelCore.data[“alpha”] = … before running calculations

dtalpha: \(\partial_t \alpha = 0\), the time derivative of the lapse

betax, betay, betaz: \(\beta^i = 0\), the shift vector with spatial indices up

dtbetax, dtbetay, dtbetaz: \(\partial_t \beta^i = 0\), the time derivative of the shift vector with spatial indices up

gxx, gxy, gxz, gyy, gyz, gzz: \(g_{ij} = \delta_{ij}\), the spatial components of the spacetime metric with indices down

kxx, kxy, kxz, kyy, kyz, kzz: \(K_{ij} = 0\), the spatial components of the extrinsic curvature with indices down

rho0: \(\rho_0 = 0\), the rest-mass energy density

press: \(p = 0\), the fluid pressure

eps: \(\epsilon = 0\), the fluid specific internal energy

w_lorentz: \(W = 1\), the Lorentz factor

velx, vely, velz: \(v^i = 0\), the Eulerian fluid three velocity with spatial indices up

Metric quantities

Lapse

alpha: \(\alpha\) Lapse. I assume \(\alpha=1\), if not then please define AurelCore.data[‘alpha’] = …

dtalpha: \(\partial_t \alpha\) Coordinate time derivative of the lapse. I assume \(\partial_t \alpha=0\), if not then please define AurelCore.data[‘dtalpha’] = …

DDalpha: D_iD_jalpha$ Spatial covariant second derivative of the lapse with spatial indices down

Shift

betax: \(\beta^{x}\) x component of the shift vector with indices up. I assume \(\beta^{x}=0\), if not then please define AurelCore.data[‘betax’] = …

betay: \(\beta^{y}\) y component of the shift vector with indices up. I assume \(\beta^{y}=0\), if not then please define AurelCore.data[‘betay’] = …

betaz: \(\beta^{z}\) z component of the shift vector with indices up. I assume \(\beta^{z}=0\), if not then please define AurelCore.data[‘betaz’] = …

betaup3: \(\beta^{i}\) Shift vector with spatial indices up

dtbetax: \(\partial_t\beta^{x}\) Coordinate time derivative of the x component of the shift vector with indices up. I assume \(\partial_t\beta^{x}=0\), if not then please define AurelCore.data[‘dtbetax’] = …

dtbetay: \(\partial_t\beta^{y}\) Coordinate time derivative of the y component of the shift vector with indices up. I assume \(\partial_t\beta^{y}=0\), if not then please define AurelCore.data[‘dtbetay’] = …

dtbetaz: \(\partial_t\beta^{z}\) Coordinate time derivative of the z component of the shift vector with indices up. I assume \(\partial_t\beta^{z}=0\), if not then please define AurelCore.data[‘dtbetaz’] = …

dtbetaup3: \(\partial_t\beta^{i}\) Coordinate time derivative of the shift vector with spatial indices up

betadown3: \(\beta_{i}\) Shift vector with spatial indices down

betamag: \(\beta_{i}\beta^{i}\) Magnitude of shift vector

Timelike normal vector

nup4: \(n^{\mu}\) Timelike vector normal to the spatial metric with spacetime indices up

ndown4: \(n_{\mu}\) Timelike vector normal to the spatial metric with spacetime indices down

Spatial metric

gtt: \(g_{tt}\) Metric with tt indices down.

gtx: \(g_{tx}\) Metric with tx indices down.

gty: \(g_{ty}\) Metric with ty indices down.

gtz: \(g_{tz}\) Metric with tz indices down.

gxx: \(g_{xx}\) Metric with xx indices down. I assume \(g_{xx}=1\), if not then please define AurelCore.data[‘gxx’] = …

gxy: \(g_{xy}\) Metric with xy indices down. I assume \(g_{xy}=0\), if not then please define AurelCore.data[‘gxy’] = …

gxz: \(g_{xz}\) Metric with xz indices down. I assume \(g_{xz}=0\), if not then please define AurelCore.data[‘gxz’] = …

gyy: \(g_{yy}\) Metric with yy indices down. I assume \(g_{yy}=1\), if not then please define AurelCore.data[‘gyy’] = …

gyz: \(g_{yz}\) Metric with yz indices down. I assume \(g_{yz}=0\), if not then please define AurelCore.data[‘gyz’] = …

gzz: \(g_{zz}\) Metric with zz indices down. I assume \(g_{zz}=1\), if not then please define AurelCore.data[‘gzz’] = …

gammadown3: \(\gamma_{ij}\) Spatial metric with spatial indices down

gammaup3: \(\gamma^{ij}\) Spatial metric with spatial indices up

dtgammaup3: \(\partial_t \gamma^{ij}\) Coordinate time derivative of spatial metric with spatial indices up

gammadet: \(\gamma\) Determinant of spatial metric

gammadown4: \(\gamma_{\mu\nu}\) Spatial metric with spacetime indices down

gammaup4: \(\gamma^{\mu\nu}\) Spatial metric with spacetime indices up

Spacetime metric

gdown4: \(g_{\mu\nu}\) Spacetime metric with spacetime indices down

gup4: \(g^{\mu\nu}\) Spacetime metric with spacetime indices up

gdet: \(g\) Determinant of spacetime metric

BSSNOK metric

psi_bssnok: \(\psi = \gamma^{1/12}\) BSSNOK conformal factor

phi_bssnok: \(\phi = \ln(\gamma^{1/12})\) BSSNOK conformal factor

dtphi_bssnok: \(\partial_t \phi\) Coordinate time derivative of BSSNOK \(\phi\) conformal factor

gammadown3_bssnok: \(\tilde{\gamma}_{ij}\) Conformal spatial metric with spatial indices down

gammaup3_bssnok: \(\tilde{\gamma}^{ij}\) Conformal spatial metric with spatial indices up

dtgammadown3_bssnok: \(\partial_t \tilde{\gamma}_{ij}\) Coordinate time derivative of conformal spatial metric with spatial indices down

Extrinsic curvature

kxx: \(K_{xx}\) Extrinsic curvature with xx indices down. I assume \(K_{xx}=0\), if not then please define AurelCore.data[‘kxx’] = …

kxy: \(K_{xy}\) Extrinsic curvature with xy indices down. I assume \(K_{xy}=0\), if not then please define AurelCore.data[‘kxy’] = …

kxz: \(K_{xz}\) Extrinsic curvature with xz indices down. I assume \(K_{xz}=0\), if not then please define AurelCore.data[‘kxz’] = …

kyy: \(K_{yy}\) Extrinsic curvature with yy indices down. I assume \(K_{yy}=0\), if not then please define AurelCore.data[‘kyy’] = …

kyz: \(K_{yz}\) Extrinsic curvature with yz indices down. I assume \(K_{yz}=0\), if not then please define AurelCore.data[‘kyz’] = …

kzz: \(K_{zz}\) Extrinsic curvature with zz indices down. I assume \(K_{zz}=0\), if not then please define AurelCore.data[‘kzz’] = …

Kdown3: \(K_{ij}\) Extrinsic curvature with spatial indices down

Kup3: \(K^{ij}\) Extrinsic curvature with spatial indices up

Ktrace: \(K = \gamma^{ij}K_{ij}\) Trace of extrinsic curvature

dtKtrace: \(\partial_t K\) Coordinate time derivative of the trace of extrinsic curvature

Adown3: \(A_{ij}\) Traceless part of the extrinsic curvature with spatial indices down

Aup3: \(A^{ij}\) Traceless part of the extrinsic curvature with spatial indices up

A2: \(A^2\) Magnitude of traceless part of the extrinsic curvature

BSSNOK extrinsic curvature

Adown3_bssnok: \(\tilde{A}_{ij}\) Conformal traceless part of the extrinsic curvature with spatial indices down

Aup3_bssnok: \(\tilde{A}^{ij}\) Conformal traceless part of the extrinsic curvature with spatial indices up

A2_bssnok: \(\tilde{A}^2\) Magnitude of conformal traceless part of the extrinsic curvature

dtAdown3_bssnok: \(\partial_t \tilde{A}_{ij}\) Coordinate time derivative of conformal traceless part of the extrinsic curvature with spatial indices down

Proper time

dttau: \(\partial_t \tau\) Coordinate time derivative of proper time

Matter quantities

Eulerian observer follows \(n^\mu\)

Lagrangian observer follows \(u^\mu\)

Lagrangian matter variables

rho0: \(\rho_0\) Rest mass energy density. I assume \(\rho_0=0\), if not then please define AurelCore.data[‘rho0’] = …

press: \(p\) Pressure. I assume \(p=0\), if not then please define AurelCore.data[‘press’] = …

eps: \(\epsilon\) Specific internal energy. I assume \(\epsilon=0\), if not then please define AurelCore.data[‘eps’] = …

rho: \(\rho\) Energy density

enthalpy: \(h\) Specific enthalpy of the fluid

Fluid velocity

w_lorentz: \(W\) Lorentz factor. I assume \(W=1\), if not then please define AurelCore.data[‘w_lorentz’] = …

velx: \(v^x\) x component of Eulerian fluid three velocity with indice up. I assume \(v^x=0\), if not then please define AurelCore.data[‘velx’] = …

vely: \(v^y\) y component of Eulerian fluid three velocity with indice up. I assume \(v^y=0\), if not then please define AurelCore.data[‘vely’] = …

velz: \(v^z\) z component of Eulerian fluid three velocity with indice up. I assume \(v^z=0\), if not then please define AurelCore.data[‘velz’] = …

velup3: \(v^i\) Eulerian fluid three velocity with spatial indices up.

velup4: \(v^\mu\) Eulerian fluid three velocity with spacetime indices up.

veldown3: \(v_i\) Eulerian fluid three velocity with spatial indices down

veldown4: \(v_\mu\) Eulerian fluid three velocity with spacetime indices down

uup0: \(u^t\) Lagrangian fluid four velocity with time indice up

uup3: \(u^i\) Lagrangian fluid four velocity with spatial indices up

uup4: \(u^\mu\) Lagrangian fluid four velocity with spacetime indices up

udown3: \(u_\mu\) Lagrangian fluid four velocity with spatial indices down

udown4: \(u_\mu\) Lagrangian fluid four velocity with spacetime indices down

hdown4: \(h_{\mu\nu}\) Spatial metric orthonomal to fluid flow with spacetime indices down

hdet: \(h\) Determinant of spatial part of spatial metric orthonormal to fluid flow

hmixed4: \({h^{\mu}}_{\nu}\) Spatial metric orthonomal to fluid flow with mixed spacetime indices

hup4: \(h^{\mu\nu}\) Spatial metric orthonomal to fluid flow with spacetime indices up

Energy-stress tensor

Tdown4: \(T_{\mu\nu}\) Energy-stress tensor with spacetime indices down

Tup4: \(T^{\mu\nu}\) Energy-stress tensor with spacetime indices up

Ttrace: \(T\) Trace of the energy-stress tensor

Eulerian matter variables

rho_n: \(\rho^{\{n\}}\) Energy density in the \(n^\mu\) frame

fluxup3_n: \(S^{\{n\}i}\) Energy flux (or momentum density) in the \(n^\mu\) frame with spatial indices up

fluxdown3_n: \(S^{\{n\}}_{i}\) Energy flux (or momentum density) in the \(n^\mu\) frame with spatial indices down

angmomup3_n: \(J^{\{n\}i}\) Angular momentum density in the \(n^\mu\) frame with spatial indices up

angmomdown3_n: \(J^{\{n\}}_{i}\) Angular momentum density in the \(n^\mu\) frame with spatial indices down

Stressup3_n: \(S^{\{n\}ij}\) Stress tensor in the \(n^\mu\) frame with spatial indices up

Stressdown3_n: \(S^{\{n\}}_{ij}\) Stress tensor in the \(n^\mu\) frame with spatial indices down

Stresstrace_n: \(S^{\{n\}}\) Trace of Stress tensor in the \(n^\mu\) frame

press_n: \(p^{\{n\}}\) Pressure in the \(n^\mu\) frame

anisotropic_press_down3_n: \(\pi^{\{n\}_{ij}}\) Anisotropic pressure in the \(n^\mu\) frame with spatial indices down

rho_n_fromHam: \(\rho^{\{n\}}\) Energy density in the \(n^\mu\) frame computed from the Hamiltonian constraint

fluxup3_n_fromMom: \(S^{\{n\}i}\) Energy flux (or momentum density) in the \(n^\mu\) frame with spatial indices up computed from the Momentum constraint

Conserved variables

conserved_D: \(D\) Conserved mass-energy density in Wilson’s formalism

conserved_E: \(E\) Conserved internal energy density in Wilson’s formalism

conserved_Sdown4: \(S_{\mu}\) Conserved energy flux (or momentum density) in Wilson’s formalism with spacetime indices down

conserved_Sdown3: \(S_{i}\) Conserved energy flux (or momentum density) in Wilson’s formalism with spatial indices down

conserved_Sup4: \(S^{\mu}\) Conserved energy flux (or momentum density) in Wilson’s formalism with spacetime indices up

conserved_Sup3: \(S^{i}\) Conserved energy flux (or momentum density) in Wilson’s formalism with spatial indices up

dtconserved: \(\partial_t D, \; \partial_t E, \partial_t S_{i}\) List of coordinate time derivatives of conserved rest mass-energy density, internal energy density and energy flux (or momentum density) with spatial indices down in Wilson’s formalism

Kinematic variables

st_covd_udown4: \(\nabla_{\mu} u_{\nu}\) Spacetime covariant derivative of Lagrangian fluid four velocity with spacetime indices down

accelerationdown4: \(a_{\mu}\) Acceleration of the fluid with spacetime indices down

accelerationup4: \(a^{\mu}\) Acceleration of the fluid with spacetime indices up

s_covd_udown4: \(\mathcal{D}^{\{u\}}_{\mu} u_{\nu}\) Spatial covariant derivative of Lagrangian fluid four velocity with spacetime indices down, with respect to spatial hypersurfaces orthonormal to the fluid flow

thetadown4: \(\Theta_{\mu\nu}\) Fluid expansion tensor with spacetime indices down

theta: \(\Theta\) Fluid expansion scalar

sheardown4: \(\sigma_{\mu\nu}\) Fluid shear tensor with spacetime indices down

shear2: \(\sigma^2\) Magnitude of fluid shear

omegadown4: \(\omega_{\mu\nu}\) Fluid vorticity tensor with spacetime indices down

omega2: \(\omega^2\) Magnitude of fluid vorticity

Curvature quantities

Spatial curvature

s_RicciS_u: \({}^{(3)}R^{\{u\}}\) Ricci scalar of the spatial metric orthonormal to fluid flow

s_Gamma_udd3: \({}^{(3)}{\Gamma^{k}}_{ij}\) Christoffel symbols of spatial metric with mixed spatial indices

s_Riemann_uddd3: \({}^{(3)}{R^{i}}_{jkl}\) Riemann tensor of spatial metric with mixed spatial indices

s_Riemann_down3: \({}^{(3)}R_{ijkl}\) Riemann tensor of spatial metric with all spatial indices down

s_Ricci_down3: \({}^{(3)}R_{ij}\) Ricci tensor of spatial metric with spatial indices down

s_RicciS: \({}^{(3)}R\) Ricci scalar of spatial metric

Spacetime curvature

st_Gamma_udd4: \({}^{(4)}{\Gamma^{\alpha}}_{\mu\nu}\) Christoffel symbols of spacetime metric with mixed spacetime indices

st_Riemann_uddd4: \({}^{(4)}{R^{\alpha}}_{\beta\mu\nu}\) Riemann tensor of spacetime metric with mixed spacetime indices

st_Riemann_down4: \({}^{(4)}R_{\alpha\beta\mu\nu}\) Riemann tensor of spacetime metric with spacetime indices down

st_Riemann_uudd4: \({}^{(4)}{R^{\alpha\beta}}_{\mu\nu}\) Riemann tensor of spacetime metric with mixed spacetime indices

st_Ricci_down4: \({}^{(4)}R_{\alpha\beta}\) Ricci tensor of spacetime metric with spacetime indices down

st_Ricci_down3: \({}^{(4)}R_{ij}\) Ricci tensor of spacetime metric with spatial indices down

st_RicciS: \({}^{(4)}R\) Ricci scalar of spacetime metric

Einsteindown4: \(G_{\alpha\beta}\) Einstein tensor with spacetime indices down

Kretschmann: \(K={R^{\alpha\beta}}_{\mu\nu}{R_{\alpha\beta}}^{\mu\nu}\) Kretschmann scalar

BSSNOK curvature

s_Gamma_udd3_bssnok: \({}^{(3)}{\tilde{\Gamma}^{k}}_{ij}\) Christoffel symbols of conformal spatial metric with mixed spatial indices

s_Gamma_bssnok: \({}^{(3)}\tilde{\Gamma}^i\) Conformal connection functions with spatial indice up

dts_Gamma_bssnok: \(\partial_t {}^{(3)}\tilde{\Gamma}^i\) Coordinate time derivative of conformal connection functions with spatial indice up

s_Ricci_down3_bssnok: \({}^{(3)}\tilde{R}_{ij}\) Ricci tensor of conformal spatial metric with spatial indices down

s_RicciS_bssnok: \({}^{(3)}\tilde{R}\) Ricci scalar of conformal spatial metric

s_Ricci_down3_phi: \({}^{(3)}R^{\phi}_{ij}\) Ricci terms that depend on the conformal function \(\phi\)

Weyl decomposition

st_Weyl_down4: \(C_{\alpha\beta\mu\nu}\) Weyl tensor of spacetime metric with spacetime indices down

Weyl_Psi: \(\Psi_0, \; \Psi_1, \; \Psi_2, \; \Psi_3, \; \Psi_4\) List of Weyl scalars for an null vector base defined with AurelCore.tetrad

Psi4_lm: \(\Psi_4^{l,m}\) List of dictionaries of spin weighted spherical harmonic decomposition of the 4th Weyl scalar. Control with AurelCore.lmax, center, extract_radii, and interp_method.

Weyl_invariants: \(I, \; J, \; L, \; K, \; N\) Dictionary of Weyl invariants

eweyl_u_down4: \(E^{\{u\}}_{\alpha\beta}\) Electric part of the Weyl tensor on the hypersurface orthogonal to \(u^{\mu}\) with spacetime indices down

eweyl_n_down3: \(E^{\{n\}}_{ij}\) Electric part of the Weyl tensor on the hypersurface orthogonal to \(n^{\mu}\) with spatial indices down

bweyl_u_down4: \(B^{\{u\}}_{\alpha\beta}\) Magnetic part of the Weyl tensor on the hypersurface orthogonal to \(u^{\mu}\) with spacetime indices down

bweyl_n_down3: \(B^{\{n\}}_{ij}\) Magnetic part of the Weyl tensor on the hypersurface orthogonal to \(n^{\mu}\) with spatial indices down

Null ray expansion

null_ray_exp_out: \(\Theta_{out}\) List of expansion of null rays radially going out

null_ray_exp_in: \(\Theta_{in}\) List of expansion of null rays radially going in

Constraints

Hamiltonian: \(\mathcal{H}\) Hamilonian constraint

Hamiltonian_Escale: [\(\mathcal{H}\)] Hamilonian constraint energy scale

Hamiltonian_norm: \(\mathcal{H}/[\mathcal{H}]\) Normalized Hamilonian constraint

Momentumx: \(\mathcal{M}^x\) Momentum constraint with x spatial indices up

Momentumy: \(\mathcal{M}^y\) Momentum constraint with y spatial indices up

Momentumz: \(\mathcal{M}^z\) Momentum constraint with z spatial indices up

Momentumdownx: \(\mathcal{M}_x\) Momentum constraint with x spatial indices down

Momentumdowny: \(\mathcal{M}_y\) Momentum constraint with y spatial indices down

Momentumdownz: \(\mathcal{M}_z\) Momentum constraint with z spatial indices down

Momentumup3: \(\mathcal{M}^i\) Momentum constraint with spatial indices up

Momentumdown3: \(\mathcal{M}_i\) Momentum constraint with spatial indices down

Momentum_Escale: [\(\mathcal{M}\)] Momentum constraint energy scale

Momentumx_norm: \(\mathcal{M}^x/[\mathcal{M}]\) Normalized Momentum constraint with x spatial indices up

Momentumy_norm: \(\mathcal{M}^y/[\mathcal{M}]\) Normalized Momentum constraint with y spatial indices up

Momentumz_norm: \(\mathcal{M}^z/[\mathcal{M}]\) Normalized Momentum constraint with z spatial indices up

Momentumdownx_norm: \(\mathcal{M}_x/[\mathcal{M}]\) Normalized Momentum constraint with x spatial indices down

Momentumdowny_norm: \(\mathcal{M}_y/[\mathcal{M}]\) Normalized Momentum constraint with y spatial indices down

Momentumdownz_norm: \(\mathcal{M}_z/[\mathcal{M}]\) Normalized Momentum constraint with z spatial indices down

AurelCore Methods

class aurel.core.AurelCore(fd, **kwargs)[source]

Bases: object

Class able to calculate any variable in aurel.descriptions.

Parameters:
  • fd (FiniteDifference) – aurel.finitedifference.FiniteDifference

  • verbose (bool) – If True, display messages about the calculations.

  • fancy_print (bool) – If True, display messages in a fancy ipython format, else normal print is used. Default is True.

  • clear_cache_every_nbr_calc (int) – Number of calculations before clearing the cache. Default is 20.

  • memory_threshold_inGB (int) – Memory threshold in GB for clearing the cache. Default is 4 GB.

  • Lambda (float, optional, also attribute) – Cosmological constant. Default is 0.0.

  • vacuum (bool, optional, also attribute) – If True, assume vacuum spacetime (no matter). Default is False.

  • tetrad (str, optional, also attribute) – Tetrad choice for Weyl scalar calculations. Default is “quasi-Kinnersley”. Any other value provides …

  • lmax (int, optional, also attribute) – Maximum l value for spherical harmonic decompositions. Default is 8.

  • center (tuple, optional, also attribute) – Center of the Psi4_lm sphere. Default is (0.0, 0.0, 0.0).

  • extract_radii (list, optional, also attribute) – List of extraction radii for spherical harmonic decompositions. Default is [0.9 * min radius in the grid].

  • interp_method (str, optional, also attribute) –

    Interpolation method for scipy.interpolate.RegularGridInterpolator. Default is ‘linear’.

param

(dict) - Dictionary containing the data grid parameters, from fd.

Type:

dict

data

(dict) - Dictionary where all the variables are stored.

Type:

dict

data_shape

(tuple) - Shape of the data arrays: (Nx, Ny, Nz)

Type:

tuple

kappa

(float) - Einstein’s constant with G = c = 1. Default is 8 * pi.

Type:

float

calculation_count

(int) - Number of calculations performed.

Type:

int

last_accessed

(dict) - Dictionary to keep track of when each variable was last accessed.

Type:

dict

var_importance

(dict) - Dictionary to keep track of the importance of each variable for cache cleanup. To never delete a variable, set its importance to 0.

Type:

dict

Lie_beta(f, indexing, weight=0)[source]

Compute the Lie derivative along the shift vector.

Parameters:
  • f (array_like) – The field to differentiate. Can be a scalar, vector, or rank-2 tensor, with shape corresponding to indexing.

  • indexing (str) –

    String describing the type and index structure of f. Must be one of:

    - ''     : scalar
    - 's_u'  : spatial vector, upper index
    - 'st_u' : spacetime vector, upper index
    - 's_d'  : spatial vector, lower index
    - 'st_d' : spacetime vector, lower index
    - 's_uu' : spatial rank-2 tensor, both indices up
    - 's_ud' : spatial rank-2 tensor, first up, second down
    - 's_du' : spatial rank-2 tensor, first down, second up
    - 's_dd' : spatial rank-2 tensor, both indices down
    

  • weight (int or float, optional) – Weight for the density correction term (default: 0). If nonzero, adds weight * div(beta) * f to the result, where div(beta) is the divergence of the shift vector.

Returns:

Lie – The Lie derivative of f along β^i, with the same shape as f.

Return type:

array_like

cleanup_cache()[source]

Remove old entries from the cache based on age and size.

freeze_data()[source]

Freeze the data dictionary to prevent cache removal.

kronecker_delta3()[source]

Compute Kronecker delta with 3 3D indices.

kronecker_delta4()[source]

Compute Kronecker delta with 4 4D indices.

levicivita_down3()[source]

Compute Levi-Civita tensor with 3 3D indices down.

levicivita_down4()[source]

Compute Levi-Civita tensor with 4 4D indices down.

levicivita_symbol_down3()[source]

Compute Levi-Civita symbol with 3 3D indices down.

levicivita_symbol_down4()[source]

Compute Levi-Civita symbol with 4 4D indices down.

load_data(sim_data, iteration)[source]

Load simulation data into this classe’s data dictionary, and freeze.

Parameters:
  • sim_data (dict) – Dictionary containing the simulation data, each key has a list of values for each iteration.

  • iteration (int) – The iteration number to load data from.

magnitude3(fdown)[source]

Compute magnitude of a 3D rank 2 tensor.

magnitude4(fdown)[source]

Compute magnitude of a 4D rank 2 tensor.

myprint(message)[source]

Print a message with a fancy format.

norm3(a)[source]

Compute norm of a 3D rank 1 tensor.

norm4(a)[source]

Compute norm of a 4D rank 1 tensor.

null_ray_expansion(F, direction='out')[source]

Compute the expansion of null rays normal to a surface discribed F

null_vector_base()[source]

Return an arbitrary null vector base.

Returns:

lup4, kup4, mup4, mbup4 – Each is (4, Nx, Ny, Nz) array_like complex

Return type:

list

Note

See ‘Introduction to 3+1 Numerical Relativity’ 2008 by M. Alcubierre page 295

s_covd(f, indexing)[source]

Spatial covariant derivative of a 3D tensor of rank 0, 1 or 2.

Covariant derivative with respects to the spatial metric.

Parameters:
  • f ((..., Nx, Ny, Nz) array_like) – Tensor of rank 0, 1 or 2. The first indices are the spatial ones.

  • indexing (str) – ‘’ for scalar, ‘u’ for upper index, ‘d’ for down index, ‘uu’ for two upper indices, ‘dd’ for two down indices, ‘ud’ for one upper and one down index

Return type:

(3, …, Nx, Ny, Nz) array_like

s_curl(fdown3, indexing)[source]

Compute curl along n of a 3D rank 2 covariant tensor.

Parameters:
  • fdown3 ((3, 3, Nx, Ny, Nz) array_like) – Rank 2 spatial tensor with both indices down

  • indexing (str) – only accepts ‘dd’ for two down indices

Return type:

(3, 3, Nx, Ny, Nz) array_like

s_div(f, indexing)[source]

Compute divergence along n of a 3D tensor of rank 1 or 2.

Parameters:
  • f – if rank 1: (3, Nx, Ny, Nz) array_like, if rank 2: (3, 3, Nx, Ny, Nz) array_like

  • indexing (str) – ‘u’ for upper index, ‘d’ for down index

Returns:

  • if rank 1 (Nx, Ny, Nz) array_like

  • if rank 2 (3, Nx, Ny, Nz) array_like

s_to_st(fdown3)[source]

Compute spacetime tensor from the spatial tensor.

Parameters:

fdown3 ((3, 3, Nx, Ny, Nz) array_like) – Rank 2 spatial tensor with both indices down

Returns:

fdown4 – Rank 2 spacetime tensor with both indices down

Return type:

(4, 4, Nx, Ny, Nz) array_like

Note

By definition the electric part of the Weyl tensor in the \(n^\mu\) frame with indices up, \({}^{(n)}E^{\alpha \beta}\), only has spatial components, same for the magnetic part, \({}^{(n)}B^{\alpha \beta}\), and the extrinsic curvature, \(K^{\alpha\beta}\). So this function only applied to those three tensors.

st_covd(f, dtf, indexing)[source]

Spacetime covariant derivative of a 4D tensor of rank 0 or 1.

Covariant derivative with respects to the spacetime metric.

Parameters:
  • f ((..., Nx, Ny, Nz) array_like) – Tensor of rank 0, or 1. The first indices are the spacetime ones.

  • dtf ((..., Nx, Ny, Nz) array_like) – Time derivative of the tensor. This array must have the same shape.

  • indexing (str) – ‘’ for scalar ‘u’ for upper index, ‘d’ for down index

Return type:

(4, …., Nx, Ny, Nz) array_like

tetrad_base()[source]

Return an quasi-Kinnersley or arbitrary tetrad base.

if AurelCore.tetrad == “quasi-Kinnersley”:

Which is the default, because the tetrad is set to “quasi-Kinnersley” in the init. Then quasi-Kinnersley tetrad is returned where the first tetrad is the normal to the hypersurface \(n^\mu\).

else:

Then an arbitrary orthonormal tetrad is returned where the first tetrad is the fluid 4-velocity \(u^\mu\).

Returns:

e0up4, e1up4, e2up4, e3up4 – Each is (4, Nx, Ny, Nz) array_like

Return type:

list

Note

  • for Kinnersly tetrad see https://doi.org/10.1103/PhysRevD.65.044001 also see: Cactus/arrangements/EinsteinAnalysis/WeylScal4/m/WeylScal4.m Like the WeylScal4 thorn: tetrad given in wave zone (lapse = 1, shift = 0) and we do not perform the final rotation. Unlike the WeylScal4 thorn: I calc Weyl tensor in full (no wave zone assumption), but this gives the same result.

  • for Gram-Schmidt scheme see Chapter 7 of ‘Linear Algebra, Theory and applications’ by W.Cheney and D.Kincaid

trace3(fdown3)[source]

Compute trace of a 3D rank 2 tensor.

trace4(fdown4)[source]

Compute trace of a 4D rank 2 tensor.

tracefree3(fdown3)[source]

Compute tracefree part of a 3D rank 2 tensor.

vector_inner_product3(a, b)[source]

Inner product of rank 1 3D tensors with indices up.

vector_inner_product4(a, b)[source]

Inner product of rank 1 4D tensors with indices up.