def __mul__(self, other): if is_number(other): if other == 1: return self fcmap = _mul_fourier_by_num(self.fc_dct, other, self.prec, cuspidal=self._is_cuspidal, hol=True) if hasattr(other, "parent"): bs = _common_base_ring(self.base_ring, other.parent()) else: bs = self.base_ring return ModFormQexpLevel1(self.wt, fcmap, self.prec, base_ring=bs, is_cuspidal=self._is_cuspidal, given_reduced_tuples_only=True) if isinstance(other, ModFormQexpLevel1) and other.wt == 0: return self.__mul__(other[(0, 0, 0)]) if is_hol_mod_form(other): prec = common_prec([self, other]) bsring = _common_base_ring(self.base_ring, other.base_ring) ms = self.fc_dct mo = other.fc_dct cuspidal = self._is_cuspidal or other._is_cuspidal fcmap = _mul_fourier(ms, mo, prec, cuspidal=cuspidal, hol=True) return ModFormQexpLevel1(self.wt + other.wt, fcmap, prec, base_ring=bsring, is_cuspidal=cuspidal, given_reduced_tuples_only=True) else: return QexpLevel1.__mul__(self, other)
def __mul__(self, other): if is_number(other): if other == 1: return self fcmap = _mul_fourier_by_num(self.fc_dct, other, self.prec, self._is_cuspidal) if hasattr(other, "parent"): bs = _common_base_ring(self.base_ring, other.parent()) else: bs = self.base_ring return QexpLevel1(fcmap, self.prec, base_ring=bs, is_cuspidal=self._is_cuspidal) elif isinstance(other, QexpLevel1): prec = common_prec([self, other]) bsring = _common_base_ring(self.base_ring, other.base_ring) ms = self.fc_dct mo = other.fc_dct cuspidal = self._is_cuspidal or other._is_cuspidal fcmap = _mul_fourier(ms, mo, prec, cuspidal) res = QexpLevel1(fcmap, prec, base_ring=bsring, is_cuspidal=cuspidal) return res elif isinstance(other, (SymWtGenElt, QseriesTimesQminushalf)): return other.__mul__(self) else: raise NotImplementedError
def __add__(self, other): if other == 0: return self elif isinstance(other, SymWtGenElt) and self.sym_wt == other.sym_wt: prec = common_prec([self, other]) forms = [sum(tp) for tp in zip(other.forms, self.forms)] base_ring = _common_base_ring(self.base_ring, other.base_ring) return SymWtGenElt(forms, prec, base_ring) else: raise NotImplementedError
def diff_opetator_4(f1, f2, f3, f4): l = [f1, f2, f3, f4] wt_s = [f.wt for f in l] prec_res = common_prec(l) base_ring = common_base_ring(l) m = [[a.wt * a for a in l], pmap(lambda a: a.differentiate_wrt_tau(), l), pmap(lambda a: a.differentiate_wrt_w(), l), pmap(lambda a: a.differentiate_wrt_z(), l)] res = det_deg2(m, wt=sum((f.wt for f in l)) + 1) res = ModFormQexpLevel1( sum(wt_s) + 3, res.fc_dct, prec_res, base_ring=base_ring) return res
def vector_valued_rankin_cohen(f, vec_val): ''' Rankin-Cohen type differential operator defined by van Dorp. Let f be a scalar valued Siegel modular form of weight det^k and vec_val be a vector valued Siegel modular form of weight det^l Sym(j). This function returns a vector valued Siegel modular form of weight det^(k + l + 1) Sym(j). ''' if not (isinstance(f, (QexpLevel1, QseriesTimesQminushalf)) and isinstance(vec_val, SWGElt)): raise TypeError("Arguments are invalid.") sym_wt = vec_val.sym_wt base_ring = _common_base_ring(f.base_ring, vec_val.base_ring) diff_tau = (f.differentiate_wrt_tau(), f.differentiate_wrt_z() * QQ(2)**(-1), f.differentiate_wrt_w()) def diff_v(vec_val): forms = [ i * f for f, i in zip(vec_val.forms[1:], range(1, vec_val.sym_wt + 1)) ] return SWGElt(forms, vec_val.prec, vec_val.base_ring) def diff_d(vec_val): return [ diff_u(diff_u(vec_val)), diff_u(diff_v(vec_val)), diff_v(diff_v(vec_val)) ] def diff_u(vec_val): forms = [ i * f for f, i in zip(vec_val.forms, reversed(range(1, vec_val.sym_wt + 1))) ] return SWGElt(forms, vec_val.prec, vec_val.base_ring) crs_prd1 = _cross_prod(diff_tau, diff_d(vec_val)) forms1 = _bracket_vec_val(crs_prd1) prec = common_prec(forms1) res1 = (vec_val.wt + sym_wt // 2 - 1) * SWGElt( forms1, prec, base_ring=base_ring) forms2 = _bracket_vec_val(_cross_prod_diff(diff_d(vec_val))) res2 = f.wt * f * SWGElt(forms2, prec, base_ring=base_ring) res = SWMFE( (res1 - res2).forms, f.wt + vec_val.wt + 1, prec, base_ring=base_ring) return res
def __add__(self, other): if is_number(other): fcmap = self.fc_dct.copy() fcmap[(0, 0, 0)] = self.fc_dct[(0, 0, 0)] + other cuspidal = other == 0 and self._is_cuspidal return QexpLevel1(fcmap, self.prec, self.base_ring, is_cuspidal=cuspidal) prec = common_prec([self, other]) bsring = _common_base_ring(self.base_ring, other.base_ring) cuspidal = self._is_cuspidal and other._is_cuspidal ms = self.fc_dct mo = other.fc_dct fcmap = _add_fourier(ms, mo, prec, cuspidal) return QexpLevel1(fcmap, prec, base_ring=bsring, is_cuspidal=cuspidal)
def __mul__(self, other): if is_number(other): prec = self.prec forms = [other * f for f in self.forms] if hasattr(other, "parent"): base_ring = _common_base_ring(self.base_ring, other.parent()) else: base_ring = self.base_ring return SymWtGenElt(forms, prec, base_ring) if isinstance(other, (QexpLevel1, QseriesTimesQminushalf)): forms = [f * other for f in self.forms] prec = common_prec(forms) base_ring = _common_base_ring(self.base_ring, other.base_ring) return SymWtGenElt(forms, prec, base_ring) else: raise NotImplementedError
def __add__(self, other): if is_number(other): fcmap = self.fc_dct.copy() fcmap[(0, 0, 0)] = self.fc_dct[(0, 0, 0)] + other if other == 0: return ModFormQexpLevel1(self.wt, fcmap, self.prec, self.base_ring, is_cuspidal=self._is_cuspidal) else: return QexpLevel1(fcmap, self.prec, self.base_ring) if is_hol_mod_form(other) and self.wt == other.wt: prec = common_prec([self, other]) bsring = _common_base_ring(self.base_ring, other.base_ring) ms = self.fc_dct mo = other.fc_dct cuspidal = self._is_cuspidal and other._is_cuspidal fcmap = _add_fourier(ms, mo, prec, cuspidal=cuspidal, hol=True) return ModFormQexpLevel1(self.wt, fcmap, prec, bsring, is_cuspidal=cuspidal, given_reduced_tuples_only=True) else: return QexpLevel1.__add__(self, other)
def _rankin_cohen_gen(Q, flist): forms = _rankin_cohen_bracket_func(Q)(flist) prec = common_prec(forms) base_ring = common_base_ring(flist) a = _inc_weight(Q) return SWMFE(forms, sum([f.wt for f in flist]) + a, prec, base_ring)