Closed 93749b3a-c0a4-47a7-b178-004ba08b0b97 closed 16 years ago
The attached patch implements a simple iterator for finding primes of number fields of small prime norm. It is very possible this won't work for large fields; I would appreciate feedback. It certainly works well for my examples, which are of degree less than or equal to 40.
Attachment: 2835-ncalexan-primes-of-degree-one-1.patch.gz
It's an interesting idea to do it this way. When I had to do something similar I just looped over primes p and computed x^p mod (p,f(x)). But I wanted p for which f split completely, which is a lot stronger than what you need.
As this is a function which will not be used all that much, I suggest putting it in and seeing how it fares in actual use.
Nick,
I agree with John on this. I looked at your patch and it looks good to me, but I've only played around with it a little bit. The real test will come when somebody actually uses it in a nontrivial way -- but that is not likely to happen if it isn't in Sage. It is extra functionality so it won't break anything that's already there.
I would prefer it if you changed the last line of next() to
return self._field.fractional_ideal([p, x - n])
for the reasons that are stated in http://groups.google.com/group/sage-devel/t/b01d58d8c3565c2 (but this is something that we can also change later on).
Merged in Sage 3.0.alpha3
It would be useful, for multimodular algorithms (and more!) to be able to find degree one primes in a number field.
For posterity, the following IRC transcript, copied from #903, is relevant:
CC: @ncalexan
Component: number theory
Keywords: degree one prime number field norm
Issue created by migration from https://trac.sagemath.org/ticket/2835