當前位置: 首頁>>代碼示例>>Python>>正文


Python module.Module類代碼示例

本文整理匯總了Python中sage.modules.module.Module的典型用法代碼示例。如果您正苦於以下問題:Python Module類的具體用法?Python Module怎麽用?Python Module使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Module類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, group, base_ring, k, ep, n):
        r"""
        Return the Module of (Hecke) cusp forms
        of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.

        EXAMPLES::

            sage: from sage.modular.modform_hecketriangle.space import CuspForms
            sage: MF = CuspForms(6, ZZ, 6, 1)
            sage: MF
            CuspForms(n=6, k=6, ep=1) over Integer Ring
            sage: MF.analytic_type()
            cuspidal
            sage: MF.category()
            Category of modules over Integer Ring
            sage: MF in MF.category()
            True
            sage: MF.module()
            Vector space of dimension 1 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
            sage: MF.ambient_module() == MF.module()
            True
            sage: MF.is_ambient()
            True
        """

        FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
        Module.__init__(self, base=base_ring)
        self._analytic_type=self.AT(["cusp"])
        self._module = FreeModule(self.coeff_ring(), self.dimension())
開發者ID:mcognetta,項目名稱:sage,代碼行數:29,代碼來源:space.py

示例2: __init__

 def __init__(self, surface, base_ring=ZZ):
     self._base_ring=base_ring
     if not isinstance(surface,SimilaritySurface):
         raise ValueError("RelativeHomology only defined for SimilaritySurfaces (and better).")
     self._s=surface
     self._cached_edges=dict()
     Module.__init__(self, base_ring)
開發者ID:videlec,項目名稱:sage-flatsurf,代碼行數:7,代碼來源:relative_homology.py

示例3: __init__

    def __init__(self, O, C, R) :
        """
        INPUT:
            - `O` -- A monoid with an action of a group; As implemented in
                     :class:~`fourier_expansion_framework.monoidpowerseries.NNMonoid`.
            - `C` -- A monoid of characters; As implemented in ::class:~`fourier_expansion_framework.monoidpowerseries.CharacterMonoid_class`.
            - `R` -- A representation on a module; As implemented
                     in :class:~`fourier_expansion_framework.monoidpowerseries.TrivialRepresentation`.

        EXAMPLES::
            sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
            sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_module import EquivariantMonoidPowerSeriesModule
            sage: emps = EquivariantMonoidPowerSeriesModule_generic(NNMonoid(True), TrivialCharacterMonoid("1", QQ), TrivialRepresentation("1", FreeModule(QQ, 2))) # indirect doctest
        """
        
        # If the representation O respects the monoid structure of S
        # the base ring should be the associated power series ring.
        if O.is_monoid_action() :
            Module.__init__(self, EquivariantMonoidPowerSeriesRing(O,C,TrivialRepresentation(R.group(), R.base_ring())))
        else :
            Module.__init__(self, R.codomain())
        EquivariantMonoidPowerSeriesAmbient_abstract.__init__(self, O, C, R)        
        
        self.__coeff_gens = \
          [self._element_class( self,
            dict([( C.one_element(), dict([(self.monoid().zero_element(), a)]) )]),
            self.monoid().filter_all() )
           for a in self.coefficient_domain().gens()]
開發者ID:Alwnikrotikz,項目名稱:purplesage,代碼行數:28,代碼來源:monoidpowerseries_module.py

示例4: __init__

 def __init__(self,domain,U,prec = None,t = None,R = None,overconvergent = False):
     if(R is None):
         if not isinstance(U,Integer):
             self._R = U.base_ring()
         else:
             if prec is None:
                 prec = 20
             self._R = Qp(domain._p,prec)
     else:
         self._R = R
     #U is a CoefficientModuleSpace
     if isinstance(U,Integer):
         if t is None:
             if overconvergent:
                 t = prec-U+1
             else:
                 t = 0
         self._U = OCVn(U-2,self._R,U-1+t)
     else:
         self._U = U
     self._source = domain
     self._list = self._source.get_list() # Contains also the opposite edges
     self._prec = self._R.precision_cap()
     self._n = self._U.weight()
     self._p = self._source._p
     Module.__init__(self,base = self._R)
     self._populate_coercion_lists_()
開發者ID:mmasdeu,項目名稱:btquotients,代碼行數:27,代碼來源:pautomorphicform.py

示例5: __init__

    def __init__(self, group, coefficients, sign=0):
        r"""
        INPUT:

            See :class:`PSModularSymbolSpace`

        EXAMPLES::

            sage: D = Distributions(2, 11)
            sage: M = PSModularSymbols(Gamma0(2), coefficients=D)
            sage: type(M)
            <class 'sage.modular.pollack_stevens.space.PSModularSymbolSpace_with_category'>
            sage: TestSuite(M).run()

        """
        Module.__init__(self, coefficients.base_ring())
        if sign not in [0,-1,1]:
            # sign must be be 0, -1 or 1
            raise ValueError, "sign must be 0, -1, or 1"
        self._group = group
        self._coefficients = coefficients
        if coefficients.is_symk():
            self.Element = PSModularSymbolElement_symk
        else:
            self.Element = PSModularSymbolElement_dist
        self._sign = sign
        # should distingish between Gamma0 and Gamma1...
        self._source = ManinRelations(group.level())
        # We have to include the first action so that scaling by Z doesn't try to pass through matrices
        actions = [PSModSymAction(ZZ, self), PSModSymAction(M2ZSpace, self)]
        self._populate_coercion_lists_(action_list=actions)
開發者ID:saraedum,項目名稱:OMS,代碼行數:31,代碼來源:space.py

示例6: __init__

 def __init__(self,X,U,prec=None,t=None,R=None,overconvergent=False):
     if(R is None):
         if(not isinstance(U,Integer)):
             self._R=U.base_ring()
         else:
             if(prec is None):
                 prec=100
             self._R=Qp(X._p,prec)
     else:
         self._R=R
     #U is a CoefficientModuleSpace
     if(isinstance(U,Integer)):
         if(t is None):
             if(overconvergent):
                 t=prec-U+1
             else:
                 t=0
         self._U=OCVn(U-2,self._R,U-1+t)
     else:
         self._U=U
     self._X=X
     self._V=self._X.get_vertex_list()
     self._E=self._X.get_edge_list()
     self._prec=self._R.precision_cap()
     self._n=self._U.weight()
     Module.__init__(self,base=self._R)
     self._populate_coercion_lists_()
開發者ID:williamstein,項目名稱:OMS,代碼行數:27,代碼來源:pautomorphicform.py

示例7: __init__

    def __init__(self, group, base_ring, k, ep):
        r"""
        Return the Module of (Hecke) modular forms
        of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.

        EXAMPLES::

            sage: MF = ModularForms()
            sage: MF
            ModularForms(n=3, k=0, ep=1) over Integer Ring
            sage: MF.analytic_type()
            modular
            sage: MF.category()
            Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
            sage: MF.module()
            Vector space of dimension 1 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
            sage: MF.ambient_module() == MF.module()
            True
            sage: MF.is_ambient()
            True
        """

        FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep)
        Module.__init__(self, base=self.coeff_ring())
        self._analytic_type = self.AT(["holo"])
        self._module = FreeModule(self.coeff_ring(), self.dimension())
開發者ID:jjermann,項目名稱:hecke_mf,代碼行數:26,代碼來源:space.py

示例8: __init__

 def __init__(self,p,depth):
     Module.__init__(self,base = ZZ)
     self._R = ZZ
     self._p = p
     self._Rmod = ZpCA(p,depth - 1)
     self._depth = depth
     self._pN = self._p**(depth - 1)
     self._PowerSeries = PowerSeriesRing(self._Rmod, default_prec = self._depth,name='z')
     self._cache_powers = dict()
     self._unset_coercions_used()
     self._Sigma0 = Sigma0(self._p, base_ring = self._Rmod, adjuster = our_adjuster())
     self.register_action(Sigma0Action(self._Sigma0,self))
     self._populate_coercion_lists_()
開發者ID:mmasdeu,項目名稱:darmonpoints,代碼行數:13,代碼來源:ocmodule.py

示例9: _coerce_map_from_

    def _coerce_map_from_(self, other) :
        """
        TESTS::
            sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
            sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_module import *
            sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_element import *
            sage: from psage.modform.fourier_expansion_framework.gradedexpansions.gradedexpansion_grading import DegreeGrading
            sage: from psage.modform.fourier_expansion_framework.gradedexpansions.gradedexpansion_module import *
            sage: m = FreeModule(QQ, 3)
            sage: mpsm = MonoidPowerSeriesModule(m, NNMonoid(False))
            sage: mps = mpsm.base_ring()
            sage: ger = GradedExpansionModule_class(Sequence([MonoidPowerSeries(mps, {1: 1}, mps.monoid().filter(4))]), Sequence([MonoidPowerSeries(mpsm, {1: m([1,1,1]), 2: m([1,3,-3])}, mpsm.monoid().filter(4))]), PolynomialRing(QQ, ['a', 'b']).ideal(0), DegreeGrading((1,2)))
            sage: ger._coerce_map_from_(ZZ)
        """
        if other is self.relations().ring() :
            from sage.structure.coerce_maps import CallableConvertMap
            
            return CallableConvertMap(other, self, self._element_constructor_)
        
        if isinstance(other, GradedExpansionSubmodule_abstract) :
            if other.graded_ambient() is self \
              or self.has_coerce_map_from(other.graded_ambient()) :
                from sage.structure.coerce_maps import CallableConvertMap

                return CallableConvertMap(other, self, other._graded_expansion_submodule_to_graded_ambient_)

        return Module._coerce_map_from_(self, other)
開發者ID:RalphieBoy,項目名稱:psage,代碼行數:27,代碼來源:gradedexpansion_module.py

示例10: __init__

    def __init__(self, abvar):
        """
        Group of all torsion points over the algebraic closure on an
        abelian variety.

        INPUT:


        -  ``abvar`` - an abelian variety


        EXAMPLES::

            sage: A = J0(23)
            sage: A.qbar_torsion_subgroup()
            Group of all torsion points in QQbar on Abelian variety J0(23) of dimension 2
        """
        self.__abvar = abvar
        Module.__init__(self, ZZ)
開發者ID:saraedum,項目名稱:sage-renamed,代碼行數:19,代碼來源:torsion_subgroup.py

示例11: __init__

    def __init__(self,n,R,depth=None,basis=None):
        Module.__init__(self,base=R)
        if basis is not None:
            self._basis=copy(basis)
        self._n=n
        self._R=R
        if R.is_exact():
            self._Rmod=self._R
        else:
            self._Rmod=Zmod(self._R.prime()**(self._R.precision_cap()))

        if depth is None:
            depth=n+1
        if depth != n+1:
            if R.is_exact(): raise ValueError, "Trying to construct an over-convergent module with exact coefficients, how do you store p-adics ??"
        self._depth=depth
        self._PowerSeries=PowerSeriesRing(self._Rmod,default_prec=self._depth,name='z')
        self._powers=dict()
        self._populate_coercion_lists_()
開發者ID:lalitkumarj,項目名稱:OMSCategory,代碼行數:19,代碼來源:ocmodule.py

示例12: __init__

    def __init__(self, group, base_ring, k, ep, n):
        r"""
        Return the Module of (Hecke) meromorphic modular forms
        of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.

        EXAMPLES::

            sage: from sage.modular.modform_hecketriangle.space import MeromorphicModularForms
            sage: MF = MeromorphicModularForms()
            sage: MF
            MeromorphicModularForms(n=3, k=0, ep=1) over Integer Ring
            sage: MF.analytic_type()
            meromorphic modular
            sage: MF.category()
            Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
            sage: MF.is_ambient()
            True
        """

        FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
        Module.__init__(self, base=self.coeff_ring())
        self._analytic_type=self.AT(["jacobi", "mero"])
開發者ID:jjermann,項目名稱:jacobi_forms,代碼行數:22,代碼來源:jacobi_space.py

示例13: __init__

    def __init__(self, group, base_ring, k, ep, n):
        r"""
        Return the Module of (Hecke) quasi modular forms
        of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.

        EXAMPLES::

            sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms
            sage: MF = QuasiModularForms(5, ZZ, 20/3, 1)
            sage: MF
            QuasiModularForms(n=5, k=20/3, ep=1) over Integer Ring
            sage: MF.analytic_type()
            quasi modular
            sage: MF.category()
            Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
            sage: MF.is_ambient()
            True
        """

        FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
        Module.__init__(self, base=self.coeff_ring())
        self._analytic_type=self.AT(["quasi", "holo"])
        self._module = FreeModule(self.coeff_ring(), self.dimension())
開發者ID:drupel,項目名稱:sage,代碼行數:23,代碼來源:space.py

示例14: __init__

    def __init__(self, abvar, field_of_definition=QQ):
        """
        Initialize ``self``.

        TESTS::

            sage: A = J0(11)
            sage: G = A.torsion_subgroup(2)
            sage: TestSuite(G).run() # long time
        """
        from sage.categories.category import Category
        from sage.categories.fields import Fields
        from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
        from sage.categories.modules import Modules
        from .abvar import is_ModularAbelianVariety
        if field_of_definition not in Fields():
            raise TypeError("field_of_definition must be a field")
        if not is_ModularAbelianVariety(abvar):
            raise TypeError("abvar must be a modular abelian variety")
        category = Category.join((Modules(ZZ), FiniteEnumeratedSets()))
        Module.__init__(self, ZZ, category=category)
        self.__abvar = abvar
        self.__field_of_definition = field_of_definition
開發者ID:mcognetta,項目名稱:sage,代碼行數:23,代碼來源:finite_subgroup.py

示例15: __init__

    def __init__(self, group, coefficients, sign=0):
        r"""
        INPUT:

            See :class:`PSModularSymbolSpace`

        EXAMPLES::

            sage: D = Distributions(2, 11)
            sage: M = PSModularSymbols(Gamma0(11), coefficients=D)
            sage: type(M)
            <class 'sage.modular.pollack_stevens.space.PSModularSymbolSpace_with_category'>
            sage: TestSuite(M).run()

        """
        Module.__init__(self, coefficients.base_ring())
        if sign not in [0,-1,1]:
            # sign must be be 0, -1 or 1
            raise ValueError, "sign must be 0, -1, or 1"
        self._group = group
        self._coefficients = coefficients
        if coefficients.is_symk():
            self.Element = PSModularSymbolElement_symk
        else:
            self.Element = PSModularSymbolElement_dist
        self._sign = sign
        # should distingish between Gamma0 and Gamma1...
        self._source = ManinRelations(group.level())

        # Register the action of 2x2 matrices on self. 
        
        if coefficients.is_symk():
            action = PSModSymAction(Sigma0(1), self)
        else:
            action = PSModSymAction(Sigma0(self.prime()), self)
            
        self._populate_coercion_lists_(action_list=[action])
開發者ID:roed314,項目名稱:OMS,代碼行數:37,代碼來源:space.py


注:本文中的sage.modules.module.Module類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。