# Changeset 6606:cac6ec5f25c5

Ignore:
Timestamp:
09/30/07 11:10:39 (6 years ago)
Branch:
default
Message:

Changed "Polynomial Ring in ..." to "Multivariate Polynomial Ring in ...".

Location:
sage
Files:
35 edited

Unmodified
Removed
• ## sage/calculus/calculus.py

 r6377 3*x^35 + 2*y^35 sage: parent(g) Polynomial Ring in x, y over Finite Field of size 7 Multivariate Polynomial Ring in x, y over Finite Field of size 7 """ vars = self.variables()
• ## sage/categories/pushout.py

 r5875 TypeError: Ambiguous Base Extension sage: pushout(ZZ['x,y,z'], QQ['w,x,z,t']) Polynomial Ring in w, x, y, z, t over Rational Field Multivariate Polynomial Ring in w, x, y, z, t over Rational Field Some other examples sage: pushout(Zp(7)['y'], Frac(QQ['t'])['x,y,z']) Polynomial Ring in x, y, z over Fraction Field of Univariate Polynomial Ring in t over 7-adic Field with capped relative precision 20 Multivariate Polynomial Ring in x, y, z over Fraction Field of Univariate Polynomial Ring in t over 7-adic Field with capped relative precision 20 sage: pushout(ZZ['x,y,z'], Frac(ZZ['x'])['y']) Polynomial Ring in y, z over Fraction Field of Univariate Polynomial Ring in x over Integer Ring Multivariate Polynomial Ring in y, z over Fraction Field of Univariate Polynomial Ring in x over Integer Ring sage: pushout(MatrixSpace(RDF, 2, 2), Frac(ZZ['x'])) Full MatrixSpace of 2 by 2 dense matrices over Fraction Field of Univariate Polynomial Ring in x over Real Double Field
• ## sage/crypto/mq/sr.py

 r6461 sage: sr.R Polynomial Ring in k100, k101, k102, k103, x100, x101, x102, x103, w100, w101, w102, w103, s000, s001, s002, s003, k000, k001, k002, k003 over Finite Field in a of size 2^4 Multivariate Polynomial Ring in k100, k101, k102, k103, x100, x101, x102, x103, w100, w101, w102, w103, s000, s001, s002, s003, k000, k001, k002, k003 over Finite Field in a of size 2^4 For SR(1,1,1,4) the ShiftRows matrix isn't that interresting:
• ## sage/ext/interactive_constructors_c.pyx

 r5374 sage: S = quo(R, (x^3, x^2 + y^2), 'a,b') sage: S Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^3, x^2 + y^2) Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^3, x^2 + y^2) sage: a^2 -b^2
• ## sage/matrix/matrix2.pyx

 r6590 [x1 x0] sage: M.kernel() Vector space of degree 2 and dimension 1 over Fraction Field of Polynomial Ring in x0, x1 over Rational Field Vector space of degree 2 and dimension 1 over Fraction Field of Multivariate Polynomial Ring in x0, x1 over Rational Field Basis matrix: [ 1 -1]
• ## sage/misc/functional.py

 r6510 sage: R, x = objgens(MPolynomialRing(QQ,3, 'x')) sage: R Polynomial Ring in x0, x1, x2 over Rational Field Multivariate Polynomial Ring in x0, x1, x2 over Rational Field sage: x (x0, x1, x2)
• ## sage/modules/free_module.py

 r6564 sage: M = FreeModule(R,2) sage: M.base_ring() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field sage: VectorSpace(QQ, 10).base_ring() sage: M = FreeModule(R,2) sage: M.ambient_module() Ambient free module of rank 2 over the integral domain Polynomial Ring in x, y over Rational Field Ambient free module of rank 2 over the integral domain Multivariate Polynomial Ring in x, y over Rational Field sage: V = FreeModule(QQ, 4).span([[1,2,3,4], [1,0,0,0]]); V
• ## sage/rings/finite_field.py

 r6518 Multivariate polynomials also coerce: sage: R = k['x,y,z']; R Polynomial Ring in x, y, z over Finite Field in a of size 5^2 Multivariate Polynomial Ring in x, y, z over Finite Field in a of size 5^2 sage: k(R(2)) 2
• ## sage/rings/fraction_field.py

 r5479 Fraction Field of Univariate Polynomial Ring in x over Integer Ring sage: FractionField(MPolynomialRing(RationalField(),2,'x')) Fraction Field of Polynomial Ring in x0, x1 over Rational Field Fraction Field of Multivariate Polynomial Ring in x0, x1 over Rational Field Dividing elements often implicitly creates elements of the fraction field. sage: R = Frac(QQ['x,y']) sage: R Fraction Field of Polynomial Ring in x, y over Rational Field Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field sage: R.ring() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field """ return self.__R EXAMPLES: sage: R = Frac(PolynomialRing(QQ,'z',10)); R Fraction Field of Polynomial Ring in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field Fraction Field of Multivariate Polynomial Ring in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field sage: R.ngens() 10 EXAMPLES: sage: R = Frac(PolynomialRing(QQ,'z',10)); R Fraction Field of Polynomial Ring in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field Fraction Field of Multivariate Polynomial Ring in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field sage: R.0 z0
• ## sage/rings/homset.py

 r5476 sage: S. = R.quotient(x^2 + y^2) sage: phi = S.hom([b,a]); phi Ring endomorphism of Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) Ring endomorphism of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) Defn: a |--> b b |--> a
• ## sage/rings/morphism.py

 r6530 sage: R. = PolynomialRing(QQ,3) sage: phi = R.hom([y,z,x^2]); phi Ring endomorphism of Polynomial Ring in x, y, z over Rational Field Ring endomorphism of Multivariate Polynomial Ring in x, y, z over Rational Field Defn: x |--> y y |--> z sage: phi = S.hom([a^2, -b]) sage: phi Ring endomorphism of Quotient of Polynomial Ring in x, y over Rational Field by the ideal (y^2 + 1) Ring endomorphism of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (y^2 + 1) Defn: a |--> a^2 b |--> -b sage: K = QQ # by the way :-) sage: R. = K[]; R Polynomial Ring in a, b, c, d over Rational Field Multivariate Polynomial Ring in a, b, c, d over Rational Field sage: S. = K[]; S Univariate Polynomial Ring in u over Rational Field sage: f = R.hom([0,0,0,u], S); f Ring morphism: From: Polynomial Ring in a, b, c, d over Rational Field From: Multivariate Polynomial Ring in a, b, c, d over Rational Field To:   Univariate Polynomial Ring in u over Rational Field Defn: a |--> 0 sage: S.lift() Set-theoretic ring morphism: From: Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2, y) To:   Polynomial Ring in x, y over Rational Field From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2, y) To:   Multivariate Polynomial Ring in x, y over Rational Field Defn: Choice of lifting map sage: S.lift() == 0 sage: phi = S.cover(); phi Ring morphism: From: Polynomial Ring in x, y over Rational Field To:   Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) From: Multivariate Polynomial Ring in x, y over Rational Field To:   Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) Defn: Natural quotient map sage: phi(x+y) sage: S. = R.quo(x^3 + y^3 + z^3) sage: phi = S.hom([b, c, a]); phi Ring endomorphism of Quotient of Polynomial Ring in x, y, z over Rational Field by the ideal (x^3 + y^3 + z^3) Ring endomorphism of Quotient of Multivariate Polynomial Ring in x, y, z over Rational Field by the ideal (x^3 + y^3 + z^3) Defn: a |--> b b |--> c
• ## sage/rings/polynomial/groebner_fan.py

 r4499 sage: G = I.groebner_fan(); G Groebner fan of the ideal: Ideal (x^2*y - z, -x + y^2*z, x*z^2 - y) of Polynomial Ring in x, y, z over Rational Field Ideal (x^2*y - z, -x + y^2*z, x*z^2 - y) of Multivariate Polynomial Ring in x, y, z over Rational Field """ self.__is_groebner_basis = is_groebner_basis sage: G._gfan_maps() (Ring morphism: From: Polynomial Ring in x, y, z over Rational Field To:   Polynomial Ring in a, b, c over Rational Field From: Multivariate Polynomial Ring in x, y, z over Rational Field To:   Multivariate Polynomial Ring in a, b, c over Rational Field Defn: x |--> a y |--> b z |--> c, Ring morphism: From: Polynomial Ring in a, b, c over Rational Field To:   Polynomial Ring in x, y, z over Rational Field From: Multivariate Polynomial Ring in a, b, c over Rational Field To:   Multivariate Polynomial Ring in x, y, z over Rational Field Defn: a |--> x b |--> y [z^15 - z, y - z^11, x - z^9] sage: X[0].ideal() Ideal (z^15 - z, y - z^11, x - z^9) of Polynomial Ring in x, y, z over Rational Field Ideal (z^15 - z, y - z^11, x - z^9) of Multivariate Polynomial Ring in x, y, z over Rational Field sage: X[:5] [[z^15 - z, y - z^11, x - z^9], sage: G Groebner fan of the ideal: Ideal (-3*x^2 + y^3, 2*x^2 - x - 2*y^3 - y + z^3) of Polynomial Ring in x, y, z over Rational Field Ideal (-3*x^2 + y^3, 2*x^2 - x - 2*y^3 - y + z^3) of Multivariate Polynomial Ring in x, y, z over Rational Field sage: G.tropical_basis () [-4*x^2 - x - y + z^3, -3*x^2 + y^3] sage: G = R.ideal([x - z^3, y^2 - 13*x]).groebner_fan() sage: G[0].ideal() Ideal (-13*z^3 + y^2, -z^3 + x) of Polynomial Ring in x, y, z over Rational Field Ideal (-13*z^3 + y^2, -z^3 + x) of Multivariate Polynomial Ring in x, y, z over Rational Field """ return self.__groebner_fan.ring().ideal(self)
• ## sage/rings/polynomial/multi_polynomial.pyx

 r5976 x^3 + (17*w^3 + 3*w)*x + w^5 + z^5 sage: parent(f.polynomial(x)) Univariate Polynomial Ring in x over Polynomial Ring in w, z over Rational Field Univariate Polynomial Ring in x over Multivariate Polynomial Ring in w, z over Rational Field sage: f.polynomial(w)
• ## sage/rings/polynomial/multi_polynomial_element.py

 r6511 sage: f = (x + y)/3 sage: f.parent() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field If we do the same over \$\ZZ\$ the result is the same as sage: f = (x + y)/3 sage: f.parent() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field sage: f = (x + y) * 1/3 sage: f.parent() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field But we get a true fraction field if the denominator is not in sage: f = x/y sage: f.parent() Fraction Field of Polynomial Ring in x, y over Integer Ring Fraction Field of Multivariate Polynomial Ring in x, y over Integer Ring """ return self.parent().fraction_field()(self.__element, right.__element) sage: R. = PolynomialRing(GF(7),1); R Polynomial Ring in x over Finite Field of size 7 Multivariate Polynomial Ring in x over Finite Field of size 7 sage: f = 5*x^2 + 3; f -2*x^2 + 3 2 sage: c.parent() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field sage: c in MPolynomialRing(RationalField(), 2, names = ['x','y']) True sage: R. = GF(389)[] sage: parent(R(x*y+5).coefficient(R(1))) Polynomial Ring in x, y over Finite Field of size 389 Multivariate Polynomial Ring in x, y over Finite Field of size 389 """ R = self.parent() 5*x*y^10 + x^2*z^9 + y*z^10 + z^11 sage: g.parent() Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field """ if self.is_homogeneous():
• ## sage/rings/polynomial/multi_polynomial_ideal.py

 r6592 sage: S. = R.quotient((x^2 + y^2, 17))                 # optional -- requires Macaulay2 sage: S                                                     # optional Quotient of Polynomial Ring in x, y over Integer Ring by the ideal (x^2 + y^2, 17) Quotient of Multivariate Polynomial Ring in x, y over Integer Ring by the ideal (x^2 + y^2, 17) sage: a^2 + b^2 == 0                                        # optional True sage: K. = CyclotomicField(3) sage: R. = K[]; R Polynomial Ring in x, y, z over Cyclotomic Field of order 3 and degree 2 Multivariate Polynomial Ring in x, y, z over Cyclotomic Field of order 3 and degree 2 sage: i = ideal(x - zeta*y + 1, x^3 - zeta*y^3); i Ideal (x + (-zeta)*y + 1, x^3 + (-zeta)*y^3) of Polynomial Ring in x, y, z over Cyclotomic Field of order 3 and degree 2 Ideal (x + (-zeta)*y + 1, x^3 + (-zeta)*y^3) of Multivariate Polynomial Ring in x, y, z over Cyclotomic Field of order 3 and degree 2 sage: i.groebner_basis() [x + (-zeta)*y + 1, 3*y^3 + (6*zeta + 3)*y^2 + (3*zeta - 3)*y - zeta - 2] sage: S = R.quotient(i); S Quotient of Polynomial Ring in x, y, z over Cyclotomic Field of order 3 and degree 2 by the ideal (x + (-zeta)*y + 1, x^3 + (-zeta)*y^3) Quotient of Multivariate Polynomial Ring in x, y, z over Cyclotomic Field of order 3 and degree 2 by the ideal (x + (-zeta)*y + 1, x^3 + (-zeta)*y^3) sage: S.0  - zeta*S.1 -1 sage: I = (p*q^2, y-z^2)*R sage: pd = I.complete_primary_decomposition(); pd [(Ideal (z^2 + 1, y + 1) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y + 1) of Polynomial Ring in x, y, z over Rational Field), (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, y - z^2) of Polynomial Ring in x, y, z over Rational Field)] [(Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field), (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field)] sage: I.complete_primary_decomposition(algorithm = 'gtz') [(Ideal (z^2 + 1, y - z^2) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y - z^2) of Polynomial Ring in x, y, z over Rational Field), (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, y - z^2) of Polynomial Ring in x, y, z over Rational Field)] [(Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field), (Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field)] """ try: sage: I = (p*q^2, y-z^2)*R sage: I.primary_decomposition() [Ideal (z^2 + 1, y + 1) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^6 + 4*z^3 + 4, y - z^2) of Polynomial Ring in x, y, z over Rational Field] [Ideal (z^2 + 1, y + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^6 + 4*z^3 + 4, y - z^2) of Multivariate Polynomial Ring in x, y, z over Rational Field] """ sage: I = (p*q^2, y-z^2)*R sage: I.associated_primes() [Ideal (y + 1, z^2 + 1) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Polynomial Ring in x, y, z over Rational Field] [Ideal (y + 1, z^2 + 1) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of Multivariate Polynomial Ring in x, y, z over Rational Field] """ return [P for _,P in self.complete_primary_decomposition(algorithm)] sage: R. = PolynomialRing(QQ, 4, order='lex') sage: I = sage.rings.ideal.Cyclic(R,4); I Ideal (a + b + c + d, a*b + a*d + b*c + c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d - 1) of Polynomial Ring in a, b, c, d over Rational Field Ideal (a + b + c + d, a*b + a*d + b*c + c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d - 1) of Multivariate Polynomial Ring in a, b, c, d over Rational Field sage: I._groebner_basis_using_singular() [c^2*d^6 - c^2*d^2 - d^4 + 1, c^3*d^2 + c^2*d^3 - c - d, b*d^4 - b + d^5 - d, b*c - b*d^5 + c^2*d^4 + c*d - d^6 - d^2, b^2 + 2*b*d + d^2, a + b + c + d] sage: R. = PolynomialRing(QQ, 4, order='lex') sage: I = sage.rings.ideal.Cyclic(R,4); I Ideal (a + b + c + d, a*b + a*d + b*c + c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d - 1) of Polynomial Ring in a, b, c, d over Rational Field Ideal (a + b + c + d, a*b + a*d + b*c + c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d - 1) of Multivariate Polynomial Ring in a, b, c, d over Rational Field sage: I._groebner_basis_using_libsingular() [c^2*d^6 - c^2*d^2 - d^4 + 1, c^3*d^2 + c^2*d^3 - c - d, b*d^4 - b + d^5 - d, b*c - b*d^5 + c^2*d^4 + c*d - d^6 - d^2, b^2 + 2*b*d + d^2, a + b + c + d] sage: J = y*R sage: I.intersection(J) Ideal (x*y) of Polynomial Ring in x, y over Rational Field Ideal (x*y) of Multivariate Polynomial Ring in x, y over Rational Field The following simple example illustrates that the product need not equal the intersection. sage: J = (y^2, x)*R sage: K = I.intersection(J); K Ideal (y^2, x*y, x^2) of Polynomial Ring in x, y over Rational Field Ideal (y^2, x*y, x^2) of Multivariate Polynomial Ring in x, y over Rational Field sage: IJ = I*J; IJ Ideal (x^2*y^2, x^3, y^3, x*y) of Polynomial Ring in x, y over Rational Field Ideal (x^2*y^2, x^3, y^3, x*y) of Multivariate Polynomial Ring in x, y over Rational Field sage: IJ == K False sage: I = (p*q^2, y-z^2)*R sage: I.minimal_associated_primes () [Ideal (z^3 + 2, -z^2 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, -z^2 + y) of Polynomial Ring in x, y, z over Rational Field] [Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] ALGORITHM: Uses Singular. sage: I = (x^2, y^3, (x*z)^4 + y^3 + 10*x^2)*R sage: I.radical() Ideal (y, x) of Polynomial Ring in x, y, z over Rational Field Ideal (y, x) of Multivariate Polynomial Ring in x, y, z over Rational Field That the radical is correct is clear from the Groebner basis. sage: I = (p*q^2, y-z^2)*R sage: I.radical() Ideal (z^2 - y, y^2*z + y*z + 2*y + 2) of Polynomial Ring in x, y, z over Rational Field Ideal (z^2 - y, y^2*z + y*z + 2*y + 2) of Multivariate Polynomial Ring in x, y, z over Rational Field \note{(From Singular manual) A combination of the algorithms sage: I = (p*q^2, y - z^2)*R sage: I.radical() Ideal (z^2 - y, y^2*z + y*z + 2*y + 2) of Polynomial Ring in x, y, z over Finite Field of size 37 Ideal (z^2 - y, y^2*z + y*z + 2*y + 2) of Multivariate Polynomial Ring in x, y, z over Finite Field of size 37 """ S = self.ring() sage: J = Ideal(I.transformed_basis('fglm',S)) sage: J Ideal (y^4 + y^3, x*y^3 - y^3, x^2 + y^3, z^4 + y^3 - y) of Polynomial Ring in z, x, y over Rational Field Ideal (y^4 + y^3, x*y^3 - y^3, x^2 + y^3, z^4 + y^3 - y) of Multivariate Polynomial Ring in z, x, y over Rational Field sage: # example from the Singular manual page of gwalk sage: R.=PolynomialRing(GF(32003),3,order='lex') sage: I = R * [x-t,y-t^2,z-t^3,s-x+y^3] sage: I.elimination_ideal([t,s]) Ideal (y^2 - x*z, x*y - z, x^2 - y) of Polynomial Ring in x, y, t, s, z over Rational Field Ideal (y^2 - x*z, x*y - z, x^2 - y) of Multivariate Polynomial Ring in x, y, t, s, z over Rational Field ALGORITHM: Uses SINGULAR sage: I = ideal(x*y-z^2, y^2-w^2)       # optional sage: I                                 # optional Ideal (x*y - z^2, y^2 - w^2) of Polynomial Ring in x, y, z, w over Integer Ring Ideal (x*y - z^2, y^2 - w^2) of Multivariate Polynomial Ring in x, y, z, w over Integer Ring """ #def __init__(self, ring, gens, coerce=True): sage: R. = PolynomialRing(IntegerRing(), 2, order='lex') sage: R.ideal([x, y]) Ideal (x, y) of Polynomial Ring in x, y over Integer Ring Ideal (x, y) of Multivariate Polynomial Ring in x, y over Integer Ring sage: R. = GF(3)[] sage: R.ideal([x0^2, x1^3]) Ideal (x0^2, x1^3) of Polynomial Ring in x0, x1 over Finite Field of size 3 Ideal (x0^2, x1^3) of Multivariate Polynomial Ring in x0, x1 over Finite Field of size 3 """ Ideal_generic.__init__(self, ring, gens, coerce=coerce)
• ## sage/rings/polynomial/multi_polynomial_libsingular.pyx

 r6605 sage: P. = QQ[] sage: P Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field sage: f = 27/113 * x^2 + y*z + 1/2; f sage: P = MPolynomialRing(GF(127),3,names='abc', order='lex') sage: P Polynomial Ring in a, b, c over Finite Field of size 127 Multivariate Polynomial Ring in a, b, c over Finite Field of size 127 sage: a,b,c = P.gens() sage: P. = QQ[] sage: P Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field """ varstr = ", ".join([ rRingVar(i,self._ring)  for i in range(self.__ngens) ]) return "Polynomial Ring in %s over %s"%(varstr,self._base) return "Multivariate Polynomial Ring in %s over %s"%(varstr,self._base) def ngens(self): sage: P. = QQ[] sage: sage.rings.ideal.Katsura(P) Ideal (x + 2*y + 2*z - 1, x^2 + 2*y^2 + 2*z^2 - x, 2*x*y + 2*y*z - y) of Polynomial Ring in x, y, z over Rational Field Ideal (x + 2*y + 2*z - 1, x^2 + 2*y^2 + 2*z^2 - x, 2*x*y + 2*y*z - y) of Multivariate Polynomial Ring in x, y, z over Rational Field sage: P.ideal([x + 2*y + 2*z-1, 2*x*y + 2*y*z-y, x^2 + 2*y^2 + 2*z^2-x]) Ideal (x + 2*y + 2*z - 1, 2*x*y + 2*y*z - y, x^2 + 2*y^2 + 2*z^2 - x) of Polynomial Ring in x, y, z over Rational Field Ideal (x + 2*y + 2*z - 1, 2*x*y + 2*y*z - y, x^2 + 2*y^2 + 2*z^2 - x) of Multivariate Polynomial Ring in x, y, z over Rational Field """ sage: P. = QQ[] sage: hash(P) -6257278808099690586 # 64-bit 967902441410893180 # 64-bit -1767675994 # 32-bit """ sage: f = (x + y)/3 sage: f.parent() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field Note that / is still a constructor for elements of the (x^3 + y)/x sage: h.parent() Fraction Field of Polynomial Ring in x, y over Rational Field Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field TESTS: sage: R. = MPolynomialRing(GF(7),1); R Polynomial Ring in x over Finite Field of size 7 Multivariate Polynomial Ring in x over Finite Field of size 7 sage: f = 5*x^2 + 3; f -2*x^2 + 3 2 sage: c.parent() Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field sage: c in P True sage: R. = MPolynomialRing(GF(389),2) sage: parent(R(x*y+5).coefficient(R(1))) Polynomial Ring in x, y over Finite Field of size 389 Multivariate Polynomial Ring in x, y over Finite Field of size 389 """ cdef poly *p = self._poly 5*x*y^10 + x^2*z^9 + y*z^10 + z^11 sage: g.parent() Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field sage: f.homogenize(x) 2*x^11 + x^10*y + 5*x*y^10
• ## sage/rings/polynomial/multi_polynomial_ring.py

 r6382 EXAMPLES: sage: R = MPolynomialRing(Integers(12), 'x', 5); R Polynomial Ring in x0, x1, x2, x3, x4 over Ring of integers modulo 12 Multivariate Polynomial Ring in x0, x1, x2, x3, x4 over Ring of integers modulo 12 sage.: loads(R.dumps()) == R     # TODO -- this currently hangs sometimes (??) True -4*y^3 + x^2 sage: parent(f) Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field sage: parent(S(f)) Polynomial Ring in x, y over Integer Ring Multivariate Polynomial Ring in x, y over Integer Ring We coerce from the finite field. 3*y^3 + x^2 sage: parent(f) Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field We dump and load a the polynomial ring S: sage: parent(f) Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field A more complicated symbolic and computational mix.  Behind the scenes (-z^3 + y^3 + x^3)^10 sage: g = R(f); parent(g) Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field sage: (f - g).expand() 0
• ## sage/rings/polynomial/multi_polynomial_ring_generic.pyx

 r6592 def _repr_(self): return "Polynomial Ring in %s over %s"%(", ".join(self.variable_names()), self.base_ring()) return "Multivariate Polynomial Ring in %s over %s"%(", ".join(self.variable_names()), self.base_ring()) def repr_long(self):
• ## sage/rings/polynomial/polynomial_ring.py

 r6428 False sage: R = PolynomialRing(ZZ,1,'w'); R Polynomial Ring in w over Integer Ring Multivariate Polynomial Ring in w over Integer Ring sage: is_PolynomialRing(R) False Univariate Polynomial Ring in x over Integer Ring sage: R.extend_variables('y, z') Polynomial Ring in x, y, z over Integer Ring Multivariate Polynomial Ring in x, y, z over Integer Ring sage: R.extend_variables(('y', 'z')) Polynomial Ring in x, y, z over Integer Ring Multivariate Polynomial Ring in x, y, z over Integer Ring """ if isinstance(added_names, str): x^2 + 2*x*y + y^2 + 2*x*z + 2*y*z + z^2 sage: parent(x) Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field sage: t = polygens(QQ,['x','yz','abc']) sage: t
• ## sage/rings/polynomial/polynomial_ring_constructor.py

 r5371 EXAMPLES of VARIABLE NAME CONTEXT: sage: R. = PolynomialRing(QQ,2); R Polynomial Ring in x, y over Rational Field Multivariate Polynomial Ring in x, y over Rational Field sage: f = x^2 - 2*y^2 2. PolynomialRing(base_ring, names,   order='degrevlex'): sage: R = PolynomialRing(QQ, 'a,b,c'); R Polynomial Ring in a, b, c over Rational Field Multivariate Polynomial Ring in a, b, c over Rational Field sage: S = PolynomialRing(QQ, ['a','b','c']); S Polynomial Ring in a, b, c over Rational Field Multivariate Polynomial Ring in a, b, c over Rational Field sage: T = PolynomialRing(QQ, ('a','b','c')); T Polynomial Ring in a, b, c over Rational Field Multivariate Polynomial Ring in a, b, c over Rational Field All three rings are identical. There is a unique polynomial ring with each term order: sage: R = PolynomialRing(QQ, 'x,y,z', order='degrevlex'); R Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field sage: S = PolynomialRing(QQ, 'x,y,z', order='revlex'); S Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field sage: S is PolynomialRing(QQ, 'x,y,z', order='revlex') True variables, then variables labeled with numbers are created. sage: PolynomialRing(QQ, 'x', 10) Polynomial Ring in x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 over Rational Field Multivariate Polynomial Ring in x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 over Rational Field sage: PolynomialRing(GF(7), 'y', 5) Polynomial Ring in y0, y1, y2, y3, y4 over Finite Field of size 7 Multivariate Polynomial Ring in y0, y1, y2, y3, y4 over Finite Field of size 7 sage: PolynomialRing(QQ, 'y', 3, sparse=True) Polynomial Ring in y0, y1, y2 over Rational Field Multivariate Polynomial Ring in y0, y1, y2 over Rational Field It is easy in Python to create fairly aribtrary variable names. sage: R = PolynomialRing(ZZ, ['x%s'%p for p in primes(100)]); R Polynomial Ring in x2, x3, x5, x7, x11, x13, x17, x19, x23, x29, x31, x37, x41, x43, x47, x53, x59, x61, x67, x71, x73, x79, x83, x89, x97 over Integer Ring Multivariate Polynomial Ring in x2, x3, x5, x7, x11, x13, x17, x19, x23, x29, x31, x37, x41, x43, x47, x53, x59, x61, x67, x71, x73, x79, x83, x89, x97 over Integer Ring By calling the \code{inject_variables()} method all those variable You can also call \code{injvar}, which is a convenient shortcut for \code{inject_variables()}. sage: R = PolynomialRing(GF(7),15,'w'); R Polynomial Ring in w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14 over Finite Field of size 7 Multivariate Polynomial Ring in w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14 over Finite Field of size 7 sage: R.injvar() Defining w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14
• ## sage/rings/polynomial/toy_buchberger.py

 r5619 sage: I Ideal (a + 2*b + 2*c - 1, a^2 + 2*b^2 + 2*c^2 - a, 2*a*b + 2*b*c - b) of Polynomial Ring in a, b, c over Finite Field of size 127 Ideal (a + 2*b + 2*c - 1, a^2 + 2*b^2 + 2*c^2 - a, 2*a*b + 2*b*c - b) of Multivariate Polynomial Ring in a, b, c over Finite Field of size 127 The original Buchberger algorithm performs 15 useless reductions to zero for this example:
• ## sage/rings/quotient_ring.py

 r6383 sage: T. = S.quo(a) sage: T Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x, y^2 + 1) Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x, y^2 + 1) sage: T.gens() (0, d) sage: l = pi.lift(); l Set-theoretic ring morphism: From: Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2, y^2) To:   Polynomial Ring in x, y over Rational Field From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2, y^2) To:   Multivariate Polynomial Ring in x, y over Rational Field Defn: Choice of lifting map sage: l(x+y^3) sage: pi = S.cover(); pi Ring morphism: From: Polynomial Ring in x, y over Rational Field To:   Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) From: Multivariate Polynomial Ring in x, y over Rational Field To:   Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) Defn: Natural quotient map sage: L = S.lift(); L Set-theoretic ring morphism: From: Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) To:   Polynomial Ring in x, y over Rational Field From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) To:   Multivariate Polynomial Ring in x, y over Rational Field Defn: Choice of lifting map sage: L(S.0)
• ## sage/rings/quotient_ring_element.py

 r4483 sage: R. = PolynomialRing(QQ, 2) sage: S = R.quo(x^2 + y^2); S Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) sage: S.gens() (xbar, ybar)
• ## sage/rings/ring.pyx

 r6375 Univariate Polynomial Ring in abc over Finite Field of size 17 sage: GF(17)['a,b,c'] Polynomial Ring in a, b, c over Finite Field of size 17 Multivariate Polynomial Ring in a, b, c over Finite Field of size 17 We can also create power series rings (in one variable) by sage: R. = QQ[] sage: R.ideal(x,y) Ideal (x, y) of Polynomial Ring in x, y over Rational Field Ideal (x, y) of Multivariate Polynomial Ring in x, y over Rational Field sage: R.ideal(x+y^2) Ideal (y^2 + x) of Polynomial Ring in x, y over Rational Field Ideal (y^2 + x) of Multivariate Polynomial Ring in x, y over Rational Field sage: R.ideal( [x^3,y^3+x^3] ) Ideal (x^3, x^3 + y^3) of Polynomial Ring in x, y over Rational Field Ideal (x^3, x^3 + y^3) of Multivariate Polynomial Ring in x, y over Rational Field """ C = self._ideal_class_() sage: R. = GF(7)[] sage: (x+y)*R Ideal (x + y) of Polynomial Ring in x, y, z over Finite Field of size 7 Ideal (x + y) of Multivariate Polynomial Ring in x, y, z over Finite Field of size 7 sage: (x+y,z+y^3)*R Ideal (x + y, y^3 + z) of Polynomial Ring in x, y, z over Finite Field of size 7 Ideal (x + y, y^3 + z) of Multivariate Polynomial Ring in x, y, z over Finite Field of size 7 """ if isinstance(self, Ring): sage: R. = ZZ[] sage: R.principal_ideal(x+2*y) Ideal (x + 2*y) of Polynomial Ring in x, y over Integer Ring Ideal (x + 2*y) of Multivariate Polynomial Ring in x, y over Integer Ring """ return self.ideal([gen], coerce=coerce) sage: R = Integers(389)['x,y'] sage: Frac(R) Fraction Field of Polynomial Ring in x, y over Ring of integers modulo 389 Fraction Field of Multivariate Polynomial Ring in x, y over Ring of integers modulo 389 sage: R.fraction_field() Fraction Field of Polynomial Ring in x, y over Ring of integers modulo 389 Fraction Field of Multivariate Polynomial Ring in x, y over Ring of integers modulo 389 """ if self.is_field(): sage: S. = R.quotient((x^2, y)) sage: S Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2, y) Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2, y) sage: S.gens() (a, 0) sage: S. = R.quo((x^2, y)) sage: S Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2, y) Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2, y) sage: S.gens() (a, 0) Rational Field sage: Frac(ZZ['x,y']).integral_closure() Fraction Field of Polynomial Ring in x, y over Integer Ring Fraction Field of Multivariate Polynomial Ring in x, y over Integer Ring """ return self
• ## sage/schemes/elliptic_curves/constructor.py

 r5772 sage: R = ZZ['u', 'v'] sage: EllipticCurve(R, [1,1]) Elliptic Curve defined by y^2  = x^3 + x +1 over Polynomial Ring in u, v Elliptic Curve defined by y^2  = x^3 + x +1 over Multivariate Polynomial Ring in u, v over Integer Ring """
• ## sage/schemes/generic/affine_space.py

 r3344 Affine Space of dimension 2 over Rational Field sage: A.coordinate_ring() Polynomial Ring in X, Y over Rational Field Multivariate Polynomial Ring in X, Y over Rational Field Use the divide operator for base extension. EXAMPLES: sage: R = AffineSpace(2, GF(9,'alpha'), 'z').coordinate_ring(); R Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2 Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2 sage: AffineSpace(3, R, 'x').coordinate_ring() Polynomial Ring in x0, x1, x2 over Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2 Multivariate Polynomial Ring in x0, x1, x2 over Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size 3^2 """ try: (x, y^2, x*y^2) sage: I = X.defining_ideal(); I Ideal (x, y^2, x*y^2) of Polynomial Ring in x, y over Rational Field Ideal (x, y^2, x*y^2) of Multivariate Polynomial Ring in x, y over Rational Field sage: I.groebner_basis() [x, y^2]
• ## sage/schemes/generic/divisor.py

 r4487 3 sage: D[1][1] Ideal (x, y) of Polynomial Ring in x, y, z over Finite Field of size 5 Ideal (x, y) of Multivariate Polynomial Ring in x, y, z over Finite Field of size 5 sage: C.divisor([(3, pts[0]), (-1, pts[1]), (10,pts[5])]) 10*(x + 2*z, y + z) + 3*(x, y) - (x, z)
• ## sage/schemes/generic/morphism.py

 r6221 X: Spectrum of Univariate Polynomial Ring in x over Rational Field Y: Spectrum of Univariate Polynomial Ring in y over Rational Field U: Spectrum of Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) U: Spectrum of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) sage: a, b = P1.gluing_maps() sage: a Affine Scheme morphism: From: Spectrum of Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) From: Spectrum of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) To:   Spectrum of Univariate Polynomial Ring in x over Rational Field Defn: Ring morphism: From: Univariate Polynomial Ring in x over Rational Field To:   Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) To:   Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) Defn: x |--> xbar sage: b Affine Scheme morphism: From: Spectrum of Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) From: Spectrum of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) To:   Spectrum of Univariate Polynomial Ring in y over Rational Field Defn: Ring morphism: From: Univariate Polynomial Ring in y over Rational Field To:   Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) To:   Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x*y - 1) Defn: y |--> ybar """
• ## sage/schemes/generic/projective_space.py

 r4482 Projective Space of dimension 2 over Rational Field sage: x.parent() Polynomial Ring in x, y, z over Rational Field Multivariate Polynomial Ring in x, y, z over Rational Field For example, we use \$x,y,z\$ to define the intersection of two lines. Projective Space of dimension 2 over Rational Field sage: P.coordinate_ring() Polynomial Ring in X, Y, Z over Rational Field Multivariate Polynomial Ring in X, Y, Z over Rational Field The divide operator does base extension. Projective Space of dimension 2 over Finite Field of size 7 sage: P.coordinate_ring() Polynomial Ring in x, y, z over Finite Field of size 7 Multivariate Polynomial Ring in x, y, z over Finite Field of size 7 sage: P.coordinate_ring() is R True Defn: Structure map sage: X.coordinate_ring() Polynomial Ring in x, y, z, w over Rational Field Multivariate Polynomial Ring in x, y, z, w over Rational Field Loading and saving: EXAMPLES: sage: ProjectiveSpace(3, GF(19^2,'alpha'), 'abcd').coordinate_ring() Polynomial Ring in a, b, c, d over Finite Field in alpha of size 19^2 Multivariate Polynomial Ring in a, b, c, d over Finite Field in alpha of size 19^2 sage: ProjectiveSpace(3).coordinate_ring() Polynomial Ring in x0, x1, x2, x3 over Integer Ring Multivariate Polynomial Ring in x0, x1, x2, x3 over Integer Ring sage: ProjectiveSpace(2, QQ, ['alpha', 'beta', 'gamma']).coordinate_ring() Polynomial Ring in alpha, beta, gamma over Rational Field Multivariate Polynomial Ring in alpha, beta, gamma over Rational Field """ try: (x*z^2, y^2*z, x*y^2) sage: I = X.defining_ideal(); I Ideal (x*z^2, y^2*z, x*y^2) of Polynomial Ring in x, y, z over Rational Field Ideal (x*z^2, y^2*z, x*y^2) of Multivariate Polynomial Ring in x, y, z over Rational Field sage: I.groebner_basis() [x*z^2, y^2*z, x*y^2]
• ## sage/schemes/generic/spec.py

 r4851 Spectrum of Univariate Polynomial Ring in x over Rational Field sage: Spec(PolynomialRing(QQ, 'x', 3)) Spectrum of Polynomial Ring in x0, x1, x2 over Rational Field Spectrum of Multivariate Polynomial Ring in x0, x1, x2 over Rational Field sage: X = Spec(PolynomialRing(GF(49,'a'), 3, 'x')); X Spectrum of Polynomial Ring in x0, x1, x2 over Finite Field in a of size 7^2 Spectrum of Multivariate Polynomial Ring in x0, x1, x2 over Finite Field in a of size 7^2 sage: loads(X.dumps()) == X True Rational Field sage: Spec(PolynomialRing(QQ,3, 'x')).coordinate_ring() Polynomial Ring in x0, x1, x2 over Rational Field Multivariate Polynomial Ring in x0, x1, x2 over Rational Field """ return self.__R
• ## sage/schemes/plane_curves/constructor.py

 r4482 0 sage: I = X.defining_ideal(); I Ideal (x^3 + y^3 + z^3, x^4 + y^4 + z^4) of Polynomial Ring in x, y, z over Rational Field Ideal (x^3 + y^3 + z^3, x^4 + y^4 + z^4) of Multivariate Polynomial Ring in x, y, z over Rational Field EXAMPLE: In three variables, the defining equation must be homogeneous.
• ## sage/structure/coerce.pyx

 r6418 t + x + zeta13 sage: f.parent() Polynomial Ring in t, x over Cyclotomic Field of order 13 and degree 12 Multivariate Polynomial Ring in t, x over Cyclotomic Field of order 13 and degree 12 sage: ZZ['x','y'].0 + ~Frac(QQ['y']).0 (x*y + 1)/y w + x sage: f.parent() Polynomial Ring in w, x, y, z, a over Rational Field Multivariate Polynomial Ring in w, x, y, z, a over Rational Field sage: ZZ['x,y,z'].0 + ZZ['w,x,z,a'].1 2*x
• ## sage/structure/parent.pyx

 r6377 sage: R. = PolynomialRing(QQ, 2) sage: R.Hom(QQ) Set of Homomorphisms from Polynomial Ring in x, y over Rational Field to Rational Field Set of Homomorphisms from Multivariate Polynomial Ring in x, y over Rational Field to Rational Field Homspaces are defined for very general \sage objects, even elements of familiar rings.
• ## sage/structure/parent_base.pyx

 r5571 sage: R. = PolynomialRing(QQ, 2) sage: R.Hom(QQ) Set of Homomorphisms from Polynomial Ring in x, y over Rational Field to Rational Field Set of Homomorphisms from Multivariate Polynomial Ring in x, y over Rational Field to Rational Field Homspaces are defined for very general \sage objects, even elements of familiar rings.
• ## sage/structure/parent_gens.pyx

 r6570 sage: R, vars = MPolynomialRing(QQ,3, 'x').objgens() sage: R Polynomial Ring in x0, x1, x2 over Rational Field Multivariate Polynomial Ring in x0, x1, x2 over Rational Field sage: vars (x0, x1, x2) sage: R = QQ['x,y,abc']; R Polynomial Ring in x, y, abc over Rational Field Multivariate Polynomial Ring in x, y, abc over Rational Field sage: R.2 abc
Note: See TracChangeset for help on using the changeset viewer.