Processing math: 100%

A contraction is a natural linear map from k-forms to k1-forms.

contract(K,v,lose=TRUE)
contract_elementary(o,v)

Arguments

K

A k-form

o

Integer-valued vector corresponding to one row of an index matrix

lose

Boolean, with default TRUE meaning to coerce a 0-form to a scalar and FALSE meaning to return the formal 0-form

v

A vector; in function contract(), if a matrix, interpret each column as a vector to contract with

Details

Given a k-form ϕ and a vector v, the contraction ϕv of ϕ and v is a k1-form with

ϕv(v1,,vk1)=ϕ(v,v1,,vk1)

provided k>1; if k=1 we specify ϕv=ϕ(v).

Function contract_elementary() is a low-level helper function that translates elementary k-forms with coefficient 1 (in the form of an integer vector corresponding to one row of an index matrix) into its contraction with v.

There is an extensive vignette in the package, vignette("contract").

Value

Returns an object of class kform.

References

Steven H. Weintraub 2014. “Differential forms: theory and practice”, Elsevier (Definition 2.2.23, chapter 2, page 77).

Author

Robin K. S. Hankin

See also

Examples

contract(as.kform(1:5),1:8)
#> An alternating linear map from V^4 to R with V=R^5:
#>              val
#>  1 2 3 4  =    5
#>  1 2 4 5  =    3
#>  2 3 4 5  =    1
#>  1 3 4 5  =   -2
#>  1 2 3 5  =   -4
contract(as.kform(1),3)   # 0-form
#> [1] 3



contract_elementary(c(1,2,5),c(1,2,10,11,71))
#> An alternating linear map from V^2 to R with V=R^5:
#>          val
#>  1 5  =   -2
#>  2 5  =    1
#>  1 2  =   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