Learn R Programming

freealg (version 1.1-1)

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

Description

The free algebra BB is a graded algebra: that is, for each integer n 0n>=0 there is a homogeneous subspace B_nB_n with B_0=RB_0=R and

B=_n=0^B_n,andB_nB_mB_n+mfor all $m,n 0.$ omitted

The elements of _n 0B_nomitted are called homogeneous and those of B_nB_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 zero, which 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

Value

Returns a disord object

Arguments

x

Freealg object

n

Integer vector

value

Replacement value, a numeric vector

Author

Robin K. S. Hankin

Details

grades(x) returns the grade (number of symbols) in each term of a freealg object 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 coden.

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

Run this code


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

Run the code above in your browser using DataLab