本文整理汇总了Python中sage.all.QQ.numerator方法的典型用法代码示例。如果您正苦于以下问题:Python QQ.numerator方法的具体用法?Python QQ.numerator怎么用?Python QQ.numerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.all.QQ
的用法示例。
在下文中一共展示了QQ.numerator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestMultiplier
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
class TestMultiplier(MultiplierSystem):
r"""
Test of multiplier for f(q). As in e.g. the paper of Bringmann and Ono.
"""
def __init__(self,group,dchar=(0,0),dual=False,weight=QQ(1)/QQ(2),dimension=1,version=1,**kwargs):
self._weight=QQ(weight)
MultiplierSystem.__init__(self,group,dchar=dchar,dual=dual,dimension=dimension,**kwargs)
self._k_den=self._weight.denominator()
self._k_num=self._weight.numerator()
self._K = CyclotomicField(12*self._k_den)
self._z = self._K.gen()**self._k_num
self._sqrti = CyclotomicField(8).gen()
self._i = CyclotomicField(4).gen()
self._fak = CyclotomicField(2*self._k_den).gen()**-self._k_num
self._fak_arg=QQ(self._weight)/QQ(2)
self._version = version
self.is_consistent(weight) # test consistency
def order(self):
return 12*self._k_den
def z(self):
return self._z
def __repr__(self):
s="Test multiplier"
if self._character<>None and not self._character.is_trivial():
s+="and character "+str(self._character)
return s
def _action(self,A):
[a,b,c,d]=A
fak=0
if c<0:
a=-a; b=-b; c=-c; d=-d; fak=self._fak_arg
if c==0:
if a>0:
res = self._z**-b
else:
res = self._fak*self._z**-b
else:
arg=-QQ(1)/QQ(8)+QQ(c+a*d+1)/QQ(4)-QQ(a+d)/QQ(24*c)-QQ(a)/QQ(4)+QQ(3*d*c)/QQ(8)
# print "arg=",arg
arg = arg-dedekind_sum(-d,c)/QQ(2)+fak #self._fak_arg
den=arg.denominator()
num=arg.numerator()
# print "den=",den
# print "num=",num
res = self._K(CyclotomicField(den).gen())**num
#res = res*fak
if self._is_dual:
return res**-1
return res
示例2: _latex_using_dpd_depth1
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def _latex_using_dpd_depth1(self, dpd_dct):
names = [dpd_dct[c] for c in self._consts]
_gcd = QQ(gcd(self._coeffs))
coeffs = [c / _gcd for c in self._coeffs]
coeffs_names = [(c, n) for c, n in zip(coeffs, names) if c != 0]
tail_terms = ["%s %s %s" % ("+" if c > 0 else "", c, n) for c, n in coeffs_names[1:]]
c0, n0 = coeffs_names[0]
head_term = str(c0) + " " + str(n0)
return r"\frac{{{pol_num}}}{{{pol_dnm}}} \left({terms}\right)".format(
pol_dnm=latex(_gcd.denominator() * self._scalar_const._polynomial_expr()),
pol_num=latex(_gcd.numerator()),
terms=" ".join([head_term] + tail_terms),
)
示例3: get_cusp_expansions_of_newform
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def get_cusp_expansions_of_newform(k, N=1, fi=0, prec=10):
r"""
Get and return Fourier coefficients of all cusps where there exist Atkin-Lehner involutions for these cusps.
INPUT:
- ''k'' -- positive integer : the weight
- ''N'' -- positive integer (default 1) : level
- ''fi'' -- non-neg. integer (default 0) We want to use the element nr. fi f=Newforms(N,k)[fi]
- ''prec'' -- integer (the number of coefficients to get)
OUTPUT:
- ''s'' string giving the Atkin-Lehner eigenvalues corresponding to the Cusps (where possible)
"""
res = dict()
(t, f) = _get_newform(k, N, 0, fi)
if(not t):
return s
res[Infinity] = 1
for c in f.group().cusps():
if(c == Cusp(Infinity)):
continue
res[c] = list()
cusp = QQ(c)
q = cusp.denominator()
p = cusp.numerator()
d = ZZ(cusp * N)
if(d == 0):
ep = f.atkin_lehner_eigenvalue()
if(d.divides(N) and gcd(ZZ(N / d), ZZ(d)) == 1):
ep = f.atkin_lehner_eigenvalue(ZZ(d))
else:
# this case is not known...
res[c] = None
continue
res[c] = ep
s = html.table([res.keys(), res.values()])
return s
示例4: EtaMultiplier
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
class EtaMultiplier(MultiplierSystem):
r"""
Eta multiplier. Valid for any (real) weight.
"""
def __init__(self,G,k=QQ(1)/QQ(2),number=0,ch=None,dual=False,version=1,dimension=1,**kwargs):
r"""
Initialize the Eta multiplier system: $\nu_{\eta}^{2(k+r)}$.
INPUT:
- G -- Group
- ch -- character
- dual -- if we have the dual (in this case conjugate)
- weight -- Weight (recall that eta has weight 1/2 and eta**2k has weight k. If weight<>k we adjust the power accordingly.
- number -- we consider eta^power (here power should be an integer so as not to change the weight...)
"""
self._weight=QQ(k)
if floor(self._weight-QQ(1)/QQ(2))==ceil(self._weight-QQ(1)/QQ(2)):
self._half_integral_weight=1
else:
self._half_integral_weight=0
MultiplierSystem.__init__(self,G,character=ch,dual=dual,dimension=dimension)
number = number % 12
if not is_even(number):
raise ValueError,"Need to have v_eta^(2(k+r)) with r even!"
self._pow=QQ((self._weight+number)) ## k+r
self._k_den=self._pow.denominator()
self._k_num=self._pow.numerator()
self._K = CyclotomicField(12*self._k_den)
self._z = self._K.gen()**self._k_num
self._i = CyclotomicField(4).gen()
self._fak = CyclotomicField(2*self._k_den).gen()**-self._k_num
self._version = version
self.is_consistent(k) # test consistency
def __repr__(self):
s="Eta multiplier "
if self._pow<>1:
s+="to power 2*"+str(self._pow)+" "
if self._character<>None and not self._character.is_trivial():
s+=" and character "+str(self._character)
s+="with weight="+str(self._weight)
return s
def order(self):
return 12*self._k_den
def z(self):
return self._z
def _action(self,A):
if self._version==1:
return self._action1(A)
elif self._version==2:
return self._action2(A)
else:
raise ValueError
def _action1(self,A):
[a,b,c,d]=A
return self._action0(a,b,c,d)
def _action0(self,a,b,c,d):
r"""
Recall that the formula is valid only for c>0. Otherwise we have to use:
v(A)=v((-I)(-A))=sigma(-I,-A)v(-I)v(-A).
Then note that by the formula for sigma we have:
sigma(-I,SL2Z[a, b, c, d])=-1 if (c=0 and d<0) or c>0 and other wise it is =1.
"""
fak=1
if c<0:
a=-a; b=-b; c=-c; d=-d; fak=-self._fak
if c==0:
if a>0:
res = self._z**b
else:
res = self._fak*self._z**b
else:
if is_even(c):
arg = (a+d)*c-b*d*(c*c-1)+3*d-3-3*c*d
v=kronecker(c,d)
else:
arg = (a+d)*c-b*d*(c*c-1)-3*c
v=kronecker(d,c)
if not self._half_integral_weight:
# recall that we can use eta for any real weight
v=v**(2*self._weight)
arg=arg*(self._k_num)
res = v*fak*self._z**arg
if self._character:
res = res * self._character(d)
if self._is_dual:
res=res**-1
return res
def _action2(self,A):
[a,b,c,d]=A
#.........这里部分代码省略.........
示例5: display_t
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def display_t(tn, td):
t = QQ("%d/%d" % (tn, td))
if t.denominator() == 1:
return str(t.numerator())
return "%s/%s" % (str(t.numerator()), str(t.denominator()))
示例6: make_label
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def make_label(A,B,tn,td):
AB_str = ab_label(A,B)
t = QQ( "%d/%d" % (tn, td))
t_str = "/t%s.%s" % (str(t.numerator()), str(t.denominator()))
return AB_str + t_str
示例7: make_t_label
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def make_t_label(t):
tsage = QQ(t)
return "t%s.%s" % (tsage.numerator(), tsage.denominator())
示例8: set_info_for_web_newform
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
#.........这里部分代码省略.........
elif WNF.is_cm is True:
s = "- Is a CM-form<br>"
else:
s = "- Is not a CM-form<br>"
properties2.append(("CM info", s))
alev = WNF.atkin_lehner_eigenvalues()
info["atkinlehner"] = None
if isinstance(alev, dict) and len(alev.keys()) > 0 and level != 1:
s1 = " Atkin-Lehner eigenvalues "
s2 = ""
for Q in alev.keys():
s2 += "\( \omega_{ %s } \) : %s <br>" % (Q, alev[Q])
properties2.append((s1, s2))
emf_logger.debug("properties={0}".format(properties2))
# alev = WNF.atkin_lehner_eigenvalues_for_all_cusps()
# if isinstance(alev,dict) and len(alev.keys())>0:
# emf_logger.debug("alev={0}".format(alev))
# info['atkinlehner'] = list()
# for Q in alev.keys():
# s = "\(" + latex(c) + "\)"
# Q = alev[c][0]
# ev = alev[c][1]
# info['atkinlehner'].append([Q, c, ev])
if level == 1:
poly = WNF.explicit_formulas.get("as_polynomial_in_E4_and_E6", "")
if poly != "":
d, monom, coeffs = poly
emf_logger.critical("poly={0}".format(poly))
info["explicit_formulas"] = "\("
for i in range(d):
c = QQ(coeffs[i])
s = ""
if d > 1 and i > 0 and c > 0:
s = "+"
if c < 0:
s = "-"
if c.denominator() > 1:
cc = "\\frac{{ {0} }}{{ {1} }}".format(abs(c.numerator()), c.denominator())
else:
cc = str(abs(c))
s += "{0} \cdot ".format(cc)
a = monom[i][0]
b = monom[i][1]
if a == 0 and b != 0:
s += "E_6^{{ {0} }}".format(b)
elif b == 0 and a != 0:
s += "E_4^{{ {0} }}".format(a)
else:
s += "E_4^{{ {0} }}E_6^{{ {1} }}".format(a, b)
info["explicit_formulas"] += s
info["explicit_formulas"] += " \)"
cur_url = (
"?&level=" + str(level) + "&weight=" + str(weight) + "&character=" + str(character) + "&label=" + str(label)
)
if len(WNF.parent.hecke_orbits) > 1:
for label_other in WNF.parent.hecke_orbits.keys():
if label_other != label:
s = "Modular form "
if character:
s = s + str(level) + "." + str(weight) + "." + str(character) + str(label_other)
else:
s = s + str(level) + "." + str(weight) + str(label_other)
url = url_for(
"emf.render_elliptic_modular_forms",
level=level,
weight=weight,
character=character,
label=label_other,
)
friends.append((s, url))
s = "L-Function "
if character:
s = s + str(level) + "." + str(weight) + "." + str(character) + str(label)
else:
s = s + str(level) + "." + str(weight) + str(label)
# url =
# "/L/ModularForm/GL2/Q/holomorphic?level=%s&weight=%s&character=%s&label=%s&number=%s"
# %(level,weight,character,label,0)
url = "/L" + url_for(
"emf.render_elliptic_modular_forms", level=level, weight=weight, character=character, label=label
)
if WNF.coefficient_field_degree > 1:
for h in range(WNF.coefficient_field_degree):
s0 = s + ".{0}".format(h)
url0 = url + "{0}/".format(h)
friends.append((s0, url0))
else:
friends.append((s, url))
# if there is an elliptic curve over Q associated to self we also list that
if WNF.weight == 2 and WNF.coefficient_field_degree == 1:
llabel = str(level) + "." + label
s = "Elliptic curve isogeny class " + llabel
url = "/EllipticCurve/Q/" + llabel
friends.append((s, url))
info["properties2"] = properties2
info["friends"] = friends
info["max_cn"] = WNF.max_cn()
return info
示例9: do_addrec
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def do_addrec(F):
global newrecs
degree, weight, A, B, t, famhodge, hodge, conductor, sign, sig, locinfo, lcms, hardness, coeffs = F
A,B = orderAB(A,B)
A.sort(reverse=True)
B.sort(reverse=True)
Astr = '.'.join([str(x) for x in A])
Bstr = '.'.join([str(x) for x in B])
myt = QQ(str(t[1])+'/'+str(t[0]))
tstr = str(myt.numerator())+'.'+str(myt.denominator())
label = "A%s_B%s_t%s" % (Astr, Bstr, tstr)
data = {
'label': label,
'degree': degree,
'weight': weight,
't': str(myt),
'A': list2string(A),
'B': list2string(B),
'Arev': list2string(B),
'Brev': list2string(A),
'hodge': list2string(hodge),
'famhodge': list2string(famhodge),
'sign': sign,
'sig': sig,
'req': hardness,
'coeffs': coeffs,
'lcms': lcms,
'cond': conductor,
'locinfo': locinfo,
'centralval': 0
}
for p in [2,3,5,7]:
mod = modpair(A,B,p)
mod = killdup(mod[0],mod[1])
data['A'+str(p)] = list2string(mod[0])
data['B'+str(p)] = list2string(mod[1])
data['C'+str(p)] = list2string(mod[2])
mod = modpair(B,A,p)
mod = killdup(mod[0],mod[1])
data['A'+str(p)+'rev'] = list2string(mod[0])
data['B'+str(p)+'rev'] = list2string(mod[1])
mod = modupperpair(A,B,p)
mod = killdup(mod[0],mod[1])
data['Au'+str(p)] = list2string(mod[0])
data['Bu'+str(p)] = list2string(mod[1])
data['Cu'+str(p)] = list2string(mod[2])
data['Bu'+str(p)+'rev'] = list2string(mod[0])
data['Au'+str(p)+'rev'] = list2string(mod[1])
is_new = True
for field in hgm.find({'label': label}):
is_new = False
break
for k in newrecs:
if k['label'] == label:
is_new = False
break
if is_new:
#print "new family"
newrecs.append(data)
示例10: fix_t
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def fix_t(t):
tsage = QQ("%d/%d" % (t[0], t[1]))
return [int(tsage.numerator()), int(tsage.denominator())]
示例11: make_t_label
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def make_t_label(t):
tsage = QQ("%d/%d" % (t[0], t[1]))
return "t%s.%s" % (tsage.numerator(), tsage.denominator())
示例12: hgm_search
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
def hgm_search(**args):
info = to_dict(args)
bread = get_bread([("Search results", url_for('.search'))])
C = base.getDBConnection()
query = {}
if 'jump_to' in info:
return render_hgm_webpage({'label': info['jump_to']})
family_search = False
if info.get('Submit Family') or info.get('family'):
family_search = True
# generic, irreducible not in DB yet
for param in ['A', 'B', 'hodge', 'a2', 'b2', 'a3', 'b3', 'a5', 'b5', 'a7', 'b7']:
if info.get(param):
info[param] = clean_input(info[param])
if IF_RE.match(info[param]):
query[param] = split_list(info[param])
query[param].sort()
else:
name = param
if field == 'hodge':
name = 'Hodge vector'
info['err'] = 'Error parsing input for %s. It needs to be a list of integers in square brackets, such as [2,3] or [1,1,1]' % name
return search_input_error(info, bread)
if info.get('t') and not family_search:
info['t'] = clean_input(info['t'])
try:
tsage = QQ(str(info['t']))
tlist = [int(tsage.numerator()), int(tsage.denominator())]
query['t'] = tlist
except:
info['err'] = 'Error parsing input for t. It needs to be a rational number, such as 2/3 or -3'
# sign can only be 1, -1, +1
if info.get('sign') and not family_search:
sign = info['sign']
sign = re.sub(r'\s','',sign)
sign = clean_input(sign)
if sign == '+1':
sign = '1'
if not (sign == '1' or sign == '-1'):
info['err'] = 'Error parsing input %s for sign. It needs to be 1 or -1' % sign
return search_input_error(info, bread)
query['sign'] = int(sign)
for param in ['degree','weight','conductor']:
# We don't look at conductor in family searches
if info.get(param) and not (param=='conductor' and family_search):
if param=='conductor':
cond = info['conductor']
try:
cond = re.sub(r'(\d)\s+(\d)', r'\1 * \2', cond) # implicit multiplication of numbers
cond = cond.replace(r'..', r'-') # all ranges use -
cond = re.sub(r'[a..zA..Z]', '', cond)
cond = clean_input(cond)
tmp = parse_range2(cond, 'cond', myZZ)
except:
info['err'] = 'Error parsing input for conductor. It needs to be an integer (e.g., 8), a range of integers (e.g. 10-100), or a list of such (e.g., 5,7,8,10-100). Integers may be given in factored form (e.g. 2^5 3^2) %s' % cond
return search_input_error(info, bread)
else: # not conductor
info[param] = clean_input(info[param])
ran = info[param]
ran = ran.replace(r'..', r'-')
if LIST_RE.match(ran):
tmp = parse_range2(ran, param)
else:
names = {'weight': 'weight', 'degree': 'degree'}
info['err'] = 'Error parsing input for the %s. It needs to be an integer (such as 5), a range of integers (such as 2-10 or 2..10), or a comma-separated list of these (such as 2,3,8 or 3-5, 7, 8-11).' % names[param]
return search_input_error(info, bread)
# work around syntax for $or
# we have to foil out multiple or conditions
if tmp[0] == '$or' and '$or' in query:
newors = []
for y in tmp[1]:
oldors = [dict.copy(x) for x in query['$or']]
for x in oldors:
x.update(y)
newors.extend(oldors)
tmp[1] = newors
query[tmp[0]] = tmp[1]
#print query
count_default = 20
if info.get('count'):
try:
count = int(info['count'])
except:
count = count_default
else:
count = count_default
info['count'] = count
start_default = 0
if info.get('start'):
try:
start = int(info['start'])
if(start < 0):
#.........这里部分代码省略.........
示例13: set_info_for_web_newform
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
#.........这里部分代码省略.........
info['CM_values'] = CM
info['is_cm'] = WNF.is_cm
if WNF.is_cm:
info['cm_field'] = "2.0.{0}.1".format(-WNF.cm_disc)
info['cm_disc'] = WNF.cm_disc
info['cm_field_knowl'] = nf_display_knowl(info['cm_field'], getDBConnection(), field_pretty(info['cm_field']))
info['cm_field_url'] = url_for("number_fields.by_label", label=info["cm_field"])
if WNF.is_cm is None:
s = '- Unknown (insufficient data)<br>'
elif WNF.is_cm:
s = 'Is a CM-form<br>'
else:
s = 'Is not a CM-form<br>'
properties2.append(('CM info', s))
alev = WNF.atkin_lehner_eigenvalues()
info['atkinlehner'] = None
if isinstance(alev,dict) and len(alev.keys())>0 and level != 1:
s1 = " Atkin-Lehner eigenvalues "
s2 = ""
for Q in alev.keys():
s2 += "\( \omega_{ %s } \) : %s <br>" % (Q, alev[Q])
properties2.append((s1, s2))
emf_logger.debug("properties={0}".format(properties2))
# alev = WNF.atkin_lehner_eigenvalues_for_all_cusps()
# if isinstance(alev,dict) and len(alev.keys())>0:
# emf_logger.debug("alev={0}".format(alev))
# info['atkinlehner'] = list()
# for Q in alev.keys():
# s = "\(" + latex(c) + "\)"
# Q = alev[c][0]
# ev = alev[c][1]
# info['atkinlehner'].append([Q, c, ev])
if(level == 1):
poly = WNF.explicit_formulas.get('as_polynomial_in_E4_and_E6','')
if poly != '':
d,monom,coeffs = poly
emf_logger.critical("poly={0}".format(poly))
info['explicit_formulas'] = '\('
for i in range(len(coeffs)):
c = QQ(coeffs[i])
s = ""
if d>1 and i >0 and c>0:
s="+"
if c<0:
s="-"
if c.denominator()>1:
cc = "\\frac{{ {0} }}{{ {1} }}".format(abs(c.numerator()),c.denominator())
else:
cc = str(abs(c))
s += "{0} \cdot ".format(cc)
a = monom[i][0]; b = monom[i][1]
if a == 0 and b != 0:
s+="E_6^{{ {0} }}".format(b)
elif b ==0 and a != 0:
s+="E_4^{{ {0} }}".format(a)
else:
s+="E_4^{{ {0} }}E_6^{{ {1} }}".format(a,b)
info['explicit_formulas'] += s
info['explicit_formulas'] += " \)"
cur_url = '?&level=' + str(level) + '&weight=' + str(weight) + '&character=' + str(character) + \
'&label=' + str(label)
if len(WNF.parent.hecke_orbits) > 1:
for label_other in WNF.parent.hecke_orbits.keys():
if(label_other != label):
s = 'Modular form '
if character:
s = s + str(level) + '.' + str(weight) + '.' + str(character) + str(label_other)
else:
s = s + str(level) + '.' + str(weight) + str(label_other)
url = url_for('emf.render_elliptic_modular_forms', level=level,
weight=weight, character=character, label=label_other)
friends.append((s, url))
s = 'L-Function '
if character:
s = s + str(level) + '.' + str(weight) + '.' + str(character) + str(label)
else:
s = s + str(level) + '.' + str(weight) + str(label)
# url =
# "/L/ModularForm/GL2/Q/holomorphic?level=%s&weight=%s&character=%s&label=%s&number=%s"
# %(level,weight,character,label,0)
url = '/L' + url_for(
'emf.render_elliptic_modular_forms', level=level, weight=weight, character=character, label=label)
if WNF.coefficient_field_degree > 1:
for h in range(WNF.coefficient_field_degree):
s0 = s + ".{0}".format(h)
url0 = url + "{0}/".format(h)
friends.append((s0, url0))
else:
friends.append((s, url))
# if there is an elliptic curve over Q associated to self we also list that
if WNF.weight == 2 and WNF.coefficient_field_degree == 1:
llabel = str(level) + '.' + label
s = 'Elliptic curve isogeny class ' + llabel
url = '/EllipticCurve/Q/' + llabel
friends.append((s, url))
info['properties2'] = properties2
info['friends'] = friends
info['max_cn'] = WNF.max_cn()
return info
示例14: EtaQuotientMultiplier
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
class EtaQuotientMultiplier(MultiplierSystem):
r"""
Eta multiplier given by eta(Az)^{r}/eta(Bz)^s
The weight should be r/2-s/2 mod 2.
The group is Gamma0(lcm(A,B))
"""
def __init__(self,A,B,r,s,k=None,number=0,ch=None,dual=False,version=1,**kwargs):
r"""
Initialize the Eta multiplier system: $\nu_{\eta}^{2(k+r)}$.
INPUT:
- G -- Group
- ch -- character
- dual -- if we have the dual (in this case conjugate)
- weight -- Weight (recall that eta has weight 1/2 and eta**2k has weight k. If weight<>k we adjust the power accordingly.
- number -- we consider eta^power (here power should be an integer so as not to change the weight...)
EXAMPLE:
"""
self._level=lcm(A,B)
G = Gamma0(self._level)
if k==None:
k = (QQ(r)-QQ(s))/QQ(2)
self._weight=QQ(k)
if floor(self._weight-QQ(1)/QQ(2))==ceil(self._weight-QQ(1)/QQ(2)):
self._half_integral_weight=1
else:
self._half_integral_weight=0
MultiplierSystem.__init__(self,G,dimension=1,character=ch,dual=dual)
number = number % 12
if not is_even(number):
raise ValueError,"Need to have v_eta^(2(k+r)) with r even!"
self._arg_num = A
self._arg_den = B
self._exp_num = r
self._exp_den = s
self._pow=QQ((self._weight+number)) ## k+r
self._k_den=self._pow.denominator()
self._k_num=self._pow.numerator()
self._K = CyclotomicField(12*self._k_den)
self._z = self._K.gen()**self._k_num
self._i = CyclotomicField(4).gen()
self._fak = CyclotomicField(2*self._k_den).gen()**-self._k_num
self._version = version
self.is_consistent(k) # test consistency
def __repr__(self):
s="Quotient of Eta multipliers : "
s+="eta({0})^{1}/eta({2})^{3}".format(self._arg_num,self._exp_num,self._arg_den,self._exp_den)
if self._character<>None and not self._character.is_trivial():
s+=" and character "+str(self._character)
s+=" with weight="+str(self._weight)
return s
def level(self):
return self._level
def order(self):
return 12*self._k_den
def z(self):
return self._z
def q_shift(self):
r"""
Gives the 'shift' at the cusp at infinity of the q-series.
The 'true' q-expansion of the eta quotient is then q^shift*q_expansion
"""
num = self._arg_num*self._exp_num-self._arg_den*self._exp_den
return QQ(num)/QQ(24)
def q_expansion(self,n=20):
r"""
Give the q-expansion of the quotient.
"""
var('q')
et = qexp_eta(ZZ[['q']],n)
etA= et.subs(q=q**self._arg_num).power_series(ZZ[['q']])
etB= et.subs(q=q**self._arg_den).power_series(ZZ[['q']])
res = etA**(self._exp_num)/etB**(self._exp_den)
return res
#def _action(self,A):
# return self._action(A)
def _action(self,A):
[a,b,c,d]=A
if not c % self._level == 0 :
raise ValueError,"Need A in {0}! Got: {1}".format(self.group,A)
fak=1
if c<0:
a=-a; b=-b; c=-c; d=-d; fak=-self._fak
#fak = fak*(-1)**(self._exp_num-self._exp_den)
arg1,v1 = eta_conjugated(a,b,c,d,self._arg_num)
arg2,v2 = eta_conjugated(a,b,c,d,self._arg_den)
res=self._z**(arg1*self._exp_num-arg2*self._exp_den)
if v1<>1:
res=res*v1**self._exp_num
if v2<>1:
#.........这里部分代码省略.........
示例15: set_info_for_web_newform
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import numerator [as 别名]
#.........这里部分代码省略.........
info['CM_values'] = CM
info['is_cm'] = WNF.is_cm
if WNF.is_cm == 1:
info['cm_field'] = "2.0.{0}.1".format(-WNF.cm_disc)
info['cm_disc'] = WNF.cm_disc
info['cm_field_knowl'] = nf_display_knowl(info['cm_field'], getDBConnection(), field_pretty(info['cm_field']))
info['cm_field_url'] = url_for("number_fields.by_label", label=info["cm_field"])
if WNF.is_cm is None or WNF.is_cm==-1:
s = '- Unknown (insufficient data)<br>'
elif WNF.is_cm == 1:
s = 'Yes<br>'
else:
s = 'No<br>'
properties2.append(('CM', s))
alev = WNF.atkin_lehner_eigenvalues()
info['atkinlehner'] = None
if isinstance(alev,dict) and len(alev.keys())>0 and level != 1:
s1 = " Atkin-Lehner eigenvalues "
s2 = ""
for Q in alev.keys():
s2 += "\( \omega_{ %s } \) : %s <br>" % (Q, alev[Q])
properties2.append((s1, s2))
emf_logger.debug("properties={0}".format(properties2))
# alev = WNF.atkin_lehner_eigenvalues_for_all_cusps()
# if isinstance(alev,dict) and len(alev.keys())>0:
# emf_logger.debug("alev={0}".format(alev))
# info['atkinlehner'] = list()
# for Q in alev.keys():
# s = "\(" + latex(c) + "\)"
# Q = alev[c][0]
# ev = alev[c][1]
# info['atkinlehner'].append([Q, c, ev])
if(level == 1):
poly = WNF.explicit_formulas.get('as_polynomial_in_E4_and_E6','')
if poly != '':
d,monom,coeffs = poly
emf_logger.critical("poly={0}".format(poly))
info['explicit_formulas'] = '\('
for i in range(len(coeffs)):
c = QQ(coeffs[i])
s = ""
if d>1 and i >0 and c>0:
s="+"
if c<0:
s="-"
if c.denominator()>1:
cc = "\\frac{{ {0} }}{{ {1} }}".format(abs(c.numerator()),c.denominator())
else:
cc = str(abs(c))
s += "{0} \cdot ".format(cc)
a = monom[i][0]; b = monom[i][1]
if a == 0 and b != 0:
s+="E_6^{{ {0} }}".format(b)
elif b ==0 and a != 0:
s+="E_4^{{ {0} }}".format(a)
else:
s+="E_4^{{ {0} }}E_6^{{ {1} }}".format(a,b)
info['explicit_formulas'] += s
info['explicit_formulas'] += " \)"
# cur_url = '?&level=' + str(level) + '&weight=' + str(weight) + '&character=' + str(character) + '&label=' + str(label) # never used
if len(WNF.parent.hecke_orbits) > 1:
for label_other in WNF.parent.hecke_orbits.keys():
if(label_other != label):
s = 'Modular form '
if character:
s += newform_label(level,weight,character,label_other)
else:
s += newform_label(level,weight,1,label_other)
url = url_for('emf.render_elliptic_modular_forms', level=level,
weight=weight, character=character, label=label_other)
friends.append((s, url))
s = 'L-Function '
if character:
s += newform_label(level,weight,character,label)
else:
s += newform_label(level,weight,1,label)
# url =
# "/L/ModularForm/GL2/Q/holomorphic?level=%s&weight=%s&character=%s&label=%s&number=%s"
# %(level,weight,character,label,0)
url = '/L' + url_for(
'emf.render_elliptic_modular_forms', level=level, weight=weight, character=character, label=label)
if WNF.coefficient_field_degree > 1:
for h in range(WNF.coefficient_field_degree):
s0 = s + ".{0}".format(h)
url0 = url + "{0}/".format(h)
friends.append((s0, url0))
else:
friends.append((s, url))
# if there is an elliptic curve over Q associated to self we also list that
if WNF.weight == 2 and WNF.coefficient_field_degree == 1:
llabel = str(level) + '.' + label
s = 'Elliptic curve isogeny class ' + llabel
url = '/EllipticCurve/Q/' + llabel
friends.append((s, url))
info['properties2'] = properties2
info['friends'] = friends
info['max_cn'] = WNF.max_available_prec()
return info