Hi Robert, On 1 Mrz., 01:00, Robert Goss <goss.rob...@gmail.com> wrote: > I have 2 ideals over the complex field and I would like to take their > intersection. If I try and use the intersection method on one of the > ideals i get an error message from singular stating the following type > error: > > TypeError: Cannot call Singular function 'intersect' with ring > parameter of type '<class > 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain'>'
Sage uses a C-library version of Singular to do intersection (libSingular), but... > This was generated by the code: > R.<x,y> = PolynomialRing(CC, 2) ... unfortunately it does not use libSingular for rings with complex coefficients: sage: type(R) <class 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain'> sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular sage: R.<x,y> = MPolynomialRing_libsingular(CC,2) Traceback (most recent call last): ... NotImplementedError: Base ring is not supported. > Am I doing something wrong? Would anyone suggest a better way of doing > this computation? I think you did nothing wrong -- it should work the way you did it. Here is a work around: sage: R.<x,y> = CC[] sage: I = x*R sage: J = y*R sage: singular(I).intersect(J) x*y That uses another Singular interface (not a C-library). The result lives there, so, you need to pull it back into your ring R: sage: parent(singular(I).intersect(J)) Singular sage: R*list(singular(I).intersect(J)) Ideal (x*y) of Multivariate Polynomial Ring in x, y over Complex Field with 53 bits of precision The second best solution is to work with a base ring that is supported by libSingular: sage: R.<x,y> = ZZ[] sage: I = x*R sage: J = y*R sage: I.intersection(J) Ideal (-x*y) of Multivariate Polynomial Ring in x, y over Integer Ring sage: R.<x,y> = QQ[] sage: I = x*R sage: J = y*R sage: I.intersection(J) Ideal (x*y) of Multivariate Polynomial Ring in x, y over Rational Field Of course, the best solution would be to wrap Singular's complex coefficients in libSingular. Is there a trac ticket for it? Kind regards, Simon -- 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 URL: http://www.sagemath.org