Skip to contents

Provides a labeled Euclidean metric tensor in n dimensions. Note that the numeric result will be different depending on the chosen index positions. If the labels are left empty, an unlabeled n by n array of the covariant metric tensor is returned.

Usage

g_eucl(dim)

Arguments

dim

The dimension of the metric tensor.

Value

A function that expects index labels (see .()) and returns a labeled tensor with dimension c(dim, dim).

See also

Other metric tensors: g_mink()

Examples

g_eucl(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_eucl(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_eucl(4)()
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    0    0    0
#> [2,]    0    1    0    0
#> [3,]    0    0    1    0
#> [4,]    0    0    0    1