A \(k\)-form is an alternating \(k\)-tensor. In the
package, \(k\)-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
\(\Lambda^k(\mathbb{R}^n)\) of \(k\)-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 \(k\)-tensor is a multilinear map from \(V^k\)
to the reals, where \(V=\mathbb{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)
$$
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
\(\Lambda^k(\mathbb{R}^n)\) of \(k\)-forms:
$$\phi=\sum_{1\leq i_1 < \cdots < i_k\leq n} a_{i_1\ldots
i_k}\mathrm{d}x_{i_1}\wedge\cdots\wedge\mathrm{d}x_{i_k}$$
and indeed we have:
$$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\).