Skip to contents

g_mink_cart() provides the covariant metric tensor in n dimensions in Cartesian coordinates with signature \((-1, 1, 1, ...)\). $$ds^2=-dx_0^2+\sum_{i=1}^{n-1} dx_i^2$$ g_mink_sph() provides the same tensor where the spatial part uses spherical coordinates. $$ds^2=-dt^2 + dr^2 + r^2 d\Omega^2$$

Usage

g_mink_cart(n, coords = paste0("x", 1:n - 1))

g_mink_sph(n, coords = c("t", "r", paste0("ph", 1:(n - 2))))

Arguments

n

The dimension of the metric tensor.

coords

A character vector of coordinate names. The length needs to match the tensor dimensions.

Value

The covariant metric tensor as array imputed with coordinate names.

See also

Wikipedia Minkowski metric tensor

Other metric tensors: g_eucl_cart(), g_sph(), g_ss(), metric_field()

Examples

g_mink_cart(4)
#> <Covariant metric tensor field> (x0, x1, x2, x3)
#>      [,1] [,2] [,3] [,4]
#> [1,]   -1    0    0    0
#> [2,]    0    1    0    0
#> [3,]    0    0    1    0
#> [4,]    0    0    0    1
g_mink_cart(4) %_% .(+i, +j)
#> <Labeled Array> [4x4] .(+i, +j)
#>      [,1] [,2] [,3] [,4]
#> [1,]   -1    0    0    0
#> [2,]    0    1    0    0
#> [3,]    0    0    1    0
#> [4,]    0    0    0    1
g_mink_sph(4)
#> <Covariant metric tensor field> (t, r, ph1, ph2)
#>      [,1] [,2] [,3]    [,4]            
#> [1,] "-1" "0"  "0"     "0"             
#> [2,] "0"  "1"  "0"     "0"             
#> [3,] "0"  "0"  "r^2*1" "0"             
#> [4,] "0"  "0"  "0"     "r^2*sin(ph1)^2"
g_mink_sph(4) %_% .(+i, +j)
#> <Labeled Array> [4x4] .(+i, +j)
#>      [,1] [,2] [,3]            [,4]                    
#> [1,] "-1" "0"  "0"             "0"                     
#> [2,] "0"  "1"  "0"             "0"                     
#> [3,] "0"  "0"  "(1) / (r^2*1)" "0"                     
#> [4,] "0"  "0"  "0"             "(1) / (r^2*sin(ph1)^2)"