Skip to contents

Function spray() creates a sparse array; function weyl() coerces a spray object to a Weyl object.

Usage

spray(M,x,addrepeats=FALSE)

Arguments

M

An integer-valued matrix, the index of the weyl object

x

Numeric vector of coefficients

addrepeats

Boolean, specifying whether repeated rows are to be added

Details

The function is discussed and motivated in the spray package.

Value

Return a weyl or a Boolean

Author

Robin K. S. Hankin

Examples


(W <- spray(matrix(1:36,6,6),1:6))
#> +6*x1^6*x2^12*x3^18*x4^24*x5^30*x6^36
#> +3*x1^3*x2^9*x3^15*x4^21*x5^27*x6^33
#> +5*x1^5*x2^11*x3^17*x4^23*x5^29*x6^35
#> +4*x1^4*x2^10*x3^16*x4^22*x5^28*x6^34
#> +2*x1^2*x2^8*x3^14*x4^20*x5^26*x6^32 +x1*x2^7*x3^13*x4^19*x5^25*x6^31
weyl(W)
#> A member of the Weyl algebra:
#> +6*x^6*y^12*z^18*dx^24*dy^30*dz^36 +3*x^3*y^9*z^15*dx^21*dy^27*dz^33
#> +5*x^5*y^11*z^17*dx^23*dy^29*dz^35 +4*x^4*y^10*z^16*dx^22*dy^28*dz^34
#> +2*x^2*y^8*z^14*dx^20*dy^26*dz^32 +x*y^7*z^13*dx^19*dy^25*dz^31

as.weyl(15,d=3)
#> A member of the Weyl algebra:
#> 15