Pari/GP Reference Documentation  Contents - Index - Meta commands

Functions related to general number fields


bnfcertify   bnfclassunit   bnfclgp   bnfdecodemodule   bnfinit   bnfisintnorm   bnfisnorm   bnfisprincipal   bnfissunit   bnfisunit   bnfmake   bnfnarrow   bnfreg   bnfsignunit   bnfsunit   bnfunit   bnrL1   bnrclass   bnrclassno   bnrclassnolist   bnrconductor   bnrconductorofchar   bnrdisc   bnrdisclist   bnrinit   bnrisconductor   bnrisprincipal   bnrrootnumber   bnrstark   dirzetak   factornf   galoisfixedfield   galoisinit   galoispermtopol   galoissubcyclo   idealadd   idealaddtoone   idealappr   idealchinese   idealcoprime   idealdiv   idealfactor   idealhnf   idealintersect   idealinv   ideallist   ideallistarch   ideallog   idealmin   idealmul   idealnorm   idealpow   idealprimedec   idealprincipal   idealred   idealstar   idealtwoelt   idealval   ideleprincipal   matalgtobasis   matbasistoalg   modreverse   newtonpoly   nfalgtobasis   nfbasis   nfbasistoalg   nfdetint   nfdisc   nfeltdiv   nfeltdiveuc   nfeltdivmodpr   nfeltdivrem   nfeltmod   nfeltmul   nfeltmulmodpr   nfeltpow   nfeltpowmodpr   nfeltreduce   nfeltreducemodpr   nfeltval   nffactor   nffactormod   nfgaloisapply   nfgaloisconj   nfhilbert   nfhnf   nfhnfmod   nfinit   nfisideal   nfisincl   nfisisom   nfkermodpr   nfmodprinit   nfnewprec   nfroots   nfrootsof1   nfsnf   nfsolvemodpr   nfsubfields   polcompositum   polgalois   polred   polredabs   polredord   poltschirnhaus   rnfalgtobasis   rnfbasis   rnfbasistoalg   rnfcharpoly   rnfconductor   rnfdedekind   rnfdet   rnfdisc   rnfeltabstorel   rnfeltdown   rnfeltreltoabs   rnfeltup   rnfequation   rnfhnfbasis   rnfidealabstorel   rnfidealdown   rnfidealhnf   rnfidealmul   rnfidealnormabs   rnfidealnormrel   rnfidealreltoabs   rnfidealtwoelt   rnfidealup   rnfinit   rnfisfree   rnfisnorm   rnfkummer   rnflllgram   rnfnormgroup   rnfpolred   rnfpolredabs   rnfpseudobasis   rnfsteinitz   subgrouplist   zetak   zetakinit  
 
bnfcertify(bnf)  

bnf being a big number field as output by bnfinit or bnfclassunit, checks whether the result is correct, i.e.whether it is possible to remove the assumption of the Generalized Riemann Hypothesis. If it is correct, the answer is 1. If not, the program may output some error message, but more probably will loop indefinitely. In no occasion can the program give a wrong answer (barring bugs of course): if the program answers 1, the answer is certified.

The library syntax is certifybuchall(bnf), and the result is a C long.

bnfclassunit(P,{flag = 0},{tech = []})  

Buchmann's sub-exponential algorithm for computing the class group, the regulator and a system of fundamental units of the general algebraic number field K defined by the irreducible polynomial P with integer coefficients.

The result of this function is a vector v with 10 components (it is not a bnf, you need bnfinit for that), which for ease of presentation is in fact output as a one column matrix. First we describe the default behaviour (flag = 0):

v[1] is equal to the polynomial P. Note that for optimum performance, P should have gone through polred or nfinit(x,2).

v[2] is the 2-component vector [r1,r2], where r1 and r2 are as usual the number of real and half the number of complex embeddings of the number field K.

v[3] is the 2-component vector containing the field discriminant and the index.

v[4] is an integral basis in Hermite normal form.

v[5] ( v.clgp) is a 3-component vector containing the class number ( v.clgp.no), the structure of the class group as a product of cyclic groups of order n_i ( v.clgp.cyc), and the corresponding generators of the class group of respective orders n_i ( v.clgp.gen).

v[6] ( v.reg) is the regulator computed to an accuracy which is the maximum of an internally determined accuracy and of the default.

v[7] is a measure of the correctness of the result. If it is close to 1, the results are correct (under GRH). If it is close to a larger integer, this shows that the product of the class number by the regulator is off by a factor equal to this integer, and you must start again with a larger value for c or a different random seed, i.e.use the function setrand. (Since the computation involves a random process, starting again with exactly the same parameters may give the correct result.) In this case a warning message is printed.

v[8] ( v.tu) a vector with 2 components, the first being the number w of roots of unity in K and the second a primitive w-th root of unity expressed as a polynomial.

v[9] ( v.fu) is a system of fundamental units also expressed as polynomials.

v[10] gives a measure of the correctness of the computations of the fundamental units (not of the regulator), expressed as a number of bits. If this number is greater than 20, say, everything is OK. If v[10] <= 0, then we have lost all accuracy in computing the units (usually an error message will be printed and the units not given). In the intermediate cases, one must proceed with caution (for example by increasing the current precision).

If flag = 1, and the precision happens to be insufficient for obtaining the fundamental units exactly, the internal precision is doubled and the computation redone, until the exact results are obtained. The user should be warned that this can take a very long time when the coefficients of the fundamental units on the integral basis are very large, for example in the case of large real quadratic fields. In that case, there are alternate methods for representing algebraic numbers which are not implemented in PARI.

If flag = 2, the fundamental units and roots of unity are not computed. Hence the result has only 7 components, the first seven ones.

tech is a technical vector (empty by default) containing c, c2, nrel, borne, nbpid, minsfb, in this order (see the beginning of the section or the keyword bnf). You can supply any number of these provided you give an actual value to each of them (the "empty arg" trick won't work here). Careful use of these parameters may speed up your computations considerably.

The library syntax is bnfclassunit0(P,flag,tech,prec).

bnfclgp(P,{tech = []})  

as bnfclassunit, but only outputs v[5], i.e.the class group.

The library syntax is bnfclassgrouponly(P,tech,prec), where tech is as described under bnfclassunit.

bnfdecodemodule(nf,m)  

if m is a module as output in the first component of an extension given by bnrdisclist, outputs the true module.

The library syntax is decodemodule(nf,m).

bnfinit(P,{flag = 0},{tech = []})  

essentially identical to bnfclassunit except that the output contains a lot of technical data, and should not be printed out explicitly in general. The result of bnfinit is used in programs such as bnfisprincipal, bnfisunit or bnfnarrow. The result is a 10-component vector bnf.

* The first 6 and last 2 components are technical and in principle are not used by the casual user. However, for the sake of completeness, their description is as follows. We use the notations explained in the book by H. Cohen, A Course in Computational Algebraic Number Theory, Graduate Texts in Maths 138, Springer-Verlag, 1993, Section 6.5, and subsection 6.5.5 in particular.

bnf[1] contains the matrix W, i.e.the matrix in Hermite normal form giving relations for the class group on prime ideal generators (p_i)_{1 <= i <= r}.

bnf[2] contains the matrix B, i.e.the matrix containing the expressions of the prime ideal factorbase in terms of the p_i. It is an r x c matrix.

bnf[3] contains the complex logarithmic embeddings of the system of fundamental units which has been found. It is an (r_1+r_2) x (r_1+r_2-1) matrix.

bnf[4] contains the matrix M"_C of Archimedean components of the relations of the matrix (W|B).

bnf[5] contains the prime factor base, i.e.the list of prime ideals used in finding the relations.

bnf[6] contains the permutation of the prime factor base which was necessary to reduce the relation matrix to the form explained in subsection 6.5.5 of GTM138 (i.e.with a big c x c identity matrix on the lower right). Note that in the above mentioned book, the need to permute the rows of the relation matrices which occur was not emphasized.

bnf[9] is a 3-element row vector used in bnfisprincipal only and obtained as follows. Let D = U W V obtained by applying the Smith normal form algorithm to the matrix W ( = bnf[1]) and let U_r be the reduction of U modulo D. The first elements of the factorbase are given (in terms of bnf.gen) by the columns of U_r, with archimedian component g_a; let also GD_a be the archimedian components of the generators of the (principal) ideals defined by the bnf.gen[i]^bnf.cyc[i]. Then bnf[9] = [U_r, g_a, GD_a].

Finally, bnf[10] is by default unused and set equal to 0. This field is used to store further information about the field as it becomes available (which is rarely needed, hence would be too expensive to compute during the initial bnfinit call). For instance, the generators of the principal ideals bnf.gen[i]^bnf.cyc[i] (during a call to bnrisprincipal), or those corresponding to the relations in W and B (when the bnf internal precision needs to be increased).

* The less technical components are as follows:

bnf[7] or bnf.nf is equal to the number field data nf as would be given by nfinit.

bnf[8] is a vector containing the last 6 components of bnfclassunit[,1], i.e.the classgroup bnf.clgp, the regulator bnf.reg, the general "check" number which should be close to 1, the number of roots of unity and a generator bnf.tu, the fundamental units bnf.fu, and finally the check on their computation. If the precision becomes insufficient, GP outputs a warning ( fundamental units too large, not given) and does not strive to compute the units by default (flag = 0).

When flag = 1, GP insists on finding the fundamental units exactly, the internal precision being doubled and the computation redone, until the exact results are obtained. The user should be warned that this can take a very long time when the coefficients of the fundamental units on the integral basis are very large.

When flag = 2, on the contrary, it is initially agreed that GP will not compute units.

When flag = 3, computes a very small version of bnfinit, a "small big number field" (or sbnf for short) which contains enough information to recover the full bnf vector very rapidly, but which is much smaller and hence easy to store and print. It is supposed to be used in conjunction with bnfmake. The output is a 12 component vector v, as follows. Let bnf be the result of a full bnfinit, complete with units. Then v[1] is the polynomial P, v[2] is the number of real embeddings r_1, v[3] is the field discriminant, v[4] is the integral basis, v[5] is the list of roots as in the sixth component of nfinit, v[6] is the matrix MD of nfinit giving a Z-basis of the different, v[7] is the matrix W = bnf[1], v[8] is the matrix matalpha = bnf[2], v[9] is the prime ideal factor base bnf[5] coded in a compact way, and ordered according to the permutation bnf[6], v[10] is the 2-component vector giving the number of roots of unity and a generator, expressed on the integral basis, v[11] is the list of fundamental units, expressed on the integral basis, v[12] is a vector containing the algebraic numbers alpha corresponding to the columns of the matrix matalpha, expressed on the integral basis.

Note that all the components are exact (integral or rational), except for the roots in v[5]. In practice, this is the only component which a user is allowed to modify, by recomputing the roots to a higher accuracy if desired. Note also that the member functions will not work on sbnf, you have to use bnfmake explicitly first.

The library syntax is bnfinit0(P,flag,tech,prec).

bnfisintnorm(bnf,x)  

computes a complete system of solutions (modulo units of positive norm) of the absolute norm equation Norm(a) = x, where a is an integer in bnf. If bnf has not been certified, the correctness of the result depends on the validity of GRH.

The library syntax is bnfisintnorm(bnf,x).

bnfisnorm(bnf,x,{flag = 1})  

tries to tell whether the rational number x is the norm of some element y in bnf. Returns a vector [a,b] where x = Norm(a)*b. Looks for a solution which is an S-unit, with S a certain set of prime ideals containing (among others) all primes dividing x. If bnf is known to be Galois, set flag = 0 (in this case, x is a norm iff b = 1). If flag is non zero the program adds to S the following prime ideals, depending on the sign of flag. If flag > 0, the ideals of norm less than flag. And if flag < 0 the ideals dividing flag.

If you are willing to assume GRH, the answer is guaranteed (i.e.x is a norm iff b = 1), if S contains all primes less than 12log(disc(Bnf))^2, where Bnf is the Galois closure of bnf.

The library syntax is bnfisnorm(bnf,x,flag,prec), where flag and prec are longs.

bnfissunit(bnf,sfu,x)  

bnf being output by bnfinit, sfu by bnfsunit, gives the column vector of exponents of x on the fundamental S-units and the roots of unity. If x is not a unit, outputs an empty vector.

The library syntax is bnfissunit(bnf,sfu,x).

bnfisprincipal(bnf,x,{flag = 1})  

bnf being the number field data output by bnfinit, and x being either a Z-basis of an ideal in the number field (not necessarily in HNF) or a prime ideal in the format output by the function idealprimedec, this function tests whether the ideal is principal or not. The result is more complete than a simple true/false answer: it gives a row vector [v_1,v_2,check], where

v_1 is the vector of components c_i of the class of the ideal x in the class group, expressed on the generators g_i given by bnfinit (specifically bnf.clgp.gen which is the same as bnf[8][1][3]). The c_i are chosen so that 0 <= c_i < n_i where n_i is the order of g_i (the vector of n_i being bnf.clgp.cyc, that is bnf[8][1][2]).

v_2 gives on the integral basis the components of alpha such that x = alphaprod_ig_i^{c_i}. In particular, x is principal if and only if v_1 is equal to the zero vector, and if this the case x = alphaZ_K where alpha is given by v_2. Note that if alpha is too large to be given, a warning message will be printed and v_2 will be set equal to the empty vector.

Finally the third component check is analogous to the last component of bnfclassunit: it gives a check on the accuracy of the result, in bits. check should be at least 10, and preferably much more. In any case, the result is checked for correctness.

If flag = 0, outputs only v_1, which is much easier to compute.

If flag = 2, does as if flag were 0, but doubles the precision until a result is obtained.

If flag = 3, as in the default behaviour (flag = 1), but doubles the precision until a result is obtained.

The user is warned that these two last setting may induce very lengthy computations.

The library syntax is isprincipalall(bnf,x,flag).

bnfisunit(bnf,x)  

bnf being the number field data output by bnfinit and x being an algebraic number (type integer, rational or polmod), this outputs the decomposition of x on the fundamental units and the roots of unity if x is a unit, the empty vector otherwise. More precisely, if u_1,...,u_r are the fundamental units, and zeta is the generator of the group of roots of unity (found by bnfclassunit or bnfinit), the output is a vector [x_1,...,x_r,x_{r+1}] such that x = u_1^{x_1}...u_r^{x_r}.zeta^{x_{r+1}}. The x_i are integers for i <= r and is an integer modulo the order of zeta for i = r+1.

The library syntax is isunit(bnf,x).

bnfmake(sbnf)  

sbnf being a "small bnf" as output by bnfinit(x,3), computes the complete bnfinit information. The result is not identical to what bnfinit would yield, but is functionally identical. The execution time is very small compared to a complete bnfinit. Note that if the default precision in GP (or prec in library mode) is greater than the precision of the roots sbnf[5], these are recomputed so as to get a result with greater accuracy.

Note that the member functions are not available for sbnf, you have to use bnfmake explicitly first.

The library syntax is makebigbnf(sbnf,prec), where prec is a C long integer.

bnfnarrow(bnf)  

bnf being a big number field as output by bnfinit, computes the narrow class group of bnf. The output is a 3-component row vector v analogous to the corresponding class group component bnf.clgp ( bnf[8][1]): the first component is the narrow class number v.no, the second component is a vector containing the SNF cyclic components v.cyc of the narrow class group, and the third is a vector giving the generators of the corresponding v.gen cyclic groups. Note that this function is a special case of bnrclass.

The library syntax is buchnarrow(bnf).

bnfsignunit(bnf)  

bnf being a big number field output by bnfinit, this computes an r_1 x (r_1+r_2-1) matrix having ±1 components, giving the signs of the real embeddings of the fundamental units.

The library syntax is signunits(bnf).

bnfreg(bnf)  

bnf being a big number field output by bnfinit, computes its regulator.

The library syntax is regulator(bnf,tech,prec), where tech is as in bnfclassunit.

bnfsunit(bnf,S)  

computes the fundamental S-units of the number field bnf (output by bnfinit), where S is a list of prime ideals (output by idealprimedec). The output is a vector v with 6 components.

v[1] gives a minimal system of (integral) generators of the S-unit group modulo the unit group.

v[2] contains technical data needed by bnfissunit.

v[3] is an empty vector (used to give the logarithmic embeddings of the generators in v[1] in version 2.0.16).

v[4] is the S-regulator (this is the product of the regulator, the determinant of v[2] and the natural logarithms of the norms of the ideals in S).

v[5] gives the S-class group structure, in the usual format (a row vector whose three components give in order the S-class number, the cyclic components and the generators).

v[6] is a copy of S.

The library syntax is bnfsunit(bnf,S,prec).

bnfunit(bnf)  

bnf being a big number field as output by bnfinit, outputs a two-component row vector giving in the first component the vector of fundamental units of the number field, and in the second component the number of bit of accuracy which remained in the computation (which is always correct, otherwise an error message is printed). This function is mainly for people who used the wrong flag in bnfinit and would like to skip part of a lengthy bnfinit computation.

The library syntax is buchfu(bnf).

bnrL1(bnr,subgroup,{flag = 0})  

bnr being the number field data which is output by bnrinit(,,1) and subgroup being a square matrix defining a congruence subgroup of the ray class group corresponding to bnr (or 0 for the trivial congruence subgroup), returns for each character chi of the ray class group which is trivial on this subgroup, the value at s = 1 (or s = 0) of the abelian L-function associated to chi. For the value at s = 0, the function returns in fact for each character chi a vector [r_chi , c_chi] where r_chi is the order of L(s, chi) at s = 0 and c_chi the first non-zero term in the expansion of L(s, chi) at s = 0; in other words

L(s, chi) = c_chi.s^{r_chi} + O(s^{r_chi + 1})

near 0. flag is optional, default value is 0; its binary digits mean 1: compute at s = 1 if set to 1 or s = 0 if set to 0, 2: compute the primitive L-functions associated to chi if set to 0 or the L-function with Euler factors at prime ideals dividing the modulus of bnr removed if set to 1 (this is the so-called L_S(s, chi) function where S is the set of infinite places of the number field together with the finite prime ideals dividing the modulus of bnr, see the example below), 3: returns also the character.

Example:

bnf = bnfinit(x^2 - 229);
 bnr = bnrinit(bnf,1,1);
 bnrL1(bnr, 0)

returns the order and the first non-zero term of the abelian L-functions L(s, chi) at s = 0 where chi runs through the characters of the class group of Q(sqrt{229}). Then

bnr2 = bnrinit(bnf,2,1);
 bnrL1(bnr2,0,2)

returns the order and the first non-zero terms of the abelian L-functions L_S(s, chi) at s = 0 where chi runs through the characters of the class group of Q(sqrt{229}) and S is the set of infinite places of Q(sqrt{229}) together with the finite prime 2 (note that the ray class group modulo 2 is in fact the class group, so bnrL1(bnr2,0) returns exactly the same answer as bnrL1(bnr,0)!).

The library syntax is bnrL1(bnr,subgroup,flag,prec)

bnrclass(bnf,ideal,{flag = 0})  

bnf being a big number field as output by bnfinit (the units are mandatory unless the ideal is trivial), and ideal being either an ideal in any form or a two-component row vector containing an ideal and an r_1-component row vector of flags indicating which real Archimedean embeddings to take in the module, computes the ray class group of the number field for the module ideal, as a 3-component vector as all other finite Abelian groups (cardinality, vector of cyclic components, corresponding generators).

If flag = 2, the output is different. It is a 6-component vector w. w[1] is bnf. w[2] is the result of applying idealstar(bnf,I,2). w[3], w[4] and w[6] are technical components used only by the function bnrisprincipal. w[5] is the structure of the ray class group as would have been output with flag = 0.

If flag = 1, as above, except that the generators of the ray class group are not computed, which saves time.

The library syntax is bnrclass0(bnf,ideal,flag,prec).

bnrclassno(bnf,I)  

bnf being a big number field as output by bnfinit (units are mandatory unless the ideal is trivial), and I being either an ideal in any form or a two-component row vector containing an ideal and an r_1-component row vector of flags indicating which real Archimedean embeddings to take in the modulus, computes the ray class number of the number field for the modulus I. This is faster than bnrclass and should be used if only the ray class number is desired.

The library syntax is rayclassno(bnf,I).

bnrclassnolist(bnf,list)  

bnf being a big number field as output by bnfinit (units are mandatory unless the ideal is trivial), and list being a list of modules as output by ideallist of ideallistarch, outputs the list of the class numbers of the corresponding ray class groups.

The library syntax is rayclassnolist(bnf,list).

bnrconductor(a_1,{a_2},{a_3}, {flag = 0})  

conductor of the subfield of a ray class field as defined by [a_1,a_2,a_3] (see bnr at the beginning of this section).

The library syntax is bnrconductor(a_1,a_2,a_3,flag,prec), where an omitted argument among the a_i is input as gzero, and flag is a C long.

bnrconductorofchar(bnr,chi)  

bnr being a big ray number field as output by bnrclass, and chi being a row vector representing a character as expressed on the generators of the ray class group, gives the conductor of this character as a modulus.

The library syntax is bnrconductorofchar(bnr,chi,prec) where prec is a long.

bnrdisc(a1,{a2},{a3},{flag = 0})  

a1, a2, a3 defining a big ray number field L over a groud field K (see bnr at the beginning of this section for the meaning of a1, a2, a3), outputs a 3-component row vector [N,R_1,D], where N is the (absolute) degree of L, R_1 the number of real places of L, and D the discriminant of L/Q, including sign (if flag = 0).

If flag = 1, as above but outputs relative data. N is now the degree of L/K, R_1 is the number of real places of K unramified in L (so that the number of real places of L is equal to R_1 times the relative degree N), and D is the relative discriminant ideal of L/K.

If flag = 2, does as in case 0, except that if the modulus is not the exact conductor corresponding to the L, no data is computed and the result is 0 ( gzero).

If flag = 3, as case 2, outputting relative data.

The library syntax is bnrdisc0(a1,a2,a3,flag,prec).

bnrdisclist(bnf,bound,{arch},{flag = 0})  

bnf being a big number field as output by bnfinit (the units are mandatory), computes a list of discriminants of Abelian extensions of the number field by increasing modulus norm up to bound bound, where the ramified Archimedean places are given by arch (unramified at infinity if arch is void or omitted). If flag is non-zero, give arch all the possible values. (See bnr at the beginning of this section for the meaning of a1, a2, a3.)

The alternative syntax bnrdisclist(bnf,list) is supported, where list is as output by ideallist or ideallistarch (with units).

The output format is as follows. The output v is a row vector of row vectors, allowing the bound to be greater than 2^{16} for 32-bit machines, and v[i][j] is understood to be in fact V[2^{15}(i-1)+j] of a unique big vector V (note that 2^{15} is hardwired and can be increased in the source code only on 64-bit machines and higher).

Such a component V[k] is itself a vector W (maybe of length 0) whose components correspond to each possible ideal of norm k. Each component W[i] corresponds to an Abelian extension L of bnf whose modulus is an ideal of norm k and no Archimedean components (hence the extension is unramified at infinity). The extension W[i] is represented by a 4-component row vector [m,d,r,D] with the following meaning. m is the prime ideal factorization of the modulus, d = [L:Q] is the absolute degree of L, r is the number of real places of L, and D is the factorization of the absolute discriminant. Each prime ideal pr = [p,alpha,e,f,beta] in the prime factorization m is coded as p.n^2+(f-1).n+(j-1), where n is the degree of the base field and j is such that

pr = idealprimedec(nf,p)[j].

m can be decoded using bnfdecodemodule.

The library syntax is bnrdisclist0(a1,a2,a3,bound,arch,flag).

bnrinit(bnf,ideal,{flag = 0})  

bnf is as output by bnfinit, ideal is a valid ideal (or a module), initializes data linked to the ray class group structure corresponding to this module. This is the same as bnrclass(bnf,ideal,flag+1).

The library syntax is bnrinit0(bnf,ideal,flag,prec).

bnrisconductor(a1,{a2},{a3})  

a1, a2, a3 represent an extension of the base field, given by class field theory for some modulus encoded in the parameters. Outputs 1 if this modulus is the conductor, and 0 otherwise. This is slightly faster than bnrconductor.

The library syntax is bnrisconductor(a1,a2,a3) and the result is a long.

bnrisprincipal(bnr,x,{flag = 1})  

bnr being the number field data which is output by bnrinit and x being an ideal in any form, outputs the components of x on the ray class group generators in a way similar to bnfisprincipal. That is a 3-component vector v where v[1] is the vector of components of x on the ray class group generators, v[2] gives on the integral basis an element alpha such that x = alphaprod_ig_i^{x_i}. Finally v[3] indicates the number of bits of accuracy left in the result. In any case the result is checked for correctness, but v[3] is included to see if it is necessary to increase the accuracy in other computations.

If flag = 0, outputs only v_1.

The settings flag = 2 or 3 are not available in this case.

The library syntax is isprincipalrayall(bnr,x,flag).

bnrrootnumber(bnr,chi,{flag = 0})  

if chi = chi is a (not necessarily primitive) character over bnr, let L(s,chi) = sum_{id} chi(id) N(id)^{-s} be the associated Artin L-function. Returns the so-called Artin root number, i.e.the complex number W(chi) of modulus 1 such that

Lambda(1-s,chi) = W(chi) Lambda(s,\overline{chi})

where Lambda(s,chi) = A(chi)^{s/2}gamma_chi(s) L(s,chi) is the enlarged L-function associated to L.

The generators of the ray class group are needed, and you can set flag = 1 if the character is known to be primitive. Example:

bnf = bnfinit(x^2 - 145);
 bnr = bnrinit(bnf,7,1);
 bnrrootnumber(bnr, [5])

returns the root number of the character chi of Cl_7(Q(sqrt{145})) such that chi(g) = zeta^5, where g is the generator of the ray-class field and zeta = e^{2iPi/N} where N is the order of g (N = 12 as bnr.cyc readily tells us).

The library syntax is bnrrootnumber(bnf,chi,flag)

bnrstark{(bnr,subgroup,{flag = 0})}  

bnr being as output by bnrinit(,,1), finds a relative equation for the class field corresponding to the modulus in bnr and the given congruence subgroup using Stark units (set subgroup = 0 if you want the whole ray class group). The main variable of bnr must not be x, and the ground field and the class field must be totally real and not isomorphic to Q (over the rationnals, use polsubcyclo or galoissubcyclo). flag is optional and may be set to 0 to obtain a reduced relative polynomial, 1 to be satisfied with any relative polynomial, 2 to obtain an absolute polynomial and 3 to obtain the irreducible relative polynomial of the Stark unit, 0 being default. Example:

bnf = bnfinit(y^2 - 3);
 bnr = bnrinit(bnf, 5, 1);
 bnrstark(bnr, 0)

returns the ray class field of Q(sqrt{3}) modulo 5.

Remark. The result of the computation depends on the choice of a modulus verifying special conditions. By default the function will try few moduli, choosing the one giving the smallest result. In some cases where the result is however very large, you can tell the function to try more moduli by adding 4 to the value of flag. Whether this flag is set or not, the function may fail in some extreme cases, returning the error message

"Cannot find a suitable modulus in FindModule".

In this case, the corresponding congruence group is a product of cyclic groups and, for the time being, the class field has to be obtained by splitting this group into its cyclic components.

The library syntax is bnrstark(bnr,subgroup,flag).

dirzetak(nf,b)  

gives as a vector the first b coefficients of the Dedekind zeta function of the number field nf considered as a Dirichlet series.

The library syntax is dirzetak(nf,b).

factornf(x,t)  

factorization of the univariate polynomial x over the number field defined by the (univariate) polynomial t. x may have coefficients in Q or in the number field. The main variable of t must be of lower priority than that of x (in other words the variable number of t must be greater than that of x). However if the coefficients of the number field occur explicitly (as polmods) as coefficients of x, the variable of these polmods must be the same as the main variable of t. For example

? factornf(x^2 + Mod(y, y^2+1), y^2+1);
 ? factornf(x^2 + 1, y^2+1); \\ these two are OK

 ? factornf(x^2 + Mod(z,z^2+1), y^2+1)   *** incorrect type in gmulsg

The library syntax is polfnf(x,t).

galoisfixedfield(gal,perm,{fl = 0},{v = y}))  

gal being be a Galois field as output by galoisinit and perm an element of gal.group or a vector of such elements, computes the fixed field of gal by the automorphism defined by the permutations perm of the roots gal.roots. P is guaranteed to be squarefree modulo gal.p.

If no flags or flag = 0, output format is the same as for nfsubfield, returning [P,x] such that P is a polynomial defining the fixed field, and x is a root of P expressed as a polmod in gal.pol.

If flag = 1 return only the polynomial P.

If flag = 2 return [P,x,F] where P and x are as above and F is the factorization of gal.pol over the field defined by P, where variable v (y by default) stands for a root of P. The priority of v must be less than the priority of the variable of gal.pol.

Example:

G = galoisinit(x^4+1);
 galoisfixedfield(G,G.group[2],2)
   [x^2 + 2, Mod(x^3 + x, x^4 + 1), [x^2 - y*x - 1, x^2 + y*x - 1]]

computes the factorization x^4+1 = (x^2-sqrt{-2}x-1)(x^2+sqrt{-2}x-1)

The library syntax is galoisfixedfield(gal,perm,p).

galoisinit(pol,{den})  

computes the Galois group and all neccessary information for computing the fixed fields of the Galois extension K/Q where K is the number field defined by pol (monic irreducible polynomial in Z[X] or a number field as output by nfinit). The extension K/Q must be Galois with Galois group "weakly" super-solvable (see nfgaloisconj)

Warning: The interface of this function is experimental, so the described output can be subject to important changes in the near future. However the function itself should work as described. For any remarks about this interface, please mail allomber@math.u-bordeaux.fr.

The output is an 8-component vector gal.

gal[1] contains the polynomial pol ( gal.pol).

gal[2] is a three--components vector [p,e,q] where p is a prime number ( gal.p) such that pol totally split modulo p , e is an integer and q = p^e ( gal.mod) is the modulus of the roots in gal.roots.

gal[3] is a vector L containing the p-adic roots of pol as integers implicitly modulo gal.mod. ( gal.roots).

gal[4] is the inverse of the Van der Monde matrix of the p-adic roots of pol, multiplied by gal[5].

gal[5] is a multiple of the least common denominator of the automorphisms expressed as polynomial in a root of pol.

gal[6] is the Galois group G expressed as a vector of permutations of L ( gal.group).

gal[7] is a generating subset S = [s_1,...,s_g] of G expressed as a vector of permutations of L ( gal.gen).

gal[8] contains the relative orders [o_1,...,o_g] of the generators of S ( gal.orders).

Let H be the maximal normal supersolvable subgroup of G, we have the following properties:

* if G/H ~ A_4 then [o_1,...,o_g] ends by [2,2,3].

* if G/H ~ S_4 then [o_1,...,o_g] ends by [2,2,3,2].

* else G is super-solvable.

* for 1 <= i <= g the subgroup of G generated by [s_1,...,s_g] is normal, with the exception of i = g-2 in the second case and of i = g-3 in the third.

* the relative order o_i of s_i is its order in the quotient group G/ <s_1,...,s_{i-1} >, with the same exceptions.

* for any x belongs to G there exists a unique family [e_1,...,e_g] such that (no exceptions):

-- for 1 <= i <= g we have 0 <= e_i < o_i -- x = g_1^{e_1}g_2^{e_2}...g_n^{e_n}

If present den must be a suitable value for gal[5].

The library syntax is galoisinit(gal,den).

galoispermtopol(gal,perm)  

gal being a galois field as output by galoisinit and perm a element of gal.group, return the polynomial defining the Galois automorphism, as output by nfgaloisconj, associated with the permutation perm of the roots gal.roots. perm can also be a vector or matrix, in this case, galoispermtopol is applied to all components recursively.

Note that

G = galoisinit(pol);
 galoispermtopol(G, G[6])~

is equivalent to nfgaloisconj(pol), if degree of pol is greater or equal to 2.

The library syntax is galoispermtopol(gal,perm).

galoissubcyclo(n,H,{Z},{v})  

compute a polynomial defining the subfield of Q(zeta_n) fixed by the subgroup H of Z/nZ. The subgroup H can be given by a generator, a set of generators given by a vector or a HNF matrix. If present Z must be znstar(n), and is currently only used when H is a HNF matrix. If v is given, the polynomial is given in the variable v.

The following function can be used to compute all subfields of Q(zeta_n) (of order less than d, if d is set):

subcyclo(n, d = -1)=
 {
   local(Z,G,S);
   if (d < 0, d = n);
   Z = znstar(n);
   G = matdiagonal(Z[2]);
   S = [];
   forsubgroup(H = G, d,
     S = concat(S, galoissubcyclo(n, mathnf(concat(G,H)),Z));
   );
   S
 }

The library syntax is galoissubcyclo(n,H,Z,v) where n is a C long integer.

idealadd(nf,x,y)  

sum of the two ideals x and y in the number field nf. When x and y are given by Z-bases, this does not depend on nf and can be used to compute the sum of any two Z-modules. The result is given in HNF.

The library syntax is idealadd(nf,x,y).

idealaddtoone(nf,x,{y})  

x and y being two co-prime integral ideals (given in any form), this gives a two-component row vector [a,b] such that a belongs to x, b belongs to y and a+b = 1.

The alternative syntax idealaddtoone(nf,v), is supported, where v is a k-component vector of ideals (given in any form) which sum to Z_K. This outputs a k-component vector e such that e[i] belongs to x[i] for 1 <= i <= k and sum_{1 <= i <= k}e[i] = 1.

The library syntax is idealaddtoone0(nf,x,y), where an omitted y is coded as NULL.

idealappr(nf,x,{flag = 0})  

if x is a fractional ideal (given in any form), gives an element alpha in nf such that for all prime ideals p such that the valuation of x at p is non-zero, we have v_{p}(alpha) = v_{p}(x), and. v_{p}(alpha) >= 0 for all other {p}.

If flag is non-zero, x must be given as a prime ideal factorization, as output by idealfactor, but possibly with zero or negative exponents. This yields an element alpha such that for all prime ideals p occurring in x, v_{p}(alpha) is equal to the exponent of p in x, and for all other prime ideals, v_{p}(alpha) >= 0. This generalizes idealappr(nf,x,0) since zero exponents are allowed. Note that the algorithm used is slightly different, so that idealapp(nf,idealfactor(nf,x)) may not be the same as idealappr(nf,x,1).

The library syntax is idealappr0(nf,x,flag).

idealchinese(nf,x,y)  

x being a prime ideal factorization (i.e.a 2 by 2 matrix whose first column contain prime ideals, and the second column integral exponents), y a vector of elements in nf indexed by the ideals in x, computes an element b such that

v_p(b - y_p) >= v_p(x) for all prime ideals in x and v_p(b) >= 0 for all other p.

The library syntax is idealchinese(nf,x,y).

idealcoprime(nf,x,y)  

given two integral ideals x and y in the number field nf, finds a beta in the field, expressed on the integral basis nf[7], such that beta.y is an integral ideal coprime to x.

The library syntax is idealcoprime(nf,x).

idealdiv(nf,x,y,{flag = 0})  

quotient x.y^{-1} of the two ideals x and y in the number field nf. The result is given in HNF.

If flag is non-zero, the quotient x.y^{-1} is assumed to be an integral ideal. This can be much faster when the norm of the quotient is small even though the norms of x and y are large.

The library syntax is idealdiv0(nf,x,y,flag). Also available are idealdiv(nf,x,y) (flag = 0) and idealdivexact(nf,x,y) (flag = 1).

idealfactor(nf,x)  

factors into prime ideal powers the ideal x in the number field nf. The output format is similar to the factor function, and the prime ideals are represented in the form output by the idealprimedec function, i.e.as 5-element vectors.

The library syntax is idealfactor(nf,x).

idealhnf(nf,a,{b})  

gives the Hermite normal form matrix of the ideal a. The ideal can be given in any form whatsoever (typically by an algebraic number if it is principal, by a Z_K-system of generators, as a prime ideal as given by idealprimedec, or by a Z-basis).

If b is not omitted, assume the ideal given was aZ_K+bZ_K, where a and b are elements of K given either as vectors on the integral basis nf[7] or as algebraic numbers.

The library syntax is idealhnf0(nf,a,b) where an omitted b is coded as NULL. Also available is idealhermite(nf,a) (b omitted).

idealintersect(nf,x,y)  

intersection of the two ideals x and y in the number field nf. When x and y are given by Z-bases, this does not depend on nf and can be used to compute the intersection of any two Z-modules. The result is given in HNF.

The library syntax is idealintersect(nf,x,y).

idealinv(nf,x)  

inverse of the ideal x in the number field nf. The result is the Hermite normal form of the inverse of the ideal, together with the opposite of the Archimedean information if it is given.

The library syntax is idealinv(nf,x).

ideallist(nf,bound,{flag = 4})  

computes the list of all ideals of norm less or equal to bound in the number field nf. The result is a row vector with exactly bound components. Each component is itself a row vector containing the information about ideals of a given norm, in no specific order. This information can be either the HNF of the ideal or the idealstar with possibly some additional information.

If flag is present, its binary digits are toggles meaning

1: give also the generators in the idealstar.

2: output [L,U], where L is as before and U is a vector of zinternallogs of the units.

4: give only the ideals and not the idealstar or the ideallog of the units.

The library syntax is ideallist0(nf,bound,flag), where bound must be a C long integer. Also available is ideallist(nf,bound), corresponding to the case flag = 0.

ideallistarch(nf,list,{arch = []},{flag = 0})  

vector of vectors of all idealstarinit (see idealstar) of all modules in list, with Archimedean part arch added (void if omitted). list is a vector of big ideals, as output by ideallist(..., flag) for instance. flag is optional; its binary digits are toggles meaning: 1: give generators as well, 2: list format is [L,U] (see ideallist).

The library syntax is ideallistarch0(nf,list,arch,flag), where an omitted arch is coded as NULL.

ideallog(nf,x,bid)  

nf being a number field, bid being a "big ideal" as output by idealstar and x being a non-necessarily integral element of nf which must have valuation equal to 0 at all prime ideals dividing I = bid[1], computes the "discrete logarithm" of x on the generators given in bid[2]. In other words, if g_i are these generators, of orders d_i respectively, the result is a column vector of integers (x_i) such that 0 <= x_i < d_i and x = prod_ig_i^{x_i} (mod ^*I) . Note that when I is a module, this implies also sign conditions on the embeddings.

The library syntax is zideallog(nf,x,bid).

idealmin(nf,x,{vdir})  

computes a minimum of the ideal x in the direction vdir in the number field nf.

The library syntax is minideal(nf,x,vdir,prec), where an omitted vdir is coded as NULL.

idealmul(nf,x,y,{flag = 0})  

ideal multiplication of the ideals x and y in the number field nf. The result is a generating set for the ideal product with at most n elements, and is in Hermite normal form if either x or y is in HNF or is a prime ideal as output by idealprimedec, and this is given together with the sum of the Archimedean information in x and y if both are given.

If flag is non-zero, reduce the result using idealred.

The library syntax is idealmul(nf,x,y) (flag = 0) or idealmulred(nf,x,y,prec) (flag ! = 0), where as usual, prec is a C long integer representing the precision.

idealnorm(nf,x)  

computes the norm of the idealx in the number fieldnf.

The library syntax is idealnorm(nf, x).

idealpow(nf,x,k,{flag = 0})  

computes the k-th power of the ideal x in the number field nf. k can be positive, negative or zero. The result is NOT reduced, it is really the k-th ideal power, and is given in HNF.

If flag is non-zero, reduce the result using idealred. Note however that this is NOT the same as as idealpow(nf,x,k) followed by reduction, since the reduction is performed throughout the powering process.

The library syntax corresponding to flag = 0 is idealpow(nf,x,k). If k is a long, you can use idealpows(nf,x,k). Corresponding to flag = 1 is idealpowred(nf,vp,k,prec), where prec is a long.

idealprimedec(nf,p)  

computes the prime ideal decomposition of the prime number p in the number field nf. p must be a (positive) prime number. Note that the fact that p is prime is not checked, so if a non-prime number p is given it may lead to unpredictable results.

The result is a vector of 5-component vectors, each representing one of the prime ideals above p in the number field nf. The representation vp = [p,a,e,f,b] of a prime ideal means the following. The prime ideal is equal to pZ_K+alphaZ_K where Z_K is the ring of integers of the field and alpha = sum_i a_iomega_i where the omega_i form the integral basis nf.zk, e is the ramification index, f is the residual index, and b is an n-component column vector representing a beta belongs to Z_K such that vp^{-1} = Z_K+beta/pZ_K which will be useful for computing valuations, but which the user can ignore. The number alpha is guaranteed to have a valuation equal to 1 at the prime ideal (this is automatic if e > 1).

The library syntax is idealprimedec(nf,p).

idealprincipal(nf,x)  

creates the principal ideal generated by the algebraic number x (which must be of type integer, rational or polmod) in the number field nf. The result is a one-column matrix.

The library syntax is principalideal(nf,x).

idealred(nf,I,{vdir = 0})  

LLL reduction of the ideal I in the number field nf, along the direction vdir. If vdir is present, it must be an r1+r2-component vector (r1 and r2 number of real and complex places of nf as usual).

This function finds a "small" a in I (it is an LLL pseudo-minimum along direction vdir). The result is the Hermite normal form of the LLL-reduced ideal r I/a, where r is a rational number such that the resulting ideal is integral and primitive. This is often, but not always, a reduced ideal in the sense of Buchmann. If I is an idele, the logarithmic embeddings of a are subtracted to the Archimedean part.

More often than not, a principal ideal will yield the identity matrix. This is a quick and dirty way to check if ideals are principal without computing a full bnf structure, but it's not a necessary condition; hence, a non-trivial result doesn't prove the ideal is non-trivial in the class group.

Note that this is not the same as the LLL reduction of the lattice I since ideal operations are involved.

The library syntax is ideallllred(nf,x,vdir,prec), where an omitted vdir is coded as NULL.

idealstar(nf,I,{flag = 1})  

nf being a number field, and I either and ideal in any form, or a row vector whose first component is an ideal and whose second component is a row vector of r_1 0 or 1, outputs necessary data for computing in the group (Z_K/I)^*.

If flag = 2, the result is a 5-component vector w. w[1] is the ideal or module I itself. w[2] is the structure of the group. The other components are difficult to describe and are used only in conjunction with the function ideallog.

If flag = 1 (default), as flag = 2, but do not compute explicit generators for the cyclic components, which saves time.

If flag = 0, computes the structure of (Z_K/I)^* as a 3-component vector v. v[1] is the order, v[2] is the vector of SNF cyclic components and v[3] the corresponding generators. When the row vector is explicitly included, the non-zero elements of this vector are considered as real embeddings of nf in the order given by polroots, i.e.in nf[6] ( nf.roots), and then I is a module with components at infinity.

To solve discrete logarithms (using ideallog), you have to choose flag = 2.

The library syntax is idealstar0(nf,I,flag).

idealtwoelt(nf,x,{a})  

computes a two-element representation of the ideal x in the number field nf, using a straightforward (exponential time) search. x can be an ideal in any form, (including perhaps an Archimedean part, which is ignored) and the result is a row vector [a,alpha] with two components such that x = aZ_K+alphaZ_K and a belongs to Z, where a is the one passed as argument if any. If x is given by at least two generators, a is chosen to be the positive generator of xcapZ.

Note that when an explicit a is given, we use an asymptotically faster method, however in practice it is usually slower.

The library syntax is ideal_two_elt0(nf,x,a), where an omitted a is entered as NULL.

idealval(nf,x,vp)  

gives the valuation of the ideal x at the prime ideal vp in the number field nf, where vp must be a 5-component vector as given by idealprimedec.

The library syntax is idealval(nf,x,vp), and the result is a long integer.

ideleprincipal(nf,x)  

creates the principal idele generated by the algebraic number x (which must be of type integer, rational or polmod) in the number field nf. The result is a two-component vector, the first being a one-column matrix representing the corresponding principal ideal, and the second being the vector with r_1+r_2 components giving the complex logarithmic embedding of x.

The library syntax is principalidele(nf,x).

matalgtobasis(nf,x)  

nf being a number field in nfinit format, and x a matrix whose coefficients are expressed as polmods in nf, transforms this matrix into a matrix whose coefficients are expressed on the integral basis of nf. This is the same as applying nfalgtobasis to each entry, but it would be dangerous to use the same name.

The library syntax is matalgtobasis(nf,x).

matbasistoalg(nf,x)  

nf being a number field in nfinit format, and x a matrix whose coefficients are expressed as column vectors on the integral basis of nf, transforms this matrix into a matrix whose coefficients are algebraic numbers expressed as polmods. This is the same as applying nfbasistoalg to each entry, but it would be dangerous to use the same name.

The library syntax is matbasistoalg(nf,x).

modreverse(a)  

a being a polmod A(X) modulo T(X), finds the "reverse polmod" B(X) modulo Q(X), where Q is the minimal polynomial of a, which must be equal to the degree of T, and such that if theta is a root of T then theta = B(alpha) for a certain root alpha of Q.

This is very useful when one changes the generating element in algebraic extensions.

The library syntax is polmodrecip(x).

newtonpoly(x,p)  

gives the vector of the slopes of the Newton polygon of the polynomial x with respect to the prime number p. The n components of the vector are in decreasing order, where n is equal to the degree of x. Vertical slopes occur iff the constant coefficient of x is zero and are denoted by VERYBIGINT, the biggest single precision integer representable on the machine (2^{31}-1 (resp.2^{63}-1) on 32-bit (resp.64-bit) machines), see Section (??).

The library syntax is newtonpoly(x,p).

nfalgtobasis(nf,x)  

this is the inverse function of nfbasistoalg. Given an object x whose entries are expressed as algebraic numbers in the number field nf, transforms it so that the entries are expressed as a column vector on the integral basis nf.zk.

The library syntax is algtobasis(nf,x).

nfbasis(x,{flag = 0},{p})  

integral basis of the number field defined by the irreducible, preferably monic, polynomial x, using a modified version of the round 4 algorithm by default. The binary digits of flag have the following meaning:

1: assume that no square of a prime greater than the default primelimit divides the discriminant of x, i.e.that the index of x has only small prime divisors.

2: use round 2 algorithm. For small degrees and coefficient size, this is sometimes a little faster. (This program is the translation into C of a program written by David Ford in Algeb.)

Thus for instance, if flag = 3, this uses the round 2 algorithm and outputs an order which will be maximal at all the small primes.

If p is present, we assume (without checking!) that it is the two-column matrix of the factorization of the discriminant of the polynomial x. Note that it does not have to be a complete factorization. This is especially useful if only a local integral basis for some small set of places is desired: only factors with exponents greater or equal to 2 will be considered.

The library syntax is nfbasis0(x,flag,p). An extended version is nfbasis(x,&d,flag,p), where d will receive the discriminant of the number field (not of the polynomial x), and an omitted p should be input as gzero. Also available are base(x,&d) (flag = 0), base2(x,&d) (flag = 2) and factoredbase(x,p,&d).

nfbasistoalg(nf,x)  

this is the inverse function of nfalgtobasis. Given an object x whose entries are expressed on the integral basis nf.zk, transforms it into an object whose entries are algebraic numbers (i.e.polmods).

The library syntax is basistoalg(nf,x).

nfdetint(nf,x)  

given a pseudo-matrix x, computes a non-zero ideal contained in (i.e.multiple of) the determinant of x. This is particularly useful in conjunction with nfhnfmod.

The library syntax is nfdetint(nf,x).

nfdisc(x,{flag = 0},{p})  

field discriminant of the number field defined by the integral, preferably monic, irreducible polynomial x. flag and p are exactly as in nfbasis. That is, p provides the matrix of a partial factorization of the discriminant of x, and binary digits of flag are as follows:

1: assume that no square of a prime greater than primelimit divides the discriminant.

2: use the round 2 algorithm, instead of the default round 4. This should be slower except maybe for polynomials of small degree and coefficients.

The library syntax is nfdiscf0(x,flag,p) where, to omit p, you should input gzero. You can also use discf(x) (flag = 0).

nfeltdiv(nf,x,y)  

given two elements x and y in nf, computes their quotient x/y in the number field nf.

The library syntax is element_div(nf,x,y).

nfeltdiveuc(nf,x,y)  

given two elements x and y in nf, computes an algebraic integer q in the number field nf such that the components of x-qy are reasonably small. In fact, this is functionally identical to round(nfeltdiv(nf,x,y)).

The library syntax is nfdiveuc(nf,x,y).

nfeltdivmodpr(nf,x,y,pr)  

given two elements x and y in nf and pr a prime ideal in modpr format (see nfmodprinit), computes their quotient x / y modulo the prime ideal pr.

The library syntax is element_divmodpr(nf,x,y,pr).

nfeltdivrem(nf,x,y)  

given two elements x and y in nf, gives a two-element row vector [q,r] such that x = qy+r, q is an algebraic integer in nf, and the components of r are reasonably small.

The library syntax is nfdivres(nf,x,y).

nfeltmod(nf,x,y)  

given two elements x and y in nf, computes an element r of nf of the form r = x-qy with q and algebraic integer, and such that r is small. This is functionally identical to x - nfeltmul(nf,round(nfeltdiv(nf,x,y)),y).

The library syntax is nfmod(nf,x,y).

nfeltmul(nf,x,y)  

given two elements x and y in nf, computes their product x*y in the number field nf.

The library syntax is element_mul(nf,x,y).

nfeltmulmodpr(nf,x,y,pr)  

given two elements x and y in nf and pr a prime ideal in modpr format (see nfmodprinit), computes their product x*y modulo the prime ideal pr.

The library syntax is element_mulmodpr(nf,x,y,pr).

nfeltpow(nf,x,k)  

given an element x in nf, and a positive or negative integer k, computes x^k in the number field nf.

The library syntax is element_pow(nf,x,k).

nfeltpowmodpr(nf,x,k,pr)  

given an element x in nf, an integer k and a prime ideal pr in modpr format (see nfmodprinit), computes x^k modulo the prime ideal pr.

The library syntax is element_powmodpr(nf,x,k,pr).

nfeltreduce(nf,x,ideal)  

given an ideal in Hermite normal form and an element x of the number field nf, finds an element r in nf such that x-r belongs to the ideal and r is small.

The library syntax is element_reduce(nf,x,ideal).

nfeltreducemodpr(nf,x,pr)  

given an element x of the number field nf and a prime ideal pr in modpr format compute a canonical representative for the class of x modulo pr.

The library syntax is nfreducemodpr2(nf,x,pr).

nfeltval(nf,x,pr)  

given an element x in nf and a prime ideal pr in the format output by idealprimedec, computes their the valuation at pr of the element x. The same result could be obtained using idealval(nf,x,pr) (since x would then be converted to a principal ideal), but it would be less efficient.

The library syntax is element_val(nf,x,pr), and the result is a long.

nffactor(nf,x)  

factorization of the univariate polynomial x over the number field nf given by nfinit. x has coefficients in nf (i.e.either scalar, polmod, polynomial or column vector). The main variable of nf must be of lower priority than that of x (in other words, the variable number of nf must be greater than that of x). However if the polynomial defining the number field occurs explicitly in the coefficients of x (as modulus of a t_POLMOD), its main variable must be the same as the main variable of x. For example,

? nf = nfinit(y^2 + 1);
 ? nffactor(nf, x^2 + y); \\ OK

 ? nffactor(nf, x^2 + Mod(y, y^2+1)); \\ OK

 ? nffactor(nf, x^2 + Mod(z, z^2+1)); \\ WRONG

The library syntax is nffactor(nf,x).

nffactormod(nf,x,pr)  

factorization of the univariate polynomial x modulo the prime ideal pr in the number field nf. x can have coefficients in the number field (scalar, polmod, polynomial, column vector) or modulo the prime ideal (integermod modulo the rational prime under pr, polmod or polynomial with integermod coefficients, column vector of integermod). The prime ideal pr must be in the format output by idealprimedec. The main variable of nf must be of lower priority than that of x (in other words the variable number of nf must be greater than that of x). However if the coefficients of the number field occur explicitly (as polmods) as coefficients of x, the variable of these polmods must be the same as the main variable of t (see nffactor).

The library syntax is nffactormod(nf,x,pr).

nfgaloisapply(nf,aut,x)  

nf being a number field as output by nfinit, and aut being a Galois automorphism of nf expressed either as a polynomial or a polmod (such automorphisms being found using for example one of the variants of nfgaloisconj), computes the action of the automorphism aut on the object x in the number field. x can be an element (scalar, polmod, polynomial or column vector) of the number field, an ideal (either given by Z_K-generators or by a Z-basis), a prime ideal (given as a 5-element row vector) or an idele (given as a 2-element row vector). Because of possible confusion with elements and ideals, other vector or matrix arguments are forbidden.

The library syntax is galoisapply(nf,aut,x).

nfgaloisconj(nf,{flag = 0},{d})  

nf being a number field as output by nfinit, computes the conjugates of a root r of the non-constant polynomial x = nf[1] expressed as polynomials in r. This can be used even if the number field nf is not Galois since some conjugates may lie in the field. As a note to old-timers of PARI, starting with version 2.0.17 this function works much better than in earlier versions.

nf can simply be a polynomial if flag ! = 1.

If no flags or flag = 0, if nf is a number field use a combination of flag 4 and 1 and the result is always complete, else use a combination of flag 4 and 2 and the result is subject to the restriction of flag = 2, but a warning is issued when it is not proven complete.

If flag = 1, use nfroots (require a number field).

If flag = 2, use complex approximations to the roots and an integral LLL. The result is not guaranteed to be complete: some conjugates may be missing (no warning issued), especially so if the corresponding polynomial has a huge index. In that case, increasing the default precision may help.

If flag = 4, use Allombert's algorithm and permutation testing. If the field is Galois with "weakly" super solvable Galois group, return the complete list of automorphisms, else only the identity element. If present, d is assumed to be a multiple of the least common denominator of the conjugates expressed as polynomial in a root of pol.

A group G is "weakly" super solvable if it contains a super solvable normal subgroup H such that G = H , or G/H ~ A_4 , or G/H ~ S_4. Abelian and nilpotent groups are "weakly" super solvable. In practice, almost all groups of small order are "weakly" super solvable, the exceptions having order 36(1 exception), 48(2), 56(1), 60(1), 72(5), 75(1), 80(1), 96(10) and >= 108.

Hence flag = 4 permits to quickly check whether a polynomial of order strictly less than 36 is Galois or not. This method is much faster than nfroots and can be applied to polynomials of degree larger than 50.

The library syntax is galoisconj0(nf,flag,d,prec). Also available are galoisconj(nf) for flag = 0, galoisconj2(nf,n,prec) for flag = 2 where n is a bound on the number of conjugates, and galoisconj4(nf,d) corresponding to flag = 4.

nfhilbert(nf,a,b,{pr})  

if pr is omitted, compute the global Hilbert symbol (a,b) in nf, that is 1 if x^2 - a y^2 - b z^2 has a non trivial solution (x,y,z) in nf, and -1 otherwise. Otherwise compute the local symbol modulo the prime ideal pr (as output by idealprimedec).

The library syntax is nfhilbert(nf,a,b,pr), where an omitted pr is coded as NULL.

nfhnf(nf,x)  

given a pseudo-matrix (A,I), finds a pseudo-basis in Hermite normal form of the module it generates.

The library syntax is nfhermite(nf,x).

nfhnfmod(nf,x,detx)  

given a pseudo-matrix (A,I) and an ideal detx which is contained in (read integral multiple of) the determinant of (A,I), finds a pseudo-basis in Hermite normal form of the module generated by (A,I). This avoids coefficient explosion. detx can be computed using the function nfdetint.

The library syntax is nfhermitemod(nf,x,detx).

nfinit(pol,{flag = 0})  

pol being a non-constant, preferably monic, irreducible polynomial in Z[X], initializes a number field structure ( nf) associated to the field K defined by pol. As such, it's a technical object passed as the first argument to most nfxxx functions, but it contains some information which may be directly useful. Access to this information via \var{member functions} is prefered since the specific data organization specified below may change in the future. Currently, nf is a row vector with 9 components:

nf[1] contains the polynomial pol ( nf.pol).

nf[2] contains [r1,r2] ( nf.sign), the number of real and complex places of K.

nf[3] contains the discriminant d(K) ( nf.disc) of K.

nf[4] contains the index of nf[1], i.e.[Z_K : Z[theta]], where theta is any root of nf[1].

nf[5] is a vector containing 7 matrices M, MC, T2, T, MD, TI, MDI useful for certain computations in the number field K.

* M is the (r1+r2) x n matrix whose columns represent the numerical values of the conjugates of the elements of the integral basis.

* MC is essentially the conjugate of the transpose of M, except that the last r2 columns are also multiplied by 2.

* T2 is an n x n matrix equal to the real part of the product MC.M (which is a real positive definite symmetric matrix), the so-called T_2-matrix ( nf.t2).

* T is the n x n matrix whose coefficients are Tr(omega_iomega_j) where the omega_i are the elements of the integral basis. Note that T = \overline{MC}.M and in particular that T = T_2 if the field is totally real (in practice T_2 will have real approximate entries and T will have integer entries). Note also that det(T) is equal to the discriminant of the field K.

* The columns of MD ( nf.diff) express a Z-basis of the different of K on the integral basis.

* TI is equal to d(K)T^{-1}, which has integral coefficients. Note that, understood as as ideal, the matrix T^{-1} generates the codifferent ideal.

* Finally, MDI is a two-element representation (for faster ideal product) of d(K) times the codifferent ideal ( nf.disc*nf.codiff, which is an integral ideal). MDI is only used in idealinv.

nf[6] is the vector containing the r1+r2 roots ( nf.roots) of nf[1] corresponding to the r1+r2 embeddings of the number field into C (the first r1 components are real, the next r2 have positive imaginary part).

nf[7] is an integral basis in Hermite normal form for Z_K ( nf.zk) expressed on the powers oftheta.

nf[8] is the n x n integral matrix expressing the power basis in terms of the integral basis, and finally

nf[9] is the n x n^2 matrix giving the multiplication table of the integral basis.

If a non monic polynomial is input, nfinit will transform it into a monic one, then reduce it (see flag = 3). It is allowed, though not very useful given the existence of nfnewprec, to input a nf or a bnf instead of a polynomial.

The special input format [x,B] is also accepted where x is a polynomial as above and B is the integer basis, as computed by nfbasis. This can be useful since nfinit uses the round 4 algorithm by default, which can be very slow in pathological cases where round 2 ( nfbasis(x,2)) would succeed very quickly.

If flag = 2: pol is changed into another polynomial P defining the same number field, which is as simple as can easily be found using the polred algorithm, and all the subsequent computations are done using this new polynomial. In particular, the first component of the result is the modified polynomial.

If flag = 3, does a polred as in case 2, but outputs [nf, Mod(a,P)], where nf is as before and Mod(a,P) = Mod(x,pol) gives the change of variables. This is implicit when pol is not monic: first a linear change of variables is performed, to get a monic polynomial, then a polred reduction.

If flag = 4, as 2 but uses a partial polred.

If flag = 5, as 3 using a partial polred.

The library syntax is nfinit0(x,flag,prec).

nfisideal(nf,x)  

returns 1 if x is an ideal in the number field nf, 0 otherwise.

The library syntax is isideal(x).

nfisincl(x,y)  

tests whether the number field K defined by the polynomial x is conjugate to a subfield of the field L defined by y (where x and y must be in Q[X]). If they are not, the output is the number 0. If they are, the output is a vector of polynomials, each polynomial a representing an embedding of K into L, i.e.being such that y | x o a.

If y is a number field (nf), a much faster algorithm is used (factoring x over y using nffactor). Before version 2.0.14, this wasn't guaranteed to return all the embeddings, hence was triggered by a special flag. This is no more the case.

The library syntax is nfisincl(x,y,flag).

nfisisom(x,y)  

as nfisincl, but tests for isomorphism. If either x or y is a number field, a much faster algorithm will be used.

The library syntax is nfisisom(x,y,flag).

nfnewprec(nf)  

transforms the number field nf into the corresponding data using current (usually larger) precision. This function works as expected if nf is in fact a bnf (update bnf to current precision) but may be quite slow (many generators of principal ideals have to be computed).

The library syntax is nfnewprec(nf,prec).

nfkermodpr(nf,a,pr)  

kernel of the matrix a in Z_K/pr, where pr is in modpr format (see nfmodprinit).

The library syntax is nfkermodpr(nf,a,pr).

nfmodprinit(nf,pr)  

transforms the prime ideal pr into modpr format necessary for all operations modulo pr in the number field nf. Returns a two-component vector [P,a], where P is the Hermite normal form of pr, and a is an integral element congruent to 1 modulo pr, and congruent to 0 modulo p / pr^e. Here p = Z cap pr and e is the absolute ramification index.

The library syntax is nfmodprinit(nf,pr).

nfsubfields(nf,{d = 0})  

finds all subfields of degree d of the number field nf (all subfields if d is null or omitted). The result is a vector of subfields, each being given by [g,h], where g is an absolute equation and h expresses one of the roots of g in terms of the root x of the polynomial defining nf. This is a crude implementation by M.Olivier of an algorithm due to J.Klüners.

The library syntax is subfields(nf,d).

nfroots(nf,x)  

roots of the polynomial x in the number field nf given by nfinit without multiplicity. x has coefficients in the number field (scalar, polmod, polynomial, column vector). The main variable of nf must be of lower priority than that of x (in other words the variable number of nf must be greater than that of x). However if the coefficients of the number field occur explicitly (as polmods) as coefficients of x, the variable of these polmods must be the same as the main variable of t (see nffactor).

The library syntax is nfroots(nf,x).

nfrootsof1(nf)  

computes the number of roots of unity w and a primitive w-th root of unity (expressed on the integral basis) belonging to the number field nf. The result is a two-component vector [w,z] where z is a column vector expressing a primitive w-th root of unity on the integral basis nf.zk.

The library syntax is rootsof1(nf).

nfsnf(nf,x)  

given a torsion module x as a 3-component row vector [A,I,J] where A is a square invertible n x n matrix, I and J are two ideal lists, outputs an ideal list d_1,...,d_n which is the Smith normal form of x. In other words, x is isomorphic to Z_K/d_1oplus...oplusZ_K/d_n and d_i divides d_{i-1} for i >= 2. The link between x and [A,I,J] is as follows: if e_i is the canonical basis of K^n, I = [b_1,...,b_n] and J = [a_1,...,a_n], then x is isomorphic to (b_1e_1oplus...oplus b_ne_n) / (a_1A_1oplus...oplus a_nA_n) , where the A_j are the columns of the matrix A. Note that every finitely generated torsion module can be given in this way, and even with b_i = Z_K for all i.

The library syntax is nfsmith(nf,x).

nfsolvemodpr(nf,a,b,pr)  

solution of a.x = b in Z_K/pr, where a is a matrix and b a column vector, and where pr is in modpr format (see nfmodprinit).

The library syntax is nfsolvemodpr(nf,a,b,pr).

polcompositum(x,y,{flag = 0})  

x and y being polynomials in Z[X] in the same variable, outputs a vector giving the list of all possible composita of the number fields defined by x and y, if x and y are irreducible, or of the corresponding étale algebras, if they are only squarefree. Returns an error if one of the polynomials is not squarefree. When one of the polynomials is irreducible (say x), it is often much faster to use nffactor(nfinit(x), y) then rnfequation.

If flag = 1, outputs a vector of 4-component vectors [z,a,b,k], where z ranges through the list of all possible compositums as above, and a (resp. b) expresses the root of x (resp. y) as a polmod in a root of z, and k is a small integer k such that a+kb is the chosen root of z.

The compositum will quite often be defined by a complicated polynomial, which it is advisable to reduce before further work. Here is a simple example involving the field Q(zeta_5, 5^{1/5}):

? z = polcompositum(x^5 - 5, polcyclo(5), 1)[1];
 ? pol = z[1]                 \\ 
pol defines the compositum

 %2 = x^20 + 5*x^19 + 15*x^18 + 35*x^17 + 70*x^16 + 141*x^15 + 260*x^14 \   + 355*x^13 + 95*x^12 - 1460*x^11 - 3279*x^10 - 3660*x^9 - 2005*x^8 \   + 705*x^7 + 9210*x^6 + 13506*x^5 + 7145*x^4 - 2740*x^3 + 1040*x^2 \   - 320*x + 256  ? a = z[2]; a^5 - 5 \\ a is a fifth root of 5

 %3 = 0  ? z = polredabs(pol, 1); \\ look for a simpler polynomial

 ? pol = z[1]  %5 = x^20 + 25*x^10 + 5  ? a = subst(a.pol, x, z[2]) \\ a in the new coordinates

 %6 = Mod(-5/22*x^19 + 1/22*x^14 - 123/22*x^9 + 9/11*x^4, x^20 + 25*x^10 + 5)

The library syntax is polcompositum0(x,y,flag).

polgalois(x)  

Galois group of the non-constant polynomial x belongs to Q[X]. In the present version 2.1.1, x must be irreducible and the degree of x must be less than or equal to 7. On certain versions for which the data file of Galois resolvents has been installed (available in the Unix distribution as a separate package), degrees 8, 9, 10 and 11 are also implemented.

The output is a 3-component vector [n,s,k] with the following meaning: n is the cardinality of the group, s is its signature (s = 1 if the group is a subgroup of the alternating group A_n, s = -1 otherwise), and k is the number of the group corresponding to a given pair (n,s) (k = 1 except in 2 cases). Specifically, the groups are coded as follows, using standard notations (see GTM 138, quoted at the beginning of this section; see also "The transitive groups of degree up to eleven", by G.Butler and J.McKay in Communications in Algebra, vol.11, 1983, pp.863--911):

In degree 1: S_1 = [1,-1,1].

In degree 2: S_2 = [2,-1,1].

In degree 3: A_3 = C_3 = [3,1,1], S_3 = [6,-1,1].

In degree 4: C_4 = [4,-1,1], V_4 = [4,1,1], D_4 = [8,-1,1], A_4 = [12,1,1], S_4 = [24,-1,1].

In degree 5: C_5 = [5,1,1], D_5 = [10,1,1], M_{20} = [20,-1,1], A_5 = [60,1,1], S_5 = [120,-1,1].

In degree 6: C_6 = [6,-1,1], S_3 = [6,-1,2], D_6 = [12,-1,1], A_4 = [12,1,1], G_{18} = [18,-1,1], S_4^ -= [24,-1,1], A_4 x C_2 = [24,-1,2], S_4^ += [24,1,1], G_{36}^ -= [36,-1,1], G_{36}^ += [36,1,1], S_4 x C_2 = [48,-1,1], A_5 = PSL_2(5) = [60,1,1], G_{72} = [72,-1,1], S_5 = PGL_2(5) = [120,-1,1], A_6 = [360,1,1], S_6 = [720,-1,1].

In degree 7: C_7 = [7,1,1], D_7 = [14,-1,1], M_{21} = [21,1,1], M_{42} = [42,-1,1], PSL_2(7) = PSL_3(2) = [168,1,1], A_7 = [2520,1,1], S_7 = [5040,-1,1].

The method used is that of resolvent polynomials and is sensitive to the current precision. The precision is updated internally but, in very rare cases, a wrong result may be returned if the initial precision was not sufficient.

The library syntax is galois(x,prec).

polred(x,{flag = 0},{p})  

finds polynomials with reasonably small coefficients defining subfields of the number field defined by x. One of the polynomials always defines Q (hence is equal to x-1), and another always defines the same number field as x if x is irreducible. All x accepted by nfinit are also allowed here (e.g. non-monic polynomials, nf, bnf, [x,Z_K_basis]).

The following binary digits of flag are significant:

1: does a partial reduction only. This means that only a suborder of the maximal order may be used.

2: gives also elements. The result is a two-column matrix, the first column giving the elements defining these subfields, the second giving the corresponding minimal polynomials.

If p is given, it is assumed that it is the two-column matrix of the factorization of the discriminant of the polynomial x.

The library syntax is polred0(x,flag,p,prec), where an omitted p is coded by gzero. Also available are polred(x,prec) and factoredpolred(x,p,prec), both corresponding to flag = 0.

polredabs(x,{flag = 0})  

finds one of the polynomial defining the same number field as the one defined by x, and such that the sum of the squares of the modulus of the roots (i.e.the T_2-norm) is minimal. All x accepted by nfinit are also allowed here (e.g. non-monic polynomials, nf, bnf, [x,Z_K_basis]).

The binary digits of flag mean

1: outputs a two-component row vector [P,a], where P is the default output and a is an element expressed on a root of the polynomial P, whose minimal polynomial is equal to x.

4: gives all polynomials of minimal T_2 norm (of the two polynomials P(x) and P(-x), only one is given).

The library syntax is polredabs0(x,flag,prec).

polredord(x)  

finds polynomials with reasonably small coefficients and of the same degree as that of x defining suborders of the order defined by x. One of the polynomials always defines Q (hence is equal to (x-1)^n, where n is the degree), and another always defines the same order as x if x is irreducible.

The library syntax is ordred(x).

poltschirnhaus(x)  

applies a random Tschirnhausen transformation to the polynomial x, which is assumed to be non-constant and separable, so as to obtain a new equation for the étale algebra defined by x. This is for instance useful when computing resolvents, hence is used by the polgalois function.

The library syntax is tschirnhaus(x).

rnfalgtobasis(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an element of L expressed as a polynomial or polmod with polmod coefficients, expresses x on the relative integral basis.

The library syntax is rnfalgtobasis(rnf,x).

rnfbasis(bnf,x)  

given a big number field bnf as output by bnfinit, and either a polynomial x with coefficients in bnf defining a relative extension L of bnf, or a pseudo-basis x of such an extension, gives either a true bnf-basis of L if it exists, or an n+1-element generating set of L if not, where n is the rank of L over bnf.

The library syntax is rnfbasis(bnf,x).

rnfbasistoalg(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an element of L expressed on the relative integral basis, computes the representation of x as a polmod with polmods coefficients.

The library syntax is rnfbasistoalg(rnf,x).

rnfcharpoly(nf,T,a,{v = x})  

characteristic polynomial of a over nf, where a belongs to the algebra defined by T over nf, i.e.nf[X]/(T). Returns a polynomial in variable v (x by default).

The library syntax is rnfcharpoly(nf,T,a,v), where v is a variable number.

rnfconductor(bnf,pol)  

bnf being a big number field as output by bnfinit, and pol a relative polynomial defining an Abelian extension, computes the class field theory conductor of this Abelian extension. The result is a 3-component vector [conductor,rayclgp,subgroup], where conductor is the conductor of the extension given as a 2-component row vector [f_0,f_ oo ], rayclgp is the full ray class group corresponding to the conductor given as a 3-component vector [h,cyc,gen] as usual for a group, and subgroup is a matrix in HNF defining the subgroup of the ray class group on the given generators gen.

The library syntax is rnfconductor(rnf,pol,prec).

rnfdedekind(nf,pol,pr)  

given a number field nf as output by nfinit and a polynomial pol with coefficients in nf defining a relative extension L of nf, evaluates the relative Dedekind criterion over the order defined by a root of pol for the prime ideal pr and outputs a 3-component vector as the result. The first component is a flag equal to 1 if the enlarged order could be proven to be pr-maximal and to 0 otherwise (it may be maximal in the latter case if pr is ramified in L), the second component is a pseudo-basis of the enlarged order and the third component is the valuation at pr of the order discriminant.

The library syntax is rnfdedekind(nf,pol,pr).

rnfdet(nf,M)  

given a pseudomatrix M over the maximal order of nf, computes its pseudodeterminant.

The library syntax is rnfdet(nf,M).

rnfdisc(nf,pol)  

given a number field nf as output by nfinit and a polynomial pol with coefficients in nf defining a relative extension L of nf, computes the relative discriminant of L. This is a two-element row vector [D,d], where D is the relative ideal discriminant and d is the relative discriminant considered as an element of nf^*/{nf^*}^2. The main variable of nf must be of lower priority than that of pol.

Note: As usual, nf can be a bnf as output by nfinit.

The library syntax is rnfdiscf(bnf,pol).

rnfeltabstorel(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an element of L expressed as a polynomial modulo the absolute equation rnf[11][1], computes x as an element of the relative extension L/K as a polmod with polmod coefficients.

The library syntax is rnfelementabstorel(rnf,x).

rnfeltdown(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an element of L expressed as a polynomial or polmod with polmod coefficients, computes x as an element of K as a polmod, assuming x is in K (otherwise an error will occur). If x is given on the relative integral basis, apply rnfbasistoalg first, otherwise PARI will believe you are dealing with a vector.

The library syntax is rnfelementdown(rnf,x).

rnfeltreltoabs(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an element of L expressed as a polynomial or polmod with polmod coefficients, computes x as an element of the absolute extension L/Q as a polynomial modulo the absolute equation rnf[11][1]. If x is given on the relative integral basis, apply rnfbasistoalg first, otherwise PARI will believe you are dealing with a vector.

The library syntax is rnfelementreltoabs(rnf,x).

rnfeltup(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an element of K expressed as a polynomial or polmod, computes x as an element of the absolute extension L/Q as a polynomial modulo the absolute equation rnf[11][1]. Note that it is unnecessary to compute x as an element of the relative extension L/K (its expression would be identical to itself). If x is given on the integral basis of K, apply nfbasistoalg first, otherwise PARI will believe you are dealing with a vector.

The library syntax is rnfelementup(rnf,x).

rnfequation(nf,pol,{flag = 0})  

given a number field nf as output by nfinit (or simply a polynomial) and a polynomial pol with coefficients in nf defining a relative extension L of nf, computes the absolute equation of L over Q.

If flag is non-zero, outputs a 3-component row vector [z,a,k], where z is the absolute equation of L over Q, as in the default behaviour, a expresses as an element of L a root alpha of the polynomial defining the base field nf, and k is a small integer such that theta = beta+kalpha where theta is a root of z and beta a root of pol.

The main variable of nf must be of lower priority than that of pol. Note that for efficiency, this does not check whether the relative equation is irreducible over nf, but only if it is squarefree. If it is reducible but squarefree, the result will be the absolute equation of the étale algebra defined by pol. If pol is not squarefree, an error message will be issued.

The library syntax is rnfequation0(nf,pol,flag).

rnfhnfbasis(bnf,x)  

given a big number field bnf as output by bnfinit, and either a polynomial x with coefficients in bnf defining a relative extension L of bnf, or a pseudo-basis x of such an extension, gives either a true bnf-basis of L in upper triangular Hermite normal form, if it exists, zero otherwise.

The library syntax is rnfhermitebasis(nf,x).

rnfidealabstorel(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an ideal of the absolute extension L/Q given in HNF (if it is not, apply idealhnf first), computes the relative pseudomatrix in HNF giving the ideal x considered as an ideal of the relative extension L/K.

The library syntax is rnfidealabstorel(rnf,x).

rnfidealdown(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an ideal of the absolute extension L/Q given in HNF (if it is not, apply idealhnf first), gives the ideal of K below x, i.e.the intersection of x with K. Note that, if x is given as a relative ideal (i.e.a pseudomatrix in HNF), then it is not necessary to use this function since the result is simply the first ideal of the ideal list of the pseudomatrix.

The library syntax is rnfidealdown(rnf,x).

rnfidealhnf(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being a relative ideal (which can be, as in the absolute case, of many different types, including of course elements), computes as a 2-component row vector the relative Hermite normal form of x, the first component being the HNF matrix (with entries on the integral basis), and the second component the ideals.

The library syntax is rnfidealhermite(rnf,x).

rnfidealmul(rnf,x,y)  

rnf being a relative number field extension L/K as output by rnfinit and x and y being ideals of the relative extension L/K given by pseudo-matrices, outputs the ideal product, again as a relative ideal.

The library syntax is rnfidealmul(rnf,x,y).

rnfidealnormabs(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being a relative ideal (which can be, as in the absolute case, of many different types, including of course elements), computes the norm of the ideal x considered as an ideal of the absolute extension L/Q. This is identical to idealnorm(rnfidealnormrel(rnf,x)), only faster.

The library syntax is rnfidealnormabs(rnf,x).

rnfidealnormrel(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being a relative ideal (which can be, as in the absolute case, of many different types, including of course elements), computes the relative norm of x as a ideal of K in HNF.

The library syntax is rnfidealnormrel(rnf,x).

rnfidealreltoabs(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being a relative ideal (which can be, as in the absolute case, of many different types, including of course elements), computes the HNF matrix of the ideal x considered as an ideal of the absolute extension L/Q.

The library syntax is rnfidealreltoabs(rnf,x).

rnfidealtwoelt(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an ideal of the relative extension L/K given by a pseudo-matrix, gives a vector of two generators of x over Z_L expressed as polmods with polmod coefficients.

The library syntax is rnfidealtwoelement(rnf,x).

rnfidealup(rnf,x)  

rnf being a relative number field extension L/K as output by rnfinit and x being an ideal of K, gives the ideal xZ_L as an absolute ideal of L/Q (the relative ideal representation is trivial: the matrix is the identity matrix, and the ideal list starts with x, all the other ideals being Z_K).

The library syntax is rnfidealup(rnf,x).

rnfinit(nf,pol)  

nf being a number field in nfinit format considered as base field, and pol a polynomial defining a relative extension over nf, this computes all the necessary data to work in the relative extension. The main variable of pol must be of higher priority (i.e.lower number) than that of nf, and the coefficients of pol must be in nf.

The result is an 11-component row vector as follows (most of the components are technical), the numbering being very close to that of nfinit. In the following description, we let K be the base field defined by nf, m the degree of the base field, n the relative degree, L the large field (of relative degree n or absolute degree nm), r_1 and r_2 the number of real and complex places of K.

rnf[1] contains the relative polynomial pol.

rnf[2] is a row vector with r_1+r_2 entries, entry j being a 2-component row vector [r_{j,1},r_{j,2}] where r_{j,1} and r_{j,2} are the number of real and complex places of L above the j-th place of K so that r_{j,1} = 0 and r_{j,2} = n if j is a complex place, while if j is a real place we have r_{j,1}+2r_{j,2} = n.

rnf[3] is a two-component row vector [d(L/K),s] where d(L/K) is the relative ideal discriminant of L/K and s is the discriminant of L/K viewed as an element of K^*/(K^*)^2, in other words it is the output of rnfdisc.

rnf[4] is the ideal index f, i.e.such that d(pol)Z_K = f^2d(L/K).

rnf[5] is a vector vm with 7 entries useful for certain computations in the relative extension L/K. vm[1] is a vector of r_1+r_2 matrices, the j-th matrix being an (r_{1,j}+r_{2,j}) x n matrix M_j representing the numerical values of the conjugates of the j-th embedding of the elements of the integral basis, where r_{i,j} is as in rnf[2]. vm[2] is a vector of r_1+r_2 matrices, the j-th matrix MC_j being essentially the conjugate of the matrix M_j except that the last r_{2,j} columns are also multiplied by 2. vm[3] is a vector of r_1+r_2 matrices T2_j, where T2_j is an n x n matrix equal to the real part of the product MC_j.M_j (which is a real positive definite matrix). vm[4] is the n x n matrix T whose entries are the relative traces of omega_iomega_j expressed as polmods in nf, where the omega_i are the elements of the relative integral basis. Note that the j-th embedding of T is equal to \overline{MC_j}.M_j, and in particular will be equal to T2_j if r_{2,j} = 0. Note also that the relative ideal discriminant of L/K is equal to det(T) times the square of the product of the ideals in the relative pseudo-basis (in rnf[7][2]). The last 3 entries vm[5], vm[6] and vm[7] are linked to the different as in nfinit, but have not yet been implemented.

rnf[6] is a row vector with r_1+r_2 entries, the j-th entry being the row vector with r_{1,j}+r_{2,j} entries of the roots of the j-th embedding of the relative polynomial pol.

rnf[7] is a two-component row vector, where the first component is the relative integral pseudo basis expressed as polynomials (in the variable of pol) with polmod coefficients in nf, and the second component is the ideal list of the pseudobasis in HNF.

rnf[8] is the inverse matrix of the integral basis matrix, with coefficients polmods in nf.

rnf[9] may be the multiplication table of the integral basis, but is not implemented at present.

rnf[10] is nf.

rnf[11] is a vector vabs with 5 entries describing the absolute extension L/Q. vabs[1] is an absolute equation. vabs[2] expresses the generator alpha of the number field nf as a polynomial modulo the absolute equation vabs[1]. vabs[3] is a small integer k such that, if beta is an abstract root of pol and alpha the generator of nf, the generator whose root is vabs will be beta + k alpha. Note that one must be very careful if k ! = 0 when dealing simultaneously with absolute and relative quantities since the generator chosen for the absolute extension is not the same as for the relative one. If this happens, one can of course go on working, but we strongly advise to change the relative polynomial so that its root will be beta + k alpha. Typically, the GP instruction would be

pol = subst(pol, x, x - k*Mod(y,nf.pol))

Finally, vabs[4] is the absolute integral basis of L expressed in HNF (hence as would be output by nfinit(vabs[1])), and vabs[5] the inverse matrix of the integral basis, allowing to go from polmod to integral basis representation.

The library syntax is rnfinitalg(nf,pol,prec).

rnfisfree(bnf,x)  

given a big number field bnf as output by bnfinit, and either a polynomial x with coefficients in bnf defining a relative extension L of bnf, or a pseudo-basis x of such an extension, returns true (1) if L/bnf is free, false (0) if not.

The library syntax is rnfisfree(bnf,x), and the result is a long.

rnfisnorm(bnf,ext,el,{flag = 1})  

similar to bnfisnorm but in the relative case. This tries to decide whether the element el in bnf is the norm of some y in ext. bnf is as output by bnfinit.

ext is a relative extension which has to be a row vector whose components are:

ext[1]: a relative equation of the number field ext over bnf. As usual, the priority of the variable of the polynomial defining the ground field bnf (say y) must be lower than the main variable of ext[1], say x.

ext[2]: the generator y of the base field as a polynomial in x (as given by rnfequation with flag = 1).

ext[3]: is the bnfinit of the absolute extension ext/Q.

This returns a vector [a,b], where el = Norm(a)*b. It looks for a solution which is an S-integer, with S a list of places (of bnf) containing the ramified primes, the generators of the class group of ext, as well as those primes dividing el. If ext/bnf is known to be Galois, set flag = 0 (here el is a norm iff b = 1). If flag is non zero add to S all the places above the primes which: divide flag if flag < 0, or are less than flag if flag > 0. The answer is guaranteed (i.e.el is a norm iff b = 1) under GRH, if S contains all primes less than 12log^2|disc(Ext)|, where Ext is the normal closure of ext / bnf. Example:

bnf = bnfinit(y^3 + y^2 - 2*y - 1);
 p = x^2 + Mod(y^2 + 2*y + 1, bnf.pol);
 rnf = rnfequation(bnf,p,1);
 ext = [p, rnf[2], bnfinit(rnf[1])];
 rnfisnorm(bnf,ext,17, 1)

checks whether 17 is a norm in the Galois extension Q(beta) / Q(alpha), where alpha^3 + alpha^2 - 2alpha - 1 = 0 and beta^2 + alpha^2 + 2*alpha + 1 = 0 (it is).

The library syntax is rnfisnorm(bnf,ext,x,flag,prec).

rnfkummer(bnr,subgroup,{deg = 0})  

bnr being as output by bnrinit, finds a relative equation for the class field corresponding to the module in bnr and the given congruence subgroup. If deg is positive, outputs the list of all relative equations of degree deg contained in the ray class field defined by bnr.

(THIS PROGRAM IS STILL IN DEVELOPMENT STAGE)

The library syntax is rnfkummer(bnr,subgroup,deg,prec), where deg is a long.

rnflllgram(nf,pol,order)  

given a polynomial pol with coefficients in nf and an order order as output by rnfpseudobasis or similar, gives [[neworder],U], where neworder is a reduced order and U is the unimodular transformation matrix.

The library syntax is rnflllgram(nf,pol,order,prec).

rnfnormgroup(bnr,pol)  

bnr being a big ray class field as output by bnrinit and pol a relative polynomial defining an Abelian extension, computes the norm group (alias Artin or Takagi group) corresponding to the Abelian extension of bnf = bnr[1] defined by pol, where the module corresponding to bnr is assumed to be a multiple of the conductor (i.e.polrel defines a subextension of bnr). The result is the HNF defining the norm group on the given generators of bnr[5][3]. Note that neither the fact that pol defines an Abelian extension nor the fact that the module is a multiple of the conductor is checked. The result is undefined if the assumption is not correct.

The library syntax is rnfnormgroup(bnr,pol).

rnfpolred(nf,pol)  

relative version of polred. Given a monic polynomial pol with coefficients in nf, finds a list of relative polynomials defining some subfields, hopefully simpler and containing the original field. In the present version 2.1.1, this is slower than rnfpolredabs.

The library syntax is rnfpolred(nf,pol,prec).

rnfpolredabs(nf,pol,{flag = 0})  

relative version of polredabs. Given a monic polynomial pol with coefficients in nf, finds a simpler relative polynomial defining the same field. If flag = 1, returns [P,a] where P is the default output and a is an element expressed on a root of P whose characteristic polynomial is pol, if flag = 2, returns an absolute polynomial (same as

rnfequation(nf,rnfpolredabs(nf,pol))

but faster).

Remark. In the present implementation, this is both faster and much more efficient than rnfpolred, the difference being more dramatic than in the absolute case. This is because the implementation of rnfpolred is based on (a partial implementation of) an incomplete reduction theory of lattices over number fields (i.e.the function rnflllgram) which deserves to be improved.

The library syntax is rnfpolredabs(nf,pol,flag,prec).

rnfpseudobasis(nf,pol)  

given a number field nf as output by nfinit and a polynomial pol with coefficients in nf defining a relative extension L of nf, computes a pseudo-basis (A,I) and the relative discriminant of L. This is output as a four-element row vector [A,I,D,d], where D is the relative ideal discriminant and d is the relative discriminant considered as an element of nf^*/{nf^*}^2.

Note: As usual, nf can be a bnf as output by bnfinit.

The library syntax is rnfpseudobasis(nf,pol).

rnfsteinitz(nf,x)  

given a number field nf as output by nfinit and either a polynomial x with coefficients in nf defining a relative extension L of nf, or a pseudo-basis x of such an extension as output for example by rnfpseudobasis, computes another pseudo-basis (A,I) (not in HNF in general) such that all the ideals of I except perhaps the last one are equal to the ring of integers of nf, and outputs the four-component row vector [A,I,D,d] as in rnfpseudobasis. The name of this function comes from the fact that the ideal class of the last ideal of I (which is well defined) is called the Steinitz class of the module Z_L.

Note: nf can be a bnf as output by bnfinit.

The library syntax is rnfsteinitz(nf,x).

subgrouplist(bnr,{bound},{flag = 0})  

bnr being as output by bnrinit or a list of cyclic components of a finite Abelian group G, outputs the list of subgroups of G (of index bounded by bound, if not omitted). Subgroups are given as HNF left divisors of the SNF matrix corresponding to G. If flag = 0 (default) and bnr is as output by bnrinit, gives only the subgroups whose modulus is the conductor.

The library syntax is subgrouplist0(bnr,bound,flag,prec), where bound, flag and prec are long integers.

zetak(znf,x,{flag = 0})  

znf being a number field initialized by zetakinit (not by nfinit), computes the value of the Dedekind zeta function of the number field at the complex number x. If flag = 1 computes Dedekind Lambda function instead (i.e.the product of the Dedekind zeta function by its gamma and exponential factors).

The accuracy of the result depends in an essential way on the accuracy of both the zetakinit program and the current accuracy, but even so the result may be off by up to 5 or 10 decimal digits.

The library syntax is glambdak(znf,x,prec) or gzetak(znf,x,prec).

zetakinit(x)  

computes a number of initialization data concerning the number field defined by the polynomial x so as to be able to compute the Dedekind zeta and lambda functions (respectively zetak(x) and zetak(x,1)). This function calls in particular the bnfinit program. The result is a 9-component vector v whose components are very technical and cannot really be used by the user except through the zetak function. The only component which can be used if it has not been computed already is v[1][4] which is the result of the bnfinit call.

This function is very inefficient and should be rewritten. It needs to computes millions of coefficients of the corresponding Dirichlet series if the precision is big. Unless the discriminant is small it will not be able to handle more than 9 digits of relative precision (e.g zetakinit(x^8 - 2) needs 440MB of memory at default precision).

The library syntax is initzeta(x).