Skip to contents

Takes the symmetric tensor part of a tensor x with respect to the specified indices .... An error is thrown if the specified indices do not exist.

Usage

sym(x, ...)

Arguments

x

A labeled tensor object, created by %_% or tensor().

...

Any number of index expressions. The indices need to occur in x.

Value

A modified tensor object.

See also

Wikipedia: Ricci calculus - Symmetric and antisymmetric parts

Other tensor operations: asym(), kron(), l(), r(), subst()

Examples

a <- array(1:4, dim = c(2, 2))
a %_% .(i, j) |> sym(i, j)
#> <Labeled Array> [2x2] .(-i, -j)
#>      [,1] [,2]
#> [1,]  1.0  2.5
#> [2,]  2.5  4.0