42 lines
1.9 KiB
Python
42 lines
1.9 KiB
Python
|
def artin_schreier_transform(power_series, prec = 10):
|
||
|
"""Given a power_series, find correction such that power_series - (correction)^p +correction has valuation
|
||
|
-jump non divisible by p. Also, express t (the variable) in terms of the uniformizer at infty on the curve
|
||
|
z^p - z = power_series, where z = 1/t_new^(jump) and express z in terms of the new uniformizer."""
|
||
|
correction = 0
|
||
|
F = power_series.parent().base()
|
||
|
p = F.characteristic()
|
||
|
Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
|
||
|
RtQ = FractionField(Rt)
|
||
|
power_series = RtQ(power_series)
|
||
|
if power_series.valuation() == +Infinity:
|
||
|
raise ValueError("Precision is too low.")
|
||
|
if power_series.valuation() >= 0:
|
||
|
# THIS IS WRONG - THERE ARE SEVERAL PLACES OVER THIS PLACE, AND IT DEPENDS
|
||
|
aux = t^p - t
|
||
|
z = new_reverse(aux, prec = prec)
|
||
|
z = z(t = power_series)
|
||
|
return(0, 0, t, z)
|
||
|
|
||
|
while(power_series.valuation() % p == 0 and power_series.valuation() < 0):
|
||
|
M = -power_series.valuation()/p
|
||
|
coeff = power_series.list()[0] #wspolczynnik a_(-p) w f_AS
|
||
|
correction += coeff.nth_root(p)*t^(-M)
|
||
|
power_series = power_series - (coeff*t^(-p*M) - coeff.nth_root(p)*t^(-M))
|
||
|
jump = max(-(power_series.valuation()), 0)
|
||
|
try:
|
||
|
if jump != 0:
|
||
|
T = nth_root2((power_series)^(-1), jump, prec=prec) #T is defined by power_series = 1/T^m
|
||
|
except:
|
||
|
print("no ", str(jump), "-th root; divide by", power_series.list()[0])
|
||
|
return (jump, power_series.list()[0])
|
||
|
if jump != 0:
|
||
|
T_rev = new_reverse(T, prec = prec)
|
||
|
t_old = T_rev(t^p/nth_root2(1 - t^((p-1)*jump), jump, prec=prec))
|
||
|
z = 1/t^(jump) + Rt(correction)(t = t_old)
|
||
|
return(jump, correction, t_old, z)
|
||
|
if jump == 0:
|
||
|
aux = t^p - t
|
||
|
z = new_reverse(aux, prec = prec)
|
||
|
z = z(t = power_series)
|
||
|
z = z + correction
|
||
|
return(0, correction, t, z)
|