Thanks very much, Simon! That worked very nicely. I don’t know why Maple was hanging on the same computation. ☹
However, I’ve got a new question. I’m trying to recover the operations that transform my original basis into the standard basis and back. Based on the SageMath documentation it seems like I should be able to use the lift() method to accomplish this but it doesn’t seem to be working for the example I’m interested in. In one direction the lift() method seems to be giving incorrect results, and in the other direction it’s hanging. (Minimal code below; hope it’s readable!)
Thanks very much for any help anyone can give me!
-----Josh
---------------------------------------------------------------------------------------
from sage.symbolic.expression_conversions import polynomial
P.<py__1, py__2, py__3> = PolynomialRing(CyclotomicField(3),3,order='negdegrevlex');P
Multivariate Polynomial Ring in py__1, py__2, py__3 over Cyclotomic Field of order 3 and degree 2
s1 = -1/12*sqrt(-3)*py__1^4 - 5/24*py__1^4 + 1/3*sqrt(-3)*py__1^3 + 1/2*py__1^2 - 1/2*sqrt(-3)*py__1 + 1/2*py__1 + py__2
s2 = -1/12*sqrt(-3)*py__2^4 - 5/24*py__2^4 + 1/3*sqrt(-3)*py__2^3 + 1/2*py__2^2 - 1/2*sqrt(-3)*py__2 + 1/2*py__2 + py__3
s3 = -1/12*sqrt(-3)*py__3^4 - 5/24*py__3^4 + 1/3*sqrt(-3)*py__3^3 + 1/2*py__3^2 - 1/2*sqrt(-3)*py__3 + py__1 + 1/2*py__3
u1 = polynomial(s1, ring=P)
u2 = polynomial(s2, ring=P)
u3 = polynomial(s3, ring=P)
myI = P*(s1, s2, s3)
myI.groebner_basis()
[py__1 + (-zeta3)*py__3 + 1/2*py__3^2 + (2/3*zeta3 + 1/3)*py__3^3, py__2 + (zeta3 + 1)*py__3 - 1/2*py__3^2 + (-1/6*zeta3 - 1/3)*py__3^3, py__3^4]
J = Ideal(myI.groebner_basis()); J
Ideal (py__1 + (-zeta3)*py__3 + 1/2*py__3^2 + (2/3*zeta3 + 1/3)*py__3^3, py__2 + (zeta3 + 1)*py__3 - 1/2*py__3^2 + (-1/6*zeta3 - 1/3)*py__3^3, py__3^4) of Multivariate Polynomial Ring in py__1, py__2, py__3 over Cyclotomic Field of order 3 and degree 2
u1 in J
True
l = u1.lift(J.gens())
sum(map(mul, zip(l, J.gens()))) == u1 #Should reconstruct u1 but it does not
False
v1, v2, v3 = J.gens()
v1 in myI
True
m = v1.lift(myI.gens()); m #Should reconstruct v1 but it hangs
Error in lines 1-1
Traceback (most recent call last):
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1230, in execute
exec(
File "", line 1, in <module>
File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 4579, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:35894)
sig_on()
KeyboardInterrupt
From: Simon King
Sent: Sunday, December 13, 2020 3:26 AM
To: sage-s...@googlegroups.com
Subject: [sage-support] Re: What's the easiest way to calculate a Hironaka standard basis using SageMath?
Hi Joshua,
SageMath uses Singular to compute Gröbner and standard bases.
I think that Singular (and thus, SageMath) doesn't strictly distinguish
between a Gröbner basis and a standard basis, because in a global term
ordering (i.e. 1 is smallest), both notions coincide, and thus in local
term orderings (i.e. 1 is biggest), they don't distinguish either,
although Buchberger (coining the notion "Gröbner basis") only considered
global orderings, whereas Hironaka (coining the notion "standard basis")
was more into local orderings.
Example from the docs:
"""
Sage also supports local orderings:
sage: P.<x,y,z> = PolynomialRing(QQ,3,order='negdegrevlex')
sage: I = P * ( x*y*z + z^5, 2*x^2 + y^3 + z^7, 3*z^5 +y^5 )
sage: I.groebner_basis()
[x^2 + 1/2*y^3, x*y*z + z^5, y^5 + 3*z^5, y^4*z - 2*x*z^5, z^6]
"""
Note that Singular seems to give a different answer:
sage: singular(I).std()
2*x^2+y^3+z^7,
x*y*z+z^5,
y^5+3*z^5,
y^4*z-2*x*z^5,
3*z^6+2*x*y*z^5
But in fact it isn't, because by default, in local orderings, Singular
doesn't seem to do tail reductions and also wouldn't automatically
normalise the leading monomials, whereas SageMath does. I'm
demonstrating that Singular's and SageMath's answers coincide:
sage: singular.option('redTail')
sage: singular(I).std().interred().normalize()
x^2+1/2*y^3,
x*y*z+z^5,
y^5+3*z^5,
y^4*z-2*x*z^5,
z^6
Best regards,
Simon
On 2020-12-12, Joshua Holden <joshuar...@gmail.com> wrote:
>
>
> Hi, everyone!
>
> I'm trying to do some computations with (truncated) multivariable power
> series, which I'd like to put into Hironaka standard basis form. This is
> almost the same as a Groebner basis, except that the "leading" terms have
> smallest degree instead of largest. This requires slight changes to the
> algorithms in order to make sure they terminate. Does anyone know if this
> has been implemented in Sage or have a good way to fake it? I don't use
> Sage a lot and I can't find anything obvious in the documentation so I
> thought I'd ask before trying to re-implement something. I tried
> ask.sagemath.org and someone said this might be a better place.
>
> Thanks very much!
>
> ----Josh
>
--
You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/Ffm6TlM-zN0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/rr4j7d%241el%241%40ciao.gmane.io.
This email originated from outside of Rose-Hulman. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Sent from Mail for Windows 10