本文整理汇总了Python中sage.all.PolynomialRing.gens方法的典型用法代码示例。如果您正苦于以下问题:Python PolynomialRing.gens方法的具体用法?Python PolynomialRing.gens怎么用?Python PolynomialRing.gens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.all.PolynomialRing
的用法示例。
在下文中一共展示了PolynomialRing.gens方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: theta_sym
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def theta_sym(self, j=2):
'''
Returns an image as a vector valued (Sym_{j} j:even) Fourier expansion
of the generalized Theta operator associated with
the Rankin-cohen operator {F, G}_{Sym_{j}}.
[Reference]
Ibukiyama, Vector valued Siegel modular forms of symmetric
tensor weight of small degrees, COMMENTARI MATHEMATICI
UNIVERSITATIS SANCTI PAULI VOL 61, NO 1, 2012.
Boecherer, Nagaoka,
On p-adic properties of Siegel modular forms, arXiv, 2013.
'''
R = PolynomialRing(QQ, "r1, r2, r3")
(r1, r2, r3) = R.gens()
S = PolynomialRing(R, "u1, u2")
(u1, u2) = S.gens()
pl = (r1 * u1 ** 2 + r2 * u1 * u2 + r3 * u2 ** 2) ** (j // 2)
pldct = pl.dict()
formsdict = {}
for (_, i), ply in pldct.iteritems():
formsdict[i] = sum([v * self._differential_operator_monomial(a, b, c)
for (a, b, c), v in ply.dict().iteritems()])
forms = [x for _, x in
sorted([(i, v) for i, v in formsdict.iteritems()],
key=lambda x: x[0])]
return SymWtGenElt(forms, self.prec, self.base_ring)
示例2: _pair_gens_r_s
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _pair_gens_r_s():
rnames = "r11, r12, r22, s11, s12, s22"
unames = "u1, u2"
RS_ring = PolynomialRing(QQ, names=rnames)
(r11, r12, r22, s11, s12, s22) = RS_ring.gens()
(u1, u2) = PolynomialRing(RS_ring, names=unames).gens()
r = r11 * u1 ** 2 + 2 * r12 * u1 * u2 + r22 * u2 ** 2
s = s11 * u1 ** 2 + 2 * s12 * u1 * u2 + s22 * u2 ** 2
return (RS_ring.gens(), (u1, u2), (r, s))
示例3: main1
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def main1():
S = PolynomialRing(GF(Integer(13)), names=('x',))
(x,) = S.gens()
R = S.quotient(x**Integer(2) - Integer(3), names=('alpha',))
(alpha,) = R.gens()
print((Integer(2) + Integer(3) * alpha)
* (Integer(1) + Integer(2) * alpha))
示例4: _anihilate_pol
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _anihilate_pol(k, M):
'''
k: The weight of an element c, where c is a construction
for generators of M_{det^* sym(10)} and an instance of
ConstDivision.
M: an instance of Sym10EvenDiv or Sym10OddDiv.
Return a polynomial pl such that the subspace of M anihilated by pl(T(2))
is equal to the subspace of holomorphic modular forms.
'''
R = PolynomialRing(QQ, names="x")
x = R.gens()[0]
if k % 2 == 0:
# Klingen-Eisenstein series
f = CuspForms(1, k + 10).basis()[0]
return x - f[2] * (1 + QQ(2) ** (k - 2))
elif k == 13:
# Kim-Ramakrishnan-Shahidi lift
f = CuspForms(1, 12).basis()[0]
a = f[2]
return x - f[2] ** 3 + QQ(2) ** 12 * f[2]
else:
chrply = M.hecke_charpoly(2)
dim = hilbert_series_maybe(10)[k]
l = [(a, b) for a, b in chrply.factor() if a.degree() == dim]
if len(l) > 1 or l[0][1] != 1:
raise RuntimeError
else:
return l[0][0]
示例5: eu
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def eu(p):
"""
local euler factor
"""
f = rho.local_factor(p)
co = [ZZ(round(x)) for x in f.coefficients(sparse=False)]
R = PolynomialRing(QQ, "T")
T = R.gens()[0]
return sum( co[n] * T**n for n in range(len(co)))
示例6: _hecke_pol_klingen
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _hecke_pol_klingen(k, j):
'''k: even.
F: Kligen-Eisenstein series of determinant weight k whose Hecke field is
the rational filed. Return the Hecke polynomial of F at 2.
'''
f = CuspForms(1, k + j).basis()[0]
R = PolynomialRing(QQ, names="x")
x = R.gens()[0]
pl = QQ(1) - f[2] * x + QQ(2) ** (k + j - 1) * x ** 2
return pl * pl.subs({x: x * QQ(2) ** (k - 2)})
示例7: _hecke_pol_krs_lift
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _hecke_pol_krs_lift():
'''Return the Hecke polynomial of KRS lift of weight det^{13}Sym(10) at 2.
'''
R = PolynomialRing(QQ, names="x")
x = R.gens()[0]
f = CuspForms(1, 12).basis()[0]
a = f[2]
b = QQ(2) ** 11
return ((1 - (a ** 3 - 3 * a * b) * x + b ** 3 * x ** 2) *
(1 - a * b * x + b ** 3 * x ** 2))
示例8: compute_local_roots_SMF2_scalar_valued
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def compute_local_roots_SMF2_scalar_valued(K, ev, k, embedding):
''' computes the dirichlet series for a Lfunction_SMF2_scalar_valued
'''
L = ev.keys()
m = ZZ(max(L)).isqrt() + 1
ev2 = {}
for p in primes(m):
try:
ev2[p] = (ev[p], ev[p * p])
except:
break
logger.debug(str(ev2))
ret = []
for p in ev2:
R = PolynomialRing(K, 'x')
x = R.gens()[0]
f = (1 - ev2[p][0] * x + (ev2[p][0] ** 2 - ev2[p][1] - p ** (
2 * k - 4)) * x ** 2 - ev2[p][0] * p ** (2 * k - 3) * x ** 3 + p ** (4 * k - 6) * x ** 4)
Rnum = PolynomialRing(CF, 'y')
x = Rnum.gens()[0]
fnum = Rnum(0)
if K != QQ:
for i in range(int(f.degree()) + 1):
fnum = fnum + f[i].complex_embeddings(NN)[embedding] * (x / p ** (k - 1.5)) ** i
else:
for i in range(int(f.degree()) + 1):
fnum = fnum + f[i] * (x / CF(p ** (k - 1.5))) ** i
r = fnum.roots(CF)
r = [1 / a[0] for a in r]
# a1 = r[1][0]/r[0][0]
# a2 = r[2][0]/r[0][0]
# a0 = 1/r[3][0]
ret.append((p, r))
return ret
示例9: _bracket_vec_val
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _bracket_vec_val(vecs):
if isinstance(vecs[0], SWGElt):
v1, v2, v3 = [a.forms for a in vecs]
else:
v1, v2, v3 = vecs
j = len(v1) - 1
def _names(s):
return ", ".join([s + str(i) for i in range(j + 1)])
R = PolynomialRing(QQ, names=", ".join([_names(s) for s in
["x", "y", "z"]]))
gens_x = R.gens()[: j + 1]
gens_y = R.gens()[j + 1: 2 * (j + 1)]
gens_z = R.gens()[2 * (j + 1):]
S = PolynomialRing(R, names="u, v")
u, v = S.gens()
def _pol(gens):
return sum([a * u ** (j - i) * v ** i
for i, a in zip(range(j + 1), gens)])
f_x, f_y, f_z = [_pol(gens) for gens in [gens_x, gens_y, gens_z]]
A = matrix([[f_x, f_y],
[f_y, f_z]])
vec = matrix([u, v]).transpose()
g = (vec.transpose() * A * vec)[0][0]
pol_dc = {(i, j + 2 - i): g[(i, j + 2 - i)] for i in range(j + 3)}
def pol_to_val(f):
dct = {}
def _dct(gens, v):
return {a: b for a, b in zip(gens, v)}
dct.update(_dct(gens_x, v1))
dct.update(_dct(gens_y, v2))
dct.update(_dct(gens_z, v3))
return f.subs(dct)
res_dc = {k: pol_to_val(v) for k, v in pol_dc.iteritems()}
return [res_dc[(j + 2 - i, i)] for i in range(j + 3)]
示例10: G_poly
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def G_poly(l, m):
'''The polynomial G of y1, y2 and y3 given in Proposition 3.7, [Kat].
'''
R = PolynomialRing(QQ, names="y1, y2, y3")
y1, y2, y3 = R.gens()
return sum(binomial(2 * n + l - QQ(5) / QQ(2), n) * y3 ** n *
sum((-y2) ** nu * (2 * y1) ** (m - 2 * n - 2 * nu) *
binomial(l + m - nu - QQ(5) / QQ(2), m - 2 * n - nu) *
binomial(m - 2 * n - nu, nu)
for nu in range((m - 2 * n) // 2 + 1))
for n in range(m // 2 + 1))
示例11: _hecke_tp_charpoly
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _hecke_tp_charpoly(self, p, var='x', algorithm='linbox'):
a = p ** (self.wt - 2) + 1
N = self.klingeneisensteinAndCuspForms()
S = CuspForms(1, self.wt)
m = S.dimension()
R = PolynomialRing(QQ, names=var)
x = R.gens()[0]
f = R(S.hecke_matrix(p).charpoly(var=var, algorithm=algorithm))
f1 = f.subs({x: a ** (-1) * x}) * a ** m
g = R(N.hecke_matrix(p).charpoly(var=var, algorithm=algorithm))
return R(g / f1)
示例12: interpolate_deg2
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def interpolate_deg2(dct, bd, autom=True, parity=None):
'''parity is 0 if the parity of the weight and the character coincide
else 1.
'''
t_ring = PolynomialRing(QQ, names="t")
t = t_ring.gens()[0]
u_ring = PolynomialRing(QQ, names="u")
u = u_ring.gens()[0]
# lift the values of dct
dct = {k: v.lift() for k, v in dct.items()}
def interpolate_pol(x, d):
prd = mul([x - a for a in d])
prd_dff = prd.derivative(x)
return sum([v * prd_dff.subs({x: k}) ** (-1) * prd // (x - k)
for k, v in d.items()])
def t_pol_dct(n, m):
if not autom:
dct_t = {a: v[(n, m)] * a ** (2 * bd) for a, v in dct.items()}
return t_ring(interpolate_pol(t, dct_t))
# put u = t + t^(-1)
elif parity == 0:
dct_u = {a + a ** (-1): v[(n, m)] for a, v in dct.items()}
u_pol = interpolate_pol(u, dct_u)
return t_ring(t ** (2 * bd) * u_pol.subs({u: t + t ** (-1)}))
else:
dct_u = {a + a ** (-1): v[(n, m)] / (a - a ** (-1))
for a, v in dct.items()}
u_pol = interpolate_pol(u, dct_u)
return t_ring(t ** (2 * bd) * u_pol.subs({u: t + t ** (-1)}) *
(t - t ** (-1)))
fc_dct = {}
for n in range(bd + 1):
for m in range(bd + 1):
pl = t_pol_dct(n, m)
for r in range(-int(floor(2 * sqrt(n * m))), int(floor(2 * sqrt(n * m))) + 1):
fc_dct[(n, r, m)] = pl[r + 2 * bd]
return fc_dct
示例13: _get_Rgens
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def _get_Rgens(self):
d = self.dim
if self.single_generator:
if self.hecke_ring_power_basis and self.field_poly_root_of_unity != 0:
R = PolynomialRing(QQ, self._nu_var)
else:
R = PolynomialRing(QQ, 'beta')
beta = R.gen()
return [beta**i for i in range(d)]
else:
R = PolynomialRing(QQ, ['beta%s' % i for i in range(1,d)])
return [1] + [g for g in R.gens()]
示例14: dict_to_pol
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def dict_to_pol(dct, bd=global_prec, base_ring=QQ):
R = PolynomialRing(base_ring, "u1, u2, q1, q2")
(u1, u2, q1, q2) = R.gens()
S = R.quotient(u1 * u2 - 1)
(uu1, uu2, qq1, qq2) = S.gens()
l = PrecisionDeg2(bd)
if not hasattr(dct, "__getitem__"):
return dct
return sum([dct[(n, r, m)] * uu1 ** r * qq1 ** n * qq2 ** m
if r > 0 else dct[(n, r, m)]
* uu2 ** (-r) * qq1 ** n * qq2 ** m for n, r, m in l])
示例15: test_cusp_sp_wt28_hecke_charpoly
# 需要导入模块: from sage.all import PolynomialRing [as 别名]
# 或者: from sage.all.PolynomialRing import gens [as 别名]
def test_cusp_sp_wt28_hecke_charpoly(self):
R = PolynomialRing(QQ, names="x")
x = R.gens()[0]
pl = (x ** Integer(7) - Integer(599148384) * x ** Integer(6) +
Integer(85597740037545984) * x ** Integer(5) +
Integer(4052196666582552432082944) * x ** Integer(4) -
Integer(992490558368877866775830593536000) * x ** Integer(3) -
Integer(7786461340613962559507216233894458163200) * x ** Integer(2) +
Integer(2554655965904300151500968857660777576875950080000) * x +
Integer(2246305351725266922462270484154998253269432286576640000))
S = CuspFormsDegree2(28)
self.assertTrue(R(S.hecke_charpoly(2)) == pl)