Function: idealprimedec
Section: number_fields
C-Name: idealprimedec_limit_f
Prototype: GGD0,L,
Description:
 (gen, gen):vec idealprimedec($1, $2)
 (gen, gen, ?small):vec idealprimedec_limit_f($1, $2, $3)
Help: idealprimedec(nf,p,{f=0}): prime ideal decomposition of the prime number
 p in the number field nf as a vector of prime ideals. If f is present
 and non-zero, restrict the result to primes of residue degree <= f.
Doc: computes the prime ideal
 decomposition of the (positive) prime number $p$ in the number field $K$
 represented by \var{nf}. If a non-prime $p$ is given the result is undefined.
 If $f$ is present and non-zero, restrict the result to primes of residue
 degree $\leq f$.

 The result is a vector of \tev{prid} structures, each representing one of the
 prime ideals above $p$ in the number field $\var{nf}$. The representation
 $\kbd{pr}=[p,a,e,f,\var{mb}]$ of a prime ideal means the following: $a$
 is an algebraic integer in the maximal order $\Z_K$ and the prime ideal is
 equal to $\goth{p} = p\Z_K + a\Z_K$;
 $e$ is the ramification index; $f$ is the residual index;
 finally, \var{mb} is the multiplication table attached to the algebraic
 integer $b$ is such that $\goth{p}^{-1}=\Z_K+ b/ p\Z_K$, which is used
 internally to compute valuations. In other words if $p$ is inert,
 then \var{mb} is the integer $1$, and otherwise it is a square \typ{MAT}
 whose $j$-th column is $b \cdot \kbd{nf.zk[j]}$.

 The algebraic number $a$ is guaranteed to have a
 valuation equal to 1 at the prime ideal (this is automatic if $e>1$).

 The components of \kbd{pr} should be accessed by member functions: \kbd{pr.p},
 \kbd{pr.e}, \kbd{pr.f}, and \kbd{pr.gen} (returns the vector $[p,a]$):
 \bprog
 ? K = nfinit(x^3-2);
 ? P = idealprimedec(K, 5);
 ? #P       \\ 2 primes above 5 in Q(2^(1/3))
 %3 = 2
 ? [p1,p2] = P;
 ? [p1.e, p1.f]    \\ the first is unramified of degree 1
 %5 = [1, 1]
 ? [p2.e, p2.f]    \\ the second is unramified of degree 2
 %6 = [1, 2]
 ? p1.gen
 %7 = [5, [2, 1, 0]~]
 ? nfbasistoalg(K, %[2])  \\ a uniformizer for p1
 %8 = Mod(x + 2, x^3 - 2)
 ? #idealprimedec(K, 5, 1) \\ restrict to f = 1
 %9 = 1            \\ now only p1
 @eprog
