bridge/class-master/depend/pari/src/basemath/mftrace.c
/* contribution of elliptic matrices of order 4 in dimension formula.
 * Only depends on CHIP the primitive char attached to CHI */
contribution of elliptic matrices of order 4 in dimension formula.
Only depends on CHIP the primitive char attached to CHI
contribution of elliptic matrices of order 4 in dimension formula . Only depends on CHIP the primitive char attached to CHI
static GEN
A22(long N, long k, GEN CHI)
{
  GEN G, chi, o, res;
  long S, a22, i, limx, o2;
  if ((N&3L) == 0) return gen_0;
  a22 = (k & 3L) - 1; 
  if (!a22) return gen_0;
  if (N <= 2) return sstoQ(a22, 4);
  if (!CHI) return sstoQ(nu2(N)*a22, 4);
  if (mfcharparity(CHI) == -1) return gen_0;
  res = sqrtm1modN(N); limx = (N - 1) >> 1;
  G = gel(CHI,1); chi = gel(CHI,2);
  o = gmfcharorder(CHI);
  o2 = itou(o)>>1;
  for (S = 0, i = 1; i < lg(res); i++)
  { 
    long x = res[i];
    if (x <= limx)
    { 
      long c = itou( znchareval(G, chi, utoi(x), o) );
      if (!c) S++; else if (c == o2) S--;
    }
  }
  return sstoQ(a22 * S, 2);
}
static GEN A22 ( long N , long k , GEN CHI ) { GEN G , chi , o , res ; long S , a22 , i , limx , o2 ; if ( ( N & 3L ) == 0 ) return gen_0 ; a22 = ( k & 3L ) - 1 ; if ( ! a22 ) return gen_0 ; if ( N <= 2 ) return sstoQ ( a22 , 4 ) ; if ( ! CHI ) return sstoQ ( nu2 ( N ) * a22 , 4 ) ; if ( mfcharparity ( CHI ) == -1 ) return gen_0 ; res = sqrtm1modN ( N ) ; limx = ( N - 1 ) >> 1 ; G = gel ( CHI , 1 ) ; chi = gel ( CHI , 2 ) ; o = gmfcharorder ( CHI ) ; o2 = itou ( o ) >> 1 ; for ( S = 0 , i = 1 ; i < lg ( res ) ; i ++ ) { long x = res [ i ] ; if ( x <= limx ) { long c = itou ( znchareval ( G , chi , utoi ( x ) , o ) ) ; if ( ! c ) S ++ ; else if ( c == o2 ) S -- ; } } return sstoQ ( a22 * S , 2 ) ; }
contribution of elliptic matrices of order 4 in dimension formula.
contribution of elliptic matrices of order 4 in dimension formula .
/* (k % 4) - 1 */ /* (x,N) = 1, S += real(chi(x)) */ /* CHI(x)=e(c/o), 4th-root of 1 */