Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fixed bug when lifting p-automorphic forms of weight > 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmasdeu committed Mar 17, 2017
1 parent 36bcfa6 commit 21e5565
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 63 deletions.
106 changes: 49 additions & 57 deletions src/sage/modular/btquotients/pautomorphicform.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,6 @@ def riemann_sum(self, f, center=1, level=0, E=None):
1 + 5 + 2*5^3 + 4*5^4 + 2*5^5 + 3*5^6 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)
"""
R1 = LaurentSeriesRing(f.base_ring(), 'r1')
# R1.set_default_prec(self.parent()._k - 1)

if E is None:
E = self.parent()._X._BT.get_balls(center, level)
else:
Expand Down Expand Up @@ -1057,9 +1055,7 @@ def _element_constructor_(self, x):
if isinstance(parent, BruhatTitsHarmonicCocycles):
return self.element_class(self, [self._U(o) for o in x._F])
elif isinstance(parent, pAdicAutomorphicForms):
tmp = [self._U(x._F[ii]).l_act_by(self._E[ii].rep)
for ii in range(self._nE)]
# tmp = [self._E[ii].rep * self._U(x._F[ii]) for ii in range(self._nE)]
tmp = [self._E[ii].rep * self._U(x._F[ii]) for ii in range(self._nE)]
return self.element_class(self, tmp)
if x == 0:
tmp = [self._U([0] * (self.weight() - 1))] * self._X._num_edges
Expand Down Expand Up @@ -1699,7 +1695,8 @@ def evaluate(self, e1):
p = self.parent().prime()
u = DoubleCosetReduction(X, e1)
tmp = ((u.t(self.parent()._U.base_ring().precision_cap())) * p ** (u.power)).adjoint()
return self.parent()._Sigma0(tmp, check=False) * self._value[u.label]
S0 = self.parent()._Sigma0
return S0(tmp, check=False) * self._value[u.label]
# Warning! Should remove check=False...

def _lmul_(self, a):
Expand Down Expand Up @@ -1803,29 +1800,33 @@ def _improve(self, hc):
"""
MMM = self.parent()
U = MMM._U
h1 = MMM(self)
try:
h1._value = [o.lift(M=MMM.precision_cap()) for o in h1._value]
except AttributeError:
pass
h2 = MMM._apply_Up_operator(h1, True, hc)
S0 = MMM._Sigma0

orig_moments = [[fval._moments[ii] for ii in range(MMM._n + 1)]
for fval in hc._F]
A = S0(Matrix(QQ, 2, 2, [0, 1 / MMM._p, 1, 0]),False)
for fval in hc._F:
tmp = -(A * fval)
orig_moments.append([tmp._moments[ii] for ii in range(MMM._n + 1)])

h1 = MMM([o.lift(M=MMM.precision_cap()) for o in self._value])
h2 = MMM._apply_Up_operator(h1, True, orig_moments)
verbose("Applied Up once")
ii = 0
current_val = 0
# old_val = -Infinity
old_val = -Infinity
init_val = self.valuation()
while ii < MMM.precision_cap(): # current_val > old_val:
# old_val = current_val
while current_val > old_val:
old_val = current_val
ii += 1
self._value = [U(c) for c in h2._value]
h2 = MMM._apply_Up_operator(self, True, hc)
current_val = (h2 - self).valuation() - init_val
h1._value = [U(c) for c in h2._value]
h2 = MMM._apply_Up_operator(h1, True, orig_moments)
current_val = (h2 - h1).valuation() - init_val
verbose('val = %s' % current_val)
if current_val is Infinity:
break
verbose('Applied Up %s times' % (ii + 1))
self._value = [U(c) for c in h2._value]
return self
return h2

def integrate(self, f, center=1, level=0, method='moments'):
r"""
Expand Down Expand Up @@ -1890,13 +1891,12 @@ def integrate(self, f, center=1, level=0, method='moments'):
- Marc Masdeu (2012-02-20)
"""
E = self.parent()._source._BT.get_balls(center, level)
R1 = LaurentSeriesRing(f.base_ring(), 'r1')
R1 = LaurentSeriesRing(f.base_ring(), 'r1', default_prec = self.parent()._U.base_ring().precision_cap() + 1)
R2 = PolynomialRing(f.base_ring(), 'x')
x = R2.gen()
value = 0
ii = 0
if method == 'riemann_sum':
# R1.set_default_prec(self.parent()._U.weight() + 1)
for e in E:
ii += 1
#print(ii,"/",len(E))
Expand All @@ -1905,7 +1905,6 @@ def integrate(self, f, center=1, level=0, method='moments'):
new = eval_dist_at_powseries(self.evaluate(e), exp.truncate(self.parent()._U.weight() + 1))
value += new
elif method == 'moments':
# R1.set_default_prec(self.parent()._U.base_ring().precision_cap())
n = self.parent()._U.weight()
for e in E:
ii += 1
Expand Down Expand Up @@ -2135,7 +2134,7 @@ def coleman(self, t1, t2, E=None, method='moments', mult=False,
K = t1.parent()
R = PolynomialRing(K, 'x')
x = R.gen()
R1 = LaurentSeriesRing(K, 'r1')
R1 = LaurentSeriesRing(K, 'r1', default_prec=self.parent()._U.base_ring().precision_cap())
r1 = R1.gen()
if E is None:
E = self.parent()._source._BT.find_covering(t1, t2)
Expand All @@ -2144,7 +2143,6 @@ def coleman(self, t1, t2, E=None, method='moments', mult=False,
ii = 0
value_exp = K(1)
if method == 'riemann_sum':
# R1.set_default_prec(self.parent()._U.weight() + 1)
for e in E:
ii += 1
b = e[0, 1]
Expand All @@ -2158,7 +2156,6 @@ def coleman(self, t1, t2, E=None, method='moments', mult=False,
value_exp *= K.teichmuller(y) ** Integer(c_e.moment(0).rational_reconstruction())

elif method == 'moments':
# R1.set_default_prec(self.parent()._U.base_ring().precision_cap())
for e in E:
ii += 1
f = (x - t1) / (x - t2)
Expand Down Expand Up @@ -2449,24 +2446,25 @@ def _element_constructor_(self, data):
# Code how to coerce x into the space
# Admissible values of x?
if type(data) is list:
return self.element_class(self, [self._U(o) for o in data])
return self.element_class(self, [self._U(o, normalize=False) for o in data])

if isinstance(data, pAdicAutomorphicFormElement):
return self.element_class(self, [self._U(o) for o in data._value])
vals = [self._U(o, normalize=False) for o in data._value]
return self.element_class(self, vals)

if isinstance(data, BruhatTitsHarmonicCocycleElement):
E = self._list
tmp = []
F = []
Uold = data.parent()._U
for ii in range(len(data._F)):
newtmp = data.parent()._Sigma0(E[ii].rep.inverse(), check=False) * Uold(data._F[ii]) # Warning, should remove check=False!
newtmp = data.parent()._Sigma0(E[ii].rep.inverse(), check=False) * Uold(data._F[ii],normalize=False)
tmp.append(newtmp)
F.append(newtmp)
A = Matrix(QQ, 2, 2, [0, -1 / self.prime(), -1, 0])
A = data.parent()._Sigma0(Matrix(QQ,2,2,[0,1/self.prime(),1,0]),check=False)
for ii in range(len(data._F)):
F.append(-(data.parent()._Sigma0(A.adjoint(), check=False) * tmp[ii]))
vals = self._make_invariant([self._U(o) for o in F])
F.append(-(A * tmp[ii]))
vals = self._make_invariant([self._U(o,normalize=False) for o in F])
return self.element_class(self, vals)
if data == 0:
return self.zero_element()
Expand Down Expand Up @@ -2542,9 +2540,7 @@ def lift(self, f):
sage: A2.lift(a) # long time
p-adic automorphic form of cohomological weight 0
"""
F = self(f)
F._improve(f)
return F
return self(f)._improve(f)

def _make_invariant(self, F):
r"""
Expand Down Expand Up @@ -2574,21 +2570,22 @@ def _make_invariant(self, F):
newF = []
for ii in range(len(S)):
Si = S[ii]
x = self._U(F[ii])
x = self._U(F[ii], normalize=False)

if any(v[2] for v in Si):
newFi = self._U(0)
s = QQ(0)
m = M[ii]
for v in Si:
s += 1
newFi += self._Sigma0((m.adjoint() * self._source.embed_quaternion(v[0], prec=self._prec) * m).adjoint(), check=False) * self._U(x)
newF.append((1 / s) * newFi)
g = self._Sigma0(m.adjoint() * self._source.embed_quaternion(v[0], prec=self._prec).adjoint() * m,check = False)
newFi += g * x
newF.append((QQ(1) / s) * newFi)
else:
newF.append(self._U(x))
newF.append(self._U(x,normalize=False))
return newF

def _apply_Up_operator(self, f, scale=True, hc=None):
def _apply_Up_operator(self, f, scale=False, original_moments=None):
r"""
Apply the Up operator to ``f``.
Expand All @@ -2607,34 +2604,29 @@ def _apply_Up_operator(self, f, scale=True, hc=None):
p-adic automorphic form of cohomological weight 2
"""
HeckeData = self._source._get_Up_data()
if scale:
factor = self._p ** (self._U.weight() / 2)
S0 = f._value[0].parent()._act._Sigma0
prec_cap = self._U.base_ring().precision_cap()

if not scale:
factor = self._p ** (self._U.weight() // 2)
else:
factor = 1

# Save original moments
if hc is None:
orig_moments = [[fval._moments[ii] for ii in range(self._n + 1)]
if original_moments is None:
original_moments = [[fval._moments[ii] for ii in range(self._n + 1)]
for fval in f._value]
else:
orig_moments = [[fval._moments[ii] for ii in range(self._n + 1)]
for fval in hc._F]
orig_moments += [[-fval._moments[ii] for ii in range(self._n + 1)]
for fval in hc._F]

Tf = []
S0 = f._value[0].parent()._act._Sigma0
for jj in range(len(self._list)):
tmp = self._U(0)
tmp = self._U(0,normalize=False)
for gg, edge_list in HeckeData:
u = edge_list[jj]
r = (self._p ** (-(u.power))
* (u.t(self._U.base_ring().precision_cap()
+ 2 * u.power + 1) * gg)).adjoint()
tmp += S0(r, check=False) * f._value[u.label]
# Warning: should activate check...
tprec = 2 * (prec_cap + u.power) + 1
r = S0(self._p ** -u.power * (u.t(tprec) * gg).adjoint(),check=False)
tmp += r * f._value[u.label]
tmp *= factor
for ii in range(self._n + 1):
tmp._moments[ii] = orig_moments[jj][ii]
tmp._moments[ii] = original_moments[jj][ii]
Tf.append(tmp)
return self(Tf)
7 changes: 3 additions & 4 deletions src/sage/modular/pollack_stevens/dist.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ cdef class Dist_vector(Dist):
sage: D = OverconvergentDistributions(3,5,6) # indirect doctest
sage: v = D([1,1,1])
"""
def __init__(self, moments, parent, ordp=0, check=True):
def __init__(self, moments, parent, ordp=0, check=True, normalize=True):
"""
Initialization.
Expand Down Expand Up @@ -824,7 +824,8 @@ cdef class Dist_vector(Dist):

self._moments = moments
self.ordp = ordp
self.normalize() # DEBUG
if normalize:
self.normalize()

def __reduce__(self):
r"""
Expand Down Expand Up @@ -871,7 +872,6 @@ cdef class Dist_vector(Dist):
sage: repr(v)
'(1 + O(7^5), 2 + O(7^4), 3 + O(7^3), 4 + O(7^2), 5 + O(7))'
"""
# self.normalize() # Should normalize only when absolutely needed.
valstr = ""
if self.ordp == 1:
valstr = "%s * " % (self.parent().prime())
Expand Down Expand Up @@ -1886,7 +1886,6 @@ cdef class WeightKAction_vector(WeightKAction):
v_moments = v._moments
ans._moments = v_moments * self.acting_matrix(g, len(v_moments))
ans.ordp = v.ordp
ans.normalize()
return ans

# cdef inline long mymod(long a, unsigned long pM):
Expand Down
7 changes: 5 additions & 2 deletions src/sage/modular/pollack_stevens/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def __init__(self, k, p=None, prec_cap=None, base=None, character=None,

self._populate_coercion_lists_(action_list=[self._act])

def _element_constructor_(self, val):
def _element_constructor_(self, val, **kwargs):
"""
Construct a distribution from data in ``val``
Expand All @@ -315,7 +315,10 @@ def _element_constructor_(self, val):
sage: v = V([1,2,3,4,5,6,7]); v
(1, 2, 3, 4, 5, 6, 7)
"""
return self.Element(val, self)
ordp = kwargs.get('ord',0)
check = kwargs.get('check',True)
normalize= kwargs.get('normalize',True)
return self.Element(val, self, ordp, check, normalize)

def _coerce_map_from_(self, other):
"""
Expand Down

0 comments on commit 21e5565

Please sign in to comment.