
<<cox.m
Print["\n\n             SALEM, DEGREE 14 (3)\n"]

salem = SmallSalems14[[3]]

(*-----------------Salem part --------------*)
qs = QEuler[salem]
fs = Mat[salem]

prime=5
ps  = PrimeTwists[qs,fs,prime] 
ps = Select[ps,GluePeriod[QTwist[qs,fs,#],fs]==4&]
p5 = ps[[1]]

prime=7
ps  = PrimeTwists[qs,fs,prime] 
ps = Select[ps,GluePeriod[QTwist[qs,fs,#],fs]==8&]
p7 = ps[[1]]

polys = FixSig[qs,fs,p5 p7]
polys = polys[[1]]
qs = QTwist[qs,fs,polys]

DiGlue[qs,fs]

(*-------------------------Cyclotomic-------------------*)
prime=7
charfs = GlueChar[qs,fs,prime]
per = GluePeriod[qs,fs,prime]
cyclo = Cyclotomic[per,x]
qc = QEuler[cyclo]
fc = Mat[cyclo]
ps = PrimeTwists[qc,fc,prime,0] 
ps = Select[ps,GlueChar[QTwist[qc,fc,#],fc,prime]==charfs&]
polyc = ps[[1]]
qc = QTwist[qc,fc,polyc]

{qd,fd} = GlueAuto[qs,fs,qc,fc,prime]
DiGlue[qd,fd]

(*-------------------------Cyclotomic-------------------*)
prime=5
charfs = GlueChar[qs,fs,prime]
per = GluePeriod[qs,fs,prime]
cyclo = Cyclotomic[per,x]
qc = QEuler[cyclo]
fc = Mat[cyclo]
ps = PrimeTwists[qc,fc,prime,2] 
ps = Select[ps,GlueChar[QTwist[qc,fc,#],fc,prime]==charfs&]
polyc = ps[[1]]
qc = QTwist[qc,fc,polyc]

{qe,fe} = GlueAuto[qd,fd,qc,fc,prime]
DiGlue[qe,fe]
