Dmodules are modules over rings of differential operators over algebraic varieties. This package is mostly concerned with computations in the Weyl algebra, the ring of differential operators over affine space (over a field of characteristic zero). Most algorithms in this package can be found in the book Gröbner deformations of Hypergeometric Differential Equations by Saito, Sturmfels and Takayama, hereafter referred to as [SST]. This is also the best place to learn about computational Dmodule theory. The book Computational Algebraic Geometry with Macaulay2 has a chapter on Dmodules and local cohomology. A good introduction to Dmodule theory is A primer of algebraic Dmodules by Coutinho.
The Weyl algebra $D_n$ is the free associative algebra in $2n$ variables $x_1,\dots,x_n$, $\partial_1,\dots,\partial_n$, subject to the following relations: the $x$'s commute with each other; the $\partial$'s commute with each other; $x_i$ commutes with $\partial_j$ if $i\neq j$; and finally, $\partial_i x_i = x_i \partial_i +1$ (the Leibniz rule).

As a reality check, let us confirm that this is not a commutative ring. Here is the Leibniz rule.

In order to type less, we can use the shortcuts makeWeylAlgebra or makeWA.



Elements and ideals are handled in the usual Macaulay2 way. Let us look at the Gauss hypergeometric equation for parameters $a=1, b=2, c=3$.




The holonomicRank function computes the dimension of the solution space of a linear system of differential equations.

AHypergeometric systems, also known as GKZ systems (see [SST, Chapters 3 and 4]) are implemented.





Holonomic Dideals are analogous to zerodimensional ideals in polynomial rings (see [SST, Section 1.4]). Let us confirm that our GKZ systems are holonomic.

Once we know our ideal is holonomic, we can compute its holonomic rank. The above is a famous GKZ example because the holonomic rank may change when the parameter vector $b$ is changed.


We can compute the characteristic ideal and singular locus of a Dideal [SST, Section 1.4]. Note that the output of charIdeal belongs to a commutative ring, the associated graded ring of $D_n$ with respect to the order filtration.


The singular locus of a GKZ system is the zero set of a polynomial called the Principal Adeterminant, which is a product of discriminants corresponding to faces of the matrix A (see Chapters 8 and 9 of the book Discriminants, Resultants and Multidimensional Determinants by Gelfand, Kapranov and Zelevinsky). Here is how to find the classic cubic discriminant.


