Skip to contents

Label and unlabel arrays

Adding index names enables the usage of Ricci calculus rules, while unlabeling restores the usual R array.

Label arrays

tensor() `%_%`
Create a labeled array (tensor)
.()
Index slot label specification

Unlabel arrays

as.array(<tensor>)
Strip array labels
as_a()
Strip array labels

Tensor operations

Working with labeled arrays allows to consicely specify various tensor operations who all take given index structures into account and act accordingly.

Index manipulation

l()
Lower tensor indices
r()
Raise tensor indices
subst()
Substitute tensor labels

Tensor arithmetic

Ops(<tensor>)
Arithmetic tensor operations
kron()
Kronecker product

Symmetric and antisymmetric part

asym()
Antisymmetric tensor part
sym()
Symmetric tensor part

Symbolic evaluation

at()
Evaluate a symbolic array
simplify()
Simplify symbolic expressions

Tensor fields

Tensor fields can be modeled by symbolic tensors, i.e. tensors that contain mathematical expressions instead of numerical values.

Covariant derivative

covd()
Covariant Derivative

Metrics tensor fields

g_eucl_cart() g_eucl_sph()
Euclidean metric tensor
g_mink_cart() g_mink_sph()
Minkowski metric tensor
g_sph()
Metric tensor of the sphere
g_ss()
Schwarzschild metric tensor
metric_field()
Create a metric tensor field

Geometric tensor fields

christoffel()
Christoffel symbols
ricci()
Ricci curvature tensor
ricci_sc()
Ricci scalar
riemann()
Riemann curvature tensor

Special tensors / symbols

d()
Kronecker delta
e()
Levi-Civita epsilon

Testthat expectation

A simple testthat helper that allows to check for tensor equality.

expect_tensor_equal()
Does code return the expected value?