grade | R Documentation |
The grade of a term is the number of basis vectors in it.
grade(C, n, drop=TRUE) grade(C,n) <- value grades(x) gradesplus(x) gradesminus(x) gradeszero(x)
C,x |
Clifford object |
n |
Integer vector specifying grades to extract |
value |
Replacement value, a numeric vector |
drop |
Boolean, with default |
A term is a single expression in a Clifford object. It has a coefficient and is described by the basis vectors it comprises. Thus \mjeqn4e_2344e_123 is a term but \mjseqne_3 + e_5 is not.
The grade of a term is the number of basis vectors in it. Thus the grade of \mjeqne_1e1 is 1, and the grade of \mjeqne_125=e_1e_2e_5e_125=e1 e2 e5 is 3. The grade operator \mjeqn\left\langle\cdot\right\rangle_r<.>_r is used to extract terms of a particular grade, with
\mjdeqnA=\left\langle A\right\rangle_0 + \left\langle A\right\rangle_1 + \left\langle A\right\rangle_2 + \cdots = \sum_r\left\langle A\right\rangle_r A = <A>_0 + <A>_1 + <A>_2 +... = sum <A>_r
for any Clifford object A. Thus \mjeqn\left\langle A\right\rangle_r<A>_r is said to be homogenous of grade r. Hestenes sometimes writes subscripts that specify grades using an overbar as in \mjeqn\left\langle A\right\rangle_\overlineromitted. It is conventional to denote the zero-grade object \mjeqn\left\langle A\right\rangle_0<A>_0 as simply \mjeqn\left\langle A\right\rangle<A>.
We have
\mjdeqn \left\langleA+B\right\rangle_r=\left\langle A\right\rangle_r + \left\langle B\right\rangle_r\qquad \left\langle\lambda A\right\rangle_r=\lambda\left\langle A\right\rangle_r\qquad \left\langle\left\langle A\right\rangle_r\right\rangle_s=\left\langle A\right\rangle_r\delta_rs. omitted; see PDF
Function grades()
returns an (unordered) vector specifying the
grades of the constituent terms. Function grades<-()
allows
idiom such as grade(x,1:2) <- 7
to operate as expected [here to
set all coefficients of terms with grades 1 or 2 to value 7].
Function gradesplus()
returns the same but counting only basis
vectors that square to +1, and gradesminus()
counts only
basis vectors that square to -1. Function signature()
controls which basis vectors square to +1 and which to -1.
From Perwass, page 57, given a bilinear form
\mjdeqn\left\langle\mathbfx,\mathbf x\right\rangle=x_1^2+x_2^2+\cdots +x_p^2-x_p+1^2-\cdots -x_p+q^2 <x,x>=x_1^2+...+x_p^2-x_p+1^2-...-x_p+q^2
and a basis blade \mjteqne_Ae_\mathbbAe_A with \mjteqnA\subseteq\left\lbrace 1,...,p+q\right\rbrace\mathbbA\subseteq\left\lbrace 1,...,p+q\right\rbraceomitted, then
\mjtdeqn \mathrmgr(e_A) = \left|\left\lbrace a\in A\colon 1\leq a\leq p+q\right\rbrace\right| \mathrmgr(e_\mathbbA) = \left|\left\lbrace a\in\mathbbA\colon 1\leq a\leq p+q\right\rbrace\right| omitted
\mjtdeqn \mathrmgr_+(e_A) = \left|\left\lbrace a\in A\colon 1\leq a\leq p\right\rbrace\right| \mathrmgr_+(e_\mathbbA) = \left|\left\lbrace a\in\mathbbA\colon 1\leq a\leq p\right\rbrace\right| omitted
\mjtdeqn \mathrmgr_-(e_A) = \left|\left\lbrace a\in A\colon p < a\leq p+q\right\rbrace\right| \mathrmgr_-(e_\mathbbA) = \left|\left\lbrace a\in\mathbbA\colon p < a\leq p+q\right\rbrace\right| omitted
Function gradeszero()
counts only the basis vectors squaring to
zero (I have not seen this anywhere else, but it is a logical
suggestion).
If the signature is zero, then the Clifford algebra reduces to a
Grassman algebra and products match the wedge product of exterior
calculus. In this case, functions gradesplus()
and
gradesminus()
return NA
.
Function grade(C,n)
returns a clifford object with just the
elements of grade g
, where g %in% n
.
The zero grade term, grade(C,0)
, is given more naturally by
const(C)
.
Function c_grade()
is a helper function that is documented at
Ops.clifford.Rd
.
In the C code, “term” has a slightly different meaning, referring to the vectors without the associated coefficient.
Robin K. S. Hankin
C. Perwass 2009. “Geometric algebra with applications in engineering”. Springer.
signature
, const
a <- clifford(sapply(seq_len(7),seq_len),seq_len(7)) a grades(a) grade(a,5) signature(2,2) x <- rcliff() drop(gradesplus(x) + gradesminus(x) + gradeszero(x) - grades(x)) a <- rcliff() a == Reduce(`+`,sapply(unique(grades(a)),function(g){grade(a,g)}))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.