wedge (version 1.0-3)

kform: k-forms

Description

Functionality for dealing with \(k\)-forms

Usage

kform(S)
as.kform(M,coeffs,lose=TRUE)
kform_basis(n, k)
kform_general(W,k,coeffs,lose=TRUE)
# S3 method for kform
as.function(x,...)

Arguments

n

Dimension of the vector space \(V=R^n\)

k

A \(k\)-form maps \(V^k\) to \(R\)

W

Integer vector of dimensions

M

Index matrix for a \(k\)-form

coeffs

Coefficients of the \(k\)-form

S

Object of class spray

lose

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

x

Object of class kform

...

Further arguments, currently ignored

Details

A \(k\)-form is an alternating \(k\)-tensor.

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

$$T\left(v_1,\ldots,v_i,\ldots,v_j,\ldots,v_k\right)= T\left(v_1,\ldots,v_j,\ldots,v_i,\ldots,v_k\right) $$

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

$$\phi=\sum_{1\leq i_1<\cdots<i_k\leq n}a_{i_1\ldots i_k} dx_{i_1}\wedge\cdots\wedge dx_{i_k} $$

and in fact

$$a_{i_1\ldots i_k}=\phi\left(\mathbf{e}_{i_1},\ldots,\mathbf{e}_{i_k}\right) $$

where \(\mathbf{e}_j,1\leq j\leq k\) is a basis for \(V\).

In the wedge package, \(k\)-forms are represented as sparse arrays (spray objects), but with a class of c("kform", "spray"). The constructor function (kform()) ensures that rows of the index matrix are strictly nonnegative integers, have no repeated entries, and are strictly increasing.

References

Hubbard and Hubbard; Spivak

See Also

ktensor,lose

Examples

Run this code
# NOT RUN {
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)
wedge(K1,K2)


f <- as.function(wedge(K1,K2))
E <- matrix(rnorm(32),8,4)

f(E) + f(E[,c(1,3,2,4)])  # should be zero


# }

Run the code above in your browser using DataLab