Ticket #4539: extplural-more.patch

File extplural-more.patch, 3.4 KB (added by AlexanderDreyer, 6 years ago)

Doctest fixes by Alexander

  • sage/rings/polynomial/plural.pyx

    diff -r 7aea2c23874a sage/rings/polynomial/plural.pyx
    a b  
    8989            sage: A1.<x,y,z> = FreeAlgebra(QQ, 3)
    9090            sage: R1 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
    9191            sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3)
    92             sage: R2 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
     92            sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
    9393            sage: A3.<x,y,z> = FreeAlgebra(GF(11), 3)
    94             sage: R3 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
     94            sage: R3 = A3.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
    9595            sage: A4.<x,y,z> = FreeAlgebra(GF(13), 3)
    96             sage: R4 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
     96            sage: R4 = A4.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
    9797            sage: _ = gc.collect()
    9898            sage: foo = R1.gen(0)
    9999            sage: del foo
     
    149149    def _repr_(self):
    150150        """
    151151        EXAMPLE:
    152             sage: from sage.rings.polynomial.plural import MPolynomialRing_plural
     152            sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural
    153153            sage: from sage.matrix.constructor  import Matrix
    154154            sage: c=Matrix(2)
    155155            sage: c[0,1]=-1
    156             sage: P = MPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2))
     156            sage: P.<x,y> = NCPolynomialRing_plural(QQ, 2, c=c, d=Matrix(2))
    157157            sage: P # indirect doctest
    158             Noncommutative Multivariate Polynomial Ring in x, y over Rational Field
    159             sage: P("x")*P("y")
     158            Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: {y*x: -x*y}
     159            sage: x*y
    160160            x*y
    161             sage: P("y")*P("x")
     161            sage: y*x
    162162            -x*y
    163163        """
    164164#TODO: print the relations
     
    175175    def relations(self, add_commutative = False):
    176176        """
    177177        EXAMPLE:
    178             sage: from sage.rings.polynomial.plural import MPolynomialRing_plural
     178            sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural
    179179            sage: from sage.matrix.constructor  import Matrix
    180180            sage: c=Matrix(2)
    181181            sage: c[0,1]=-1
    182             sage: P = MPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2))
     182            sage: P = NCPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2))
    183183            sage: P # indirect doctest
    184184            Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: ...
    185185        """
     
    891891
    892892def SCA(base_ring, names, alt_vars, order='degrevlex'):
    893893    """
    894     sage: SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex')
     894sage: from sage.rings.polynomial.plural import SCA
     895sage: E = SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex')
     896sage: E # indirect doc test
     897Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field, nc-relations: {y*x: -xy}
     898sage: E.inject_variables()
     899Defining x, y, z
     900sage: y*x
     901-xy
     902sage: y^2
     9030
    895904    """
    896905    n = len(names)
    897906    alt_start = min(alt_vars)