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

Commit

Permalink
more doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpc5 committed Jul 5, 2018
1 parent 9504bc2 commit 97ce629
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 42 deletions.
8 changes: 4 additions & 4 deletions src/sage/algebras/lie_algebras/lie_algebra_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ cdef class LieAlgebraElementWrapper(ElementWrapper):
sage: x = L.gen(2); x
(1,2,3)
sage: y = L.gen(1); y
(1,3,2)
(1,3)
sage: u = x*3; u
3*(1,2,3)
sage: parent(u) == L
Expand All @@ -366,13 +366,13 @@ cdef class LieAlgebraElementWrapper(ElementWrapper):
sage: parent(u) == L
True
sage: elt = x*y - y*x; elt
0
-b3 + b5
sage: xp, yp = x.lift_associative(), y.lift_associative()
sage: eltp = xp*yp - yp*xp; eltp
0
-(2,3) + (1,2)
sage: G = list(S.basis())
sage: G[4] - G[5]
-(1,2) + (1,3)
-(1,2) + (1,3,2)
TESTS::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/finite_dimensional_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,10 @@ def peirce_decomposition(self, idempotents=None, check=True):
sage: [[decomposition[i][j].dimension() # long time (4s)
....: for j in range(len(decomposition))]
....: for i in range(len(decomposition))]
[[9, 0, 0, 0, 0],
[[1, 0, 0, 0, 0],
[0, 9, 0, 0, 0],
[0, 0, 4, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 9, 0],
[0, 0, 0, 0, 1]]
The dimension of each block is `d^2`, where `d` is the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def structure_coefficients(self, include_zeros=False):
sage: S = GroupAlgebra(G, QQ)
sage: L = LieAlgebra(associative=S)
sage: L.structure_coefficients()
Finite family {((1,3,2), (1,3)): (2,3) - (1,2), ((1,2,3), (1,3)): -(2,3) + (1,2), ((1,3,2), (1,2)): -(2,3) + (1,3), ((2,3), (1,3)): -(1,2,3) + (1,3,2), ((1,2,3), (1,2)): (2,3) - (1,3), ((1,3), (1,2)): -(1,2,3) + (1,3,2), ((2,3), (1,2)): (1,2,3) - (1,3,2), ((1,3,2), (2,3)): (1,2) - (1,3), ((1,2,3), (2,3)): -(1,2) + (1,3)}
Finite family {((1,3), (2,3)): (1,2,3) - (1,3,2), ((2,3), (1,3,2)): -(1,2) + (1,3), ((1,3), (1,3,2)): -(2,3) + (1,2), ((1,3,2), (1,2)): -(2,3) + (1,3), ((1,3), (1,2,3)): (2,3) - (1,2), ((1,2,3), (1,2)): (2,3) - (1,3), ((1,3), (1,2)): -(1,2,3) + (1,3,2), ((2,3), (1,2)): (1,2,3) - (1,3,2), ((1,2,3), (2,3)): -(1,2) + (1,3)}
"""
d = {}
B = self.basis()
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ class provides even greater flexibility, including changing
k| a b c a b c b a c b a c
l| a b c a b c c b a c b a
sage: trans = T.translation()
sage: comm = [trans['a'], trans['d'],trans['h']]
sage: comm = [trans['a'], trans['b'],trans['c']]
sage: comm
[(), (1,2)(3,4), (1,4,2,3)(5,6)]
[(), (5,6,7), (5,7,6)]
sage: P=G.cayley_table(elements=comm)
sage: P
* a b c
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def submodule(self, gens, check=True, already_echelonized=False,
sage: S3A = S3.algebra(QQ)
sage: basis = S3A.annihilator_basis(S3A.algebra_generators(), S3A.bracket)
sage: basis
((), (1,2,3) + (1,3,2), (2,3) + (1,2) + (1,3))
((), (2,3) + (1,2) + (1,3), (1,2,3) + (1,3,2))
sage: center = S3A.submodule(basis,
....: category=AlgebrasWithBasis(QQ).Subobjects(),
....: already_echelonized=True)
Expand All @@ -782,7 +782,7 @@ def submodule(self, gens, check=True, already_echelonized=False,
sage: center.print_options(prefix='c')
sage: c = center.basis()
sage: c[1].lift()
(1,2,3) + (1,3,2)
(2,3) + (1,2) + (1,3)
sage: c[0]^2
c[0]
sage: e = 1/6*(c[0]+c[1]+c[2])
Expand Down
8 changes: 4 additions & 4 deletions src/sage/combinat/constellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,8 @@ def braid_group_action(self):
sage: C = Constellations(3,3)
sage: C.braid_group_action()
[Looped multi-digraph on 3 vertices,
Looped multi-digraph on 1 vertex,
Looped multi-digraph on 3 vertices]
Looped multi-digraph on 3 vertices,
Looped multi-digraph on 1 vertex]
"""
G = []
for c in self:
Expand All @@ -1226,9 +1226,9 @@ def braid_group_orbits(self):
sage: [x.profile() for x in O[0]]
[([1, 1, 1], [3], [3]), ([3], [1, 1, 1], [3]), ([3], [3], [1, 1, 1])]
sage: [x.profile() for x in O[1]]
[([3], [3], [3])]
sage: [x.profile() for x in O[2]]
[([2, 1], [2, 1], [3]), ([2, 1], [3], [2, 1]), ([3], [2, 1], [2, 1])]
sage: [x.profile() for x in O[2]]
[([3], [3], [3])]
"""
return [g.vertices() for g in self.braid_group_action()]

Expand Down
6 changes: 3 additions & 3 deletions src/sage/combinat/symmetric_group_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
sage: SGA.group()
Symmetric group of order 4! as a permutation group
sage: SGA.an_element()
() + (1,2,3,4) + 2*(1,3)(2,4) + 3*(1,4)(2,3)
() + (1,2,3,4) + 3*(1,2,4) + 2*(1,4)
sage: SGA = SymmetricGroupAlgebra(QQ, WeylGroup(["A",3], prefix='s')); SGA
Symmetric group algebra of order 4 over Rational Field
Expand Down Expand Up @@ -247,7 +247,7 @@ def __init__(self, R, W, category):
sage: G = SymmetricGroup(4).algebra(QQ)
sage: S = SymmetricGroupAlgebra(QQ,4)
sage: S(G.an_element())
[1, 2, 3, 4] + [2, 3, 4, 1] + 2*[3, 4, 1, 2] + 3*[4, 3, 2, 1]
[1, 2, 3, 4] + [2, 3, 4, 1] + 3*[2, 4, 3, 1] + 2*[4, 2, 3, 1]
sage: G(S.an_element())
() + 2*(3,4) + 3*(2,3) + (1,4,3,2)
Expand Down Expand Up @@ -936,7 +936,7 @@ def retract_okounkov_vershik(self, f, m):
sage: G = SymmetricGroup(4).algebra(QQ)
sage: G.retract_okounkov_vershik(G.an_element(), 3)
() + 3*(2,3) + (1,2,3) + 2*(1,3)
3*() + 3*(1,2) + (1,2,3)
.. SEEALSO::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17781,7 +17781,7 @@ def _color_by_label(self, format='hex', as_function=False, default_color = "blac

sage: f = G._color_by_label(as_function=True)
sage: [f(1), f(2), f(3)]
['#ff0000', '#0000ff', '#00ff00']
['#0000ff', '#ff0000', '#00ff00']
sage: f = G._color_by_label({1: "blue", 2: "red", 3: "green"}, as_function=True)
sage: [f(1), f(2), f(3)]
['blue', 'red', 'green']
Expand All @@ -17795,9 +17795,9 @@ def _color_by_label(self, format='hex', as_function=False, default_color = "blac
The default output is a dictionary assigning edges to colors::

sage: G._color_by_label()
{'#0000ff': [((1,3,2,4), (1,2,4), 2), ...],
{'#0000ff': [((1,3,2,4), (1,3)(2,4), 1), ...],
'#00ff00': [((1,3,2,4), (1,4)(2,3), 3), ...],
'#ff0000': [((1,3,2,4), (1,3)(2,4), 1), ...]}
'#ff0000': [((1,3,2,4), (1,2,4), 2), ...]}

sage: G._color_by_label({1: "blue", 2: "red", 3: "green"})
{'blue': [((1,3,2,4), (1,3)(2,4), 1), ...],
Expand Down
6 changes: 3 additions & 3 deletions src/sage/groups/libgap_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ def character_table(self):
[ 2 -1 0]
[ 1 1 1]
sage: MatrixGroup(SymmetricGroup(5)).character_table()
[ 1 1 1 1 1 1 1]
[ 1 -1 -1 1 -1 1 1]
[ 4 0 1 -1 -2 1 0]
[ 4 0 -1 -1 2 1 0]
[ 5 -1 1 0 1 -1 1]
[ 5 1 -1 0 -1 -1 1]
[ 6 0 0 1 0 0 -2]
[ 5 -1 1 0 1 -1 1]
[ 4 0 -1 -1 2 1 0]
[ 1 1 1 1 1 1 1]
"""
#code from function in permgroup.py, but modified for
#how gap handles these groups.
Expand Down
4 changes: 2 additions & 2 deletions src/sage/matrix/operation_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ class OperationTable(SageObject):
group ``H``, using a simple ``for`` loop::
sage: L = H.list() #list of elements of the group H
sage: elts = [L[i] for i in {0, 2}]
sage: elts = [L[i] for i in {0, 1}]
sage: elts
[(), (1,4,3,2)]
[(), (1,3)(2,4)]
sage: OperationTable(H, operator.mul, elements=elts)
* a b
+----
Expand Down
32 changes: 16 additions & 16 deletions src/sage/tests/books/judson-abstract-algebra/groups-sage.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: [[a(x) for x in triangle.domain()] for a in triangle]
[[1, 2, 3], [3, 1, 2], [2, 3, 1], [1, 3, 2], [3, 2, 1], [2, 1, 3]]
[[1, 2, 3], [3, 2, 1], [2, 3, 1], [1, 3, 2], [3, 1, 2], [2, 1, 3]]
~~~~~~~~~~~~~~~~~~~~~~ ::
Expand Down Expand Up @@ -165,35 +165,35 @@
* a b c d e f
+------------
a| a b c d e f
b| b c a f d e
c| c a b e f d
b| b a d c f e
c| c f e b a d
d| d e f a b c
e| e f d c a b
f| f d e b c a
e| e d a f c b
f| f c b e d a
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: triangle.cayley_table(names='elements')
* () (1,3,2) (1,2,3) (2,3) (1,3) (1,2)
* () (1,3) (1,2,3) (2,3) (1,3,2) (1,2)
+------------------------------------------------
()| () (1,3,2) (1,2,3) (2,3) (1,3) (1,2)
(1,3,2)| (1,3,2) (1,2,3) () (1,2) (2,3) (1,3)
(1,2,3)| (1,2,3) () (1,3,2) (1,3) (1,2) (2,3)
(2,3)| (2,3) (1,3) (1,2) () (1,3,2) (1,2,3)
(1,3)| (1,3) (1,2) (2,3) (1,2,3) () (1,3,2)
(1,2)| (1,2) (2,3) (1,3) (1,3,2) (1,2,3) ()
()| () (1,3) (1,2,3) (2,3) (1,3,2) (1,2)
(1,3)| (1,3) () (2,3) (1,2,3) (1,2) (1,3,2)
(1,2,3)| (1,2,3) (1,2) (1,3,2) (1,3) () (2,3)
(2,3)| (2,3) (1,3,2) (1,2) () (1,3) (1,2,3)
(1,3,2)| (1,3,2) (2,3) () (1,2) (1,2,3) (1,3)
(1,2)| (1,2) (1,2,3) (1,3) (1,3,2) (2,3) ()
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: triangle.cayley_table(names=['id','u3','r1','r2','u1','u2'])
* id u3 r1 r2 u1 u2
+------------------
id| id u3 r1 r2 u1 u2
u3| u3 r1 id u2 r2 u1
r1| r1 id u3 u1 u2 r2
u3| u3 id r2 r1 u2 u1
r1| r1 u2 u1 u3 id r2
r2| r2 u1 u2 id u3 r1
u1| u1 u2 r2 r1 id u3
u2| u2 r2 u1 u3 r1 id
u1| u1 r2 id u2 r1 u3
u2| u2 r1 u3 u1 r2 id
~~~~~~~~~~~~~~~~~~~~~~ ::
Expand Down

0 comments on commit 97ce629

Please sign in to comment.