signature()
in the
clifford
package## function (p, q = 0)
## {
## if (missing(p)) {
## s <- getOption("signature")
## if (is.null(s)) {
## s <- c(.Machine$integer.max, 0)
## }
## showsig(s)
## class(s) <- "sigobj"
## return(s)
## }
## else {
## s <- c(p, q)
## m <- getOption("maxdim")
## if (!is.null(m)) {
## if (p + q > m) {
## stop("signature requires p+q <= maxdim")
## }
## }
## p <- min(s[1], .Machine$integer.max)
## q <- min(s[2], .Machine$integer.max)
## stopifnot(is_ok_sig(s))
## options(signature = c(p, q))
## showsig(s)
## return(invisible(s))
## }
## }
To cite the clifford
package in publications please use
Hankin (2022b). This short document
discusses signature()
in the clifford
R
package. As an example we might wish to work in Cl (1, 2):
Thus e12 = +1, and e22 = e32 = −1:
## [1] 1 -1 -1
We might ask what e4 would evaluate to, and this is assumed to be zero as is ei2 for i ≥ 4:
## [1] 0 0
If we wish to set paranoid-level safety measures, we would set option
maxdim
to prevent accidentally working with too-large
values of i:
Now we work with a four-dimensional vector space in which e12 = +1, e22 = e32 = −1, e42 = 0, but now e5 is undefined:
## [1] 1 -1 -1 0
## Error in is_ok_clifford(terms, coeffs): option maxdim exceeded
The operation of signature()
is modelled on the
sol()
function in the lorentz
package (Hankin 2022a). Thus, if given no arguments we
return the signature:
## [1] 1 2
However, the default value is to use an infinite signature which corresponds to ei2 = 1∀i:
## [1] Inf 0
Function signature()
returns an object of (trivial)
class sigobj
which has a bespoke print method,
print.sigobj()
. For technical reasons an infinite signature
is not allowed but is represented internally by a near-infinite integer,
specifically .Machine$integer.max
:
## structure(c(2147483647, 0), class = "sigobj")