Learn R Programming

weyl (version 0.0-8)

grade: The grade of a weyl object

Description

The grade of a homogeneous term of a Weyl algebra is the sum of the powers. Thus the grade of \(4xy^2\partial_x^3\partial_y^4\) is \(1+2+3+4=10\).

The functionality documented here closely follows the equivalent in the clifford package.

Coutinho calls this the symbol map.

Usage

grade(C, n, drop=TRUE)
grade(C, n) <- value
grades(x)

Value

Integer vector or weyl object

Arguments

C, x

Weyl object

n

Integer vector specifying grades to extract

value

Replacement value, a numeric vector

drop

Boolean, with default TRUE meaning to coerce a constant operator to numeric, and FALSE meaning not to

Author

Robin K. S. Hankin

Details

Function grades() returns an (unordered) vector specifying the grades of the constituent terms.

Function grade(x,n) returns a Weyl object with just the elements of grade g, where g %in% n.

Function grade<-() 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].

The zero grade term, grade(x,0), is given more naturally by constant(C).

Examples

Run this code

a <- rweyl(30)

grades(a)
grade(a, 1:4)
grade(a, 5:9) <- -99
a

Run the code above in your browser using DataLab