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 nonzero, 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 nonprime $p$ is given the result is undefined.
 If $f$ is present and nonzero, 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 an algebraic
 integer $b$ 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
