On Saturday 21 February 2009, davidp wrote: > Hi, > > Singular's hilb command does not work as expected: > > sage: R = singular.ring(0,'(x,y,z)','dp') > sage: I = singular.ideal(['x^3-y^2*z','z^2-x*y']) > sage: I.hilb() > `sage90` > > Could someone please explain this?
The hilb() command only prints information and returns nothing, which we don't deal with at this level. You can work around this by: sage: R = singular.ring(0,'(x,y,z)','dp') sage: I = singular.ideal(['x^3-y^2*z','z^2-x*y']) sage: print singular.eval("hilb(%s)"%I.name()) // ** sage43 is no standard basis // 1 t^0 // -1 t^2 // -1 t^3 // 1 t^4 // 1 t^0 // 1 t^1 // -1 t^3 // dimension (proj.) = 1 // degree (proj.) = 1 or you can use Sage's native commands: sage: P.<x,y,z> = QQ[] sage: I = (x^3-y^2*z,z^2-x*y)*P; sage: I.hilbert_series() (t^3 + 2*t^2 + 2*t + 1)/(-t + 1) sage: I.hilbert_series? Type: instancemethod Base Class: <type 'instancemethod'> String Form: <bound method MPolynomialIdeal.hilbert_series of Ideal (x^3 - y^2*z, -x*y + z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field> Namespace: Interactive File: /home/malb/SAGE/local/lib/python2.5/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py Definition: I.hilbert_series(self, singular=Singular) Docstring: Return the Hilbert series of this ideal. Let I = self be a homogeneous ideal and R = self.ring() be a graded commutative algebra (R = oplus R_d) over a field K. Then the Hilbert function is defined as H(d) = dim_K R_d and the Hilbert series of I is defined as the formal power series HS(t) = sum_0^{infty} H(d) t^d. This power series can be expressed as HS(t) = Q(t)/(1-t)^n where Q(t) is a polynomial over Z and n the number of variables in R. This method returns Q(t)/(1-t)^n. EXAMPLE: sage: P.<x,y,z> = PolynomialRing(QQ) sage: I = Ideal([x^3*y^2 + 3*x^2*y^2*z + y^3*z^2 + z^5]) sage: I.hilbert_series() (-t^4 - t^3 - t^2 - t - 1)/(-t^2 + 2*t - 1) Cheers, Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF _www: http://www.informatik.uni-bremen.de/~malb _jab: martinralbre...@jabber.ccc.de --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---