Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In general, for my purposes and in my opinion sage (or any other computer algebra system) cannot be an all-purpose computational device, so computations should / must often be complemented by putting the problem to be solved in position to be digested by the computational engine. This means that it is often simpler to search for the best setting to implement a specific question. (This is mentioned here, since it better introduces the answer.) So here we go.

For the special case of the quadratic extension $\Bbb F_{49}=\Bbb F_7[j]$, with $j^2=-1$, we are still in shape to use "standard" sage constructions:

R.<T> = PolynomialRing(GF(7))
F.<j> = GF(7^2, modulus=T^2 + 1)
S = SL(2, F)

And now:

sage: S.cardinality()
117600
sage: S.is_finite()
True

For the second question, sage has dedicated methods implemented in special classes. Often, the algorithm used needs a specific algorithm. To insure the algorithm can be applied (in a needed structure) means in program terms that a situation is or can be modeled in a specific class. In our case:

sage: K = DihedralGroup(12)
sage: K.__class__
<class 'sage.groups.perm_gps.permgroup_named.DihedralGroup_with_category'>
sage: K.conjugacy_classes_subgroups
<bound method PermutationGroup_generic.conjugacy_classes_subgroups of Dihedral group of order 24 
    as a permutation group>

(Lines were manually adjusted.) So the method wants a "permutation group", maybe. To see why it works for K, we ask for

sage: K.conjugacy_classes_subgroups??

and get the code, and the file...

Source:   
    def conjugacy_classes_subgroups(self):
        """
        Return a complete list of representatives of conjugacy classes of
        subgroups in a permutation group `G`.

        The ordering is that given by GAP.

        EXAMPLES::

            sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]])
            sage: cl = G.conjugacy_classes_subgroups()
            sage: cl
            [Subgroup generated by [()] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(1,2)(3,4)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(1,3)(2,4)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(2,4)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(1,2)(3,4), (1,4)(2,3)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(2,4), (1,3)(2,4)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(1,2,3,4), (1,3)(2,4)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)]),
             Subgroup generated by [(2,4), (1,2)(3,4), (1,4)(2,3)] of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4)])]

        ::

            sage: G = SymmetricGroup(3)
            sage: G.conjugacy_classes_subgroups()
            [Subgroup generated by [()] of (Symmetric group of order 3! as a permutation group),
             Subgroup generated by [(2,3)] of (Symmetric group of order 3! as a permutation group),
             Subgroup generated by [(1,2,3)] of (Symmetric group of order 3! as a permutation group),
             Subgroup generated by [(2,3), (1,2,3)] of (Symmetric group of order 3! as a permutation group)]

        AUTHORS:

        - David Joyner (2006-10)
        """
        cl = self._libgap_().ConjugacyClassesSubgroups()
        return [self.subgroup(gap_group=sub.Representative()) for sub in cl]
File:      /usr/lib/python3.10/site-packages/sage/groups/perm_gps/permgroup.py
Type:      method

So the instance self needs that _libgap_ - and on this object we further ask for ConjugacyClassesSubgroups.

So i tried for S the obvious

sage: S._libgap_().ConjugacyClassesSubgroups()

and to my surprise the screen was filled after some seconds with many (gap specific) lines like...

Group([ [ [ Z(7)^3, 0*Z(7) ], [ 0*Z(7), Z(7)^3 ] ], [ [ Z(7^2)^18, Z(7^2)^11 ], [ Z(7^2)^23, Z(7^2)^45 ] ], [ [ Z(7^2)^45, Z(7) ], [ Z(7^2)^22, Z(7^2)^6 ] ] ])^G, 

Group([ [ [ Z(7)^3, 0*Z(7) ], [ 0*Z(7), Z(7)^3 ] ], [ [ Z(7^2)^18, Z(7^2)^11 ], [ Z(7^2)^23, Z(7^2)^45 ] ], [ [ Z(7)^5, Z(7^2)^31 ], [ Z(7^2)^41, 0*Z(7) ] ] ])^G