contract | R Documentation |
k
-formsA contraction is a natural linear map from \mjseqnk-forms to \mjseqnk-1-forms.
contract(K,v,lose=TRUE)
contract_elementary(o,v)
K |
A \mjseqnk-form |
o |
Integer-valued vector corresponding to one row of an index matrix |
lose |
Boolean, with default |
v |
A vector; in function |
Given a \mjseqnk-form \mjeqn\phiphi and a vector \mjeqn\mathbfvv, the contraction \mjeqn\phi_\mathbfvphi_v of \mjeqn\phiphi and \mjeqn\mathbfvv is a \mjseqnk-1-form with
\mjdeqn \phi_\mathbfv\left(\mathbfv^1,...,\mathbfv^k-1\right) = \phi\left(\mathbfv,\mathbfv^1,...,\mathbfv^k-1\right) omitted; see PDF
provided \mjseqnk>1; if \mjseqnk=1 we specify \mjeqn\phi_\mathbfv=\phi(\mathbfv)phi_v=phi(v).
Function contract_elementary()
is a low-level helper function
that translates elementary \mjseqnk-forms with coefficient 1 (in the form
of an integer vector corresponding to one row of an index matrix) into
its contraction with \mjeqn\mathbfvv.
There is an extensive vignette in the package,
vignette("contract")
.
Returns an object of class kform
.
Robin K. S. Hankin
Steven H. Weintraub 2014. “Differential forms: theory and practice”, Elsevier (Definition 2.2.23, chapter 2, page 77).
wedge
,lose
contract(as.kform(1:5),1:8)
contract(as.kform(1),3) # 0-form
contract_elementary(c(1,2,5),c(1,2,10,11,71))
## Now some verification [takes ~10s to run]:
#o <- kform(spray(t(replicate(2, sample(9,4))), runif(2)))
#V <- matrix(rnorm(36),ncol=4)
#jj <- c(
# as.function(o)(V),
# as.function(contract(o,V[,1,drop=TRUE]))(V[,-1]), # scalar
# as.function(contract(o,V[,1:2]))(V[,-(1:2),drop=FALSE]),
# as.function(contract(o,V[,1:3]))(V[,-(1:3),drop=FALSE]),
# as.function(contract(o,V[,1:4],lose=FALSE))(V[,-(1:4),drop=FALSE])
#)
#print(jj)
#max(jj) - min(jj) # zero to numerical precision
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.