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

Commit

Permalink
ticket 18675: append the method example to GradedHopfAlgebrasWithBasi…
Browse files Browse the repository at this point in the history
…s and GradedConnectedHopfAlgebrasWithBasis
  • Loading branch information
elixyre committed Sep 24, 2015
1 parent 174d228 commit ad19690
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
Expand Up @@ -25,8 +25,7 @@ def __init__(self, base_ring):
"""
EXAMPLES::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: TestSuite(H).run()
"""
Expand All @@ -41,8 +40,7 @@ def one_basis(self):
EXAMPLES::r
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.one_basis()
0
sage: H.one()
Expand All @@ -57,8 +55,7 @@ def degree_on_basis(self, t):
TESTS::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.degree_on_basis(45)
45
Expand All @@ -71,8 +68,7 @@ def _repr_(self):
EXAMPLES::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: GradedConnectedHopfAlgebraOfInteger(QQ)
sage: GradedHopfAlgebrasWithBasis(QQ).Connected().example()
An example of a graded connected hopf algebra with basis over Rational Field
"""
Expand All @@ -85,8 +81,7 @@ def _repr_term(self, t):
EXAMPLES::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H._repr_term(45)
'P45'
"""
Expand All @@ -96,8 +91,7 @@ def product_on_basis(self, i, j):
"""
TESTS::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.monomial(4) * H.monomial(5)
P9
Expand All @@ -108,8 +102,7 @@ def coproduct_on_basis(self, i):
"""
TESTS::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.monomial(3).coproduct()
P0 # P3 + 3*P1 # P2 + 3*P2 # P1 + P3 # P0
Expand Down
36 changes: 28 additions & 8 deletions src/sage/categories/graded_hopf_algebras_with_basis.py
Expand Up @@ -36,6 +36,17 @@ class GradedHopfAlgebrasWithBasis(GradedModulesCategory):
sage: TestSuite(C).run()
"""

def example(self):
"""
TESTS::
sage: GradedHopfAlgebrasWithBasis(QQ).example()
An example of a graded connected hopf algebra with basis over Rational Field
"""
from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
return GradedConnectedHopfAlgebraOfInteger(self.base())

class ParentMethods:
pass

Expand All @@ -56,6 +67,7 @@ def super_categories(self):
TESTS::
sage: TestSuite(GradedHopfAlgebrasWithBasis(QQ).WithRealizations()).run()
"""
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
R = self.base_category().base_ring()
Expand All @@ -64,6 +76,18 @@ def super_categories(self):

class Connected(CategoryWithAxiom_over_base_ring):


def example(self):
"""
TESTS::
sage: GradedHopfAlgebrasWithBasis(QQ).Connected().example()
An example of a graded connected hopf algebra with basis over Rational Field
"""
from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
return GradedConnectedHopfAlgebraOfInteger(self.base())

class ParentMethods:

def counit_on_basis(self, i):
Expand All @@ -80,8 +104,7 @@ def counit_on_basis(self, i):
EXAMPLES::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.monomial(4).counit() # indirect doctest
0
sage: H.monomial(0).counit() # indirect doctest
Expand All @@ -103,8 +126,7 @@ def antipode_on_basis(self, indice):
TESTS::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.monomial(0).antipode() #indirect doctest
P0
sage: H.monomial(1).antipode() #indirect doctest
Expand All @@ -131,8 +153,7 @@ def antipode(self, elem):
r"""
TESTS::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.antipode(H.monomial(140))
P140
Expand All @@ -150,8 +171,7 @@ def antipode(self):
r"""
TESTS::
sage: from sage.categories.examples.graded_connected_hopf_algebras_with_basis import GradedConnectedHopfAlgebraOfInteger
sage: H = GradedConnectedHopfAlgebraOfInteger(QQ)
sage: H = GradedHopfAlgebrasWithBasis(QQ).Connected().example()
sage: H.monomial(0).antipode()
P0
sage: H.monomial(1).antipode()
Expand Down

0 comments on commit ad19690

Please sign in to comment.