Printing is dispatched to print.ktensor()
and
print.kform()
depending on its argument. Special dispensation is
given for the zero object.
Although \(k\)-forms are alternating tensors and thus mathematically
are tensors, they are handled differently.
The default print method uses the spray print methods,
and as such respects the polyform
option. However, setting
polyform
to TRUE
can give misleading output, because
spray
objects are interpreted as multivariate polynomials not
differential forms (and in particular uses the caret to signify
powers).
It is much better to use options ktensor_symbolic_print
or
kform_symbolic_print
instead: the bespoke print methods
print.kform()
and print.ktensor()
are sensitive to these
options.
For kform
objects, if option kform_symbolic_print
is
non-null, the print method uses as.symbolic()
to give an
alternate way of displaying \(k\)-tensors and \(k\)-forms. The
generic non-null value for this option would be “x
”
which gives output like “dx1 ^ dx2
”. However, it has
two special values: set kform_symbolic_print
to
“dx
” for output like “dx ^ dz
” and
“txyz
” for output like “dt ^ dx
”, useful
in relativistic physics with a Minkowski metric. See the examples.
For ktensor
objects, if option ktensor_symbolic_print
is
TRUE
, a different system is used. Given a tensor
\(3\phi_4\otimes\phi_1 -5\phi_2\otimes\phi_2\), for example (where
\(\phi_i(x^j)=\delta_i^j\)), the method will give output that looks
like “+3 d4*d1 -5 d2*d2
”. I am not entirely happy with
this and it might change in future.
More detail is given at symbolic.Rd
and the dx
vignette.