def __init__(self, group, base_ring, k, ep, n): r""" Return the zero Module for the zero form of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. The ZeroForm space coerces into any forms space or ring with a compatible group. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import ZeroForm sage: MF = ZeroForm(6, CC, 3, -1) sage: MF ZeroForms(n=6, k=3, ep=-1) over Complex Field with 53 bits of precision sage: MF.analytic_type() zero sage: MF.category() Category of vector spaces over Complex Field with 53 bits of precision sage: MF in MF.category() True sage: MF.module() Vector space of dimension 0 over Fraction Field of Univariate Polynomial Ring in d over Complex Field with 53 bits of precision 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([]) self._module = FreeModule(self.coeff_ring(), self.dimension())
def __init__(self, O, C, R) : 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_generic sage: emps = EquivariantMonoidPowerSeriesModule_generic(NNMonoid(True), TrivialCharacterMonoid("1", QQ), TrivialRepresentation("1", FreeModule(QQ, 2))) # indirect doctest sage: emps = EquivariantMonoidPowerSeriesModule_generic(NNMonoid(True), TrivialCharacterMonoid("1", ZZ), TrivialRepresentation("1", FreeModule(ZZ, 2))) # indirect doctest sage: emps.base_ring() Ring of equivariant monoid power series over NN sage: (1 / 2) * emps.0 Equivariant monoid power series in Module of equivariant monoid power series over NN """ # 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()]
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)
def __init__(self, group, base_ring, k, ep, n): r""" Return the Module of (Hecke) quasi cusp forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import QuasiCuspForms sage: MF = QuasiCuspForms(8, ZZ, 16/3) sage: MF QuasiCuspForms(n=8, k=16/3, ep=1) over Integer Ring sage: MF.analytic_type() quasi cuspidal sage: MF.category() Category of modules over Integer Ring sage: MF in MF.category() True sage: MF.is_ambient() True sage: QuasiCuspForms(n=infinity) QuasiCuspForms(n=+Infinity, k=0, ep=1) over Integer Ring """ 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(["quasi", "cusp"]) self._module = FreeModule(self.coeff_ring(), self.dimension())
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())
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()]
def __init__(self, group, base_ring, k, ep, n): r""" Return the Module of (Hecke) modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import ModularForms 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 sage: MF = ModularForms(n=infinity, k=8) sage: MF ModularForms(n=+Infinity, k=8, 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 """ 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(["holo"]) self._module = FreeModule(self.coeff_ring(), self.dimension())
def __init__(self, group, base_ring, k, ep, n): r""" Return the Module of (Hecke) weakly holomorphic modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import WeakModularForms sage: MF = WeakModularForms(5, CC, 20/3) sage: MF WeakModularForms(n=5, k=20/3, ep=1) over Complex Field with 53 bits of precision sage: MF.analytic_type() weakly holomorphic modular sage: MF.category() Category of vector spaces over Complex Field with 53 bits of precision sage: MF in MF.category() 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(["weak"])
def __init__(self, p, depth, act_on_left=False, adjuster=None): self._dimension = 0 ## Hack!! Dimension was being called before it was intialised self._Rmod = ZpCA(p, depth - 1) ## create Zp Module.__init__(self, base=self._Rmod) self.Element = BianchiDistributionElement self._R = ZZ self._p = p self._depth = depth self._pN = self._p**(depth - 1) self._cache_powers = dict() self._unset_coercions_used() ## Initialise monoid Sigma_0(p) + action; use Pollack-Stevens modular symbol code ## our_adjuster() is set above to allow different conventions if adjuster is None: adjuster = _default_adjuster() self._adjuster = adjuster ## Power series ring for representing distributions as strings self._repr_R = PowerSeriesRing(self._R, num_gens=2, default_prec=self._depth, names='X,Y') self._Sigma0Squared = Sigma0Squared(self._p, self._Rmod, adjuster) self._act = Sigma0SquaredAction(self._Sigma0Squared, self, act_on_left=act_on_left) self.register_action(self._act) self._populate_coercion_lists_() ## Initialise dictionaries of indices to translate between pairs and index for moments self._index = dict() self._ij = [] m = 0 ## Populate dictionary/array giving index of the basis element corr. to tuple (i,j), 0 <= i,j <= depth = n ## These things are ordered by degree of y, then degree of x: [1, x, x^2, ..., y, xy, ... ] for j in range(depth): for i in range(depth): self._ij.append((i, j)) self._index[(i, j)] = m m += 1 self._dimension = m ## Number of moments we store ## Power series ring Zp[[x,y]]. We have to work with monomials up to x^depth * y^depth, so need prec = 2*depth self._PowerSeries_x = PowerSeriesRing(self._Rmod, default_prec=self._depth, names='x') self._PowerSeries_x_ZZ = PowerSeriesRing(ZZ, default_prec=self._depth, names='x') self._PowerSeries = PowerSeriesRing(self._PowerSeries_x, default_prec=self._depth, names='y') self._PowerSeries_ZZ = PowerSeriesRing(self._PowerSeries_x_ZZ, default_prec=self._depth, names='y')
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_()
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())
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_()
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)
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 modules over Integer Ring sage: MF in MF.category() 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(["mero"])
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)
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_()
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)
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)
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)
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_()
def __init__(self, A, S) : """ INPUT: - `A` -- A module. - `S` -- A monoid as implemented in :class:~`fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids.NNMonoid`. TESTS:: sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import * sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_module import MonoidPowerSeriesModule_generic sage: mps = MonoidPowerSeriesModule_generic(FreeModule(QQ,2), NNMonoid(False)) """ Module.__init__(self, MonoidPowerSeriesRing(A.base_ring(), S)) MonoidPowerSeriesAmbient_abstract.__init__(self, A, S) self.__coeff_gens = \ [ self._element_class(self, dict([(S.zero_element(), a)]), self.monoid().filter_all() ) for a in A.gens() ]
def __init__(self, group, base_ring, k, ep): r""" Return the Module of (Hecke) weakly holomorphic modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: MF = WeakModularForms(5, CC, 20/3) sage: MF WeakModularForms(n=5, k=20/3, ep=1) over Complex Field with 53 bits of precision sage: MF.analytic_type() weakly holomorphic modular sage: MF.category() Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Complex Field with 53 bits of precision """ 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(["weak"])
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_()
def __init__(self, group, base_ring, k, ep): r""" Return the Module of (Hecke) quasi cusp forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: MF = QCuspForms(8, ZZ, 16/3) sage: MF QuasiCuspForms(n=8, k=16/3, ep=1) over Integer Ring sage: MF.analytic_type() quasi cuspidal 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) Module.__init__(self, base=self.coeff_ring()) self._analytic_type=self.AT(["quasi", "cusp"])
def __init__(self, group, base_ring, k, ep): r""" Return the Module of (Hecke) quasi meromorphic modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: MF = QMModularForms(5, ZZ, 20/3, 1) sage: MF QuasiMeromorphicModularForms(n=5, k=20/3, ep=1) over Integer Ring sage: MF.analytic_type() quasi meromorphic modular sage: MF.category() Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Integer Ring sage: MF.ambient_space() == MF 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(["quasi", "mero"])
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_()
def __init__(self, group, base_ring, k, ep, n): r""" Return the Module of (Hecke) weakly holomorphic modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import WeakModularForms sage: MF = WeakModularForms(5, CC, 20/3) sage: MF WeakModularForms(n=5, k=20/3, ep=1) over Complex Field with 53 bits of precision sage: MF.analytic_type() weakly holomorphic modular sage: MF.category() Category of vector spaces over Complex Field with 53 bits of precision sage: MF in MF.category() 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(["weak"])
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"])
def __init__(self, group, base_ring, k, ep, n): r""" Return the Module of (Hecke) quasi weakly holomorphic modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import QuasiWeakModularForms sage: MF = QuasiWeakModularForms(4, ZZ, 8, 1) sage: MF QuasiWeakModularForms(n=4, k=8, ep=1) over Integer Ring sage: MF.analytic_type() quasi weakly holomorphic 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", "weak"])
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())
def __init__(self, A, S) : r""" INPUT: - `A` -- A module. - `S` -- A monoid as implemented in :class:~`fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids.NNMonoid`. TESTS:: sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import * sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_module import MonoidPowerSeriesModule_generic sage: mps = MonoidPowerSeriesModule_generic(FreeModule(QQ,2), NNMonoid(False)) sage: mps = MonoidPowerSeriesModule_generic(FreeModule(ZZ,2), NNMonoid(False)) sage: mps.base_ring() Ring of monoid power series over NN sage: (1 / 2) * mps.0 Monoid power series in Module of monoid power series over NN """ Module.__init__(self, MonoidPowerSeriesRing(A.base_ring(), S)) MonoidPowerSeriesAmbient_abstract.__init__(self, A, S) self.__coeff_gens = \ [ self._element_class(self, dict([(S.zero_element(), a)]), self.monoid().filter_all() ) for a in A.gens() ]
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
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])
def __init__(self, group, base_ring, k, ep, n): r""" Return the Module of (Hecke) quasi weakly holomorphic modular forms of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import QuasiWeakModularForms sage: MF = QuasiWeakModularForms(4, ZZ, 8, 1) sage: MF QuasiWeakModularForms(n=4, k=8, ep=1) over Integer Ring sage: MF.analytic_type() quasi weakly holomorphic modular sage: MF.category() Category of modules over Integer Ring sage: MF in MF.category() 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(["quasi", "weak"])
def __init__(self, group, coefficients, sign=0): r""" INPUT: See :class:`PollackStevensModularSymbolspace` EXAMPLES:: sage: D = OverconvergentDistributions(2, 11) sage: M = PollackStevensModularSymbols(Gamma0(11), coefficients=D) sage: type(M) <class 'sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace_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 distinguish 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])
def __init__(self, base_ring_generators, generators, relations, grading, all_relations=True, reduce_before_evaluating=True): r""" The degree one part of the monomials that correspond to generators over the base expansion ring will serve as the coordinates of the elements. INPUT: - ``base_ring_generators`` -- A list of (equivariant) monoid power series with coefficient domain the base ring of the coefficient domain of the generators or ``None``. - ``generators`` -- A list of (equivariant) monoid power series; The generators of the ambient over the ring generated by the base ring generators. - ``relations`` -- An ideal in a polynomial ring with ``len(base_ring_generators) + len(generators)`` variables. - ``grading`` -- A grading deriving from :class:~`fourier_expansion_framework.gradedexpansions.gradedexpansion_grading`; A grading for the polynomial ring of the relations. - ``all_relations`` -- A boolean (default: ``True``); If ``True`` the relations given for the polynomial ring are all relations that the Fourier expansion have. - ``reduce_before_evaluating`` -- A boolean (default: ``True``); If ``True`` any monomial will be Groebner reduced before the Fourier expansion is calculated. NOTE: The grading must respect the relations of the generators. 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.base_ring() Graded expansion ring with generators a """ if not hasattr(self, '_element_class'): self._element_class = GradedExpansionVector_class if hasattr(self, "_extended_base_ring"): Module.__init__(self, self._extended_base_ring) elif base_ring_generators is None or len(base_ring_generators) == 0: Module.__init__(self, relations.base_ring()) else: gb = filter( lambda p: all( all(a == 0 for a in list(e)[len(base_ring_generators):]) for e in p.exponents()), relations.groebner_basis()) P = PolynomialRing( relations.base_ring(), list(relations.ring().variable_names()) [:len(base_ring_generators)]) base_relations = P.ideal(gb) R = GradedExpansionRing_class( None, base_ring_generators, base_relations, grading.subgrading(xrange(len(base_ring_generators))), all_relations, reduce_before_evaluating) Module.__init__(self, R) GradedExpansionAmbient_abstract.__init__(self, base_ring_generators, generators, relations, grading, all_relations, reduce_before_evaluating) self._populate_coercion_lists_( convert_list=[self.relations().ring()], convert_method_name="_graded_expansion_submodule_to_graded_ambient_" )
def __init__(self, surface, base_ring=ZZ): self._base_ring=base_ring self._s=surface self._cached_edges=dict() Module.__init__(self, base_ring)
def __init__(self, ambient_space, basis): r""" Return the Submodule of (Hecke) forms in ``ambient_space`` for the given ``basis``. INPUT: - ``ambient_space`` - An ambient forms space. - ``basis``` - A tuple of linearly independent elements of ``ambient_space``. OUTPUT: The corresponding submodule. EXAMPLES:: sage: from space import ModularForms sage: MF = ModularForms(group=6, k=20, ep=1) sage: MF ModularForms(n=6, k=20, ep=1) over Integer Ring sage: MF.dimension() 4 sage: subspace = MF.subspace([MF.Delta()*MF.E4()^2, MF.gen(0)]) sage: subspace Subspace of dimension 2 of ModularForms(n=6, k=20, ep=1) over Integer Ring sage: subspace.analytic_type() modular sage: subspace.category() Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Integer Ring sage: subspace.module() Vector space of degree 4 and dimension 2 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring Basis matrix: [ 1 0 0 0] [ 0 1 13/(18*d) 103/(432*d^2)] sage: subspace.ambient_module() Vector space of dimension 4 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring sage: subspace.ambient_module() == MF.module() True sage: subspace.ambient_space() == MF True sage: subspace.basis() [q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5), 1 + 360360*q^4 + O(q^5)] sage: subspace.basis()[0].parent() == MF True sage: subspace.gens() [q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5), 1 + 360360*q^4 + O(q^5)] sage: subspace.gens()[0].parent() == subspace True sage: subspace.is_ambient() False """ FormsSpace_abstract.__init__(self, group=ambient_space.group(), base_ring=ambient_space.base_ring(), k=ambient_space.weight(), ep=ambient_space.ep()) Module.__init__(self, base=self.coeff_ring()) self._ambient_space = ambient_space self._basis = [v for v in basis] # self(v) instead would somehow mess up the coercion model self._gens = [self._element_constructor_(v) for v in basis] self._module = ambient_space._module.submodule([ambient_space.coordinate_vector(v) for v in basis]) # TODO: get the analytic type from the basis #self._analytic_type=self.AT(["quasi", "mero"]) self._analytic_type = ambient_space._analytic_type
def __init__ ( self, base_ring_generators, generators, relations, grading, all_relations = True, reduce_before_evaluating = True ) : r""" The degree one part of the monomials that correspond to generators over the base expansion ring will serve as the coordinates of the elements. INPUT: - ``base_ring_generators`` -- A list of (equivariant) monoid power series with coefficient domain the base ring of the coefficient domain of the generators or ``None``. - ``generators`` -- A list of (equivariant) monoid power series; The generators of the ambient over the ring generated by the base ring generators. - ``relations`` -- An ideal in a polynomial ring with ``len(base_ring_generators) + len(generators)`` variables. - ``grading`` -- A grading deriving from :class:~`fourier_expansion_framework.gradedexpansions.gradedexpansion_grading`; A grading for the polynomial ring of the relations. - ``all_relations`` -- A boolean (default: ``True``); If ``True`` the relations given for the polynomial ring are all relations that the Fourier expansion have. - ``reduce_before_evaluating`` -- A boolean (default: ``True``); If ``True`` any monomial will be Groebner reduced before the Fourier expansion is calculated. NOTE: The grading must respect the relations of the generators. 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.base_ring() Graded expansion ring with generators a """ if not hasattr(self, '_element_class') : self._element_class = GradedExpansionVector_class if hasattr(self, "_extended_base_ring") : Module.__init__(self, self._extended_base_ring) elif base_ring_generators is None or len(base_ring_generators) == 0 : Module.__init__(self, relations.base_ring()) else : gb = filter( lambda p: all( all(a == 0 for a in list(e)[len(base_ring_generators):]) for e in p.exponents() ), relations.groebner_basis() ) P = PolynomialRing( relations.base_ring(), list(relations.ring().variable_names())[:len(base_ring_generators)] ) base_relations = P.ideal(gb) R = GradedExpansionRing_class(None, base_ring_generators, base_relations, grading.subgrading(xrange(len(base_ring_generators))), all_relations, reduce_before_evaluating) Module.__init__(self, R) GradedExpansionAmbient_abstract.__init__(self, base_ring_generators, generators, relations, grading, all_relations, reduce_before_evaluating) self._populate_coercion_lists_( convert_list = [self.relations().ring()], convert_method_name = "_graded_expansion_submodule_to_graded_ambient_" )
def __init__(self, ambient_space, basis, check): r""" Return the Submodule of (Hecke) forms in ``ambient_space`` for the given ``basis``. INPUT: - ``ambient_space`` -- An ambient forms space. - ``basis`` -- A tuple of (not necessarily linearly independent) elements of ``ambient_space``. - ``check`` -- If ``True`` (default) then a maximal linearly independent subset of ``basis`` is choosen. Otherwise it is assumed that ``basis`` is linearly independent. OUTPUT: The corresponding submodule. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import ModularForms, QuasiCuspForms sage: MF = ModularForms(n=6, k=20, ep=1) sage: MF ModularForms(n=6, k=20, ep=1) over Integer Ring sage: MF.dimension() 4 sage: subspace = MF.subspace([MF.Delta()*MF.E4()^2, MF.gen(0), 2*MF.gen(0)]) sage: subspace Subspace of dimension 2 of ModularForms(n=6, k=20, ep=1) over Integer Ring sage: subspace.analytic_type() modular sage: subspace.category() Category of vector spaces over Fraction Field of Univariate Polynomial Ring in d over Integer Ring sage: subspace.module() Vector space of degree 4 and dimension 2 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring Basis matrix: [ 1 0 0 0] [ 0 1 13/(18*d) 103/(432*d^2)] sage: subspace.ambient_module() Vector space of dimension 4 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring sage: subspace.ambient_module() == MF.module() True sage: subspace.ambient_space() == MF True sage: subspace.basis() [q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5), 1 + 360360*q^4 + O(q^5)] sage: subspace.basis()[0].parent() == MF True sage: subspace.gens() [q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5), 1 + 360360*q^4 + O(q^5)] sage: subspace.gens()[0].parent() == subspace True sage: subspace.is_ambient() False sage: MF = QuasiCuspForms(n=infinity, k=12, ep=1) sage: MF.dimension() 4 sage: subspace = MF.subspace([MF.Delta(), MF.E4()*MF.f_inf()*MF.E2()*MF.f_i(), MF.E4()*MF.f_inf()*MF.E2()^2, MF.E4()*MF.f_inf()*(MF.E4()-MF.E2()^2)]) sage: subspace.default_prec(3) sage: subspace Subspace of dimension 3 of QuasiCuspForms(n=+Infinity, k=12, ep=1) over Integer Ring sage: subspace.gens() [q + 24*q^2 + O(q^3), q - 24*q^2 + O(q^3), q - 8*q^2 + O(q^3)] """ FormsSpace_abstract.__init__(self, group=ambient_space.group(), base_ring=ambient_space.base_ring(), k=ambient_space.weight(), ep=ambient_space.ep(), n=ambient_space.hecke_n()) Module.__init__(self, base=self.coeff_ring()) self._ambient_space = ambient_space self._basis = [v for v in basis] # self(v) instead would somehow mess up the coercion model self._gens = [self._element_constructor_(v) for v in basis] self._module = ambient_space._module.submodule([ambient_space.coordinate_vector(v) for v in basis]) # TODO: get the analytic type from the basis #self._analytic_type=self.AT(["quasi", "mero"]) self._analytic_type = ambient_space._analytic_type
def __init__(self, ambient_space, basis, check): r""" Return the Submodule of (Hecke) forms in ``ambient_space`` for the given ``basis``. INPUT: - ``ambient_space`` -- An ambient forms space. - ``basis`` -- A tuple of (not necessarily linearly independent) elements of ``ambient_space``. - ``check`` -- If ``True`` (default) then a maximal linearly independent subset of ``basis`` is choosen. Otherwise it is assumed that ``basis`` is linearly independent. OUTPUT: The corresponding submodule. EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import ModularForms, QuasiCuspForms sage: MF = ModularForms(n=6, k=20, ep=1) sage: MF ModularForms(n=6, k=20, ep=1) over Integer Ring sage: MF.dimension() 4 sage: subspace = MF.subspace([MF.Delta()*MF.E4()^2, MF.gen(0), 2*MF.gen(0)]) sage: subspace Subspace of dimension 2 of ModularForms(n=6, k=20, ep=1) over Integer Ring sage: subspace.analytic_type() modular sage: subspace.category() Category of modules over Integer Ring sage: subspace in subspace.category() True sage: subspace.module() Vector space of degree 4 and dimension 2 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring Basis matrix: [ 1 0 0 0] [ 0 1 13/(18*d) 103/(432*d^2)] sage: subspace.ambient_module() Vector space of dimension 4 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring sage: subspace.ambient_module() == MF.module() True sage: subspace.ambient_space() == MF True sage: subspace.basis() [q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5), 1 + 360360*q^4 + O(q^5)] sage: subspace.basis()[0].parent() == MF True sage: subspace.gens() [q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5), 1 + 360360*q^4 + O(q^5)] sage: subspace.gens()[0].parent() == subspace True sage: subspace.is_ambient() False sage: MF = QuasiCuspForms(n=infinity, k=12, ep=1) sage: MF.dimension() 4 sage: subspace = MF.subspace([MF.Delta(), MF.E4()*MF.f_inf()*MF.E2()*MF.f_i(), MF.E4()*MF.f_inf()*MF.E2()^2, MF.E4()*MF.f_inf()*(MF.E4()-MF.E2()^2)]) sage: subspace.default_prec(3) sage: subspace Subspace of dimension 3 of QuasiCuspForms(n=+Infinity, k=12, ep=1) over Integer Ring sage: subspace.gens() [q + 24*q^2 + O(q^3), q - 24*q^2 + O(q^3), q - 8*q^2 + O(q^3)] """ FormsSpace_abstract.__init__(self, group=ambient_space.group(), base_ring=ambient_space.base_ring(), k=ambient_space.weight(), ep=ambient_space.ep(), n=ambient_space.hecke_n()) Module.__init__(self, base=ambient_space.base_ring()) self._ambient_space = ambient_space self._basis = [v for v in basis] # self(v) instead would somehow mess up the coercion model self._gens = [self._element_constructor_(v) for v in basis] self._module = ambient_space._module.submodule( [ambient_space.coordinate_vector(v) for v in basis]) # TODO: get the analytic type from the basis #self._analytic_type=self.AT(["quasi", "mero"]) self._analytic_type = ambient_space._analytic_type