Ask Your Question

Can I define a graded ring in sage?

asked 2016-06-20 21:40:28 +0100

done_with_fish gravatar image

I can define a custom grading on a polynomial ring in Macaulay2 with the command

S = QQ[x,y, Degrees => {{1},{2}}]

Can I define this ring in sage?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-21 08:38:33 +0100

B r u n o gravatar image

If I correctly understand the Macaulay2 command you provide, you can mimick the same behavior in SageMath as follows:

sage: T = TermOrder("wdeglex", (1,2))
sage: R = PolynomialRing(QQ, 'x,y', order=T)
sage: R
Multivariate Polynomial Ring in x, y over Rational Field
sage: x,y = R.gens()
sage: (x*y).degree()

You can find more informations on term orders in the documentation [1]. Several weighted term orders are available.


edit flag offensive delete link more


Ahh great! Also, is it possible to define a bidegree? TermOrder('wdeglex', ((1,0),(2,2))) returns a TypeError

done_with_fish gravatar imagedone_with_fish ( 2016-06-21 18:50:07 +0100 )edit

I do not think so. I urge you to propose a ticket on to implement this kind of term orders.

B r u n o gravatar imageB r u n o ( 2016-06-22 08:47:59 +0100 )edit

Well, thinking a bit more about this, you can use matrix term orders:

sage: S = TermOrder('M(2,3,0,1)')
sage: S
Matrix term order with matrix
[2 3]
[0 1]

In such a way, the first variable will have weight (2,0) and the second (3,1). This order is used when you compare monomials. Unfortunately, the method degree only returns the degree with respect with the first weight of each variable rather than a tuple. I do not know how one can get the tuple.

B r u n o gravatar imageB r u n o ( 2016-06-22 09:00:54 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-06-20 21:40:28 +0100

Seen: 770 times

Last updated: Jun 21 '16