Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support constructing Singular ring with ring order with 'c' or 'C' #28389

Closed
kwankyu opened this issue Aug 23, 2019 · 19 comments
Closed

Support constructing Singular ring with ring order with 'c' or 'C' #28389

kwankyu opened this issue Aug 23, 2019 · 19 comments

Comments

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 23, 2019

Presently, there is no way to construct a multi-variate polynomial ring based on a Singular ring with ring order with 'c' or 'C'. Singular ring order with 'c' or 'C' is useful if computation with modules over the ring is needed.

This ticket aims to support constructing base Singular ring with ring order with 'c' or 'C'.

This enhancement is mainly for developers.

With the patch, we have for instance:

sage: T = TermOrder('degrevlex(2),lex(3)')
sage: P.<a,b,x,y,z> = PolynomialRing(QQ,order=T)
sage: P._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 5
//        block   1 : ordering dp
//                  : names    a b
//        block   2 : ordering lp
//                  : names    x y z
//        block   3 : ordering C
sage: T._singular_ringorder_column = 0
sage: P.<a,b,x,y,z> = PolynomialRing(QQ,order=T)
sage: P._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 5
//        block   1 : ordering C
//        block   2 : ordering dp
//                  : names    a b
//        block   3 : ordering lp
//                  : names    x y z
sage: T._singular_ringorder_column = 1
sage: P.<a,b,x,y,z> = PolynomialRing(QQ,order=T)
sage: P._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 5
//        block   1 : ordering c
//        block   2 : ordering dp
//                  : names    a b
//        block   3 : ordering lp
//                  : names    x y z
sage: T._singular_ringorder_column = 2
sage: P.<a,b,x,y,z> = PolynomialRing(QQ,order=T)
sage: P._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 5
//        block   1 : ordering dp
//                  : names    a b
//        block   2 : ordering C
//        block   3 : ordering lp
//                  : names    x y z
sage: T._singular_ringorder_column = 3
sage: P.<a,b,x,y,z> = PolynomialRing(QQ,order=T)
sage: P._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 5
//        block   1 : ordering dp
//                  : names    a b
//        block   2 : ordering c
//        block   3 : ordering lp
//                  : names    x y z

CC: @saliola @antonleykin @mwageringel

Component: commutative algebra

Author: Kwankyu Lee

Branch/Commit: d16fe7a

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/28389

@kwankyu kwankyu added this to the sage-8.9 milestone Aug 23, 2019
@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 23, 2019

Branch: u/klee/28389

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 23, 2019

Author: Kwankyu Lee

@kwankyu kwankyu changed the title Support Singular ringorder column in term order Support constructing Singular ring with ring order with 'c' or 'C' Aug 23, 2019
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 23, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

cb8a69dSupport singular ring order column(c or C)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 23, 2019

Commit: cb8a69d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 23, 2019

Changed commit from cb8a69d to b240299

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 23, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b240299Support singular ring order column(c or C)

@dimpase
Copy link
Member

dimpase commented Aug 27, 2019

comment:5

what are these c/C orderings? I never heard of them...

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 28, 2019

comment:6

Replying to @dimpase:

what are these c/C orderings? I never heard of them...

Let R=k[x,y,z] and R3 be a free module over R. Then an element of the free module is represented, in Singular, like

(x, -y, x+z) = xgen(1) - ygen(2) + (x+z)*gen(3)

That is, gen(1), gen(2), gen(3) denotes the "columns" of the free module. On the other hand, an element of R is viewed as

x3+z = (x3+z)*gen(1)

by Singular. The ordering of monomials of a free module is determined by ordering of monomial of R like x, y, x+z, ... and ordering of generators like gen(1), gen(2), ...

c/C ordering is ordering of the generators, and the position of c/C ordering in term order determine when to break ties by ordering of generators. TOP (term over position) and POT (position over term) are used to denote typical special cases. C denotes ascending order, and c denotes descending order.

Hence position of c/C ordering affects computations of Groebner bases in free modules over R.

If you compute only over R, c/C ordering doesn't matter. But if you start computing on free modules over R in Singular, it does. But currently Sage does not allow to specify the position of c/C ordering when you create a polynomial ring based on Singular. Typically you want POT or (c,dp) in Singular string.

If you start computing with free modules over the Singular ring underlying (or derived from by _singular_) Sage polynomial ring, then you want to control c/C ordering (the default is TOP, c/C ordering at the end in term order).

This is a developer thing. Hence I decided to make the handle _singular_ringorder_column an underlined attribute.

@dimpase
Copy link
Member

dimpase commented Aug 28, 2019

comment:7

I don't understand how this is "a developer thing". For actually carrying out computations orderings are essential, and for different tasks the user might want to choose a different order. So it should not be hidden from the user.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 28, 2019

comment:8

Replying to @dimpase:

I don't understand how this is "a developer thing". For actually carrying out computations orderings are essential, and for different tasks the user might want to choose a different order. So it should not be hidden from the user.

Note that _singular_ringorder_column is an attribute of TermOrder. A TermOrder object is to specify ordering of monomials of a multi-variate polynomial ring of Sage. For a (non-developer) user of TermOrder, an attribute that is concerned with ordering of monomials of free modules over the underlying Singular ring is irrelevant.

If someday we add a new class ModuleTermOrder for free modules over polynomial rings, then it would internally set _singular_ringorder_column of the TermOrder of the polynomial ring. Then a user is just concerned with the ModuleTermOrder object, but not directly with _singular_ringorder_column`.

@dimpase
Copy link
Member

dimpase commented Aug 28, 2019

comment:9

As a matter of fact, we're interested in getting ChainComplex functionality for modules over polynomial rings (Macaulay2 can do such computations).

But even without ModuleTermOrder, but with c/C, one would be able to do computations in modules over polynomial rings, no?

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 28, 2019

comment:10

Replying to @dimpase:

As a matter of fact, we're interested in getting ChainComplex functionality for modules over polynomial rings (Macaulay2 can do such computations).

Nice. Then you will need this branch :-)

But even without ModuleTermOrder, but with c/C, one would be able to do computations in modules over polynomial rings, no?

I just checked this:

sage: R.<x,y,z> = PolynomialRing(QQ)
sage: R
Multivariate Polynomial Ring in x, y, z over Rational Field
sage: type(R)
<class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
sage: M = R**3
sage: M
Ambient free module of rank 3 over the integral domain Multivariate Polynomial Ring in x, y, z over Rational Field
sage: type(M)
<class 'sage.modules.free_module.FreeModule_ambient_domain_with_category'>

Apparently sage doesn't have a FreeModule_libsingular. (If it had, then there would also be ModuleTermOrder)

So sage doesn't have functionality for modules over polynomial rings like singular or macaulay2.

But sage has singular interface, and we can do

sage: I = R.ideal([x+y,x-y])
sage: Ising = I._singular_()
sage: Ising.syz()
-x+y,
x+y
sage: _.sage()
[-x + y]
[ x + y]

and the computation above would be affected by c/C ordering.

sage: R._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 3
//        block   1 : ordering dp
//                  : names    x y z
//        block   2 : ordering C

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 16, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d16fe7aSupport singular ring order column(c or C)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 16, 2019

Changed commit from b240299 to d16fe7a

@dimpase
Copy link
Member

dimpase commented Oct 22, 2019

comment:12

I totally forgot about this ticket while at IMA, cf. #28573

@fchapoton
Copy link
Contributor

comment:13

Should we merge this as it is now ? the patchbot is green.

@dimpase
Copy link
Member

dimpase commented Jan 5, 2020

comment:14

Thanks for the reminder. I keep forgetting about reviewing these things, sorry.

@dimpase
Copy link
Member

dimpase commented Jan 5, 2020

Reviewer: Dima Pasechnik

@dimpase dimpase modified the milestones: sage-9.0, sage-9.1 Jan 5, 2020
@vbraun
Copy link
Member

vbraun commented Jan 9, 2020

Changed branch from u/klee/28389 to d16fe7a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants