Function: idealprimedec
Section: number_fields
C-Name: idealprimedec
Prototype: GG
Help: idealprimedec(nf,p): prime ideal decomposition of the prime number p
 in the number field nf as a vector of 5 component vectors [p,a,e,f,b]
 representing the prime ideals pZ_K+a. Z_K, e,f as usual, a as vector of
 components on the integral basis, b Lenstra's constant.
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.

 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$ and
 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 associated 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's 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);
 ? L = idealprimedec(K, 5);
 ? #L       \\ 2 primes above 5 in Q(2^(1/3))
 %3 = 2
 ? p1 = L[1]; p2 = L[2];
 ? [p1.e, p1.f]    \\ the first is unramified of degree 1
 %4 = [1, 1]
 ? [p2.e, p2.f]    \\ the second is unramified of degree 2
 %5 = [1, 2]
 ? p1.gen
 %6 = [5, [2, 1, 0]~]
 ? nfbasistoalg(K, %[2])  \\ a uniformizer for p1
 %7 = Mod(x + 2, x^3 - 2)
 @eprog
