1Function: idealprimedec 2Section: number_fields 3C-Name: idealprimedec_limit_f 4Prototype: GGD0,L, 5Description: 6 (gen, gen):vec idealprimedec($1, $2) 7 (gen, gen, ?small):vec idealprimedec_limit_f($1, $2, $3) 8Help: idealprimedec(nf,p,{f=0}): prime ideal decomposition of the prime number 9 p in the number field nf as a vector of prime ideals. If f is present 10 and nonzero, restrict the result to primes of residue degree <= f. 11Doc: computes the prime ideal 12 decomposition of the (positive) prime number $p$ in the number field $K$ 13 represented by \var{nf}. If a nonprime $p$ is given the result is undefined. 14 If $f$ is present and nonzero, restrict the result to primes of residue 15 degree $\leq f$. 16 17 The result is a vector of \tev{prid} structures, each representing one of the 18 prime ideals above $p$ in the number field $\var{nf}$. The representation 19 $\kbd{pr}=[p,a,e,f,\var{mb}]$ of a prime ideal means the following: $a$ 20 is an algebraic integer in the maximal order $\Z_K$ and the prime ideal is 21 equal to $\goth{p} = p\Z_K + a\Z_K$; 22 $e$ is the ramification index; $f$ is the residual index; 23 finally, \var{mb} is the multiplication table attached to the algebraic 24 integer $b$ is such that $\goth{p}^{-1}=\Z_K+ b/ p\Z_K$, which is used 25 internally to compute valuations. In other words if $p$ is inert, 26 then \var{mb} is the integer $1$, and otherwise it is a square \typ{MAT} 27 whose $j$-th column is $b \cdot \kbd{nf.zk[j]}$. 28 29 The algebraic number $a$ is guaranteed to have a 30 valuation equal to 1 at the prime ideal (this is automatic if $e>1$). 31 32 The components of \kbd{pr} should be accessed by member functions: \kbd{pr.p}, 33 \kbd{pr.e}, \kbd{pr.f}, and \kbd{pr.gen} (returns the vector $[p,a]$): 34 \bprog 35 ? K = nfinit(x^3-2); 36 ? P = idealprimedec(K, 5); 37 ? #P \\ 2 primes above 5 in Q(2^(1/3)) 38 %3 = 2 39 ? [p1,p2] = P; 40 ? [p1.e, p1.f] \\ the first is unramified of degree 1 41 %5 = [1, 1] 42 ? [p2.e, p2.f] \\ the second is unramified of degree 2 43 %6 = [1, 2] 44 ? p1.gen 45 %7 = [5, [2, 1, 0]~] 46 ? nfbasistoalg(K, %[2]) \\ a uniformizer for p1 47 %8 = Mod(x + 2, x^3 - 2) 48 ? #idealprimedec(K, 5, 1) \\ restrict to f = 1 49 %9 = 1 \\ now only p1 50 @eprog 51