# Ticket #4539: extplural-more

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

Line | |
---|---|

1 | diff -r 7aea2c23874a sage/rings/polynomial/plural.pyx |

2 | --- a/sage/rings/polynomial/plural.pyx Tue Jul 20 15:16:56 2010 +0200 |

3 | +++ b/sage/rings/polynomial/plural.pyx Tue Jul 20 16:22:29 2010 +0200 |

4 | @@ -89,11 +89,11 @@ |

5 | sage: A1.<x,y,z> = FreeAlgebra(QQ, 3) |

6 | 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)) |

7 | sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3) |

8 | - 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)) |

9 | + 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)) |

10 | sage: A3.<x,y,z> = FreeAlgebra(GF(11), 3) |

11 | - 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)) |

12 | + 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)) |

13 | sage: A4.<x,y,z> = FreeAlgebra(GF(13), 3) |

14 | - 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)) |

15 | + 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)) |

16 | sage: _ = gc.collect() |

17 | sage: foo = R1.gen(0) |

18 | sage: del foo |

19 | @@ -149,16 +149,16 @@ |

20 | def _repr_(self): |

21 | """ |

22 | EXAMPLE: |

23 | - sage: from sage.rings.polynomial.plural import MPolynomialRing_plural |

24 | + sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural |

25 | sage: from sage.matrix.constructor import Matrix |

26 | sage: c=Matrix(2) |

27 | sage: c[0,1]=-1 |

28 | - sage: P = MPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) |

29 | + sage: P.<x,y> = NCPolynomialRing_plural(QQ, 2, c=c, d=Matrix(2)) |

30 | sage: P # indirect doctest |

31 | - Noncommutative Multivariate Polynomial Ring in x, y over Rational Field |

32 | - sage: P("x")*P("y") |

33 | + Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: {y*x: -x*y} |

34 | + sage: x*y |

35 | x*y |

36 | - sage: P("y")*P("x") |

37 | + sage: y*x |

38 | -x*y |

39 | """ |

40 | #TODO: print the relations |

41 | @@ -175,11 +175,11 @@ |

42 | def relations(self, add_commutative = False): |

43 | """ |

44 | EXAMPLE: |

45 | - sage: from sage.rings.polynomial.plural import MPolynomialRing_plural |

46 | + sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural |

47 | sage: from sage.matrix.constructor import Matrix |

48 | sage: c=Matrix(2) |

49 | sage: c[0,1]=-1 |

50 | - sage: P = MPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) |

51 | + sage: P = NCPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) |

52 | sage: P # indirect doctest |

53 | Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: ... |

54 | """ |

55 | @@ -891,7 +891,16 @@ |

56 | |

57 | def SCA(base_ring, names, alt_vars, order='degrevlex'): |

58 | """ |

59 | - sage: SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex') |

60 | +sage: from sage.rings.polynomial.plural import SCA |

61 | +sage: E = SCA(QQ, ['x', 'y', 'z'], [0, 1], order = 'degrevlex') |

62 | +sage: E # indirect doc test |

63 | +Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field, nc-relations: {y*x: -xy} |

64 | +sage: E.inject_variables() |

65 | +Defining x, y, z |

66 | +sage: y*x |

67 | +-xy |

68 | +sage: y^2 |

69 | +0 |

70 | """ |

71 | n = len(names) |

72 | alt_start = min(alt_vars) |