Learn R Programming

stokes (version 1.0-8)

Alt: Alternating multilinear forms

Description

Converts a \(k\)-tensor to alternating form

Usage

Alt(S,give_kform)

Arguments

S

A multilinear form, an object of class ktensor

give_kform

Boolean, with default FALSE meaning to return an alternating \(k\)-tensor [that is, an object of class ktensor that happens to be alternating] and TRUE meaning to return a \(k\)-form [that is, an object of class kform]

Value

Returns an alternating \(k\)-tensor. To work with \(k\)-forms, which are a much more efficient representation of alternating tensors, use as.kform().

Details

Given a \(k\)-tensor \(T\), we have

Alt(T)(v_1,…,v_k)= 1k!_ S_ksgn() T(v_(1),…,v_(k)) omitted; see latex

Thus for example if \(k=3\):

Alt(T)(v_1,v_2,v_3)= 16(arraycc +T(v_1,v_2,v_3)& -T(v_1,v_3,v_2) -T(v_2,v_1,v_3)& +T(v_2,v_3,v_1) +T(v_3,v_1,v_2)& -T(v_3,v_2,v_1) array ) omitted; see latex

and it is reasonably easy to see that \(\mathrm{Alt}(T)\) is alternating, in the sense that

Alt(T)(v_1,…,v_i,…,v_j,…,v_k)= -Alt(T)(v_1,…,v_j,…,v_i,…,v_k) omitted; see latex

Function Alt() is intended to take and return an object of class ktensor; but if given a kform object, it just returns its argument unchanged.

See also the `Alt` vignette which contains more details and examples.

See Also

kform

Examples

Run this code
# NOT RUN {
S <- as.ktensor(expand.grid(1:3,1:3),rnorm(9))
S
Alt(S)

issmall(Alt(S) - Alt(Alt(S)))  # should be TRUE

a <- rtensor()
a
V <- matrix(rnorm(21),ncol=3)
c(as.function(Alt(a))(V), as.function(Alt(a,give_kform=TRUE))(V)) # should match
# }

Run the code above in your browser using DataLab