Download A Tutorial for Pari/GP
Transcript
and we have the desired HNF. Let’s now perform ideal operations. For example type idealmul(nf, pr, idealmul(nf, pr,pr)) or more simply pr3 = idealpow(nf, pr,3) to get the cube of the ideal pr. Since the norm of this ideal is equal to 343 = 73 , to check that it is really the cube of pr and not of other ideals above 7, we can type for(i=1, #P, print( idealval(nf, pr3, P[i]) )) and we see that the valuation at pr is equal to 3, while the others are equal to zero. We could see this as well from idealfactor(nf, pr3). Let us now “idelize” pr3 by typing id3 = [pr3, [0,0]] r1 = idealred(nf, id3) (We need r1 + r2 = 2 components for the second vector.) The new ideal r1 is equivalent to id3 (modulo the principal ideals). The Archimedean component is non-trivial and gives the distance from the reduced ideal to the original one (see H. Cohen A Course in Computational Algebraic Number Theory, GTM 138 for details, especially Sections 5.8.4 and 6.5). Now, just for fun type r = r1; for(i=1,3, r = idealred(nf,r,[1,5]); print(r)) The ideals in the third r and initial r1 are equal: this means we have found a unit in our field, and it is easy to extract this unit given the Archimedean information: arch = r[2] - r1[2]; l1 = arch[1]; l2 = arch[2]; L = real(l1 + l2) / 4; v = exp( [l1,l2,conj(l1),conj(l2)]~ / 2 - [L,L,L,L]~ ); The vector v contains by definition the four complex embeddings of the unit. We may obtain the characteristic polynomial of the unit as ach = prod(i=1, #v, x-v[i]) ch = round(ach) Since the coefficients of ach should be very close to integer, we rounded it above. We can also get directly the representation of the unit on the integral basis by typing ro = concat(nf.roots, conj(nf.roots)); m = matrix( 4,4, i,j, subst(nf.zk[j], x, ro[i]) ) au = matsolve(m, v) u = round(au) Then u is the representation of the unit u on the integral basis. The closeness of the approximation of au to u gives us confidence that we have made no numerical mistake. Type charpoly( nfbasistoalg(nf, u) ) and we obtain ch again. (Whose constant coefficient is 1, hence u is indeed a unit.) There is of course no reason for u to be a fundamental unit. Let us see if it is a square. Type f1 = factor(subst(ch, x, x^2)) 40