pari groups

192 views
Skip to first unread message

John Cremona

unread,
Oct 15, 2017, 12:25:11 PM10/15/17
to SAGE devel, sage-a...@googlegroups.com, sage-nt
Extracting information about a Galois group is more painful than it
should be. After

sage: K.<z> = CyclotomicField(5)
sage: G = K.galois_group(type='pari')
sage: G
Galois group PARI group [4, -1, 1, "C(4) = 4"] of degree 4 of the
Cyclotomic Field of order 5 and degree 4

we have

sage: type(G)
<class 'sage.rings.number_field.galois_group.GaloisGroup_v1'>

(other types are returned if other options for the galois_group()
method are chosen). There is not a lot you can do with this G except
get its order (G.order()) without going deeper:

sage: GG=G.group()
sage: type(GG)
<class 'sage.groups.pari_group.PariGroup_with_category'>
sage: GG
PARI group [4, -1, 1, "C(4) = 4"] of degree 4

This type has "forgotten" that it is a Galois group but has many more
methods; sadly most not implemented. At least one might want to
extract the 4 elements of the underlying list which are the order (4)
which in this example happens to also be the degree (4), meaning that
GG is a subgroup of S_4 (degree=4) of order 4. The second entry -1 is
the sign (-1 means odd, i.e. not a subgroup of A_4), the third is the
"T-number" which identifies this group in some classification of
transitive groups.

As far as I know the only way to get the sign and T-number is to
retrieve the underlying PARI list via GG.__pari__() (which until
recently was GG._pari_() with single underscores). I would like to
implement

GG.sign() # returns GG.__pari__()[1]
GG.t_number() # returns GG.__pari__()[2]

and perhaps more. I have been looking in the PARI/gp documentation on
Galois groups and what it says about this 4-tuple is

"The output is a 4-component vector [n,s,k,name] with the following
meaning: n is the cardinality of the group, s is its signature (s = 1
if the group is a subgroup of the alternating group A_d, s = -1
otherwise) and name is a character string containing name of the
transitive group according to the GAP 4 transitive groups library by
Alexander Hulpke.

k is more arbitrary and the choice made up to version 2.2.3 of PARI is
rather unfortunate: for d > 7, k is the numbering of the group among
all transitive subgroups of S_d, as given in "The transitive groups of
degree up to eleven", G. Butler and J. McKay, Communications in
Algebra, vol. 11, 1983, pp. 863--911 (group k is denoted T_k there).
And for d ≤ 7, it was ad hoc, so as to ensure that a given triple
would denote a unique group. Specifically, for polynomials of degree d
≤ 7, the groups are coded as follows, using standard notations (etc)"

Despite the ad hoc nature of this parameter k I still think we should
allow users to get at it more easily.

John

Samuel Lelievre

unread,
Jan 3, 2018, 7:46:15 PM1/3/18
to sage-devel
Sorry to reply almost three months later. I opened #24469 for that,
with a link to this discussion.



Sun 2017-10-15 16:25:11 UTC, John Cremona:

Sanketh

unread,
Apr 13, 2018, 7:34:46 AM4/13/18
to sage-devel
This is probably obvious but why is type='gap' not standard for Galois groups?

David Loeffler

unread,
Apr 13, 2018, 8:22:23 AM4/13/18
to SAGE devel
On 13 April 2018 at 12:25, Sanketh <mendas...@gmail.com> wrote:
This is probably obvious but why is type='gap' not standard for Galois groups? 

Because Pari is *vastly* faster. E.g. see this example, where Pari beats Gap by a factor of 100:

sage: K.<a> = NumberField(x^5 - x - 1)
sage: time _=K.galois_group(type='pari')
CPU times: user 8.26 ms, sys: 3.65 ms, total: 11.9 ms
Wall time: 53.5 ms
sage: time _=K.galois_group(type='gap')
CPU times: user 212 ms, sys: 149 ms, total: 361 ms
Wall time: 5.38 s

Samuel Lelièvre

unread,
Apr 13, 2018, 8:49:30 AM4/13/18
to Sage-devel
The difference is the time to fire up GAP.

Once GAP is started, there is not much difference
in time between computing with type='pari' or type='gap'.

$ sage -q
sage: K.<a> = NumberField(x^5 - x - 1)
sage: %time K.galois_group(type='pari')
CPU times: user 3.5 ms, sys: 831 µs, total: 4.33 ms
Wall time: 4.72 ms
Galois group PARI group [120, -1, 5, "S5"] of degree 5 of the Number Field in a with defining polynomial x^5 - x - 1
sage: %time K.galois_group(type='gap')
CPU times: user 113 ms, sys: 61.5 ms, total: 175 ms
Wall time: 8.15 s
Galois group Transitive group number 5 of degree 5 of the Number Field in a with defining polynomial x^5 - x - 1

sage: L.<a> = NumberField(x^5 - x + 1)
sage: %time L.galois_group(type='pari')
CPU times: user 1.58 ms, sys: 566 µs, total: 2.15 ms
Wall time: 2.16 ms
Galois group PARI group [120, -1, 5, "S5"] of degree 5 of the Number Field in a with defining polynomial x^5 - x + 1
sage: %time L.galois_group(type='gap')
CPU times: user 1.56 ms, sys: 418 µs, total: 1.98 ms
Wall time: 1.98 ms
Galois group Transitive group number 5 of degree 5 of the Number Field in a with defining polynomial x^5 - x + 1


Sanketh

unread,
Apr 13, 2018, 8:55:19 AM4/13/18
to sage-devel
Yup. Also, sage seems to have better support for gap groups. For instance,

sage: L.<a> = NumberField(x^5 - x + 1)
sage: L.galois_group(type='gap').group().is_abelian()
False
sage: L.galois_group(type='pari').group().is_abelian()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-6-92f6c78fc721> in <module>()
----> 1 L.galois_group(type='pari').group().is_abelian()

NotImplementedError:

Simon King

unread,
Apr 13, 2018, 9:00:17 AM4/13/18
to sage-...@googlegroups.com
Hi David,
Might be interesting to offer libgap as one option. After all, it avoids
the time to start Gap.

Best regards,
Simon

John Cremona

unread,
Apr 13, 2018, 9:21:39 AM4/13/18
to SAGE devel
The pari option essentially just identifies which group it is from a list, and gives back some very basic data about the group.  This is not always easy to extract (see https://trac.sagemath.org/ticket/24469).   If you want to do more, for example use group elements as automorphisms of the field, you need more.

John


--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscribe@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Sanketh

unread,
Apr 13, 2018, 4:31:04 PM4/13/18
to sage-devel
For the specific case you mentioned, wouldn't it be easier to make .automorphisms() return a group? This way you can also work with relative fields.


On Sunday, October 15, 2017 at 12:25:11 PM UTC-4, John Cremona wrote:
Reply all
Reply to author
Forward
0 new messages