Function: ideallist
Section: number_fields
C-Name: gideallist
Prototype: GGD4,L,
Help: ideallist(nf,bound,{flag=4}): vector of vectors L of all idealstar of
 all ideals of norm<=bound. If (optional) flag is present, its binary digits
 are toggles meaning 1: give generators; 2: add units; 4: give only the
 ideals and not the bid; 8: omit ideals which cannot be conductors.
Doc: computes the list of all ideals of norm less or equal to \var{bound} in
 the number field
 \var{nf}. The result is a row vector with exactly \var{bound} components.
 Each component is itself a row vector containing the information about
 ideals of a given norm, in no specific order. The information is inferred
 from local data and Chinese remainders and less expensive than computing
 than a direct global computation.

 The binary digits of $\fl$ mean:

 \item 1: if the ideals are given by a \var{bid}, include generators;
 otherwise don't.

 \item 2: if this bit is set, \var{nf} must be a \var{bnf} with units. Each
 component is of the form $[\var{bid},U]$, where \var{bid} is attached to
 an ideal $f$ and $U$ is a vector of discrete logarithms of the units in
 $(\Z_K/f)^*$. More precisely, $U$ gives the \kbd{ideallog}s with respect
 to \var{bid} of $(\zeta,u_1,\dots,u_r)$
 where $\zeta$ is the torsion unit generator \kbd{bnf.tu[2]} and $(u_i)$
 are the fundamental units in \kbd{bnf.fu}.
 This structure is technical, meant to be used in conjunction with
 \tet{bnrclassnolist} or \tet{bnrdisclist}.

 \item 4: give only the ideal (in HNF), else a \var{bid}.

 \item 8: omit ideals which cannot be conductors, i.e. divisible exactly my
 a prime ideal of norm $2$.

 \bprog
 ? nf = nfinit(x^2+1);
 ? L = ideallist(nf, 100);
 ? L[1]
 %3 = [[1, 0; 0, 1]]  \\@com A single ideal of norm 1
 ? #L[65]
 %4 = 4               \\@com There are 4 ideals of norm 65 in $\Z[i]$
 @eprog
 If one wants more information:
 \bprog
 ? L = ideallist(nf, 100, 0);
 ? l = L[25]; vector(#l, i, l[i].clgp)
 %6 = [[20, [20]], [16, [4, 4]], [20, [20]]]
 ? l[1].mod
 %7 = [[25, 18; 0, 1], []]
 ? l[2].mod
 %8 = [[5, 0; 0, 5], []]
 ? l[3].mod
 %9 = [[25, 7; 0, 1], []]
 @eprog\noindent where we ask for the structures of the $(\Z[i]/f)^*$ for all
 three ideals of norm $25$. In fact, for all moduli with finite part of norm
 $25$ and trivial Archimedean part, as the last 3 commands show. See
 \tet{ideallistarch} to treat general moduli.

 Finally, one can input a negative \kbd{bound}. The function
 then returns the ideals of norm $|\kbd{bound}|$, given by their
 factorization matrix. The only valid value of \fl\ is then the default.
 If needed, one can obtain their HNF using
 \kbd{idealfactorback}, and the corresponding \var{bid} structures using
 \kbd{idealstar} (which accepts ideals in factored form).
Variant: Also available is
 \fun{GEN}{ideallist0}{GEN nf,long bound, long flag} for a non-negative
 bound.

