sympy/sympy — pull request #1190 by ness01 (2012-03-31 13:03:55+00:00)
Title: Groebner bases for modules and non-global orders

Hi,

I implemented some simple groebner basis code for modules. I tried to follow the code layout of polys as closely as possible and reuse it as much as possible, without messing up anyone else's code. Here is a run-down of my changes:

- to monomialtools.py, add new monomial orders ProductOrder and InverseOrder
- to monomialtools.py, add new functions monomial_divides and monomial_deg
- create a new file distributedmodules.py

The main code is in the new file. It copies the style of distributedpolys.py, whilst being (I hope) more thoroughly documented. It implements "sparse distributed module elements", but only the bare functionality needed to write a groebner basis algorithm. The code is probably very under-optimized...

I added tests to cover almost every part of the code, although I would have to admit that the code "can do more" than is being tested.

There are a few TODOs, mainly regarding cythonization which I have absolutely no experience with. I would like to get this code into master nonetheless, if only according to the "improve later" philosophy. (Actually I would like to believe that the code is quite useful as it stands. In fact I hope to implement some more abstract computational commutative algebra code using this one as a low-level starting point.)