I think this is a fast algorithm. Im not sure what fast can be just testing the multiplicative order
El domingo, 20 de abril de 2014 15:00:37 UTC-5, John Cremona escribió: > > Any reason not to just test r.multiplicative_order() ? > > John Cremona > > On 20 April 2014 20:11, Jan Medina <janme...@gmail.com <javascript:>> > wrote: > > I did this algorithm to find a primitive element of a multiplicative > group > > on a finite field. This is a basic algorithm > > def random_primitive(p,h): > > F.<x>=GF(p^h) > > s=p^h-1 > > r=F.random_element() > > j=0 > > if r!=0: > > for t in prime_factors(s): > > if r^(s/t)==1: > > j=j+1 > > if j==0: > > return r > > else: > > return random_primitive(p,h) > > else: > > return random_primitive(p,h) > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "sage-support" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to sage-support...@googlegroups.com <javascript:>. > > To post to this group, send email to > > sage-s...@googlegroups.com<javascript:>. > > > Visit this group at http://groups.google.com/group/sage-support. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.