# Ticket #15243: 15243_uniformizer.patch

File 15243_uniformizer.patch, 5.5 KB (added by jdemeyer, 9 years ago)
• ## sage/libs/pari/decl.pxi

```# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1380554104 -7200
# Node ID b4306fbb59ae2c323a00ae9bb6a940a065bbde3f
# Parent  677bcdd0c113352cb802657a199a2e0e578ec820
Change algorithm for K.uniformizer(P)

diff --git a/sage/libs/pari/decl.pxi b/sage/libs/pari/decl.pxi```
 a void    pari_close() void    pari_init(size_t parisize, ulong maxprime) void    pari_init_opts(size_t parisize, ulong maxprime, ulong init_opts) void    stackdummy(GEN x, long l) long    gsizebyte(GEN x) long    gsizeword(GEN x) long    timer()
• ## sage/libs/pari/gen.pyx

`diff --git a/sage/libs/pari/gen.pyx b/sage/libs/pari/gen.pyx`
 a def idealappr(self, x, long flag=0): t0GEN(x) pari_catch_sig_on() return self.new_gen(idealappr(self.g, t0)) return self.new_gen(idealappr0(self.g, t0, flag)) def idealcoprime(self, x, y): """
• ## sage/rings/number_field/number_field.py

`diff --git a/sage/rings/number_field/number_field.py b/sage/rings/number_field/number_field.py`
 a sage: P,Q = K.ideal(3).prime_factors() sage: P Fractional ideal (3, a + 1) sage: pi=K.uniformizer(P); pi sage: pi = K.uniformizer(P); pi a + 1 sage: K.ideal(pi).factor() (Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)) sage: pi=K.uniformizer(P,'negative'); pi sage: pi = K.uniformizer(P,'negative'); pi 1/2*a + 1/2 sage: K.ideal(pi).factor() (Fractional ideal (2, a + 1))^-1 * (Fractional ideal (3, a + 1)) [1, 1, 1] sage: [ pilist[i] in Plist[i] for i in range(len(Plist)) ] [True, True, True] :: sage: K. = NumberField(x^4 - x^3 - 3*x^2 - x + 1) sage: [K.uniformizer(P) for P,e in factor(K.ideal(2))] [2] sage: [K.uniformizer(P) for P,e in factor(K.ideal(3))] [t - 1] sage: [K.uniformizer(P) for P,e in factor(K.ideal(5))] [t^2 - t + 1, t + 2, t - 2] sage: [K.uniformizer(P) for P,e in factor(K.ideal(7))] [t^2 + 3*t + 1] sage: [K.uniformizer(P) for P,e in factor(K.ideal(67))] [t + 23, t + 26, t - 32, t - 18] ALGORITHM: Use PARI. More precisely, use the second component of ``idealprimedec`` in the "positive" case. Use `idealappr` with exponent of -1 and invert the result in the "negative" case. """ if not is_NumberFieldIdeal(P): P = self.ideal(P) if not P.is_maximal(): raise ValueError, "P must be a nonzero prime" if others == "negative": P = ~P elif others != "positive": raise ValueError, "others must be 'positive' or 'negative'" nf = self.pari_nf() a = self(nf.idealappr(P.pari_hnf())) if others == "negative": a = ~a return a P = P.pari_prime() if others == "positive": return self(P[1]) elif others == "negative": nf = self.pari_nf() F = pari.matrix(1, 2, [P, -1]) return ~self(nf.idealappr(F, 1)) else: raise ValueError("others must be 'positive' or 'negative'") def units(self, proof=None): """
• ## sage/schemes/elliptic_curves/ell_number_field.py

`diff --git a/sage/schemes/elliptic_curves/ell_number_field.py b/sage/schemes/elliptic_curves/ell_number_field.py`
 a sage: K. = NumberField(x^2 + 161*x - 150) sage: E = EllipticCurve([25105/216*v - 3839/36, 634768555/7776*v - 98002625/1296, 634768555/7776*v - 98002625/1296, 0, 0]) sage: E.global_integral_model() Elliptic Curve defined by y^2 + (33872485050625*v-31078224284250)*x*y + (2020602604156076340058146664245468750000*v-1871778534673615560803175189398437500000)*y = x^3 + (6933305282258321342920781250*v-6422644400723486559914062500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150 Elliptic Curve defined by y^2 + (-502639783*v+465618899)*x*y + (-6603604211463489399460860*v+6117229527723443603191500)*y = x^3 + (1526887622075335620*v-1414427901517840500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150 :trac:`14476`:: sage: K. = NumberField(t^4 - t^3 - 3*t^2 - t + 1) sage: E = EllipticCurve([ -43/625*g^3 + 14/625*g^2 - 4/625*g + 706/625, -4862/78125*g^3 - 4074/78125*g^2 - 711/78125*g + 10304/78125,  -4862/78125*g^3 - 4074/78125*g^2 - 711/78125*g + 10304/78125, 0,0]) sage: E.global_integral_model() Elliptic Curve defined by y^2 + (-18*g^3+29*g^2+63*g+7)*x*y + (-704472*g^3-958584*g^2-166242*g+298101)*y = x^3 + (-2859*g^3-3978*g^2-669*g+1332)*x^2 over Number Field in g with defining polynomial t^4 - t^3 - 3*t^2 - t + 1 Elliptic Curve defined by y^2 + (15*g^3-48*g-42)*x*y + (-111510*g^3-162162*g^2-44145*g+37638)*y = x^3 + (-954*g^3-1134*g^2+81*g+576)*x^2 over Number Field in g with defining polynomial t^4 - t^3 - 3*t^2 - t + 1 """ K = self.base_field()