Beispiel #1
0
    def super_categories(self):
        """
        TESTS::

            sage: from yacop.categories import *
            sage: SteenrodAlgebraModulesAlgebras(SteenrodAlgebra(5)).super_categories()
        """
        return [self.ModuleCategory(), AlgebrasWithBasis(self.base_ring().base_ring())]
    def super_categories(self):
        """
        EXAMPLES::

            sage: FiniteDimensionalAlgebrasWithBasis(QQ).super_categories()
            [Category of finite dimensional modules with basis over Rational Field, Category of algebras with basis over Rational Field]
        """
        R = self.base_ring()
        return [FiniteDimensionalModulesWithBasis(R), AlgebrasWithBasis(R)]
Beispiel #3
0
    def super_categories(self):
        """
        EXAMPLES::

            sage: BialgebrasWithBasis(QQ).super_categories()
            [Category of algebras with basis over Rational Field, Category of coalgebras with basis over Rational Field, Category of bialgebras over Rational Field]
        """
        R = self.base_ring()
        return [AlgebrasWithBasis(R), CoalgebrasWithBasis(R), Bialgebras(R)]
    def __init__(self, R, alphabet = ("a", "b", "c")):
        """
        EXAMPLES::

            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: TestSuite(A).run()

        """
        self._alphabet = alphabet
        CombinatorialFreeModule.__init__(self, R, Words(alphabet), category = AlgebrasWithBasis(R))
Beispiel #5
0
    def super_categories(self):
        """
        TESTS::

            sage: from yacop.categories import *
            sage: A=SteenrodAlgebra(3)
            sage: YacopLeftModules(A).super_categories()
            [Category of yacop differential modules over mod 3 Steenrod algebra, milnor basis,
             Category of vector spaces with basis over Finite Field of size 3,
             Category of left modules over mod 3 Steenrod algebra, milnor basis]
            sage: YacopRightModules(A).super_categories()
            [Category of yacop differential modules over mod 3 Steenrod algebra, milnor basis,
             Category of vector spaces with basis over Finite Field of size 3,
             Category of right modules over mod 3 Steenrod algebra, milnor basis]
            sage: YacopBimodules(A).super_categories()
            [Category of yacop differential modules over mod 3 Steenrod algebra, milnor basis,
             Category of vector spaces with basis over Finite Field of size 3,
             Category of bimodules over mod 3 Steenrod algebra, milnor basis on the left and mod 3 Steenrod algebra, milnor basis on the right]
            sage: YacopLeftModuleAlgebras(A).super_categories()
            [Category of yacop differential modules over mod 3 Steenrod algebra, milnor basis,
             Category of vector spaces with basis over Finite Field of size 3,
             Category of left modules over mod 3 Steenrod algebra, milnor basis,
             Category of algebras with basis over Finite Field of size 3]
            sage: YacopRightModuleAlgebras(A).super_categories()
            [Category of yacop differential modules over mod 3 Steenrod algebra, milnor basis,
             Category of vector spaces with basis over Finite Field of size 3,
             Category of right modules over mod 3 Steenrod algebra, milnor basis,
             Category of algebras with basis over Finite Field of size 3]
            sage: YacopBimoduleAlgebras(A).super_categories()
            [Category of yacop differential modules over mod 3 Steenrod algebra, milnor basis,
             Category of vector spaces with basis over Finite Field of size 3,
             Category of bimodules over mod 3 Steenrod algebra, milnor basis on the left and mod 3 Steenrod algebra, milnor basis on the right,
             Category of algebras with basis over Finite Field of size 3]

        """
        from sage.categories.modules_with_basis import ModulesWithBasis
        from yacop.categories.differential_modules import YacopDifferentialModules

        (left, right, algebra) = self._yacop_category

        R = self.base_ring()
        x = []
        x.append(YacopDifferentialModules(R))
        x.append(ModulesWithBasis(R.base_ring()))
        if left and right:
            x.append(Bimodules(R, R))
        else:
            if left:
                x.append(LeftModules(R))
            if right:
                x.append(RightModules(R))
        if algebra:
            x.append(AlgebrasWithBasis(R.base_ring()))
        return x
        def super_categories(self):
            r"""
            EXAMPLES::

                sage: A = Sets().WithRealizations().example(); A
                The subset algebra of {1, 2, 3} over Rational Field
                sage: C = A.Realizations(); C
                The category of realizations of The subset algebra of {1, 2, 3} over Rational Field
                sage: C.super_categories()
                [Join of Category of algebras over Rational Field and Category of realizations of sets, Category of algebras with basis over Rational Field]
            """
            R = self.base().base_ring()
            return [Algebras(R).Realizations(), AlgebrasWithBasis(R)]
Beispiel #7
0
    def super_categories(self):
        """
        EXAMPLES::

            sage: GradedAlgebrasWithBasis(QQ).super_categories()
            [Category of graded modules with basis over Rational Field, Category of graded algebras over Rational Field, Category of algebras with basis over Rational Field]
        """
        R = self.base_ring()
        return [
            GradedModulesWithBasis(R),
            GradedAlgebras(R),
            AlgebrasWithBasis(R)
        ]
Beispiel #8
0
    def super_categories(self):
        """
        TESTS::

            sage: from yacop.categories import *
            sage: YacopRightModuleAlgebras(SteenrodAlgebra(5)).super_categories()
            [Category of yacop right modules over mod 5 Steenrod algebra, milnor basis,
             Category of algebras with basis over Finite Field of size 5]

        """
        return [
            self.ModuleCategory(),
            AlgebrasWithBasis(self.base_ring().base_ring())
        ]
Beispiel #9
0
 def __init__(self, prime, numxi, numtau, degrees, names, latexnames):
     self._prime = prime
     self.numxi = numxi
     self.numtau = numtau
     self.names = names
     self.latexnames = latexnames
     self._degrees = degrees
     # hack: create a tiny pseudo basis for the test suite
     b = []
     for e in range(0, 8):
         for u in range(0, 3):
             for v in range(0, 3):
                 b.append((e, (u, v)))
     CombinatorialFreeModule.__init__(
         self, GF(prime), Family(b), category=AlgebrasWithBasis(GF(prime))
     )
    def __init__(self, R, cc=None, element_class=None, category=None):
        """
        TESTS::

            sage: s = sage.combinat.combinatorial_algebra.TestAlgebra(QQ)
            sage: TestSuite(s).run()
        """
        #Check to make sure that the user defines the necessary
        #attributes / methods to make the combinatorial module
        #work
        required = [
            '_one',
        ]
        for r in required:
            if not hasattr(self, r):
                raise ValueError("%s is required" % r)
        if not hasattr(self, '_multiply') and not hasattr(
                self, '_multiply_basis'):
            raise ValueError("either _multiply or _multiply_basis is required")

        #Create a class for the elements of this combinatorial algebra
        #We need to do this so to distinguish between element of different
        #combinatorial algebras


#         if element_class is None:
#             if not hasattr(self, '_element_class'):
#                 class CAElement(CombinatorialAlgebraElement):
#                     pass
#                 self._element_class = CAElement
#         else:
#             self._element_class = element_class

        if category is None:
            category = AlgebrasWithBasis(R)

        # for backward compatibility
        if cc is None:
            if hasattr(self, "_indices"):
                cc = self._indices
        assert (cc is not None)

        CombinatorialFreeModule.__init__(self,
                                         R,
                                         cc,
                                         element_class,
                                         category=category)
Beispiel #11
0
    def __init__(self, R, n, r):
        """
        Initialize ``self``.

        TESTS::

            sage: S = SchurAlgebra(ZZ, 2, 2)
            sage: TestSuite(S).run()

        ::

            sage: SchurAlgebra(ZZ, -2, 2)
            Traceback (most recent call last):
            ...
            ValueError: n (=-2) must be a positive integer
            sage: SchurAlgebra(ZZ, 2, -2)
            Traceback (most recent call last):
            ...
            ValueError: r (=-2) must be a non-negative integer
            sage: SchurAlgebra('niet', 2, 2)
            Traceback (most recent call last):
            ...
            ValueError: R (=niet) must be a commutative ring
        """
        if n not in ZZ or n <= 0:
            raise ValueError("n (={}) must be a positive integer".format(n))
        if r not in ZZ or r < 0:
            raise ValueError(
                "r (={}) must be a non-negative integer".format(r))
        if not R in Rings.Commutative():
            raise ValueError("R (={}) must be a commutative ring".format(R))

        self._n = n
        self._r = r

        CombinatorialFreeModule.__init__(self,
                                         R,
                                         schur_representative_indices(n, r),
                                         prefix='S',
                                         bracket=False,
                                         category=AlgebrasWithBasis(R))
Beispiel #12
0
    def __init__(self, W, q1, q2, base_ring, prefix):
        """
        EXAMPLES::

            sage: R.<q1,q2>=QQ[]
            sage: H = IwahoriHeckeAlgebraT("A2",q1,q2,base_ring=Frac(R),prefix="t"); H
            The Iwahori Hecke Algebra of Type A2 in q1,q2 over Fraction Field of Multivariate Polynomial Ring in q1, q2 over Rational Field and prefix t
            sage: TestSuite(H).run()

         """
        self._cartan_type = W.cartan_type()
        self._prefix = prefix
        self._index_set = W.index_set()
        self._q1 = base_ring(q1)
        self._q2 = base_ring(q2)

        if W.is_finite():
            category = FiniteDimensionalAlgebrasWithBasis(base_ring)
        else:
            category = AlgebrasWithBasis(base_ring)
        CombinatorialFreeModule.__init__(self, base_ring, W, category=category)
    def __init__(self, n, R=ZZ, prefix='a'):
        """
        Initiates the affine nilTemperley Lieb algebra over the ring `R`.

        EXAMPLES::

            sage: A = AffineNilTemperleyLiebTypeA(3, prefix="a"); A
            The affine nilTemperley Lieb algebra A3 over the ring Integer Ring
            sage: TestSuite(A).run()
            sage: A = AffineNilTemperleyLiebTypeA(3, QQ); A
            The affine nilTemperley Lieb algebra A3 over the ring Rational Field
        """
        if not isinstance(R, Ring):
            raise TypeError("Argument R must be a ring.")
        self._cartan_type = CartanType(['A', n - 1, 1])
        self._n = n
        W = WeylGroup(self._cartan_type)
        self._prefix = prefix
        self._index_set = W.index_set()
        self._base_ring = R
        category = AlgebrasWithBasis(R)
        CombinatorialFreeModule.__init__(self, R, W, category=category)
Beispiel #14
0
    def __init__(self,
                 domain,
                 on_generators,
                 position=0,
                 codomain=None,
                 category=None,
                 anti=False):
        """
        Given a map on the multiplicative basis of a free algebra, this method
        returns the algebra morphism that is the linear extension of its image
        on generators.

        INPUT:

        - ``domain`` -- an algebra with a multiplicative basis
        - ``on_generators`` -- a function defined on the index set of the generators
        - ``codomain`` -- the codomain
        - ``position`` -- integer; default is 0
        - ``category`` -- a category; defaults to None
        - ``anti`` -- a boolean; defaults to False

        OUTPUT:

        - module morphism

        EXAMPLES:

        We construct explicitly an algbera morphism::

            sage: from sage.combinat.ncsf_qsym.generic_basis_code import AlgebraMorphism
            sage: NCSF = NonCommutativeSymmetricFunctions(QQ)
            sage: Psi = NCSF.Psi()
            sage: f = AlgebraMorphism(Psi, attrcall('conjugate'), codomain=Psi)
            sage: f
            Generic endomorphism of Non-Commutative Symmetric Functions over the Rational Field in the Psi basis

        Usually, however, one constructs algebra morphisms
        using the ``algebra_morphism`` method for an algebra::

            sage: NCSF = NonCommutativeSymmetricFunctions(QQ)
            sage: Psi = NCSF.Psi()
            sage: def double(i) : return Psi[i,i]
            sage: f = Psi.algebra_morphism(double, codomain = Psi)
            sage: f
            Generic endomorphism of Non-Commutative Symmetric Functions over the Rational Field in the Psi basis
            sage: f(2*Psi[[]] + 3 * Psi[1,3,2] + Psi[2,4] )
            2*Psi[] + 3*Psi[1, 1, 3, 3, 2, 2] + Psi[2, 2, 4, 4]
            sage: f.category()
            Join of Category of hom sets in Category of modules with basis over Rational Field and Category of hom sets in Category of rings

        When extra properties about the morphism are known, one
        can specify the category of which it is a morphism::

            sage: def negate(i): return -Psi[i]
            sage: f = Psi.algebra_morphism(negate, codomain = Psi, category = GradedHopfAlgebrasWithBasis(QQ))
            sage: f
            Generic endomorphism of Non-Commutative Symmetric Functions over the Rational Field in the Psi basis
            sage: f(2*Psi[[]] + 3 * Psi[1,3,2] + Psi[2,4] )
            2*Psi[] - 3*Psi[1, 3, 2] + Psi[2, 4]
            sage: f.category()
            Join of Category of hom sets in Category of modules with basis over Rational Field and Category of hom sets in Category of rings

        If ``anti`` is true, this returns an anti-algebra morphism::

            sage: f = Psi.algebra_morphism(double, codomain = Psi, anti=True)
            sage: f
            Generic endomorphism of Non-Commutative Symmetric Functions over the Rational Field in the Psi basis
            sage: f(2*Psi[[]] + 3 * Psi[1,3,2] + Psi[2,4] )
            2*Psi[] + 3*Psi[2, 2, 3, 3, 1, 1] + Psi[4, 4, 2, 2]
            sage: f.category()
            Category of hom sets in Category of modules with basis over Rational Field


        TESTS::

            sage: Psi = NonCommutativeSymmetricFunctions(QQ).Psi()
            sage: Phi = NonCommutativeSymmetricFunctions(QQ).Phi()
            sage: f = Psi.algebra_morphism(Phi.antipode_on_generators, codomain=Phi)
            sage: f(Psi[1, 2, 2, 1])
            Phi[1, 2, 2, 1]
            sage: f(Psi[3, 1, 2])
            -Phi[3, 1, 2]
            sage: f.__class__
            <class 'sage.combinat.ncsf_qsym.generic_basis_code.AlgebraMorphism'>
            sage: TestSuite(f).run(skip=['_test_nonzero_equal']) # known issue; see ModuleMorphismByLinearity.__init__
            Failure in _test_category:
            ...
            The following tests failed: _test_category
        """
        assert position == 0
        assert codomain is not None
        if category is None:
            if anti:
                category = ModulesWithBasis(domain.base_ring())
            else:
                category = AlgebrasWithBasis(domain.base_ring())
        self._anti = anti
        self._on_generators = on_generators
        ModuleMorphismByLinearity.__init__(self,
                                           domain=domain,
                                           codomain=codomain,
                                           position=position,
                                           category=category)