bridge/class-master/depend/pari/src/modules/algebras.c
/* assumes that mt defines a central simple algebra over nf */
assumes that mt defines a central simple algebra over nf
assumes that mt defines a central simple algebra over nf
GEN
alg_csa_table(GEN nf, GEN mt0, long v, long maxord)
{
  pari_sp av = avma;
  GEN al, mt;
  long n, D, d2 = lg(mt0)-1, d = usqrt(d2);
  dbg_printf(1)("alg_csa_table\n");
  nf = checknf(nf);
  mt = check_relmt(nf,mt0);
  if (!mt) pari_err_TYPE("alg_csa_table", mt0);
  n = nf_get_degree(nf);
  D = n*d2;
  if (d*d != d2)
    pari_err_DOMAIN("alg_csa_table","(nonsquare) dimension","!=",stoi(d*d),mt);
  al = cgetg(12, t_VEC);
  gel(al,10) = gen_0; 
  gel(al,1) = zerovec(12); gmael(al,1,10) = nf;
  gmael(al,1,1) = gpowgs(pol_x(0), d); 
  gel(al,2) = mt;
  gel(al,3) = gen_0; 
  gel(al,4) = gel(al,5) = gen_0; 
  gel(al,5) = gel(al,6) = gen_0; 
  gel(al,7) = matid(D);
  gel(al,8) = matid(D);
  gel(al,9) = algnatmultable(al,D);
  gel(al,11)= algtracebasis(al);
  if (maxord) al = alg_maximal(al);
  computesplitting(al, d, v);
  return gerepilecopy(av, al);
}
GEN alg_csa_table ( GEN nf , GEN mt0 , long v , long maxord ) { pari_sp av = avma ; GEN al , mt ; long n , D , d2 = lg ( mt0 ) - 1 , d = usqrt ( d2 ) ; dbg_printf ( 1 ) ( " \n " ) ; nf = checknf ( nf ) ; mt = check_relmt ( nf , mt0 ) ; if ( ! mt ) pari_err_TYPE ( " " , mt0 ) ; n = nf_get_degree ( nf ) ; D = n * d2 ; if ( d * d != d2 ) pari_err_DOMAIN ( " " , " " , " " , stoi ( d * d ) , mt ) ; al = cgetg ( 12 , t_VEC ) ; gel ( al , 10 ) = gen_0 ; gel ( al , 1 ) = zerovec ( 12 ) ; gmael ( al , 1 , 10 ) = nf ; gmael ( al , 1 , 1 ) = gpowgs ( pol_x ( 0 ) , d ) ; gel ( al , 2 ) = mt ; gel ( al , 3 ) = gen_0 ; gel ( al , 4 ) = gel ( al , 5 ) = gen_0 ; gel ( al , 5 ) = gel ( al , 6 ) = gen_0 ; gel ( al , 7 ) = matid ( D ) ; gel ( al , 8 ) = matid ( D ) ; gel ( al , 9 ) = algnatmultable ( al , D ) ; gel ( al , 11 ) = algtracebasis ( al ) ; if ( maxord ) al = alg_maximal ( al ) ; computesplitting ( al , d , v ) ; return gerepilecopy ( av , al ) ; }
assumes that mt defines a central simple algebra over nf
assumes that mt defines a central simple algebra over nf
/* must be set first */ /* placeholder before splitting field */ /* placeholder */ /* TODO Hasse invariants */ /* placeholder */