Ticket #991: trac_991_doctest.patch

File trac_991_doctest.patch, 6.3 KB (added by malb, 14 years ago)
  • sage/rings/polynomial/multi_polynomial_ideal.py

    # HG changeset patch
    # User Martin Albrecht <malb@informatik.uni-bremen.de>
    # Date 1195321697 0
    # Node ID 448d02694afbb79f3ac4f095ce8b5b320a19a8ae
    # Parent  0b49417bdbc793222688baf7ce4e5acbed9c6cfb
    added doctest for #991
    
    diff -r 0b49417bdbc7 -r 448d02694afb sage/rings/polynomial/multi_polynomial_ideal.py
    a b class MPolynomialIdeal_singular_repr: 
    376376            sage: GB.triangular_decomposition('singular:triangLfak')
    377377            [Ideal (a - 1, b - 1, c - 1, d^2 + 3*d + 1, e + d + 3) of
    378378            Multivariate Polynomial Ring in e, d, c, b, a over
    379             Rational Field,
    380             Ideal (a - 1, b - 1, c^2 + 3*c + 1, d + c + 3, e - 1) of
     379            Rational Field, Ideal (a - 1, b - 1, c^2 + 3*c + 1, d + c
     380            + 3, e - 1) of Multivariate Polynomial Ring in e, d, c, b,
     381            a over Rational Field, Ideal (a - 1, b^4 + b^3 + b^2 + b +
     382            1, c - b^2, d - b^3, e + b^3 + b^2 + b + 1) of
    381383            Multivariate Polynomial Ring in e, d, c, b, a over
    382             Rational Field,
    383             Ideal (a - 1, b^4 + b^3 + b^2 + b + 1, c - b^2, d - b^3, e
    384             + b^3 + b^2 + b + 1) of Multivariate Polynomial Ring in e,
    385             d, c, b, a over Rational Field,
    386             Ideal (a - 1, b^2 + 3*b + 1, c + b + 3, d - 1, e - 1) of
     384            Rational Field, Ideal (a - 1, b^2 + 3*b + 1, c + b + 3, d
     385            - 1, e - 1) of Multivariate Polynomial Ring in e, d, c, b,
     386            a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b -
     387            1, c + a^3 + a^2 + a + 1, d - a^3, e - a^2) of
    387388            Multivariate Polynomial Ring in e, d, c, b, a over
    388             Rational Field,
    389             Ideal (a^4 + a^3 + a^2 + a + 1, b - 1, c + a^3 + a^2 + a +
    390             1, d - a^3, e - a^2) of Multivariate Polynomial Ring in e,
    391             d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a
    392             + 1, b - a, c - a, d^2 + 3*d*a + a^2, e + d + 3*a) of
    393             Multivariate Polynomial Ring in e, d, c, b, a over
    394             Rational Field,
     389            Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1, b - a, c -
     390            a, d^2 + 3*d*a + a^2, e + d + 3*a) of Multivariate
     391            Polynomial Ring in e, d, c, b, a over Rational Field,
    395392            Ideal (a^4 + a^3 + a^2 + a + 1, b - a, c^2 + 3*c*a + a^2,
    396393            d + c + 3*a, e - a) of Multivariate Polynomial Ring in e,
    397             d, c, b, a over Rational Field,
    398             Ideal (a^4 + a^3 + a^2 + a + 1, b^3 + b^2*a + b^2 + b*a^2
    399             + b*a + b + a^3 + a^2 + a + 1, c + b^2*a^3 + b^2*a^2 +
    400             b^2*a + b^2, d - b^2*a^2 - b^2*a - b^2 - b*a^2 - b*a -
    401             a^2, e - b^2*a^3 + b*a^2 + b*a + b + a^2 + a) of
     394            d, c, b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a
     395            + 1, b^3 + b^2*a + b^2 + b*a^2 + b*a + b + a^3 + a^2 + a +
     396            1, c + b^2*a^3 + b^2*a^2 + b^2*a + b^2, d - b^2*a^2 -
     397            b^2*a - b^2 - b*a^2 - b*a - a^2, e - b^2*a^3 + b*a^2 + b*a
     398            + b + a^2 + a) of Multivariate Polynomial Ring in e, d, c,
     399            b, a over Rational Field, Ideal (a^4 + a^3 + a^2 + a + 1,
     400            b^2 + 3*b*a + a^2, c + b + 3*a, d - a, e - a) of
    402401            Multivariate Polynomial Ring in e, d, c, b, a over
    403             Rational Field,
    404             Ideal (a^4 + a^3 + a^2 + a + 1, b^2 + 3*b*a + a^2, c + b +
    405             3*a, d - a, e - a) of Multivariate Polynomial Ring in e,
    406             d, c, b, a over Rational Field,
    407             Ideal (a^4 + a^3 + 6*a^2 - 4*a + 1, 11*b^2 - 6*b*a^3 -
    408             10*b*a^2 - 39*b*a - 2*b - 16*a^3 - 23*a^2 - 104*a + 24,
    409             11*c + 3*a^3 + 5*a^2 + 25*a + 1, 11*d + 3*a^3 + 5*a^2 +
    410             25*a + 1, 11*e + 11*b - 6*a^3 - 10*a^2 - 39*a - 2) of
    411             Multivariate Polynomial Ring in e, d, c, b, a over
    412             Rational Field,
    413             Ideal (a^4 - 4*a^3 + 6*a^2 + a + 1, 11*b^2 - 6*b*a^3 +
    414             26*b*a^2 - 41*b*a + 4*b + 8*a^3 - 31*a^2 + 40*a + 24, 11*c
    415             + 3*a^3 - 13*a^2 + 26*a - 2, 11*d + 3*a^3 - 13*a^2 + 26*a
    416             - 2, 11*e + 11*b - 6*a^3 + 26*a^2 - 41*a + 4) of
    417             Multivariate Polynomial Ring in e, d, c, b, a over
    418             Rational Field,
    419             Ideal (a^2 + 3*a + 1, b - 1, c - 1, d - 1, e + a + 3) of
    420             Multivariate Polynomial Ring in e, d, c, b, a over
    421             Rational Field, Ideal (a^2 + 3*a + 1, b + a + 3, c - 1, d
    422             - 1, e - 1) of Multivariate Polynomial Ring in e, d, c, b,
    423             a over Rational Field]
     402            Rational Field, Ideal (a^4 - 4*a^3 + 6*a^2 + a + 1, 11*b^2
     403            - 6*b*a^3 + 26*b*a^2 - 41*b*a + 4*b + 8*a^3 - 31*a^2 +
     404            40*a + 24, 11*c + 3*a^3 - 13*a^2 + 26*a - 2, 11*d + 3*a^3
     405            - 13*a^2 + 26*a - 2, 11*e + 11*b - 6*a^3 + 26*a^2 - 41*a +
     406            4) of Multivariate Polynomial Ring in e, d, c, b, a over
     407            Rational Field, Ideal (a^4 + a^3 + 6*a^2 - 4*a + 1, 11*b^2
     408            - 6*b*a^3 - 10*b*a^2 - 39*b*a - 2*b - 16*a^3 - 23*a^2 -
     409            104*a + 24, 11*c + 3*a^3 + 5*a^2 + 25*a + 1, 11*d + 3*a^3
     410            + 5*a^2 + 25*a + 1, 11*e + 11*b - 6*a^3 - 10*a^2 - 39*a -
     411            2) of Multivariate Polynomial Ring in e, d, c, b, a over
     412            Rational Field, Ideal (a^2 + 3*a + 1, b - 1, c - 1, d - 1,
     413            e + a + 3) of Multivariate Polynomial Ring in e, d, c, b,
     414            a over Rational Field, Ideal (a^2 + 3*a + 1, b + a + 3, c
     415            - 1, d - 1, e - 1) of Multivariate Polynomial Ring in e,
     416            d, c, b, a over Rational Field]
    424417            """
    425418
    426419        P = self.ring()
    class MPolynomialIdeal_singular_repr: 
    10871080            sage: I.vector_space_dimension()
    10881081            48
    10891082
     1083        TESTS:
     1084            sage: K.<w> = GF(27)
     1085            sage: P.<x, y> = PolynomialRing(K, 2, order='lex')
     1086            sage: I = Ideal([ x^8 + y + 2, y^6 + x*y^5 + x^2 ])
     1087
     1088            Testing the robustness of the Singular interface
     1089           
     1090            sage: T = I.triangular_decomposition('singular:triangLfak')
     1091            sage: I.variety()
     1092            [{y: w^2 + 2, x: 2*w}, {y: w^2 + w, x: 2*w + 1}, {y: w^2 + 2*w, x: 2*w + 2}]
     1093
    10901094        ALGORITHM: Uses triangular decomposition.
    10911095        """
    10921096        def _variety(T, V, v=None):