Create, coerce, and test for clifford objects
clifford.RdAn object of class clifford is a member of a Clifford algebra.
These objects may be added and multiplied, and have various applications
in physics and mathematics.
Usage
clifford(terms, coeffs=1)
is_ok_clifford(terms, coeffs)
as.clifford(x)
is.clifford(x)
nbits(x)
nterms(x)
# S3 method for class 'clifford'
dim(x)Details
Function
clifford()is the formal creation mechanism forcliffordobjects. Ifcoeffsis of length 1, it will be recycled (even iftermsis empty, in which case the zero Clifford object is returned). Argumenttermsis passed throughlist_modifier(), so a zero entry is interpreted asnumeric(0)Function
as.clifford()is much more user-friendly and attempts to coerce a range of input arguments to clifford formFunction
nbits()returns the number of bits required in the low-level C routines to store the terms (this is the largest entry in the list of terms). For a scalar, this is zero and for the zero clifford object it (currently) returns zero as well although a case could be made forNULLFunction
nterms()returns the number of terms in the expressionFunction
is_ok_clifford()is a helper function that checks for consistency of its arguments
References
Snygg 2012. “A new approach to differential geometry using Clifford's geometric algebra”. Birkhauser; Springer Science+Business.
Examples
(x <- clifford(list(1,2,1:4),1:3)) # Formal creation method
#> Element of a Clifford algebra, equal to
#> + 1e_1 + 2e_2 + 3e_1234
(y <- as.1vector(4:2))
#> Element of a Clifford algebra, equal to
#> + 4e_1 + 3e_2 + 2e_3
(z <- rcliff(include.fewer=TRUE))
#> Element of a Clifford algebra, equal to
#> + 6 - 6e_23 - 9e_25 - 2e_125 + 9e_1245 + 6e_2345 + 5e_1246 + 1e_2346 - 7e_56 -
#> 3e_3456
terms(x+100)
#> A disord object with hash b970bfa31ac8e546f0d03091602b82227e72fc24 and elements
#> [[1]]
#> integer(0)
#>
#> [[2]]
#> [1] 1
#>
#> [[3]]
#> [1] 2
#>
#> [[4]]
#> [1] 1 2 3 4
#>
#> (in some order)
coeffs(z)
#> A disord object with hash b168b85501e6a173fb372f5ed2ecc8fa82018488 and elements
#> [1] 6 -6 -9 -2 9 6 5 1 -7 -3
#> (in some order)
## Clifford objects may be added and multiplied:
x + y
#> Element of a Clifford algebra, equal to
#> + 5e_1 + 5e_2 + 2e_3 + 3e_1234
x*y
#> Element of a Clifford algebra, equal to
#> + 10 - 5e_12 + 2e_13 + 4e_23 - 6e_124 + 9e_134 - 12e_234