For a number field N I am trying to factor an integral prime p in a p-maximal order Op. In the end I would like a map from the quotient of the p-maximal order Op/P (for P|p) to some finite field in Sage's standard finite field form, but I can't quite figure out how to do it.
Firstly, Sage doesn't have ideals or residue fields of non-maximal orders implemented, so I am trying to compute the factorisation of p in Op via the PARI/GP interface with sage. I think this can be done, for example, in the following way, in which we compute a 7-maximal order of the number field defined by x^8+x^3-13*x+26 and compute all primes above 7 in this order.
x=polygen(QQ);
nf=gp.nfinit([x^8 + x^3 - 13*x + 26,[7]]); #Note the [7] at the end, indicating a 7-maximal order only.
nf;
fact=gp.idealprimedec(nf,7);
fact;
res_field_sizes=[];
for i in fact:
res_field_sizes.append(i[1]**i[4]);
res_field_sizes;
Now, for each element fact[i] of fact, I would like to compute a homomorphism Op->Op/fact[i]->GF(res_field_sizes[i-1],'gen') - note that we're using a vector in pari/gp and a list in sage hence fact[i] corresponds to res_field_sizes[i-1]. I can't quite get this to work.
I feel like there are two options:
- Translate the p-maximal order and prime factorisation back to sage. Take a poly quotient or something. Map this to a finite field.
- Keep on working in pari/gp and use, for example, nfeltreducemodpr to reduce elts of Op to the residue field (does this really calculate Op/P if the nf.zk is a non-maximal Z-basis?). Map this to a finite field somehow. Translate back to Sage.
I can't really get either approach to work at the moment. But I wouldn't call myself a big Sage or PARI/GP expert, so it is very possible that I am missing something.
Any suggestions would be much appreciated!