Skip to content

Commit

Permalink
sage.categories: Fix/realign some # optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Apr 16, 2023
1 parent 4de54cf commit 7cb61c9
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 137 deletions.
2 changes: 1 addition & 1 deletion src/sage/categories/algebra_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, A):
sage: AlgebraModules(QQ['a'])
Category of algebra modules over Univariate Polynomial Ring in a over Rational Field
sage: AlgebraModules(QQ['a,b']) # todo: not implemented (QQ['a,b'] should be in Algebras(QQ))
sage: AlgebraModules(FreeAlgebra(QQ, 2, 'a,b')) # optional - sage.combinat sage.modules
sage: AlgebraModules(FreeAlgebra(QQ, 2, 'a,b')) # optional - sage.combinat sage.modules
Traceback (most recent call last):
...
TypeError: A (=Free Algebra on 2 generators (a, b) over Rational Field) must be a commutative algebra
Expand Down
12 changes: 6 additions & 6 deletions src/sage/categories/algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __contains__(self, x):
sage: QQ['x'] in Algebras(QQ)
True
sage: QQ^3 in Algebras(QQ) # optional - sage.modules
sage: QQ^3 in Algebras(QQ) # optional - sage.modules
False
sage: QQ['x'] in Algebras(CDF)
False
Expand Down Expand Up @@ -154,15 +154,15 @@ def _div_(self, y):
EXAMPLES::
sage: C = AlgebrasWithBasis(QQ).example() # optional - sage.combinat
sage: x = C(2); x # optional - sage.combinat
sage: C = AlgebrasWithBasis(QQ).example() # optional - sage.combinat
sage: x = C(2); x # optional - sage.combinat
2*B[word: ]
sage: y = C.algebra_generators().first(); y # optional - sage.combinat
sage: y = C.algebra_generators().first(); y # optional - sage.combinat
B[word: a]
sage: y._div_(x) # optional - sage.combinat
sage: y._div_(x) # optional - sage.combinat
1/2*B[word: a]
sage: x._div_(y) # optional - sage.combinat
sage: x._div_(y) # optional - sage.combinat
Traceback (most recent call last):
...
ValueError: cannot invert self (= B[word: a])
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/category_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _repr_object_names(self):
'algebras over Rational Field'
sage: Algebras(Fields())._repr_object_names()
'algebras over fields'
sage: Algebras(GF(2).category())._repr_object_names() # optional - sage.rings.finite_rings
sage: Algebras(GF(2).category())._repr_object_names() # optional - sage.rings.finite_rings
'algebras over (finite enumerated fields and subquotients of monoids and quotients of semigroups)'
"""
base = self.__base
Expand Down
26 changes: 13 additions & 13 deletions src/sage/categories/finite_dimensional_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,8 @@ def cartan_invariants_matrix(self):
in characteristic zero, the Cartan invariants matrix is
the identity::
sage: A3 = SymmetricGroup(3).algebra(QQ) # optional - sage.groups sage.modules
sage: A3.cartan_invariants_matrix() # optional - sage.groups sage.modules
sage: A3 = SymmetricGroup(3).algebra(QQ) # optional - sage.groups sage.modules
sage: A3.cartan_invariants_matrix() # optional - sage.groups sage.modules
[1 0 0]
[0 1 0]
[0 0 1]
Expand Down Expand Up @@ -945,10 +945,10 @@ def is_identity_decomposition_into_orthogonal_idempotents(self, l):
With the algebra of the `0`-Hecke monoid::
sage: from sage.monoids.hecke_monoid import HeckeMonoid # optional - sage.groups
sage: A = HeckeMonoid(SymmetricGroup(4)).algebra(QQ) # optional - sage.groups sage.modules
sage: idempotents = A.orthogonal_idempotents_central_mod_radical() # optional - sage.groups sage.modules sage.rings.number_field
sage: A.is_identity_decomposition_into_orthogonal_idempotents(idempotents) # optional - sage.groups sage.modules sage.rings.number_field
sage: from sage.monoids.hecke_monoid import HeckeMonoid # optional - sage.groups
sage: A = HeckeMonoid(SymmetricGroup(4)).algebra(QQ) # optional - sage.groups sage.modules
sage: idempotents = A.orthogonal_idempotents_central_mod_radical() # optional - sage.groups sage.modules sage.rings.number_field
sage: A.is_identity_decomposition_into_orthogonal_idempotents(idempotents) # optional - sage.groups sage.modules sage.rings.number_field
True
Here are some more counterexamples:
Expand Down Expand Up @@ -994,19 +994,19 @@ def is_identity_decomposition_into_orthogonal_idempotents(self, l):
2. Some idempotents summing to 1 but not orthogonal::
sage: R.<x> = PolynomialRing(GF(2)) # optional - sage.rings.finite_rings
sage: A = PQAlgebra(GF(2), x) # optional - sage.rings.finite_rings
sage: a = A.one() # optional - sage.rings.finite_rings
sage: A.is_identity_decomposition_into_orthogonal_idempotents((a,)) # optional - sage.rings.finite_rings
sage: R.<x> = PolynomialRing(GF(2)) # optional - sage.rings.finite_rings
sage: A = PQAlgebra(GF(2), x) # optional - sage.rings.finite_rings
sage: a = A.one() # optional - sage.rings.finite_rings
sage: A.is_identity_decomposition_into_orthogonal_idempotents((a,)) # optional - sage.rings.finite_rings
True
sage: A.is_identity_decomposition_into_orthogonal_idempotents((a, a, a)) # optional - sage.rings.finite_rings
sage: A.is_identity_decomposition_into_orthogonal_idempotents((a, a, a)) # optional - sage.rings.finite_rings
False
3. Some orthogonal idempotents not summing to the identity::
sage: A.is_identity_decomposition_into_orthogonal_idempotents((a,a)) # optional - sage.rings.finite_rings
sage: A.is_identity_decomposition_into_orthogonal_idempotents((a,a)) # optional - sage.rings.finite_rings
False
sage: A.is_identity_decomposition_into_orthogonal_idempotents(()) # optional - sage.rings.finite_rings
sage: A.is_identity_decomposition_into_orthogonal_idempotents(()) # optional - sage.rings.finite_rings
False
"""
return (self.sum(l) == self.one()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/integral_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __contains__(self, x):
"""
EXAMPLES::
sage: GF(4, "a") in IntegralDomains() # optional - sage.libs.pari
sage: GF(4, "a") in IntegralDomains() # optional - sage.rings.finite_rings
True
sage: QQ in IntegralDomains()
True
Expand Down
8 changes: 4 additions & 4 deletions src/sage/categories/lie_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ def extra_super_categories(self):
[Category of finite sets]
sage: LieAlgebras(ZZ).FiniteDimensional().extra_super_categories()
[]
sage: C = LieAlgebras(GF(5)).FiniteDimensional() # optional - sage.libs.pari
sage: C.is_subcategory(Sets().Finite()) # optional - sage.libs.pari
sage: C = LieAlgebras(GF(5)).FiniteDimensional() # optional - sage.rings.finite_rings
sage: C.is_subcategory(Sets().Finite()) # optional - sage.rings.finite_rings
True
sage: C = LieAlgebras(ZZ).FiniteDimensional()
sage: C.is_subcategory(Sets().Finite())
False
sage: C = LieAlgebras(GF(5)).WithBasis().FiniteDimensional() # optional - sage.libs.pari
sage: C.is_subcategory(Sets().Finite()) # optional - sage.libs.pari
sage: C = LieAlgebras(GF(5)).WithBasis().FiniteDimensional() # optional - sage.rings.finite_rings
sage: C.is_subcategory(Sets().Finite()) # optional - sage.rings.finite_rings
True
"""
if self.base_ring() in Sets().Finite():
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/magmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ def is_field(self, proof=True):
EXAMPLES::
sage: SymmetricGroup(1).algebra(QQ).is_field() # optional - sage.groups
sage: SymmetricGroup(1).algebra(QQ).is_field() # optional - sage.groups
True
sage: SymmetricGroup(1).algebra(ZZ).is_field() # optional - sage.groups
sage: SymmetricGroup(1).algebra(ZZ).is_field() # optional - sage.groups
False
sage: SymmetricGroup(2).algebra(QQ).is_field() # optional - sage.groups
sage: SymmetricGroup(2).algebra(QQ).is_field() # optional - sage.groups
False
"""
if not self.base_ring().is_field(proof):
Expand Down
Loading

0 comments on commit 7cb61c9

Please sign in to comment.