Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fixing doctests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Apr 10, 2016
1 parent 2d48ce1 commit 02df281
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/sage/algebras/associated_graded.py
Expand Up @@ -139,10 +139,10 @@ class AssociatedGradedAlgebra(CombinatorialFreeModule):
``grA`` are isomorphic::
sage: grA(A.an_element())
bar(U['x']^2*U['y']^2*U['z']^3) + bar(U['x']) + 2*bar(U['z']) + 3*bar(1)
bar(U['x']^2*U['y']^2*U['z']^3) + 2*bar(U['x']) + 3*bar(U['y']) + bar(1)
sage: elt = A.an_element() + A.algebra_generators()['x'] + 2
sage: grelt = grA(elt); grelt
bar(U['x']^2*U['y']^2*U['z']^3) + 2*bar(U['x']) + 2*bar(U['z']) + 5*bar(1)
bar(U['x']^2*U['y']^2*U['z']^3) + 3*bar(U['x']) + 3*bar(U['y']) + 3*bar(1)
sage: A(grelt) == elt
True
Expand Down Expand Up @@ -241,10 +241,10 @@ def _element_constructor_(self, x):
sage: grA = A.graded_algebra()
sage: grA(A.an_element())
bar(U['x']^2*U['y']^2*U['z']^3)
+ bar(U['x']) + 2*bar(U['z']) + 3*bar(1)
+ 2*bar(U['x']) + 3*bar(U['y']) + bar(1)
sage: grA(A.an_element() + A.algebra_generators()['x'] + 2)
bar(U['x']^2*U['y']^2*U['z']^3)
+ 2*bar(U['x']) + 2*bar(U['z']) + 5*bar(1)
+ 3*bar(U['x']) + 3*bar(U['y']) + 3*bar(1)
"""
if isinstance(x, CombinatorialFreeModule.Element):
if x.parent() is self._A:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/jordan_algebra.py
Expand Up @@ -287,7 +287,7 @@ def _an_element_(self):
sage: F.<x,y,z> = FreeAlgebra(QQ)
sage: J = JordanAlgebra(F)
sage: J.an_element()
2*y + 2*y^2 + 3*y^2*z
2 + 2*x + 3*y
"""
return self.element_class(self, self._A.an_element())

Expand Down
Expand Up @@ -114,7 +114,7 @@ def degree_on_basis(self, m):
sage: A.degree_on_basis((x^4).leading_support())
4
sage: a = A.an_element(); a
U['x']^2*U['y']^2*U['z']^3 + U['x'] + 2*U['z'] + 3
U['x']^2*U['y']^2*U['z']^3 + 2*U['x'] + 3*U['y'] + 1
sage: A.degree_on_basis(a.leading_support())
1
sage: s = sorted(a.support(), key=str)[2]; s
Expand Down
10 changes: 5 additions & 5 deletions src/sage/categories/filtered_algebras_with_basis.py
Expand Up @@ -131,10 +131,10 @@ def to_graded_conversion(self):
sage: A = Algebras(QQ).WithBasis().Filtered().example()
sage: p = A.an_element() + A.algebra_generators()['x'] + 2; p
U['x']^2*U['y']^2*U['z']^3 + 2*U['x'] + 2*U['z'] + 5
U['x']^2*U['y']^2*U['z']^3 + 3*U['x'] + 3*U['y'] + 3
sage: q = A.to_graded_conversion()(p); q
bar(U['x']^2*U['y']^2*U['z']^3)
+ 2*bar(U['x']) + 2*bar(U['z']) + 5*bar(1)
bar(U['x']^2*U['y']^2*U['z']^3) + 3*bar(U['x'])
+ 3*bar(U['y']) + 3*bar(1)
sage: q.parent() is A.graded_algebra()
True
"""
Expand All @@ -160,7 +160,7 @@ def from_graded_conversion(self):
sage: A = Algebras(QQ).WithBasis().Filtered().example()
sage: p = A.an_element() + A.algebra_generators()['x'] + 2; p
U['x']^2*U['y']^2*U['z']^3 + 2*U['x'] + 2*U['z'] + 5
U['x']^2*U['y']^2*U['z']^3 + 3*U['x'] + 3*U['y'] + 3
sage: q = A.to_graded_conversion()(p)
sage: A.from_graded_conversion()(q) == p
True
Expand Down Expand Up @@ -191,7 +191,7 @@ def projection(self, i):
sage: A = Algebras(QQ).WithBasis().Filtered().example()
sage: p = A.an_element() + A.algebra_generators()['x'] + 2; p
U['x']^2*U['y']^2*U['z']^3 + 2*U['x'] + 2*U['z'] + 5
U['x']^2*U['y']^2*U['z']^3 + 3*U['x'] + 3*U['y'] + 3
sage: q = A.projection(7)(p); q
bar(U['x']^2*U['y']^2*U['z']^3)
sage: q.parent() is A.graded_algebra()
Expand Down
16 changes: 8 additions & 8 deletions src/sage/categories/filtered_modules_with_basis.py
Expand Up @@ -835,11 +835,11 @@ def homogeneous_component(self, n):
sage: G = A.algebra_generators()
sage: g = A.an_element() - 2 * G['x'] * G['y']; g
U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y']
+ U['x'] + 2*U['z'] + 3
+ 2*U['x'] + 3*U['y'] + 1
sage: g.homogeneous_component(-1)
0
sage: g.homogeneous_component(0)
3
1
sage: g.homogeneous_component(2)
-2*U['x']*U['y']
sage: g.homogeneous_component(5)
Expand Down Expand Up @@ -901,22 +901,22 @@ def truncate(self, n):
sage: G = A.algebra_generators()
sage: g = A.an_element() - 2 * G['x'] * G['y']; g
U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y']
+ U['x'] + 2*U['z'] + 3
+ 2*U['x'] + 3*U['y'] + 1
sage: g.truncate(-1)
0
sage: g.truncate(0)
0
sage: g.truncate(2)
U['x'] + 2*U['z'] + 3
2*U['x'] + 3*U['y'] + 1
sage: g.truncate(3)
-2*U['x']*U['y'] + U['x'] + 2*U['z'] + 3
-2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1
sage: g.truncate(5)
-2*U['x']*U['y'] + U['x'] + 2*U['z'] + 3
-2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1
sage: g.truncate(7)
-2*U['x']*U['y'] + U['x'] + 2*U['z'] + 3
-2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1
sage: g.truncate(8)
U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y']
+ U['x'] + 2*U['z'] + 3
+ 2*U['x'] + 3*U['y'] + 1
TESTS:
Expand Down

0 comments on commit 02df281

Please sign in to comment.