Exemple #1
0
    def super_categories(self):
        """
        EXAMPLES::

            sage: Bialgebras(QQ).super_categories()
            [Category of algebras over Rational Field, Category of coalgebras over Rational Field]
        """
        R = self.base_ring()
        return [Algebras(R), Coalgebras(R)]
Exemple #2
0
    def super_categories(self):
        """
        EXAMPLES::

            sage: AlgebrasWithBasis(QQ).super_categories()
            [Category of modules with basis over Rational Field, Category of algebras over Rational Field]
        """
        R = self.base_ring()
        return [ModulesWithBasis(R), Algebras(R)]
Exemple #3
0
        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.Bases(); C
                Category of bases of The subset algebra of {1, 2, 3} over Rational Field
                sage: C.super_categories()
                [Category of realizations of The subset algebra of {1, 2, 3} over Rational Field,
                 Join of Category of algebras with basis over Rational Field and
                         Category of commutative algebras over Rational Field and
                         Category of realizations of unital magmas]
            """
            A = self.base()
            category = Algebras(A.base_ring()).Commutative()
            return [A.Realizations(),
                    category.Realizations().WithBasis()]
        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)]
    def __init__(self, R, S):
        r"""
        EXAMPLES::

            sage: from sage.categories.examples.with_realizations import SubsetAlgebra
            sage: A = SubsetAlgebra(QQ, Set((1,2,3))); A
            The subset algebra of {1, 2, 3} over Rational Field
            sage: Sets().WithRealizations().example() is A
            True
            sage: TestSuite(A).run()
        """
        assert (R in Rings())
        self._base = R  # Won't be needed when CategoryObject won't override anymore base_ring
        self._S = S
        Parent.__init__(self, category=Algebras(R).WithRealizations())
        def extra_super_categories(self):
            r"""
            Returns the dual category

            EXAMPLES:

            The category of coalgebras over the Rational Field is dual
            to the category of algebras over the same field::

                sage: C = Coalgebras(QQ)
                sage: C.dual()
                Category of duals of coalgebras over Rational Field
                sage: C.dual().super_categories() # indirect doctest
                [Category of algebras over Rational Field, Category of duals of vector spaces over Rational Field]

            """
            from sage.categories.algebras import Algebras
            return [Algebras(self.base_category().base_ring())]
    def __init__(self,
                 coeff_ring=ZZ,
                 group='Sp(4,Z)',
                 weights='even',
                 degree=2,
                 default_prec=SMF_DEFAULT_PREC):
        r"""
        Initialize an algebra of Siegel modular forms of degree ``degree`` 
        with coefficients in ``coeff_ring``, on the group ``group``.  
        If ``weights`` is 'even', then only forms of even weights are 
        considered; if ``weights`` is 'all', then all forms are 
        considered.

        EXAMPLES::

            sage: A = SiegelModularFormsAlgebra(QQ)
            sage: B = SiegelModularFormsAlgebra(ZZ)
            sage: A._coerce_map_from_(B)
            True                                                                                                      
            sage: B._coerce_map_from_(A)
            False                                                                                                                                            
            sage: A._coerce_map_from_(ZZ)
            True   
        """
        self.__coeff_ring = coeff_ring
        self.__group = group
        self.__weights = weights
        self.__degree = degree
        self.__default_prec = default_prec
        R = coeff_ring
        from sage.algebras.all import GroupAlgebra
        if isinstance(R, GroupAlgebra):
            R = R.base_ring()
        from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
        if is_PolynomialRing(R):
            self.__base_ring = R.base_ring()
        else:
            self.__base_ring = R
        from sage.categories.all import Algebras
        Algebra.__init__(self,
                         base=self.__base_ring,
                         category=Algebras(self.__base_ring))
Exemple #8
0
    def __init__(self, R, S):
        r"""
        EXAMPLES::

            sage: from sage.categories.examples.with_realizations import SubsetAlgebra
            sage: A = SubsetAlgebra(QQ, Set((1,2,3))); A
            The subset algebra of {1, 2, 3} over Rational Field
            sage: Sets().WithRealizations().example() is A
            True
            sage: TestSuite(A).run()

        TESTS::

            sage: A = Sets().WithRealizations().example(); A
            The subset algebra of {1, 2, 3} over Rational Field
            sage: F, In, Out = A.realizations()
            sage: type(F.coerce_map_from(In))
            <class 'sage.categories.modules_with_basis.TriangularModuleMorphism'>
            sage: type(In.coerce_map_from(F))
            <class 'sage.categories.modules_with_basis.TriangularModuleMorphism'>
            sage: type(F.coerce_map_from(Out))
            <class 'sage.categories.modules_with_basis.TriangularModuleMorphism'>
            sage: type(Out.coerce_map_from(F))
            <class 'sage.categories.modules_with_basis.TriangularModuleMorphism'>
            sage: In.coerce_map_from(Out)
            Composite map:
              From: The subset algebra of {1, 2, 3} over Rational Field in the Out basis
              To:   The subset algebra of {1, 2, 3} over Rational Field in the In basis
              Defn:   Generic morphism:
                      From: The subset algebra of {1, 2, 3} over Rational Field in the Out basis
                      To:   The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis
                    then
                      Generic morphism:
                      From: The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis
                      To:   The subset algebra of {1, 2, 3} over Rational Field in the In basis
            sage: Out.coerce_map_from(In)
            Composite map:
              From: The subset algebra of {1, 2, 3} over Rational Field in the In basis
              To:   The subset algebra of {1, 2, 3} over Rational Field in the Out basis
              Defn:   Generic morphism:
                      From: The subset algebra of {1, 2, 3} over Rational Field in the In basis
                      To:   The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis
                    then
                      Generic morphism:
                      From: The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis
                      To:   The subset algebra of {1, 2, 3} over Rational Field in the Out basis
        """
        assert (R in Rings())
        self._base = R  # Won't be needed when CategoryObject won't override anymore base_ring
        self._S = S
        Parent.__init__(self, category=Algebras(R).WithRealizations())

        # Initializes the bases and change of bases of ``self``

        category = self.Bases()
        F = self.F()
        In = self.In()
        Out = self.Out()

        In_to_F = In.module_morphism(F.sum_of_monomials * Subsets,
                                     codomain=F,
                                     category=category,
                                     triangular='upper',
                                     unitriangular=True,
                                     cmp=self.indices_cmp)
        In_to_F.register_as_coercion()
        (~In_to_F).register_as_coercion()

        F_to_Out = F.module_morphism(Out.sum_of_monomials * self.supsets,
                                     codomain=Out,
                                     category=category,
                                     triangular='lower',
                                     unitriangular=True,
                                     cmp=self.indices_cmp)
        F_to_Out.register_as_coercion()
        (~F_to_Out).register_as_coercion()