Skip to content

Commit 75f8078

Browse files
committed
Finally added the old method of embed_order, as embed_order_legacy.
1 parent 396204a commit 75f8078

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

arithgroup.py

+56
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,62 @@ def embed_order(self,p,K,prec,orientation = None, use_magma = True,outfile = Non
824824
gamma.set_immutable()
825825
return self(gamma), v0(tau)
826826

827+
def embed_order_legacy(self,p,K,prec,outfile = None,return_all = False):
828+
r'''
829+
'''
830+
from limits import _find_initial_embedding_list,find_optimal_embeddings,order_and_unit, find_the_unit_of
831+
832+
verbose('Computing quadratic embedding to precision %s'%prec)
833+
mu = find_optimal_embeddings(K,use_magma = True, extra_conductor = 1)[-1]
834+
verbose('Finding module generators')
835+
w = module_generators(K)[1]
836+
verbose('Done')
837+
w_minpoly = w.minpoly().change_ring(Qp(p,prec))
838+
Cp = Qp(p,prec).extension(w_minpoly,names = 'g')
839+
wl = w.list()
840+
assert len(wl) == 2
841+
r0 = -wl[0]/wl[1]
842+
r1 = 1/wl[1]
843+
assert r0 + r1 * w == K.gen()
844+
padic_Kgen = Cp(r0)+Cp(r1)*Cp.gen()
845+
try:
846+
fwrite('d_K = %s, h_K = %s, h_K^- = %s'%(K.discriminant(),K.class_number(),len(K.narrow_class_group())),outfile)
847+
except NotImplementedError: pass
848+
fwrite('w_K satisfies: %s'%w.minpoly(),outfile)
849+
mu = r0 + r1*mu
850+
assert K.gen(0).trace() == mu.trace() and K.gen(0).norm() == mu.determinant()
851+
iotap = self.get_embedding(prec)
852+
a,b,c,d = iotap(mu).list()
853+
X = PolynomialRing(Cp,names = 'X').gen()
854+
tau1 = (Cp(a-d) + 2*padic_Kgen)/Cp(2*c)
855+
tau2 = (Cp(a-d) - 2*padic_Kgen)/Cp(2*c)
856+
assert (Cp(c)*tau1**2 + Cp(d-a)*tau1-Cp(b)) == 0
857+
assert (Cp(c)*tau2**2 + Cp(d-a)*tau2-Cp(b)) == 0
858+
u = find_the_unit_of(self.F,K)
859+
gammalst = u.list()
860+
assert len(gammalst) == 2
861+
gammaquatrep = self.B(gammalst[0]) + self.B(gammalst[1]) * mu
862+
verbose('gammaquatrep trd = %s and nrd = %s'%(gammaquatrep.trace(),gammaquatrep.determinant()))
863+
verbose('u trace = %s and unorm = %s'%(u.trace(),u.norm()))
864+
assert gammaquatrep.trace() == u.trace() and gammaquatrep.determinant() == u.norm()
865+
gammaq = gammaquatrep
866+
while True:
867+
try:
868+
gamma = self(gammaq)
869+
break
870+
except ValueError:
871+
gammaq *= gammaquatrep
872+
a, b, c, d = iotap(gamma.quaternion_rep).list()
873+
assert (c*tau1**2 + (d-a)*tau1 - b) == 0
874+
fwrite('\cO_K to R_0 given by w_K |-> %s'%mu,outfile)
875+
fwrite('gamma_psi = %s'%gamma,outfile)
876+
fwrite('tau_psi = %s'%tau1,outfile)
877+
fwrite('(where g satisfies: %s)'%w.minpoly(),outfile)
878+
if return_all:
879+
return gamma, tau1, tau2
880+
else:
881+
return gamma, tau1
882+
827883
def check_word(self,delta,wd):
828884
tmp = self.B(1)
829885
for i,a in wd:

0 commit comments

Comments
 (0)