kform: k-forms

kformR Documentation

k-forms

Description

\loadmathjax

Functionality for dealing with \mjseqnk-forms

Usage

kform(S)
as.kform(M,coeffs,lose=TRUE)
kform_basis(n, k)
kform_general(W,k,coeffs,lose=TRUE)
is.kform(x)
d(i)
e(i,n)
## S3 method for class 'kform'
as.function(x,...)

Arguments

n

Dimension of the vector space \mjeqnV=R^nV=R^n

i

Integer

k

A \mjseqnk-form maps \mjeqnV^kV^k to \mjseqnR

W

Integer vector of dimensions

M,coeffs

Index matrix and coefficients for a \mjseqnk-form

S

Object of class spray

lose

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

x

Object of class kform

...

Further arguments, currently ignored

Details

A \mjseqnk-form is an alternating \mjseqnk-tensor. In the package, \mjseqnk-forms are represented as sparse arrays (spray objects), but with a class of c("kform", "spray"). The constructor function kform() takes a spray object and returns a kform object: it ensures that rows of the index matrix are strictly nonnegative integers, have no repeated entries, and are strictly increasing. Function as.kform() is more user-friendly.

  • kform() is the constructor function. It takes a spray object and returns a kform.

  • as.kform() also returns a kform but is a bit more user-friendly than kform().

  • kform_basis() is a low-level helper function that returns a matrix whose rows constitute a basis for the vector space \mjeqn\Lambda^k(R^n)L^k(R^n) of \mjseqnk-forms.

  • kform_general() returns a kform object with terms that span the space of alternating tensors.

  • is.kform() returns TRUE if its argument is a kform object.

  • d() is an easily-typed synonym for as.kform(). The idea is that d(1) = dx, d(2)=dy, d(5)=dx^5, etc. Also note that, for example, d(1:3)=dx^dy^dz, the volume form.

Recall that a \mjseqnk-tensor is a multilinear map from \mjseqnV^k to the reals, where \mjseqnV=R^n is a vector space. A multilinear \mjseqnk-tensor \mjseqnT is alternating if it satisfies

\mjdeqn

T\left(v_1,...,v_i,...,v_j,...,v_k\right)= -T\left(v_1,...,v_j,...,v_i,...,v_k\right) omitted; see latex

In the package, an object of class kform is an efficient representation of an alternating tensor.

Function kform_basis() is a low-level helper function that returns a matrix whose rows constitute a basis for the vector space \mjeqn\Lambda^k(R^n)L^k(R^n) of \mjseqnk-forms:

\mjdeqn\phi

=\sum_1\leq i_1 < \cdots < i_k\leq n a_i_1... i_kdx_i_1\wedge\cdots\wedge dx_i_komitted; see latex

and indeed we have:

\mjdeqn

a_i_1... i_k=\phi\left(\mathbfe_i_1,...,\mathbfe_i_k\right) omitted; see latex

where \mjeqn\mathbfe_j,1\leq j\leq ke_j,1<=j<=k is a basis for \mjseqnV.

Value

All functions documented here return a kform object except as.function.kform(), which returns a function, and is.kform(), which returns a Boolean, and e(), which returns a conjugate basis to that of d().

Note

Hubbard and Hubbard use the term “\mjseqnk-form”, but Spivak does not.

Author(s)

Robin K. S. Hankin

References

Hubbard and Hubbard; Spivak

See Also

ktensor,lose

Examples


as.kform(cbind(1:5,2:6),rnorm(5))
kform_general(1:4,2,coeffs=1:6)  # used in electromagnetism

K1 <- as.kform(cbind(1:5,2:6),rnorm(5))
K2 <- kform_general(5:8,2,1:6)
K1^K2  # or wedge(K1,K2)

d(1:3)
dx^dy^dz   # same thing

d(sample(9)) # coeff is +/-1 depending on even/odd permutation of 1:9

f <- as.function(wedge(K1,K2))
E <- matrix(rnorm(32),8,4)
f(E) + f(E[,c(1,3,2,4)])  # should be zero by alternating property

options(kform_symbolic_print = 'd')
(d(5)+d(7)) ^ (d(2)^d(5) + 6*d(4)^d(7))
options(kform_symbolic_print = NULL)  # revert to default


stokes documentation built on Aug. 19, 2023, 1:07 a.m.