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

Commit

Permalink
Add exposition in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorkarn committed Jul 8, 2021
1 parent c038ef5 commit a75293a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/sage/modules/with_basis/invariant.py
Expand Up @@ -354,9 +354,12 @@ def _test_invariant(self,**options): ## Lift to representation and check that th
class Element(SubmoduleWithBasis.Element):

def _mul_(self, other):
"""
r"""
EXAMPLES::
In general, there is not a well defined multiplication between two elements
of a given module, but there is a multiplication with scalars.
sage: M = CombinatorialFreeModule(QQ,[1,2,3],prefix='M');
sage: G = CyclicPermutationGroup(3); G.rename('G')
sage: g = G.an_element(); g
Expand All @@ -378,9 +381,14 @@ def _mul_(self, other):
sage: v*(1/2)
1/2*B[0]
Sometimes, the module is also a ring. To ensure the multiplication
works as desired, we should be sure to pass the correct category to
the ``Representation``. In the following example, we use the exterior
algebra over `\Bold{Q}` with three generators, which is in the category
of finite dimensional `\Bold{Q}`-algebras with a basis.
sage: G = CyclicPermutationGroup(3); G.rename('G')
sage: M = algebras.Exterior(QQ, 'x', 3)
sage: from sage.modules.with_basis.representation import Representation
sage: on_basis = lambda g,m: M.prod([M.monomial((g(j+1)-1,)) for j in m]) #cyclically permute generators
sage: from sage.categories.algebras import Algebras
sage: R = Representation(G, M, on_basis, category=Algebras(QQ).WithBasis().FiniteDimensional(), side = 'right')
Expand Down

0 comments on commit a75293a

Please sign in to comment.