# Singular

##### 7.7.13.0. facWeyl
Procedure from library `ncfactor.lib` (see ncfactor_lib).

Usage:
facWeyl(h); h a polynomial in the nth Weyl algebra

Return:
list

Purpose:
compute all factorizations of a polynomial in the first Weyl algebra

Theory:
Implements the new algorithm by A. Heinle and V. Levandovskyy, see the thesis of A. Heinle

Assume:
basering is the nth Weyl algebra, where n in NN.

Note:
Every entry of the output list is a list with factors for one possible factorization. The first factor is always a constant (1, if no nontrivial constant could be excluded).

Example:
 ```LIB "ncfactor.lib"; ring R = 0,(x1,x2,d1,d2),dp; matrix C[4][4] = 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1; matrix D[4][4] = 0,0,1,0, 0,0,0,1, -1,0,0,0, 0,-1,0,0; def r = nc_algebra(C,D); setring(r); poly h = (d1+1)^2*(d1 + x1*d2); facWeyl(h); ==> [1]: ==> [1]: ==> 1 ==> [2]: ==> x1*d1*d2+d1^2+x1*d2+d1+2*d2 ==> [3]: ==> d1+1 ==> [2]: ==> [1]: ==> 1 ==> [2]: ==> d1+1 ==> [3]: ==> d1+1 ==> [4]: ==> x1*d2+d1 ```