# stafford(Ideal) -- computes 2 generators for a given ideal in the Weyl algebra

## Synopsis

• Usage:
stafford I
• Function: stafford
• Inputs:
• I, an ideal, in the Weyl algebra
• Outputs:
• an ideal, with 2 generators (that has the same extension as I in k(x)<dx>)

## Description

A theorem of Stafford says that every ideal in the Weyl algebra can be generated by 2 elements. This routine is the implementation of the effective version of this theorem following the constructive proof in A.Leykin, `Algorithmic proofs of two theorems of Stafford', Journal of Symbolic Computation, 38(6):1535-1550, 2004.

The current implementation provides a weaker result: the 2 generators produced are guaranteed to generate only the extension of the ideal I in the Weyl algebra with rational-function coefficients.

 ```i1 : R = QQ[x_1..x_4,D_1..D_4, WeylAlgebra=>(apply(4,i->x_(i+1)=>D_(i+1)))] o1 = R o1 : PolynomialRing``` ```i2 : stafford ideal (D_1,D_2,D_3,D_4) 4 2 3 o2 = ideal (D , x x D + x x D + x D + x D + D ) 1 1 4 4 1 3 3 1 4 1 3 2 o2 : Ideal of QQ[x , x , x , x , D , D , D , D ] 1 2 3 4 1 2 3 4```

## Caveat

The input should be generated by at least 2 generators. The output and input ideals are not equal necessarily.