
(* Realize lambda_8 at p=23, like lambda_10 *)

Print["\n\n             SALEM, DEGREE 8\n"]


(* Note:  in this case there are root planes containing the axis of f *)
<<cox.m

prime = 23

(*-----------------Find Salem action --------------*)
qs = QEuler[salem8]
fs = Mat[salem8]
(*
ps = PrimeTwists[qs,fs,prime,1] 
ps = Select[ps,AbGp[QTwist[qs,fs,#],prime]=={prime,prime}&]
polys = ps[[1]] 
*)
polys =  x*(1 + x)*(6*x + x^2 - 2*x^3)*(-2*x - x^2 + x^3)
qs = QTwist[qs,fs,polys]
charfs = GlueChar[qs,fs,prime]

(*-----------------Find twist of QA[10] with suitable signature--------------*)
qc = QA[10]
fc = Cox[qc]
(*
ps = PrimeTwists[qc,fc,23,2] 
ps = Select[ps,GlueChar[QTwist[qc,fc,#],fc,prime]==charfs&]
ps = Select[ps,AbGp[QTwist[qc,fc,#],prime]=={prime,prime}&]
polyc = ps[[1]]
*)
polyc = 2 - 3*x - 3*x^2 + x^3 + x^4
qc = QTwist[qc,fc,polyc]

(*-----------------Glue Salem and cyclotomic pieces --------------*)
{qj,fj} = GlueAuto[qs,fs,qc,fc,prime]

(*-----------------Glue up extra form of rank 4 ----------*)
(* Even, dim 3, disc 22 *)
qa =  {{6, -1, -1}, {-1, 4, 2}, {-1, 2, 2}}
fa = Id[qa]
qb = {{6}}
fb = -Id[qb]
{qx,fx} = GlueAuto[qa,fa,qb,fb,2]

(*-----------------Glue these final pieces at 3 and 11  ----------*)
{q,f} = Glue1[qj,fj,qx,fx,{3,11}]

DiK3[q,f,polys]

DiK3Salem[salem8]
