# Changeset 4077:96ed94d32305

Ignore:
Timestamp:
04/23/07 01:50:08 (6 years ago)
Branch:
default
Children:
4078:3cee4b64bf26, 4079:0f2ffefcfa13, 4099:543dba25c40e, 4103:bf0311ec7662, 4136:1578cb90808d, 4804:2c23e747fbb7, 4806:3bf6690d9871
Message:

Martin's patch.

Location:
sage
Files:
11 edited

Unmodified
Removed
• ## sage/ext/interactive_constructors_c.pyx

 r3973 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 (y^2 + x^2, x^3) Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^3, y^2 + x^2) sage: a^2 -1*b^2
• ## sage/rings/groebner_fan.py

 r4007 sage: G = I.groebner_fan(); G Groebner fan of the ideal: Ideal (y^2*z - x, -1*y + x*z^2, -1*z + x^2*y) of Polynomial Ring in x, y, z over Rational Field Ideal (-1*z + x^2*y, y^2*z - x, -1*y + x*z^2) of Polynomial Ring in x, y, z over Rational Field """ self.__is_groebner_basis = is_groebner_basis sage: G = R.ideal([x^2*y - z, y^2*z - x, z^2*x - y]).groebner_fan() sage: G._gfan_ideal() '{-1*b + a*c^2, b^2*c - a, -1*c + a^2*b}' '{-1*c + a^2*b, b^2*c - a, -1*b + a*c^2}' """ try:
• ## sage/rings/ideal.py

 r4059 sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2]) sage: I Ideal (x^2 + 1, x^2 + 3*x + 4) of Univariate Polynomial Ring in x over Integer Ring Ideal (x^2 + 3*x + 4, x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring sage: Ideal(R, [4 + 3*x + x^2, 1 + x^2]) Ideal (x^2 + 1, x^2 + 3*x + 4) of Univariate Polynomial Ring in x over Integer Ring Ideal (x^2 + 3*x + 4, x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring sage: Ideal((4 + 3*x + x^2, 1 + x^2)) Ideal (x^2 + 1, x^2 + 3*x + 4) of Univariate Polynomial Ring in x over Integer Ring Ideal (x^2 + 3*x + 4, x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring sage: ideal(x^2-2*x+1, x^2-1) Ideal (x^2 - 2*x + 1, x^2 - 1) of Univariate Polynomial Ring in x over Integer Ring Ideal (x^2 - 1, x^2 - 2*x + 1) of Univariate Polynomial Ring in x over Integer Ring sage: ideal([x^2-2*x+1, x^2-1]) Ideal (x^2 - 2*x + 1, x^2 - 1) of Univariate Polynomial Ring in x over Integer Ring sage: ideal(x^2-2*x+1, x^2-1) Ideal (x^2 - 2*x + 1, x^2 - 1) of Univariate Polynomial Ring in x over Integer Ring sage: ideal([x^2-2*x+1, x^2-1]) Ideal (x^2 - 2*x + 1, x^2 - 1) of Univariate Polynomial Ring in x over Integer Ring Ideal (x^2 - 1, x^2 - 2*x + 1) of Univariate Polynomial Ring in x over Integer Ring This example illustrates how SAGE finds a common ambient ring for the ideal, even though sage: i = ideal(1,t,t^2) sage: i Ideal (1, t, t^2) of Univariate Polynomial Ring in t over Integer Ring Ideal (t, 1, t^2) of Univariate Polynomial Ring in t over Integer Ring sage: i = ideal(1/2,t,t^2) Traceback (most recent call last): if coerce: gens = [ring(x) for x in gens] gens = list(set(gens)) # Regarding the "important" comment below: Otherwise the # generators will be in a completely random order, given the # code that comes before that line.  A basic design choice in # SAGE is that as much as possible lists of objects (e.g., # list(R), where R is finite), should not be in a random # order.  Feel free to add this as a comment.  It would be # fine to replace the sort by something else, if it yields the # same answer.  However, I don't think randomizing the orders # of things, e.g., lists of generators, for no reason, is a # good idea in SAGE.  This is another "rule of thumb" for the # programmer's guide. gens.sort()    # important! self.__gens = tuple(gens) MonoidElement.__init__(self, ring.ideal_monoid())
• ## sage/rings/morphism.py

 r4057 sage: S.lift() Set-theoretic ring morphism: From: Quotient of Polynomial Ring in x, y over Rational Field by the ideal (y, y^2 + x^2) From: Quotient of Polynomial Ring in x, y over Rational Field by the ideal (y^2 + x^2, y) To:   Polynomial Ring in x, y over Rational Field Defn: Choice of lifting map
• ## sage/rings/multi_polynomial_element.py

 r4061 sage: M = f.lift(I) sage: M [y^4 + x*y^5 + x^2*y^3 + x^3*y^4 + x^4*y^2 + x^5*y^3 + x^6*y + x^7*y^2 + x^8, y^7] [y^7, y^4 + x*y^5 + x^2*y^3 + x^3*y^4 + x^4*y^2 + x^5*y^3 + x^6*y + x^7*y^2 + x^8] sage: sum( map( mul , zip( M, I.gens() ) ) ) == f True
• ## sage/rings/multi_polynomial_ideal.py

 r4057 sage: S = I._singular_() sage: S y, x^3+y x^3+y, y """ if singular is None: singular = singular_default Ideal (y^2, x*y, x^2) of Polynomial Ring in x, y over Rational Field sage: IJ = I*J; IJ Ideal (y^3, x*y, x^2*y^2, x^3) of Polynomial Ring in x, y over Rational Field Ideal (x^2*y^2, x^3, y^3, x*y) of 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 (-1*z^2 + y, 2 + z^3) of Polynomial Ring in x, y, z over Rational Field, Ideal (-1*z^2 + y, 1 + z^2) of Polynomial Ring in x, y, z over Rational Field] [Ideal (2 + z^3, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (1 + z^2, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field] ALGORITHM: Uses Singular. sage: I = ideal([x^2,x*y^4,y^5]) sage: I.integral_closure() [x^2, y^5, x*y^3] [x^2, y^5, -1*x*y^3] ALGORITHM: Use Singular sage: R. = PolynomialRing(IntegerRing(), 2, order='lex') sage: R.ideal([x, y]) Ideal (y, x) of Polynomial Ring in x, y over Integer Ring Ideal (x, y) of Polynomial Ring in x, y over Integer Ring sage: R. = GF(3)[] sage: R.ideal([x0^2, x1^3])
• ## sage/rings/number_field/number_field_ideal.py

 r4019 sage: J = K.ideal([i+1, 2]) sage: J.gens() (2, i + 1) (i + 1, 2) sage: J.gens_reduced() (i + 1,)
• ## sage/rings/quotient_ring.py

 r4059 sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2]) sage: S = R.quotient_ring(I); S Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 1, x^2 + 3*x + 4) Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1) sage: R. = PolynomialRing(QQ) sage: l = pi.lift(); l Set-theoretic ring morphism: From: Quotient of Polynomial Ring in x, y over Rational Field by the ideal (y^2, x^2) 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 Defn: Choice of lifting map
• ## sage/rings/quotient_ring_element.py

 r4059 sage: R. = PolynomialRing(ZZ) sage: S. = R.quo((4 + 3*x + x^2, 1 + x^2)); S Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 1, x^2 + 3*x + 4) Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1) sage: v = S.gens(); v (xbar,)
• ## sage/rings/ring.pyx

 r4057 sage: R. = QQ[] sage: R.ideal((x,y)) Ideal (y, x) of Polynomial Ring in x, y over Rational Field Ideal (x, y) of 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 sage: S. = R.quotient((x^2, y)) sage: S Quotient of Polynomial Ring in x, y over Rational Field by the ideal (y, x^2) Quotient of 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 (y, x^2) Quotient of Polynomial Ring in x, y over Rational Field by the ideal (x^2, y) sage: S.gens() (a, 0)
• ## sage/schemes/generic/divisor.py

 r2147 True sage: D = D1 - D2 + D3; D 10*(z + y, 2*z + x) + 3*(y, x) - (z, x) 10*(2*z + x, z + y) + 3*(x, y) - (x, z) sage: D[1][0] 3 sage: D[1][1] Ideal (y, x) of Polynomial Ring in x, y, z over Finite Field of size 5 Ideal (x, y) of 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*(z + y, 2*z + x) + 3*(y, x) - (z, x) 10*(2*z + x, z + y) + 3*(x, y) - (x, z) """ #******************************************************************************* [(0, 0), (2, 2), (2, 3), (3, 1), (3, 4)] sage: D = C.divisor(pts[0])*3 - C.divisor(pts[1]); D -(3 + y, 3 + x) + 3*(y, x) -(3 + x, 3 + y) + 3*(x, y) sage: D.scheme() Affine Curve over Finite Field of size 5 defined by y^2 + 4*x + 4*x^9 sage: D = E.divisor(P) sage: D (y, x) (x, y) sage: 10*D 10*(y, x) 10*(x, y) sage: E.divisor([P, P]) 2*(y, x) 2*(x, y) sage: E.divisor([(3,P), (-4,5*P)]) -4*(5/8*z + y, -1/4*z + x) + 3*(y, x) -4*(-1/4*z + x, 5/8*z + y) + 3*(x, y) """ def __init__(self, v, check=True, reduce=True, parent=None): [(0, 0), (2, 2), (2, 3), (3, 1), (3, 4)] sage: D = C.divisor([(3,pts[0]), (-1, pts[1])]); D -(3 + y, 3 + x) + 3*(y, x) -(3 + x, 3 + y) + 3*(x, y) sage: D.support() [(0, 0), (2, 2)] 1 sage: D = C.divisor([(3,pts[0]), (-1,pts[1])]); D -(3 + y, 3 + x) + 3*(y, x) -(3 + x, 3 + y) + 3*(x, y) sage: D.coeff(pts[0]) 3
Note: See TracChangeset for help on using the changeset viewer.