Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sage/categories/action.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ cdef class PrecomposedAction(Action):
We demonstrate that an example discussed on :issue:`14711` did not become a
problem::

sage: # needs sage.modular
sage: # needs sage.libs.flint sage.modular
sage: E = ModularSymbols(11).2
sage: s = E.modular_symbol_rep()
sage: del E,s
Expand Down Expand Up @@ -487,7 +487,7 @@ cdef class PrecomposedAction(Action):

Check that this action can be pickled (:issue:`29031`)::

sage: # needs sage.modular
sage: # needs sage.libs.flint sage.modular
sage: E = ModularSymbols(11).2
sage: v = E.manin_symbol_rep()
sage: c,x = v[0]
Expand Down
26 changes: 14 additions & 12 deletions src/sage/categories/algebra_functor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage.doctest: needs sage.groups
# sage.doctest: needs sage.groups sage.modules
r"""
Group algebras and beyond: the Algebra functorial construction

Expand Down Expand Up @@ -205,7 +205,7 @@
divide the characteristic of the base field, the algebra is
semisimple::

sage: SymmetricGroup(5).algebra(QQ) in Algebras(QQ).Semisimple()
sage: SymmetricGroup(5).algebra(QQ) in Algebras(QQ).Semisimple() # needs sage.combinat
True
sage: CyclicPermutationGroup(10).algebra(FiniteField(7)) in Algebras.Semisimple
True
Expand All @@ -225,6 +225,7 @@
since there is a natural map from the integers to the rationals, there
is a natural map from `\ZZ[D_2]` to `\QQ[S_4]`::

sage: # needs sage.combinat
sage: A = DihedralGroup(2).algebra(ZZ)
sage: B = SymmetricGroup(4).algebra(QQ)
sage: a = A.an_element(); a
Expand Down Expand Up @@ -308,12 +309,12 @@

Properties of group algebras::

sage: SU(2, GF(4, 'a')).algebra(IntegerModRing(12)).category()
sage: SU(2, GF(4, 'a')).algebra(IntegerModRing(12)).category() # needs sage.rings.finite_rings
Category of finite group algebras over Ring of integers modulo 12

sage: SymmetricGroup(2).algebra(QQ).is_commutative()
sage: SymmetricGroup(2).algebra(QQ).is_commutative() # needs sage.combinat
True
sage: SymmetricGroup(3).algebra(QQ).is_commutative()
sage: SymmetricGroup(3).algebra(QQ).is_commutative() # needs sage.combinat
False

sage: G = DihedralGroup(4)
Expand Down Expand Up @@ -364,7 +365,7 @@

sage: G = SymmetricGroup(5)
sage: x,y = G.gens()
sage: A = G.algebra(QQ)
sage: A = G.algebra(QQ) # needs sage.combinat
sage: A( A(x) )
(1,2,3,4,5)

Expand All @@ -379,6 +380,7 @@
Coercion from the base ring takes precedences over coercion from the
group::

sage: # needs sage.rings.number_field
sage: G = GL(2,7)
sage: OG = GroupAlgebra(G, ZZ[AA(5).sqrt()])
sage: OG(2)
Expand All @@ -387,7 +389,6 @@
sage: OG(G(2))
[2 0]
[0 2]

sage: OG(FormalSum([ (1, G(2)), (2, RR(0.77)) ]) )
Traceback (most recent call last):
...
Expand All @@ -411,7 +412,7 @@
morphism::

sage: G = SymmetricGroup(3)
sage: A = G.algebra(ZZ)
sage: A = G.algebra(ZZ) # needs sage.combinat
sage: h = GF(5).coerce_map_from(ZZ)

sage: functor = A.construction()[0]; functor
Expand All @@ -420,7 +421,7 @@
sage: hh
Generic morphism:
From: Symmetric group algebra of order 3 over Integer Ring
To: Symmetric group algebra of order 3 over Finite Field of size 5
To: Symmetric group algebra of order 3 over Finite Field of size 5
sage: a = 2 * A.an_element(); a
2*() + 2*(2,3) + 6*(1,2,3) + 4*(1,3,2)

Expand Down Expand Up @@ -561,7 +562,7 @@ def __init__(self, group):
EXAMPLES::

sage: from sage.categories.algebra_functor import GroupAlgebraFunctor
sage: GroupAlgebra(SU(2, GF(4, 'a')), IntegerModRing(12)).category()
sage: GroupAlgebra(SU(2, GF(4, 'a')), IntegerModRing(12)).category() # needs sage.rings.finite_rings
Category of finite group algebras over Ring of integers modulo 12
"""
self.__group = group
Expand Down Expand Up @@ -617,14 +618,14 @@ def _apply_functor_to_morphism(self, f):

EXAMPLES::

sage: # needs sage.combinat
sage: G = SymmetricGroup(3)
sage: A = GroupAlgebra(G, ZZ)
sage: h = GF(5).coerce_map_from(ZZ)
sage: hh = A.construction()[0](h); hh
Generic morphism:
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) + 6*(1,2,3) + 4*(1,3,2)
sage: hh(a)
Expand Down Expand Up @@ -673,7 +674,7 @@ def _repr_object_names(self):
"""
EXAMPLES::

sage: Semigroups().Algebras(QQ) # indirect doctest
sage: Semigroups().Algebras(QQ) # indirect doctest
Category of semigroup algebras over Rational Field
"""
return "{} algebras over {}".format(self.base_category()._repr_object_names()[:-1],
Expand Down Expand Up @@ -726,6 +727,7 @@ def coproduct_on_basis(self, g):

EXAMPLES::

sage: # needs sage.combinat
sage: PF = NonDecreasingParkingFunctions(4)
sage: A = PF.algebra(ZZ); A
Algebra of Non-decreasing parking functions of size 4 over Integer Ring
Expand Down
75 changes: 35 additions & 40 deletions src/sage/categories/algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,32 @@ class AlgebrasWithBasis(CategoryWithAxiom_over_base_ring):
We construct a typical parent in this category, and do some
computations with it::

sage: A = C.example(); A # needs sage.combinat sage.modules
sage: # needs sage.combinat sage.modules
sage: A = C.example(); A
An example of an algebra with basis:
the free algebra on the generators ('a', 'b', 'c') over Rational Field

sage: A.category() # needs sage.combinat sage.modules
sage: A.category()
Category of algebras with basis over Rational Field

sage: A.one_basis() # needs sage.combinat sage.modules
sage: A.one_basis()
word:
sage: A.one() # needs sage.combinat sage.modules
sage: A.one()
B[word: ]

sage: A.base_ring() # needs sage.combinat sage.modules
sage: A.base_ring()
Rational Field
sage: A.basis().keys() # needs sage.combinat sage.modules
sage: A.basis().keys()
Finite words over {'a', 'b', 'c'}

sage: (a,b,c) = A.algebra_generators() # needs sage.combinat sage.modules
sage: a^3, b^2 # needs sage.combinat sage.modules
sage: (a,b,c) = A.algebra_generators()
sage: a^3, b^2
(B[word: aaa], B[word: bb])
sage: a * c * b # needs sage.combinat sage.modules
sage: a * c * b
B[word: acb]

sage: A.product # needs sage.combinat sage.modules
sage: A.product
<bound method MagmaticAlgebras.WithBasis.ParentMethods._product_from_product_on_basis_multiply of
An example of an algebra with basis:
the free algebra on the generators ('a', 'b', 'c') over Rational Field>
sage: A.product(a * b, b) # needs sage.combinat sage.modules
sage: A.product(a * b, b)
B[word: abb]

sage: TestSuite(A).run(verbose=True) # needs sage.combinat sage.modules
sage: TestSuite(A).run(verbose=True)
running ._test_additive_associativity() . . . pass
running ._test_an_element() . . . pass
running ._test_associativity() . . . pass
Expand Down Expand Up @@ -93,9 +88,9 @@ class AlgebrasWithBasis(CategoryWithAxiom_over_base_ring):
running ._test_prod() . . . pass
running ._test_some_elements() . . . pass
running ._test_zero() . . . pass
sage: A.__class__ # needs sage.combinat sage.modules
sage: A.__class__
<class 'sage.categories.examples.algebras_with_basis.FreeAlgebra_with_category'>
sage: A.element_class # needs sage.combinat sage.modules
sage: A.element_class
<class 'sage.categories.examples.algebras_with_basis.FreeAlgebra_with_category.element_class'>

Please see the source code of `A` (with ``A??``) for how to
Expand Down Expand Up @@ -150,9 +145,10 @@ def hochschild_complex(self, M):
sage: A = algebras.DifferentialWeyl(R) # needs sage.modules
sage: H = A.hochschild_complex(A) # needs sage.modules

sage: SGA = SymmetricGroupAlgebra(QQ, 3) # needs sage.combinat sage.modules
sage: T = SGA.trivial_representation() # needs sage.combinat sage.modules
sage: H = SGA.hochschild_complex(T) # needs sage.combinat sage.modules
sage: # needs sage.combinat sage.groups sage.modules
sage: SGA = SymmetricGroupAlgebra(QQ, 3)
sage: T = SGA.trivial_representation()
sage: H = SGA.hochschild_complex(T)
"""
from sage.homology.hochschild_complex import HochschildComplex
return HochschildComplex(self, M)
Expand Down Expand Up @@ -243,19 +239,19 @@ def one_from_cartesian_product_of_one_basis(self):

EXAMPLES::

sage: A = AlgebrasWithBasis(QQ).example(); A # needs sage.combinat sage.modules
sage: # needs sage.combinat sage.modules
sage: A = AlgebrasWithBasis(QQ).example(); A
An example of an algebra with basis: the free algebra
on the generators ('a', 'b', 'c') over Rational Field
sage: A.one_basis() # needs sage.combinat sage.modules
sage: A.one_basis()
word:

sage: B = cartesian_product((A, A, A)) # needs sage.combinat sage.modules
sage: B.one_from_cartesian_product_of_one_basis() # needs sage.combinat sage.modules
sage: B = cartesian_product((A, A, A))
sage: B.one_from_cartesian_product_of_one_basis()
B[(0, word: )] + B[(1, word: )] + B[(2, word: )]
sage: B.one() # needs sage.combinat sage.modules
sage: B.one()
B[(0, word: )] + B[(1, word: )] + B[(2, word: )]

sage: cartesian_product([SymmetricGroupAlgebra(QQ, 3), # needs sage.combinat sage.modules
sage: cartesian_product([SymmetricGroupAlgebra(QQ, 3), # needs sage.combinat sage.groups sage.modules
....: SymmetricGroupAlgebra(QQ, 4)]).one()
B[(0, [1, 2, 3])] + B[(1, [1, 2, 3, 4])]
"""
Expand Down Expand Up @@ -347,23 +343,22 @@ def product_on_basis(self, t1, t2):

EXAMPLES::

sage: A = AlgebrasWithBasis(QQ).example(); A # needs sage.combinat sage.modules
sage: # needs sage.combinat sage.modules
sage: A = AlgebrasWithBasis(QQ).example(); A
An example of an algebra with basis: the free algebra
on the generators ('a', 'b', 'c') over Rational Field
sage: (a,b,c) = A.algebra_generators() # needs sage.combinat sage.modules

sage: x = tensor((a, b, c)); x # needs sage.combinat sage.modules
sage: (a,b,c) = A.algebra_generators()
sage: x = tensor((a, b, c)); x
B[word: a] # B[word: b] # B[word: c]
sage: y = tensor((c, b, a)); y # needs sage.combinat sage.modules
sage: y = tensor((c, b, a)); y
B[word: c] # B[word: b] # B[word: a]
sage: x * y # needs sage.combinat sage.modules
sage: x * y
B[word: ac] # B[word: bb] # B[word: ca]

sage: x = tensor(((a + 2*b), c)); x # needs sage.combinat sage.modules
sage: x = tensor(((a + 2*b), c)); x
B[word: a] # B[word: c] + 2*B[word: b] # B[word: c]
sage: y = tensor((c, a)) + 1; y # needs sage.combinat sage.modules
sage: y = tensor((c, a)) + 1; y
B[word: ] # B[word: ] + B[word: c] # B[word: a]
sage: x * y # needs sage.combinat sage.modules
sage: x * y
B[word: a] # B[word: c] + B[word: ac] # B[word: ca]
+ 2*B[word: b] # B[word: c] + 2*B[word: bc] # B[word: ca]

Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/bialgebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def is_primitive(self):

sage: # needs sage.modules
sage: s = SymmetricFunctions(QQ).schur()
sage: s([5]).is_primitive()
sage: s([5]).is_primitive() # needs lrcalc_python
False
sage: p = SymmetricFunctions(QQ).powersum()
sage: p([5]).is_primitive()
Expand All @@ -87,9 +87,9 @@ def is_grouplike(self):
EXAMPLES::

sage: s = SymmetricFunctions(QQ).schur() # needs sage.modules
sage: s([5]).is_grouplike() # needs sage.modules
sage: s([5]).is_grouplike() # needs lrcalc_python sage.modules
False
sage: s([]).is_grouplike() # needs sage.modules
sage: s([]).is_grouplike() # needs lrcalc_python sage.modules
True
"""
return self.coproduct() == self.tensor(self)
Expand Down
Loading