Alt | R Documentation |
Converts a \mjseqnk-tensor to alternating form
Alt(S,give_kform)
S |
A multilinear form, an object of class |
give_kform |
Boolean, with default |
Given a \mjseqnk-tensor \mjseqnT, we have
\mjdeqn\mathrmAlt(T)\left(v_1,...,v_k\right)= \frac1k!\sum_\sigma\in S_k\mathrmsgn(\sigma)\cdot T\left(v_\sigma(1),...,v_\sigma(k)\right) omitted; see latex
Thus for example if \mjseqnk=3:
\mjdeqn\mathrmAlt(T)\left(v_1,v_2,v_3\right)=
\frac16\left(\beginarrayc
+T\left(v_1,v_2,v_3\right)\quad
-T\left(v_1,v_3,v_2\right)
-T\left(v_2,v_1,v_3\right)\quad
+T\left(v_2,v_3,v_1\right)
+T\left(v_3,v_1,v_2\right)\quad
-T\left(v_3,v_2,v_1\right)
\endarray
\right)
omitted; see latex
and it is reasonably easy to see that \mjeqn\mathrmAlt(T)Alt(T) is alternating, in the sense that
\mjdeqn\mathrmAlt(T)\left(v_1,...,v_i,...,v_j,...,v_k\right)= -\mathrmAlt(T)\left(v_1,...,v_j,...,v_i,...,v_k\right) 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.
A short vignette is provided with the package: type
vignette("Alt")
at the commandline.
Returns an alternating \mjseqnk-tensor. To work with \mjseqnk-forms,
which are a much more efficient representation of alternating tensors,
use as.kform()
.
Robin K. S. Hankin
kform
(X <- ktensor(spray(rbind(1:3),6)))
Alt(X)
Alt(X,give_kform=TRUE)
S <- as.ktensor(expand.grid(1:3,1:3),rnorm(9))
S
Alt(S)
issmall(Alt(S) - Alt(Alt(S))) # should be TRUE; Alt() is idempotent
a <- rtensor()
V <- matrix(rnorm(21),ncol=3)
LHS <- as.function(Alt(a))(V)
RHS <- as.function(Alt(a,give_kform=TRUE))(V)
c(LHS=LHS,RHS=RHS,diff=LHS-RHS)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.