# gbw -- Groebner basis w.r.t. a weight

## Synopsis

• Usage:
gbI = gbw(I,w), gbM = gbw(M,w)
• Inputs:
• I, an ideal, in the Weyl algebra
• M, , with entries in the Weyl algebra
• w, a list, of weights
• Outputs:
• gbI, an ideal, with the generators forming a Grobner basis of the ideal with respect to the weight vector
• gbM, , with the columns forming a Grobner basis of the submodule generated by the columns of the matrix with respect to the weight vector

## Description

This routine computes a Groebner basis of a left ideal I of the Weyl algebra with respect to a weight vector w = (u,v) where either u+v > 0 or u+v = 0. In the case where u+v > 0 the ordinary Buchberger algorithm works for any term order refining the weight order. In the case where u+v = 0 the Buchberger algorithm needs to be adapted to guarantee termination. There are two strategies for doing this. One is to homogenize to an ideal of the homogeneous Weyl algebra. The other is to homogenize with respect to the weight vector w.
 ```i1 : W = QQ[x,y,Dx,Dy, WeylAlgebra => {x=>Dx,y=>Dy}] o1 = W o1 : PolynomialRing``` ```i2 : I = ideal (x*Dx+2*y*Dy-3, Dx^2-Dy) 2 o2 = ideal (x*Dx + 2y*Dy - 3, Dx - Dy) o2 : Ideal of W``` ```i3 : gbw(I, {1,3,3,-1}) 2 2 2 o3 = ideal (x*Dx + 2y*Dy - 3, 4y Dy - x Dy + 2x*Dx - 2y*Dy, 2y*Dx*Dy + x*Dy ------------------------------------------------------------------------ 2 - 2Dx, Dx - Dy) o3 : Ideal of W``` ```i4 : gbw(I, {-1,-3,1,3}) 2 o4 = ideal (x*Dx + 2y*Dy - 3, - Dx + Dy) o4 : Ideal of W```

## Caveat

The weight vector w = (u,v) must have u+v>=0.