Alt {stokes} R Documentation
Alternating multilinear forms
Description
Converts a k k 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 k k
-tensor [that is, an object of class
ktensor
that happens to be alternating] and TRUE
meaning to return a k k k
-form [that is, an object of class
kform
]
Details
Given a k k k
-tensor T T T
, we have
A l t ( T ) ( v 1 , … , v k ) = 1 k ! ∑ σ ∈ S k s g n ( σ ) ⋅ T ( v σ ( 1 ) , … , v σ ( k ) ) \mathrm{Alt}(T)\left(v_1,\ldots,v_k\right)=
\frac{1}{k!}\sum_{\sigma\in S_k}\mathrm{sgn}(\sigma)\cdot
T\left(v_{\sigma(1)},\ldots,v_{\sigma(k)}\right)
Alt ( T ) ( v 1 , … , v k ) = k ! 1 ∑ σ ∈ S k sgn ( σ ) ⋅ T ( v σ ( 1 ) , … , v σ ( k ) )
Thus for example if k = 3 k=3 k = 3
:
A l t ( T ) ( v 1 , v 2 , v 3 ) = 1 6 ( + 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 ) ) \mathrm{Alt}(T)\left(v_1,v_2,v_3\right)=
\frac{1}{6}\left(\begin{array}{c}
+T\left(v_1,v_2,v_3\right)\quad
-T\left(v_1,v_3,v_2\right)\cr
-T\left(v_2,v_1,v_3\right)\quad
+T\left(v_2,v_3,v_1\right)\cr
+T\left(v_3,v_1,v_2\right)\quad
-T\left(v_3,v_2,v_1\right)
\end{array}
\right)
Alt ( T ) ( v 1 , v 2 , v 3 ) = 6 1 ⎝ ⎛ + 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 ) ⎠ ⎞
and it is reasonably easy to see that A l t ( T ) \mathrm{Alt}(T) Alt ( T )
is alternating, in the sense that
A l t ( T ) ( v 1 , … , v i , … , v j , … , v k ) = − A l t ( T ) ( v 1 , … , v j , … , v i , … , v k ) \mathrm{Alt}(T)\left(v_1,\ldots,v_i,\ldots,v_j,\ldots,v_k\right)=
-\mathrm{Alt}(T)\left(v_1,\ldots,v_j,\ldots,v_i,\ldots,v_k\right)
Alt ( T ) ( v 1 , … , v i , … , v j , … , v k ) = − Alt ( T ) ( v 1 , … , v j , … , v i , … , v k )
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.
Value
Returns an alternating k k k
-tensor. To work with k k k
-forms,
which are a much more efficient representation of alternating tensors,
use as.kform()
.
Author(s)
Robin K. S. Hankin
See Also
kform
Examples
(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)
[Package
stokes version 1.2-1
Index ]