/* subsupfields.gp */ pol1 = y^8 - y^6 + 2*y^2 + 1; #nfsubfields(pol1) #nfsubfields(pol1,4) sub1 = nfsubfields(pol1,4) a = y^2+y; minpoly(Mod(a,sub1[1][1])) minpoly(Mod(subst(a,y,sub1[1][2]),pol1)) nf1 = nfinit(pol1); #nfsubfields(nf1,2) fa1 = nffactor(pol1, subst(pol1,y,x)); sub1b = nfsubfields([pol1,fa1],4) nfisisom(sub1[1][1],sub1b[1][1]) matrix(#sub1,#sub1b,i,j,nfisisom(sub1[i][1],sub1b[j][1])!=0) {pol2 = x^16 - 4*x^15 + 34*x^14 - 102*x^13 + 620*x^12 - 1542*x^11 + 7436*x^10 - 14962*x^9 + 67815*x^8 - 111634*x^7 + 409898*x^6 - 504000*x^5 + 1459447*x^4 - 1224212*x^3 + 3769899*x^2 - 1828918*x + 6914293}; sub2 = nfsubfieldsmax(pol2); apply(a -> poldegree(a[1]), sub2) fa2 = nffactor(pol2, subst(pol2,x,t)); t = varhigher("t"); fa2 = nffactor(pol2, subst(pol2,x,t)); nfsubfieldsmax([pol2,fa2]) == sub2 {pol3 = y^12 + 6*y^10 - 10*y^9 + 36*y^8 - 60*y^7 + 276*y^6 - 720*y^5 + 1776*y^4 - 2360*y^3 + 2160*y^2 - 1200*y + 400}; sub3 = nfsubfieldsmax(pol3); apply(a -> poldegree(a[1]), sub3) sub3b = nfsubfieldsmax(sub3[1][1]) polredbest(sub3b[1][1]) nfsubfieldscm(pol1) sub2b = nfsubfieldscm([pol2,fa2]) polredbest(sub2b[1],1) polredbest(substpol(sub2b[1],x^2,x)) polsubcyclo(23,11) #polsubcyclo(60,8) galoissubcyclo(60,-1) G = znstar(7*13*19) H = mathnfmodid([1,0;-1,1;0,-1],3); galoissubcyclo(G,H) nfdiscfactors(%) quadhilbert(-23) quadray(-7,8) bnrstark(bnrinit(bnfinit(y^3-y^2-41*y+104),1)) pol4 = y^2-y+1007 bnf = bnfinit(pol4); bnf.cyc ext4 = bnrclassfield(bnf) nfcompositum(bnf,ext4[1],ext4[2],2) bnrclassfield(bnf,,1) bnrclassfield(bnf,,2) pr = idealprimedec(bnf,13)[1]; bnr = bnrinit(bnf,pr); bnr.cyc [deg,r1,D] = bnrdisc(bnr); deg D ext2 = bnrclassfield(bnr) apply(P -> lift(rnfpolredbest(bnf,P)), ext2) ext2b = bnrclassfield(bnr,,2) nfdisc([ext2b,1000]) == D pr2 = idealprimedec(bnf,2)[1]; bnr2 = bnrinit(bnf,[pr,1;pr2,3]); bnr2.cyc H2 = [2,1,1;0,2,0;0,0,1] bnrclassfield(bnr2,H2) ext3 = bnrclassfield(bnr2,3) ext3 = bnrclassfield(bnr2,9) pr313 = idealprimedec(bnf,313)[1]; bnrisprincipal(bnr2,pr313,0) bnf2 = bnfinit(y^2-217); bnf2.cyc bnrinit(bnf2,1).cyc bnr3 = bnrinit(bnf2,[1,[1,1]]); bnr3.cyc [deg,r1,D] = bnrdisc(bnr3); [deg,r1] D bnrclassfield(bnr3) pol5 = bnrclassfield(bnr3,,2) polsturm(pol5) nfdisc(pol5) == D