bridge/class-master/depend/pari/src/modules/algebras.c
/* Ld[i] must be nontrivial powers of the same prime ell */
/* pl : -1 at real places at which the extention must ramify, 0 elsewhere */
Ld[i] must be nontrivial powers of the same prime ell
pl : -1 at real places at which the extention must ramify, 0 elsewhere
Ld [ i ] must be nontrivial powers of the same prime ell pl : - 1 at real places at which the extention must ramify 0 elsewhere
GEN
nfgwkummer(GEN nf, GEN Lpr, GEN Ld, GEN pl, long var)
{
  const long n = (lg(Ld)==1)? 2: vecsmall_max(Ld);
  pari_sp av = avma;
  ulong ell;
  long i, v;
  GEN cnd, y, x, pol;
  v = uisprimepower(n, &ell);
  cnd = zeromatcopy(lg(Lpr)-1,2);
  y = vec_ei(lg(Lpr)-1,1);
  for (i=1; i<lg(Lpr); i++) {
    GEN pr = gel(Lpr,i), p = pr_get_p(pr), E;
    long e = pr_get_e(pr);
    gcoeff(cnd,i,1) = pr;
    if (!absequalui(ell,p))
      E = gen_1;
    else
      E = addui(1 + v*e, divsi(e,subiu(p,1)));
    gcoeff(cnd,i,2) = E;
    gel(y,i) = localextdeg(nf, pr, idealpow(nf,pr,E), Ld[i], ell, n);
  }
  x = idealchinese(nf, mkvec2(cnd,pl), y);
  x = basistoalg(nf,x);
  pol = gsub(gpowgs(pol_x(var),n),x);
  return gerepileupto(av,pol);
}
GEN nfgwkummer ( GEN nf , GEN Lpr , GEN Ld , GEN pl , long var ) { const long n = ( lg ( Ld ) == 1 ) ? 2 : vecsmall_max ( Ld ) ; pari_sp av = avma ; ulong ell ; long i , v ; GEN cnd , y , x , pol ; v = uisprimepower ( n , & ell ) ; cnd = zeromatcopy ( lg ( Lpr ) - 1 , 2 ) ; y = vec_ei ( lg ( Lpr ) - 1 , 1 ) ; for ( i = 1 ; i < lg ( Lpr ) ; i ++ ) { GEN pr = gel ( Lpr , i ) , p = pr_get_p ( pr ) , E ; long e = pr_get_e ( pr ) ; gcoeff ( cnd , i , 1 ) = pr ; if ( ! absequalui ( ell , p ) ) E = gen_1 ; else E = addui ( 1 + v * e , divsi ( e , subiu ( p , 1 ) ) ) ; gcoeff ( cnd , i , 2 ) = E ; gel ( y , i ) = localextdeg ( nf , pr , idealpow ( nf , pr , E ) , Ld [ i ] , ell , n ) ; } x = idealchinese ( nf , mkvec2 ( cnd , pl ) , y ) ; x = basistoalg ( nf , x ) ; pol = gsub ( gpowgs ( pol_x ( var ) , n ) , x ) ; return gerepileupto ( av , pol ) ; }
Ld[i] must be nontrivial powers of the same prime ell
pl : -1 at real places at which the extention must ramify, 0 elsewhere
Ld [ i ] must be nontrivial powers of the same prime ell pl : - 1 at real places at which the extention must ramify 0 elsewhere
/* TODO use a factoredextchinese to ease computations afterwards ? */