bridge/class-master/depend/pari/src/basemath/mftrace.c
/* F form, E embedding; mfa = mfatkininit or root number (eigenform case) */
F form, E embedding; mfa = mfatkininit or root number (eigenform case)
F form E embedding ; mfa = mfatkininit or root number ( eigenform case )
static GEN
mflfuncreate(GEN mfa, GEN F, GEN E, GEN N, GEN gk)
{
  GEN LF = cgetg(8,t_VEC), polar = cgetg(1,t_COL), eps;
  long k = itou(gk);
  gel(LF,1) = lfuntag(t_LFUN_MFCLOS, mkvec3(F,E,gen_1));
  if (typ(mfa) != t_VEC)
    eps = mfa; 
  else
  { 
    GEN a0, b0, vF, vG, G = NULL, M = gdiv(gel(mfa,2), gel(mfa,3)), mf = gel(mfa,4);
    vF = mftobasis_i(mf, F);
    vG = RgM_RgC_mul(M, vF);
    if (gequal(vF,vG)) eps = gen_1;
    else if (gequal(vF,gneg(vG))) eps = gen_m1;
    else
    { 
      eps = NULL;
      G = mfatkin(mfa, F);
      gel(LF,2) = lfuntag(t_LFUN_MFCLOS, mkvec3(G,E,ginv(gel(mfa,3))));
      gel(LF,6) = powIs(k);
    }
    a0 = mfcoef(F,0);
    b0 = eps? gmul(eps,a0): mfcoef(G,0);
    if (!gequal0(b0))
    {
      b0 = mulcxpowIs(gmul2n(b0,1), k);
      polar = vec_append(polar, mkvec2(gk, simple_pole(b0)));
    }
    if (!gequal0(a0))
    {
      a0 = gneg(gmul2n(a0,1));
      polar = vec_append(polar, mkvec2(gen_0, simple_pole(a0)));
    }
  }
  if (eps) 
  {
    gel(LF,2) = mfcharorder(mf_get_CHI(F)) <= 2? gen_0: gen_1;
    gel(LF,6) = mulcxpowIs(eps,k);
  }
  gel(LF,3) = mkvec2(gen_0, gen_1);
  gel(LF,4) = gk;
  gel(LF,5) = N;
  if (lg(polar) == 1) setlg(LF,7); else gel(LF,7) = polar;
  return LF;
}
static GEN mflfuncreate ( GEN mfa , GEN F , GEN E , GEN N , GEN gk ) { GEN LF = cgetg ( 8 , t_VEC ) , polar = cgetg ( 1 , t_COL ) , eps ; long k = itou ( gk ) ; gel ( LF , 1 ) = lfuntag ( t_LFUN_MFCLOS , mkvec3 ( F , E , gen_1 ) ) ; if ( typ ( mfa ) != t_VEC ) eps = mfa ; else { GEN a0 , b0 , vF , vG , G = NULL , M = gdiv ( gel ( mfa , 2 ) , gel ( mfa , 3 ) ) , mf = gel ( mfa , 4 ) ; vF = mftobasis_i ( mf , F ) ; vG = RgM_RgC_mul ( M , vF ) ; if ( gequal ( vF , vG ) ) eps = gen_1 ; else if ( gequal ( vF , gneg ( vG ) ) ) eps = gen_m1 ; else { eps = NULL ; G = mfatkin ( mfa , F ) ; gel ( LF , 2 ) = lfuntag ( t_LFUN_MFCLOS , mkvec3 ( G , E , ginv ( gel ( mfa , 3 ) ) ) ) ; gel ( LF , 6 ) = powIs ( k ) ; } a0 = mfcoef ( F , 0 ) ; b0 = eps ? gmul ( eps , a0 ) : mfcoef ( G , 0 ) ; if ( ! gequal0 ( b0 ) ) { b0 = mulcxpowIs ( gmul2n ( b0 , 1 ) , k ) ; polar = vec_append ( polar , mkvec2 ( gk , simple_pole ( b0 ) ) ) ; } if ( ! gequal0 ( a0 ) ) { a0 = gneg ( gmul2n ( a0 , 1 ) ) ; polar = vec_append ( polar , mkvec2 ( gen_0 , simple_pole ( a0 ) ) ) ; } } if ( eps ) { gel ( LF , 2 ) = mfcharorder ( mf_get_CHI ( F ) ) <= 2 ? gen_0 : gen_1 ; gel ( LF , 6 ) = mulcxpowIs ( eps , k ) ; } gel ( LF , 3 ) = mkvec2 ( gen_0 , gen_1 ) ; gel ( LF , 4 ) = gk ; gel ( LF , 5 ) = N ; if ( lg ( polar ) == 1 ) setlg ( LF , 7 ) ; else gel ( LF , 7 ) = polar ; return LF ; }
F form, E embedding; mfa = mfatkininit or root number (eigenform case)
F form E embedding ; mfa = mfatkininit or root number ( eigenform case )
/* cuspidal eigenform: root number; no poles */ /* mfatkininit */ /* not self-dual */ /* polar part */ /* self-dual */