bridge/class-master/depend/pari/src/basemath/ellisog.c
/* Assume there is a single p-isogeny */
Assume there is a single p-isogeny
Assume there is a single p - isogeny
static GEN
isomatdbl(GEN nf, GEN L, GEN M, ulong p, GEN T2, long flag)
{
  long i, j, n = lg(L) -1;
  GEN P = get_polmodular(p), V = cgetg(2*n+1, t_VEC), N = cgetg(2*n+1, t_MAT);
  for (i=1; i <= n; i++)
  {
    GEN F, E, e = gel(L,i);
    if (i == 1)
      F = gmael(T2, 2, 1);
    else
    {
      F = ellisograph_iso(nf, e, p, P, NULL, flag);
      if (lg(F) != 2) pari_err_BUG("isomatdbl");
    }
    E = gel(F, 1);
    if (flag)
      E = mkvec3(gel(E,1), gel(E,2), gel(E,3));
    else
    {
      GEN iso = ellnfcompisog(nf, gel(E,4), gel(e, 4));
      GEN isot = ellnfcompisog(nf, gel(e,5), gel(E, 5));
      E = mkvec5(gel(E,1), gel(E,2), gel(E,3), iso, isot);
    }
    gel(V, i)   = e;
    gel(V, i+n) = E;
  }
  for (i=1; i <= 2*n; i++) gel(N, i) = cgetg(2*n+1, t_COL);
  for (i=1; i <= n; i++)
    for (j=1; j <= n; j++)
    {
      gcoeff(N,i,j) = gcoeff(N,i+n,j+n) = gcoeff(M,i,j);
      gcoeff(N,i,j+n) = gcoeff(N,i+n,j) = muliu(gcoeff(M,i,j), p);
    }
  return mkvec2(V, N);
}
static GEN isomatdbl ( GEN nf , GEN L , GEN M , ulong p , GEN T2 , long flag ) { long i , j , n = lg ( L ) - 1 ; GEN P = get_polmodular ( p ) , V = cgetg ( 2 * n + 1 , t_VEC ) , N = cgetg ( 2 * n + 1 , t_MAT ) ; for ( i = 1 ; i <= n ; i ++ ) { GEN F , E , e = gel ( L , i ) ; if ( i == 1 ) F = gmael ( T2 , 2 , 1 ) ; else { F = ellisograph_iso ( nf , e , p , P , NULL , flag ) ; if ( lg ( F ) != 2 ) pari_err_BUG ( " " ) ; } E = gel ( F , 1 ) ; if ( flag ) E = mkvec3 ( gel ( E , 1 ) , gel ( E , 2 ) , gel ( E , 3 ) ) ; else { GEN iso = ellnfcompisog ( nf , gel ( E , 4 ) , gel ( e , 4 ) ) ; GEN isot = ellnfcompisog ( nf , gel ( e , 5 ) , gel ( E , 5 ) ) ; E = mkvec5 ( gel ( E , 1 ) , gel ( E , 2 ) , gel ( E , 3 ) , iso , isot ) ; } gel ( V , i ) = e ; gel ( V , i + n ) = E ; } for ( i = 1 ; i <= 2 * n ; i ++ ) gel ( N , i ) = cgetg ( 2 * n + 1 , t_COL ) ; for ( i = 1 ; i <= n ; i ++ ) for ( j = 1 ; j <= n ; j ++ ) { gcoeff ( N , i , j ) = gcoeff ( N , i + n , j + n ) = gcoeff ( M , i , j ) ; gcoeff ( N , i , j + n ) = gcoeff ( N , i + n , j ) = muliu ( gcoeff ( M , i , j ) , p ) ; } return mkvec2 ( V , N ) ; }
Assume there is a single p-isogeny
Assume there is a single p - isogeny