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

Commit

Permalink
Fixing doctests due to bad rebase and some doc tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Aug 24, 2018
1 parent 79c25c9 commit ca2d1b3
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 61 deletions.
4 changes: 2 additions & 2 deletions src/sage/algebras/group_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def GroupAlgebra(G, R=IntegerRing()):
sage: A = GroupAlgebra(G, R); A
Algebra of Dihedral group of order 6 as a permutation group over Rational Field
sage: a = A.an_element(); a
() + (1,2) + 3*(1,2,3) + 2*(1,3)
() + (1,2) + 3*(1,2,3) + 2*(1,3,2)
This space is endowed with an algebra structure, obtained by extending
by bilinearity the multiplication of `G` to a multiplication on `RG`::
sage: A in Algebras
True
sage: a * a
6*() + 9*(2,3) + 8*(1,2) + 8*(1,2,3) + 11*(1,3,2) + 7*(1,3)
14*() + 5*(2,3) + 2*(1,2) + 10*(1,2,3) + 13*(1,3,2) + 5*(1,3)
:func:`GroupAlgebra` is just a short hand for a more general
construction that covers, e.g., monoid algebras, additive group
Expand Down
26 changes: 13 additions & 13 deletions src/sage/categories/algebra_functor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
Algebra of Dihedral group of order 6 as a permutation group
over Rational Field
sage: a = A.an_element(); a
() + (1,2) + 3*(1,2,3) + 2*(1,3)
() + (1,2) + 3*(1,2,3) + 2*(1,3,2)
This space is endowed with an algebra structure, obtained by extending
by bilinearity the multiplication of `G` to a multiplication on `RG`::
sage: A in Algebras
True
sage: a * a
6*() + 9*(2,3) + 8*(1,2) + 8*(1,2,3) + 11*(1,3,2) + 7*(1,3)
14*() + 5*(2,3) + 2*(1,2) + 10*(1,2,3) + 13*(1,3,2) + 5*(1,3)
In particular, the product of two basis elements is induced by the
product of the corresponding elements of the group, and the unit of
Expand Down Expand Up @@ -230,12 +230,12 @@
sage: a = A.an_element(); a
() + 2*(3,4) + 3*(1,2) + (1,2)(3,4)
sage: b = B.an_element(); b
() + (2,3,4) + 2*(1,2) + 3*(1,2,3,4)
() + (2,3,4) + 3*(1,2,4) + 2*(1,4)
sage: B(a)
() + 2*(3,4) + 3*(1,2) + (1,2)(3,4)
sage: a * b # a is automatically converted to an element of B
7*() + 4*(3,4) + 2*(2,3) + (2,3,4) + 5*(1,2) + 5*(1,2)(3,4) + 6*(1,2,3)
+ 3*(1,2,3,4) + (1,3,2) + 3*(1,3,4,2) + 3*(1,3) + 9*(1,3,4)
() + 2*(3,4) + 2*(2,3) + (2,3,4) + 3*(1,2) + (1,2)(3,4) + 8*(1,2,4,3)
+ 9*(1,2,4) + (1,3,2) + 3*(1,3,4,2) + 7*(1,4,3) + 11*(1,4)
sage: parent(a * b)
Symmetric group algebra of order 4 over Rational Field
Expand All @@ -244,7 +244,7 @@
sage: A(b)
Traceback (most recent call last):
...
TypeError: do not know how to make x (= () + (2,3,4) + 2*(1,2) + 3*(1,2,3,4))
TypeError: do not know how to make x (= () + (2,3,4) + 3*(1,2,4) + 2*(1,4))
an element of self
(=Algebra of Dihedral group of order 4 as a permutation group over Integer Ring)
Expand Down Expand Up @@ -339,11 +339,11 @@
sage: kD4 in HopfAlgebras
True
sage: a = kD4.an_element(); a
() + 3*(1,2,3,4) + (1,3) + 2*(1,4)(2,3)
() + (1,3) + 2*(1,3)(2,4) + 3*(1,4,3,2)
sage: a.antipode()
() + (1,3) + 3*(1,4,3,2) + 2*(1,4)(2,3)
() + 3*(1,2,3,4) + (1,3) + 2*(1,3)(2,4)
sage: a.coproduct()
() # () + 3*(1,2,3,4) # (1,2,3,4) + (1,3) # (1,3) + 2*(1,4)(2,3) # (1,4)(2,3)
() # () + (1,3) # (1,3) + 2*(1,3)(2,4) # (1,3)(2,4) + 3*(1,4,3,2) # (1,4,3,2)
Coercions from the base ring::
Expand Down Expand Up @@ -422,10 +422,10 @@
From: Symmetric group algebra of order 3 over Integer Ring
To: Symmetric group algebra of order 3 over Finite Field of size 5
sage: a = 2 * A.an_element(); a
2*() + 2*(2,3) + 4*(1,2) + 6*(1,2,3)
2*() + 2*(2,3) + 6*(1,2,3) + 4*(1,3)
sage: hh(a)
2*() + 2*(2,3) + 4*(1,2) + (1,2,3)
2*() + 2*(2,3) + (1,2,3) + 4*(1,3)
Conversion from a formal sum::
Expand Down Expand Up @@ -626,9 +626,9 @@ def _apply_functor_to_morphism(self, f):
To: Symmetric group algebra of order 3 over Finite Field of size 5
sage: a = 2 * A.an_element(); a
2*() + 2*(2,3) + 4*(1,2) + 6*(1,2,3)
2*() + 2*(2,3) + 6*(1,2,3) + 4*(1,3)
sage: hh(a)
2*() + 2*(2,3) + 4*(1,2) + (1,2,3)
2*() + 2*(2,3) + (1,2,3) + 4*(1,3)
"""
from sage.categories.rings import Rings
domain = self(f.domain())
Expand Down
14 changes: 11 additions & 3 deletions src/sage/categories/finite_dimensional_lie_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def killing_form_matrix(self):

@cached_method
def structure_coefficients(self, include_zeros=False):
"""
r"""
Return the structure coefficients of ``self``.
INPUT:
Expand Down Expand Up @@ -334,8 +334,16 @@ 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,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)}
"""
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()
K = list(B.keys())
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,7 @@ def _an_element_(self):
sage: A.an_element()
B[word: ] + 2*B[word: a] + 3*B[word: b] + B[word: bab]
sage: B.an_element()
B[()] + B[(1,2)] + 3*B[(1,2,3)] + 2*B[(1,3)]
B[()] + B[(1,2)] + 3*B[(1,2,3)] + 2*B[(1,3,2)]
sage: cartesian_product((A, B, A)).an_element() # indirect doctest
2*B[(0, word: )] + 2*B[(0, word: a)] + 3*B[(0, word: b)]
"""
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/sets_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1559,15 +1559,15 @@ def algebra(self, base_ring, category=None, **kwds):
sage: A.category()
Category of finite group algebras over Rational Field
sage: a = A.an_element(); a
() + 3*(1,2,3,4) + (1,3) + 2*(1,4)(2,3)
() + (1,3) + 2*(1,3)(2,4) + 3*(1,4,3,2)
This space is endowed with an algebra structure, obtained
by extending by bilinearity the multiplication of `G` to a
multiplication on `RG`::
sage: a * a
6*() + 6*(2,4) + 3*(1,2)(3,4) + 8*(1,2,3,4) + 8*(1,3)
+ 9*(1,3)(2,4) + 2*(1,4,3,2) + 7*(1,4)(2,3)
6*() + 4*(2,4) + 3*(1,2)(3,4) + 12*(1,2,3,4) + 2*(1,3)
+ 13*(1,3)(2,4) + 6*(1,4,3,2) + 3*(1,4)(2,3)
If `S` is a :class:`monoid <Monoids>`, the result is its
monoid algebra `KS`::
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()
() + (2,3,4) + 2*(1,2) + 3*(1,2,3,4)
() + (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] + [1, 3, 4, 2] + 2*[2, 1, 3, 4] + 3*[2, 3, 4, 1]
[1, 2, 3, 4] + [1, 3, 4, 2] + 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)
() + (2,3) + 2*(1,2) + 3*(1,2,3)
3*() + (2,3) + 3*(1,2)
.. SEEALSO::
Expand Down
10 changes: 5 additions & 5 deletions src/sage/groups/perm_gps/permgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,10 +802,10 @@ def list(self):
sage: G = PermutationGroup([[(1,2,3,4)], [(1,2)]])
sage: G.list()
[(), (1,2), (1,2,3,4), (1,3)(2,4), (1,3,4), (2,3,4), (1,4,3,2),
(1,3,2,4), (1,3,4,2), (1,2,4,3), (1,4,2,3), (2,4,3), (1,4,3),
(1,4)(2,3), (1,4,2), (1,3,2), (1,3), (3,4), (2,4), (1,4), (2,3),
(1,2)(3,4), (1,2,3), (1,2,4)]
[(), (1,4)(2,3), (1,2)(3,4), (1,3)(2,4), (2,4,3), (1,4,2),
(1,2,3), (1,3,4), (2,3,4), (1,4,3), (1,2,4), (1,3,2), (3,4),
(1,4,2,3), (1,2), (1,3,2,4), (2,4), (1,4,3,2), (1,2,3,4),
(1,3), (2,3), (1,4), (1,2,4,3), (1,3,4,2)]
sage: G = PermutationGroup([[('a','b')]], domain=('a', 'b')); G
Permutation Group with generators [('a','b')]
Expand Down Expand Up @@ -1597,7 +1597,7 @@ def base(self, seed=None):
return [self._domain_from_gap[x] for x in self._gap_().StabChain(seed).BaseStabChain().sage()]

def strong_generating_system(self, base_of_group=None, implementation="sage"):
"""
r"""
Return a Strong Generating System of ``self`` according the given
base for the right action of ``self`` on itself.
Expand Down
53 changes: 24 additions & 29 deletions src/sage/groups/perm_gps/permgroup_element.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
Permutation group elements
AUTHORS:
Expand All @@ -11,27 +11,25 @@ AUTHORS:
There are several ways to define a permutation group element:
- Define a permutation group `G`, then use
``G.gens()`` and multiplication \* to construct
elements.
- Define a permutation group `G`, then use ``G.gens()``
and multiplication ``*`` to construct elements.
- Define a permutation group `G`, then use e.g.,
- Define a permutation group `G`, then use, e.g.,
``G([(1,2),(3,4,5)])`` to construct an element of the
group. You could also use ``G('(1,2)(3,4,5)')``
- Use e.g.,
- Use, e.g.,
``PermutationGroupElement([(1,2),(3,4,5)])`` or
``PermutationGroupElement('(1,2)(3,4,5)')`` to make a
permutation group element with parent `S_5`.
EXAMPLES:
EXAMPLES: We illustrate construction of permutation using several
We illustrate construction of permutation using several
different methods.
First we construct elements by multiplying together generators for
a group.
::
a group::
sage: G = PermutationGroup(['(1,2)(3,4)', '(3,4,5,6)'], canonicalize=False)
sage: s = G.gens()
Expand All @@ -45,9 +43,7 @@ a group.
Permutation Group with generators [(1,2)(3,4), (3,4,5,6)]
Next we illustrate creation of a permutation using coercion into an
already-created group.
::
already-created group::
sage: g = G([(1,2),(3,5,6)])
sage: g
Expand All @@ -58,9 +54,7 @@ already-created group.
True
We can also use a string or one-line notation to specify the
permutation.
::
permutation::
sage: h = G('(1,2)(3,5,6)')
sage: i = G([2,1,5,4,6,3])
Expand All @@ -69,23 +63,24 @@ permutation.
The Rubik's cube group::
sage: f= [(17,19,24,22),(18,21,23,20),(6,25,43,16),(7,28,42,13),(8,30,41,11)]
sage: b=[(33,35,40,38),(34,37,39,36),( 3, 9,46,32),( 2,12,47,29),( 1,14,48,27)]
sage: l=[( 9,11,16,14),(10,13,15,12),( 1,17,41,40),( 4,20,44,37),( 6,22,46,35)]
sage: r=[(25,27,32,30),(26,29,31,28),( 3,38,43,19),( 5,36,45,21),( 8,33,48,24)]
sage: u=[( 1, 3, 8, 6),( 2, 5, 7, 4),( 9,33,25,17),(10,34,26,18),(11,35,27,19)]
sage: d=[(41,43,48,46),(42,45,47,44),(14,22,30,38),(15,23,31,39),(16,24,32,40)]
sage: cube = PermutationGroup([f,b,l,r,u,d])
sage: F=cube.gens()[0]
sage: B=cube.gens()[1]
sage: L=cube.gens()[2]
sage: R=cube.gens()[3]
sage: U=cube.gens()[4]
sage: D=cube.gens()[5]
sage: f = [(17,19,24,22),(18,21,23,20),( 6,25,43,16),( 7,28,42,13),( 8,30,41,11)]
sage: b = [(33,35,40,38),(34,37,39,36),( 3, 9,46,32),( 2,12,47,29),( 1,14,48,27)]
sage: l = [( 9,11,16,14),(10,13,15,12),( 1,17,41,40),( 4,20,44,37),( 6,22,46,35)]
sage: r = [(25,27,32,30),(26,29,31,28),( 3,38,43,19),( 5,36,45,21),( 8,33,48,24)]
sage: u = [( 1, 3, 8, 6),( 2, 5, 7, 4),( 9,33,25,17),(10,34,26,18),(11,35,27,19)]
sage: d = [(41,43,48,46),(42,45,47,44),(14,22,30,38),(15,23,31,39),(16,24,32,40)]
sage: cube = PermutationGroup([f, b, l, r, u, d])
sage: F, B, L, R, U, D = cube.gens()
sage: cube.order()
43252003274489856000
sage: F.order()
4
We create element of a permutation group of large degree::
sage: G = SymmetricGroup(30)
sage: s = G(srange(30,0,-1)); s
(1,30)(2,29)(3,28)(4,27)(5,26)(6,25)(7,24)(8,23)(9,22)(10,21)(11,20)(12,19)(13,18)(14,17)(15,16)
"""

#*****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modules/with_basis/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ def _element_constructor_(self, x):
sage: A = G.algebra(ZZ)
sage: R = A.regular_representation()
sage: x = A.an_element(); x
() + 3*(1,2,3,4) + (1,3) + 2*(1,4)(2,3)
() + (1,3) + 2*(1,3)(2,4) + 3*(1,4,3,2)
sage: R(x)
() + 3*(1,2,3,4) + (1,3) + 2*(1,4)(2,3)
() + (1,3) + 2*(1,3)(2,4) + 3*(1,4,3,2)
"""
if isinstance(x, Element) and x.parent() is self._module:
return self._from_dict(x.monomial_coefficients(copy=False), remove_zeros=False)
Expand Down

0 comments on commit ca2d1b3

Please sign in to comment.