diff r 7aea2c23874a sage/rings/polynomial/plural.pyx
a

b


89  89  sage: A1.<x,y,z> = FreeAlgebra(QQ, 3) 
90  90  sage: R1 = A1.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
91  91  sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3) 
92   sage: R2 = A1.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
 92  sage: R2 = A2.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
93  93  sage: A3.<x,y,z> = FreeAlgebra(GF(11), 3) 
94   sage: R3 = A1.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
 94  sage: R3 = A3.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
95  95  sage: A4.<x,y,z> = FreeAlgebra(GF(13), 3) 
96   sage: R4 = A1.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
 96  sage: R4 = A4.g_algebra({y*x:x*yz, z*x:x*z+2*x, z*y:y*z2*y}, order=TermOrder('degrevlex', 2)) 
97  97  sage: _ = gc.collect() 
98  98  sage: foo = R1.gen(0) 
99  99  sage: del foo 
… 
… 

149  149  def _repr_(self): 
150  150  """ 
151  151  EXAMPLE: 
152   sage: from sage.rings.polynomial.plural import MPolynomialRing_plural 
 152  sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural 
153  153  sage: from sage.matrix.constructor import Matrix 
154  154  sage: c=Matrix(2) 
155  155  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)) 
157  157  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, ncrelations: {y*x: x*y} 
 159  sage: x*y 
160  160  x*y 
161   sage: P("y")*P("x") 
 161  sage: y*x 
162  162  x*y 
163  163  """ 
164  164  #TODO: print the relations 
… 
… 

175  175  def relations(self, add_commutative = False): 
176  176  """ 
177  177  EXAMPLE: 
178   sage: from sage.rings.polynomial.plural import MPolynomialRing_plural 
 178  sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural 
179  179  sage: from sage.matrix.constructor import Matrix 
180  180  sage: c=Matrix(2) 
181  181  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)) 
183  183  sage: P # indirect doctest 
184  184  Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, ncrelations: ... 
185  185  """ 
… 
… 

891  891  
892  892  def SCA(base_ring, names, alt_vars, order='degrevlex'): 
893  893  """ 
894   sage: SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex') 
 894  sage: from sage.rings.polynomial.plural import SCA 
 895  sage: E = SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex') 
 896  sage: E # indirect doc test 
 897  Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field, ncrelations: {y*x: xy} 
 898  sage: E.inject_variables() 
 899  Defining x, y, z 
 900  sage: y*x 
 901  xy 
 902  sage: y^2 
 903  0 
895  904  """ 
896  905  n = len(names) 
897  906  alt_start = min(alt_vars) 