Skip to contents

Provides a labeled generalized Kronecker delta. In the special case of two labels this represents simply the identity matrix. The Kronecker delta always has an even number of indices. Note that the first half of the tensor labels need to be lowered, while the second half needs upper indices. Otherwise an error is thrown.

Usage

d(n)

Arguments

n

The dimension.

Value

A function that expects index labels (see .()) and returns a labeled tensor. The underlying data will differs depending on the number of labels provided.

See also

Underlying implementation: calculus::delta()

Wikipedia: Generalized Kronecker delta

Other tensor symbols: e()

Examples

d(3)(i, +j)
#> <Labeled Array> [3x3] .(-i, +j)
#>      [,1] [,2] [,3]
#> [1,]    1    0    0
#> [2,]    0    1    0
#> [3,]    0    0    1

d(3)(i, j, +k, +l)
#> <Labeled Array> [3x3x3x3] .(-i, -j, +k, +l)