PARI

There is also a CRT algorithm for number fields in PARI, but it is more cumbersome to use. First we defined $ \mathbf{Q}(\sqrt[3]{2})$ and factor the ideals $ (3)$ and $ (5)$.
   ? f = x^3 - 2;
   ? k = nfinit(f);
   ? i = idealfactor(k,3);
   ? j = idealfactor(k,5);

Next we form matrix whose rows correspond to a product of two primes, one dividing $ 3$ and one dividing $ 5$:

   ? m = matrix(2,2);       
   ? m[1,] = i[1,];  
   ? m[1,2] = 1;
   ? m[2,] = j[1,];
Note that we set m[1,2] = 1, so the exponent is 1 instead of $ 3$. We apply the CRT to obtain a lift in terms of the basis for $ \O_K$.
   ? ?idealchinese
   idealchinese(nf,x,y): x being a prime ideal factorization and y 
   a vector of elements, gives an element b such that 
   v_p(b-y_p)>=v_p(x) for all prime ideals p dividing x, 
   and v_p(b)>=0 for all other p.
   ? idealchinese(k, m, [x,1])
   [0, 0, -1]~
   ? nfbasis(f)
   [1, x, x^2]
Thus PARI finds the lift $ -(\sqrt[3]{2})^2$, and we finish by verifying that this lift is correct. I couldn't figure out how to test for ideal membership in PARI, so here we just check that the prime ideal plus the element is not the unit ideal, which since the ideal is prime, implies membership.
   ? idealadd(k, i[1,1], -x^2 - x)
   [3 1 2]
   [0 1 0]
   [0 0 1]
   ? idealadd(k, j[1,1], -x^2-1)
   [5 2 1]
   [0 1 0]
   [0 0 1]



William Stein 2012-09-24