id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
29064 is_galois() / automorphisms() can be made faster rburing "Let `K. = NumberField(f)`. The method `K.is_galois()` does the following:
{{{
if self.degree() < 12:
return self.galois_group(type='pari').order() == self.degree()
else:
return len(self.automorphisms()) == self.degree()
}}}
The method `K.automorphisms()` [https://github.com/sagemath/sage/blob/31cb54b77951c888af513734ca36ac045fa9ca86/src/sage/rings/number_field/number_field.py#L8329 defined here] runs essentially the PARI code
{{{
nfgaloisconj(nfinit(f))
}}}
to compute the automorphisms, followed by some conversions.
As [https://pari.math.u-bordeaux.fr/archives/pari-users-2001/msg00002.html just discussed on pari-users], it is faster to run instead
{{{
nfgaloisconj(f)
}}}
because `nfinit` computes the full factorization of the discriminant of the polynomial, which is not (always) needed.
The question is whether the `nfinit(f)` data is really needed for the conversions in `K.automorphisms()`. If it is not needed, then the optimization (that is, calling `nfgaloisconj(f)` instead) can be implemented there. If it is needed, then the optimization can be implemented in `is_galois()`.
Either way, this would make `is_galois()` work faster for extensions of high degree.
The fact that it is currently slow was [https://ask.sagemath.org/question/49620/is_galois-computation/ reported on Ask SageMath], which led me to investigate." enhancement new major sage-9.5 number fields is_galois,automorphisms N/A