grade: The grade (or degree) of terms in a 'freealg' object

gradeR Documentation

The grade (or degree) of terms in a freealg object

Description

The free algebra \mathcal B is a graded algebra: that is, for each integer n\geq 0 there is a homogeneous subspace \mathcal{B}_n with \mathcal{B}_0=\mathcal{R} and

\mathcal{B}=\bigoplus_{n=0}^\infty\mathcal{B}_n,\quad\mbox{and}\quad\mathcal{B}_n\mathcal{B}_m\subseteq\mathcal{B}_{n+m}\quad\mbox{for all $m,n\geq 0.$}

The elements of \cup_{n\geq 0}\mathcal{B}_n are called homogeneous and those of \mathcal{B}_n are called homogenous of degree (or grade) n.

The grade of a term is the number of symbols in it. Thus the grade of xxx and 4xxy is 3; the grade of a constant is zero. Because the terms are stored in an implementation-specific way, the grade of a multi-term object is a disord object.

The grade of the zero freealg object, grade(as.freealg(0)), is defined to be -\infty, as per Knuth [TAOCP, volume 2, p436]. This ensures that max(grades(abelianize(x))) <= max(grades(x)) is always satisfied. However, a case for NULL could be made.

Usage

grades(x)
grade(x,n)
grade(x,n) <- value
deg(x)

Arguments

x

Freealg object

n

Integer vector

value

Replacement value, a numeric vector

Details

grades(x) returns the grade (number of symbols) in each term of a freealg object x.

deg(x) returns the maximum of the grades of each symbol of x; max(grades(x)).

grade(x,n) returns the freealg object comprising terms with grade n (which may be a vector). Note that this function is considerably less efficient than clifford::grade().

grade(x,n) <- value sets the coefficients of terms with grade n. For value, a length-one numeric vector is accepted (notably zero, which kills terms of grade n) and also a freealg object comprising terms of grade n.

Value

Returns a disord object

Note

A similar concept grade is discussed in the clifford package

Author(s)

Robin K. S. Hankin

References

H. Munthe-Kaas and B. Owren 1999. “Computations in a free Lie algebra”, Phil. Trans. R. Soc. Lond. A, 357:957–981 (theorem 3.8)

Examples



X <- as.freealg("1 -x + 5*y + 6*x*y -8*x*x*x*x*y*x")
X
grades(X)

a <- rfalg(30)
a
grades(a)
grade(a,2)
grade(a,2) <- 0 # kill all grade-2 terms
a

grade(a,1) <- grade(a,1) * 888 
a

RobinHankin/freealg documentation built on Dec. 24, 2024, 3:16 a.m.