Attachment 'magma.sage'
Download 1 def root_number_pari(E):
2 if E.base_field() != QQ:
3 raise NotImplementedError("only implemented ")
4 return pari(E).ellrootno()
5
6 def hilbert_symbol_magma(a, b, P):
7 K = P.number_field()
8 f = K.polynomial()
9 pr = "PQ<" + f.variable_name() + ">:=PolynomialRing(Rationals());"
10 nf = "K2<" + str(K.gen()) + ">:=NumberField(" + str(f) + ");"
11 pi = "P2:=ideal<MaximalOrder(K2)|" + str(list(P.gens()))[1:-1] + ">;"
12 hs = "HilbertSymbol(K2!" + str(a) + ",K2!" + str(b) + ",P2)"
13 # print pr + nf + pi + hs
14 return Integer(magma_free(pr + nf + pi + hs))
15
16 def root_number_magma(E):
17 K = E.base_field()
18 f = K.polynomial()
19 pr = "PQ<" + f.variable_name() + ">:=PolynomialRing(Rationals());"
20 nf = "K2<" + str(K.gen()) + ">:=NumberField(" + str(f) + ");"
21 ec = "E2:=EllipticCurve([K2|" + str(E.a_invariants())[1:-1] + "]);"
22 rn = "RootNumber(E2)"
23 # print pr + nf + ec + rn
24 return Integer(magma_free(pr + nf + ec + rn))
25
26 def root_number_magma_local(E, P):
27 K = E.base_field()
28 f = K.polynomial()
29 pr = "PQ<" + f.variable_name() + ">:=PolynomialRing(Rationals());"
30 nf = "K2<" + str(K.gen()) + ">:=NumberField(" + str(f) + ");"
31 ec = "E2:=EllipticCurve([K2|" + str(E.a_invariants())[1:-1] + "]);"
32 pi = "P2:=ideal<MaximalOrder(K2)|" + str(list(P.gens()))[1:-1] + ">;"
33 rn = "RootNumber(E2,P2)"
34 # print pr + nf + ec + rn
35 return Integer(magma_free(pr + nf + ec + pi + rn))
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.