Polynomial Interfaces to Singular¶

AUTHORS:

TESTS:

sage: R = PolynomialRing(GF(2**8,'a'),10,'x', order='invlex')
True
sage: P.<a,b> = PolynomialRing(GF(7), 2)
sage: f = (a^3 + 2*b^2*a)^7; f
a^21 + 2*a^7*b^14

class sage.rings.polynomial.polynomial_singular_interface.PolynomialRing_singular_repr

Implements methods to convert polynomial rings to Singular.

This class is a base class for all univariate and multivariate polynomial rings which support conversion from and to Singular rings.

class sage.rings.polynomial.polynomial_singular_interface.Polynomial_singular_repr

Implements coercion of polynomials to Singular polynomials.

This class is a base class for all (univariate and multivariate) polynomial classes which support conversion from and to Singular polynomials.

Due to the incompatibility of Python extension classes and multiple inheritance, this just defers to module-level functions.

lcm(singular=Singular, have_ring=False)

x.__init__(...) initializes x; see help(type(x)) for signature

resultant(other, variable=None)

x.__init__(...) initializes x; see help(type(x)) for signature

sage.rings.polynomial.polynomial_singular_interface.can_convert_to_singular(R)

Returns True if this ring’s base field or ring can be represented in Singular, and the polynomial ring has at least one generator. If this is True then this polynomial ring can be represented in Singular.

The following base rings are supported: finite fields, rationals, number fields, and real and complex fields.

EXAMPLES:

sage: from sage.rings.polynomial.polynomial_singular_interface import can_convert_to_singular
sage: can_convert_to_singular(PolynomialRing(QQ, names=['x']))
True

sage: can_convert_to_singular(PolynomialRing(QQ, names=[]))
False

sage.rings.polynomial.polynomial_singular_interface.lcm_func(self, right, have_ring=False)

Returns the least common multiple of this element and the right element.

INPUT:

• right - multivariate polynomial
• have_ring - see self._singular_(). (Default:False)

OUTPUT: multivariate polynomial representing the least common multiple of self and right

ALGORITHM: Singular

EXAMPLES:

sage: r.<x,y> = PolynomialRing(GF(2**8,'a'),2)
sage: a = r.base_ring().0
sage: f = (a^2+a)*x^2*y + (a^4+a^3+a)*y + a^5
sage: f.lcm(x^4)
(a^2 + a)*x^6*y + (a^4 + a^3 + a)*x^4*y + (a^5)*x^4

sage: w = var('w')
sage: r.<x,y> = PolynomialRing(NumberField(w^4+1,'a'),2)
sage: a = r.base_ring().0
sage: f = (a^2+a)*x^2*y + (a^4+a^3+a)*y + a^5
sage: f.lcm(x^4)
(a^2 + a)*x^6*y + (a^3 + a - 1)*x^4*y + (-a)*x^4


TESTS:

sage: R.<X>=QQ[]
sage: a=R(1)
sage: b=X
sage: lcm(b,a)
X
sage: lcm(a,b)
X

sage.rings.polynomial.polynomial_singular_interface.resultant_func(self, other, variable=None)

computes the resultant of self and the first argument with respect to the variable given as the second argument.

If a second argument is not provide the first variable of self.parent() is chosen.

INPUT:

• other - polynomial in self.parent()
• variable - optional variable (of type polynomial) in self.parent(). (Default: None)

EXAMPLES:

sage: P.<x,y> = PolynomialRing(QQ,2)
sage: a = x+y
sage: b = x^3-y^3
sage: c = a.resultant(b); c
-2*y^3
sage: d = a.resultant(b,y); d
2*x^3


TESTS:

sage: from sage.rings.polynomial.multi_polynomial_ring import MPolynomialRing_polydict_domain
sage: P.<x,y> = MPolynomialRing_polydict_domain(QQ,2,order='degrevlex')
sage: a = x+y
sage: b = x^3-y^3
sage: c = a.resultant(b); c
-2*y^3
sage: d = a.resultant(b,y); d
2*x^3


Previous topic

Dense univariate polynomials over $$\RR$$, implemented using MPFR

Next topic

Isolate Real Roots of Real Polynomials