# Ticket #4539: extplural-more.patch

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

Doctest fixes by Alexander

• ## sage/rings/polynomial/plural.pyx

`diff -r 7aea2c23874a sage/rings/polynomial/plural.pyx`
 a sage: A1. = FreeAlgebra(QQ, 3) 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)) sage: A2. = FreeAlgebra(GF(5), 3) 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)) 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)) sage: A3. = FreeAlgebra(GF(11), 3) 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)) 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)) sage: A4. = FreeAlgebra(GF(13), 3) 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)) 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)) sage: _ = gc.collect() sage: foo = R1.gen(0) sage: del foo def _repr_(self): """ EXAMPLE: sage: from sage.rings.polynomial.plural import MPolynomialRing_plural sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural sage: from sage.matrix.constructor  import Matrix sage: c=Matrix(2) sage: c[0,1]=-1 sage: P = MPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) sage: P. = NCPolynomialRing_plural(QQ, 2, c=c, d=Matrix(2)) sage: P # indirect doctest Noncommutative Multivariate Polynomial Ring in x, y over Rational Field sage: P("x")*P("y") Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: {y*x: -x*y} sage: x*y x*y sage: P("y")*P("x") sage: y*x -x*y """ #TODO: print the relations def relations(self, add_commutative = False): """ EXAMPLE: sage: from sage.rings.polynomial.plural import MPolynomialRing_plural sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural sage: from sage.matrix.constructor  import Matrix sage: c=Matrix(2) sage: c[0,1]=-1 sage: P = MPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) sage: P = NCPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) sage: P # indirect doctest Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: ... """ def SCA(base_ring, names, alt_vars, order='degrevlex'): """ sage: SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex') sage: from sage.rings.polynomial.plural import SCA sage: E = SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex') sage: E # indirect doc test Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field, nc-relations: {y*x: -xy} sage: E.inject_variables() Defining x, y, z sage: y*x -xy sage: y^2 0 """ n = len(names) alt_start = min(alt_vars)