bridge/class-master/depend/pari/src/basemath/mftrace.c
/* F = vector of newforms in mftobasis format */
F = vector of newforms in mftobasis format
F = vector of newforms in mftobasis format
static GEN
mffrickeeigen_i(GEN mf, GEN F, GEN vE, long prec)
{
  GEN M, Z, L0, gN = MF_get_gN(mf), gk = MF_get_gk(mf);
  long N0, i, lM, bit = prec2nbits(prec), k = itou(gk);
  long LIM = 5; 
  L0 = mfthetaancreate(NULL, gN, gk); 
START:
  N0 = lfunthetacost(L0, gen_1, LIM, bit);
  M = mfcoefs_mf(mf, N0, 1);
  lM = lg(F);
  Z = cgetg(lM, t_VEC);
  for (i = 1; i < lM; i++)
  { 
    GEN D, z, van = RgM_RgC_mul(M, Q_remove_denom(gel(F,i), &D));
    GEN L = van_embedall(van, gel(vE,i), gN, gk);
    long l = lg(L), j, bit_add = D? expi(D): 0;
    gel(Z,i) = z = cgetg(l, t_VEC);
    for (j = 1; j < l; j++)
    {
      GEN v, C, C0;
      long m, e;
      for (m = 0; m <= LIM; m++)
      {
        v = lfuntheta(gmael(L,j,2), gen_1, m, bit);
        if (gexpo(v) > bit_add - bit/2) break;
      }
      if (m > LIM) { LIM <<= 1; goto START; }
      C = mulcxpowIs(gdiv(v,conj_i(v)), 2*m - k);
      C0 = grndtoi(C, &e); if (e < 5-bit_accuracy(precision(C))) C = C0;
      gel(z,j) = C;
    }
  }
  return Z;
}
static GEN mffrickeeigen_i ( GEN mf , GEN F , GEN vE , long prec ) { GEN M , Z , L0 , gN = MF_get_gN ( mf ) , gk = MF_get_gk ( mf ) ; long N0 , i , lM , bit = prec2nbits ( prec ) , k = itou ( gk ) ; long LIM = 5 ; L0 = mfthetaancreate ( NULL , gN , gk ) ; START : N0 = lfunthetacost ( L0 , gen_1 , LIM , bit ) ; M = mfcoefs_mf ( mf , N0 , 1 ) ; lM = lg ( F ) ; Z = cgetg ( lM , t_VEC ) ; for ( i = 1 ; i < lM ; i ++ ) { GEN D , z , van = RgM_RgC_mul ( M , Q_remove_denom ( gel ( F , i ) , & D ) ) ; GEN L = van_embedall ( van , gel ( vE , i ) , gN , gk ) ; long l = lg ( L ) , j , bit_add = D ? expi ( D ) : 0 ; gel ( Z , i ) = z = cgetg ( l , t_VEC ) ; for ( j = 1 ; j < l ; j ++ ) { GEN v , C , C0 ; long m , e ; for ( m = 0 ; m <= LIM ; m ++ ) { v = lfuntheta ( gmael ( L , j , 2 ) , gen_1 , m , bit ) ; if ( gexpo ( v ) > bit_add - bit / 2 ) break ; } if ( m > LIM ) { LIM <<= 1 ; goto START ; } C = mulcxpowIs ( gdiv ( v , conj_i ( v ) ) , 2 * m - k ) ; C0 = grndtoi ( C , & e ) ; if ( e < 5 - bit_accuracy ( precision ( C ) ) ) C = C0 ; gel ( z , j ) = C ; } } return Z ; }
F = vector of newforms in mftobasis format
F = vector of newforms in mftobasis format
/* Sturm bound is enough */ /* only for thetacost */ /* expansion of D * F[i] */