Can Sage compute the Groebner basis of a module?

293 views
Skip to first unread message

Mao Zeng

unread,
Oct 18, 2019, 3:43:53 AM10/18/19
to sage-devel
As I understand, groebner_basis() in Sage uses Singular as a backend to compute the groebner basis of ideals in polynomial rings. However, Singular can also compute the groebner basis of modules. Is this functionality available in Sage? Similarly, in Singular the "syz" function can compute the syzygy module of either an ideal or a module, but the syzygy_module() function in Sage seems to work for ideals only. I would like to use Sage instead of using Singular directly. Is there an easy workaround?

Thank you!

Mao Zeng

unread,
Oct 18, 2019, 8:32:06 AM10/18/19
to sage-devel
I've come up with a rather awkward workaround using the Sage interface to libSingular. Still I'd be interested to learn about any simpler solution. Below is the Singular code, followed by Sage code which performs the same task.

Singular input:

ring R=73, (a,b), dp;
module module1 = [a,a^3], [1,a];
print(groebner(module1));

Singular output:

1,a2-a,
a,0

Sage input:

import sage.libs.singular.function_factory
groebner = sage.libs.singular.function_factory.ff.groebner
from sage.modules.free_module_element import FreeModuleElement_generic_dense as module_elem
P.<a,b> = PolynomialRing(GF(73))
M=P^2
module1=Sequence(
    [module_elem(M, [a,a^3]),
     module_elem(M, [1, a])
    ])
groebner(module1)

Sage output:
[(1, a), (a^2 - a, 0)]

Dima Pasechnik

unread,
Oct 18, 2019, 9:21:05 AM10/18/19
to sage-devel, Saliola, Franco Valentino, Markus Wageringel, Anton Leykin
Hi,
well, Sage's functionality for modules over polynomial rings is quite limited.
It assumes that a submodule of a free module is free.
We discussed this at length at a recent Sage/Macaulay2 coding sprint at IMA,
and concluded that it would be quite a bit of work to do.

While this is not improved, your solution is a good one.

Dima
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/d5973687-a902-476b-97fa-c3f2cfbe7a81%40googlegroups.com.

Kwankyu Lee

unread,
Oct 21, 2019, 8:21:37 PM10/21/19
to sage-devel


On Friday, October 18, 2019 at 4:43:53 PM UTC+9, Mao Zeng wrote:
As I understand, groebner_basis() in Sage uses Singular as a backend to compute the groebner basis of ideals in polynomial rings. However, Singular can also compute the groebner basis of modules. Is this functionality available in Sage? Similarly, in Singular the "syz" function can compute the syzygy module of either an ideal or a module, but the syzygy_module() function in Sage seems to work for ideals only. I would like to use Sage instead of using Singular directly. Is there an easy workaround?

You may be interested in this ticket


where computing with Singular modules via Sage is facilitated. 

Bill Hart

unread,
Oct 22, 2019, 4:51:45 PM10/22/19
to sage-devel


On Friday, 18 October 2019 15:21:05 UTC+2, Dima Pasechnik wrote:
Hi,
well, Sage's functionality for modules over polynomial rings is quite limited.
It assumes that a submodule of a free module is free.

In what way does it assume this? There are limitations, but I'm not so sure I would summarise them like this.

We discussed this at length at a recent Sage/Macaulay2 coding sprint at IMA,
and concluded that it would be quite a bit of work to do.

There is a major effort planned/underway to implement more sophisticated modules (in fact as I understand it, J. Boehm already has a prototype/first implementation in Singular itself, conducted under his supervision by a student). 

Bill Hart

unread,
Oct 22, 2019, 4:54:13 PM10/22/19
to sage-devel
From the Singular documentation [1]:

"Hence any finitely generated $R$-module can be represented in SINGULAR by its module of relations."

Dima Pasechnik

unread,
Oct 22, 2019, 5:23:44 PM10/22/19
to sage-devel
On Tue, Oct 22, 2019 at 9:51 PM 'Bill Hart' via sage-devel
<sage-...@googlegroups.com> wrote:
>
>
>
> On Friday, 18 October 2019 15:21:05 UTC+2, Dima Pasechnik wrote:
>>
>> Hi,
>> well, Sage's functionality for modules over polynomial rings is quite limited.
>> It assumes that a submodule of a free module is free.
>
>
> In what way does it assume this? There are limitations, but I'm not so sure I would summarise them like this.

I am talking about Sage, not Singular. Singular's functionality to
work with modules over polynomial rings is not exposed in Sage at all.

In Sage every (sub)module comes with a basis. This works only for
modules over PIDs, if I recall
correctly.

>
>> We discussed this at length at a recent Sage/Macaulay2 coding sprint at IMA,
>> and concluded that it would be quite a bit of work to do.
>
>
> There is a major effort planned/underway to implement more sophisticated modules (in fact as I understand it, J. Boehm already has a prototype/first implementation in Singular itself, conducted under his supervision by a student).
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/9fc49cba-a627-4f50-849f-a93dd37102c4%40googlegroups.com.

Bill Hart

unread,
Oct 25, 2019, 2:22:23 PM10/25/19
to sage-devel


On Tuesday, 22 October 2019 23:23:44 UTC+2, Dima Pasechnik wrote:
On Tue, Oct 22, 2019 at 9:51 PM 'Bill Hart' via sage-devel
<sage-...@googlegroups.com> wrote:
>
>
>
> On Friday, 18 October 2019 15:21:05 UTC+2, Dima Pasechnik wrote:
>>
>> Hi,
>> well, Sage's functionality for modules over polynomial rings is quite limited.
>> It assumes that a submodule of a free module is free.
>
>
> In what way does it assume this? There are limitations, but I'm not so sure I would summarise them like this.

I am talking about Sage, not Singular. Singular's functionality to
work with modules over polynomial rings is not exposed in Sage at all.

In Sage every (sub)module comes with a basis. This works only for
modules over PIDs, if I recall
correctly.

A submodule of a free module over a PID is free, of course.

But yes, Singular handles more general modules, at least over a polynomial ring. 

Bill Hart

unread,
Oct 25, 2019, 2:22:26 PM10/25/19
to sage-devel


On Tuesday, 22 October 2019 23:23:44 UTC+2, Dima Pasechnik wrote:
On Tue, Oct 22, 2019 at 9:51 PM 'Bill Hart' via sage-devel
<sage-...@googlegroups.com> wrote:
>
>
>
> On Friday, 18 October 2019 15:21:05 UTC+2, Dima Pasechnik wrote:
>>
>> Hi,
>> well, Sage's functionality for modules over polynomial rings is quite limited.
>> It assumes that a submodule of a free module is free.
>
>
> In what way does it assume this? There are limitations, but I'm not so sure I would summarise them like this.

I am talking about Sage, not Singular. Singular's functionality to
work with modules over polynomial rings is not exposed in Sage at all.

In Sage every (sub)module comes with a basis. This works only for
modules over PIDs, if I recall
correctly.

Reply all
Reply to author
Forward
0 new messages