Function Repository Resource:

GroupDirectProduct

Source Notebook

Construct direct products of groups

Contributed by: Naman T.

ResourceFunction["GroupDirectProduct"][G1,G2,,Gn]

constructs the direct product of groups G1,G2,,Gn.

Details

For groups G1, G2, , Gn, their direct product is given by iGi={(gi):gi∈Gii} under a component-wise operation.
The result is returned as a permutation group whose generators act on pairwise disjoint supports.

Examples

Basic Examples (4) 

Construct Klein's 4-group:

In[1]:=
k4 = ResourceFunction["GroupDirectProduct"][CyclicGroup[2], CyclicGroup[2]]
Out[1]=

Its multiplication table:

In[2]:=
GroupMultiplicationTable[k4] // MatrixForm
Out[2]=

CyclicGroup[4] also has order 4 but differs from Klein's 4-group:

In[3]:=
GroupMultiplicationTable[CyclicGroup[4]] // MatrixForm
Out[3]=

Construct direct products of explicit permutation groups:

In[4]:=
ResourceFunction["GroupDirectProduct"][
 PermutationGroup[{Cycles[{{1, 6}}]}],
 PermutationGroup[{Cycles[{{1, 2, 3}}]}]
 ]
Out[4]=

Find its order:

In[5]:=
GroupOrder[%]
Out[5]=

Easily deal with large groups:

In[6]:=
GroupOrder@ResourceFunction["GroupDirectProduct"][
  SymmetricGroup[10], SymmetricGroup[20]
  ]
Out[6]=

This is as expected:

In[7]:=
10! 20!
Out[7]=

Compute direct products of large named groups:

In[8]:=
ResourceFunction["GroupDirectProduct"][MathieuGroupM11[], MathieuGroupM12[]] // GroupGenerators
Out[8]=

Scope (1) 

Construct direct product of more than 2 groups:

In[9]:=
ResourceFunction["GroupDirectProduct"][CyclicGroup[2], SymmetricGroup[3], CyclicGroup[2]]
Out[9]=

Applications (4) 

Show that CyclicGroup[2] × CyclicGroup[2] × CyclicGroup[2] shares the same structure as that of AbelianGroup[{2,2,2}]:

In[10]:=
CayleyGraph[AbelianGroup[{2, 2, 2}]]
Out[10]=
In[11]:=
CayleyGraph[
 ResourceFunction["GroupDirectProduct"][CyclicGroup[2], CyclicGroup[2],
   CyclicGroup[2]]
 ]
Out[11]=

Index of the subgroup {e}×CyclicGroup[2] inside CyclicGroup[4]×CyclicGroup[2] yields the expected order of the quotient group (CyclicGroup[4]):

In[12]:=
g = ResourceFunction["GroupDirectProduct"][CyclicGroup[4], CyclicGroup[2]];
h = PermutationGroup[{Cycles[{{5, 6}}]}];
In[13]:=
GroupOrder[g]/GroupOrder[h] == GroupOrder[CyclicGroup[4]]
Out[13]=

Construct the symmetry group of a regular n-gonal prism:

In[14]:=
PrismGroup[n_] := ResourceFunction["GroupDirectProduct"][DihedralGroup[n], CyclicGroup[2]]

For n=6:

In[15]:=
PrismGroup[6] // GroupOrder
Out[15]=

Show that the symmetry group of a disjoint union of two separate complete graphs is the direct product of their respective symmetric groups:

In[16]:=
graph = GraphDisjointUnion[CompleteGraph[2], CompleteGraph[3]];
In[17]:=
GraphAutomorphismGroup[graph]
Out[17]=
In[18]:=
ResourceFunction["GroupDirectProduct"][SymmetricGroup[2], SymmetricGroup[3]]
Out[18]=

Verify that these are isomorphic to each other:

In[19]:=
ResourceFunction["FindGroupIsomorphism"][%, %%, 1]
Out[19]=

Properties and Relations (3) 

Order of the direct product equals product of orders of the constituent groups:

In[20]:=
gdp = ResourceFunction["GroupDirectProduct"][AlternatingGroup[4], DihedralGroup[5]];
In[21]:=
GroupOrder[gdp] == GroupOrder[AlternatingGroup[4]] GroupOrder[DihedralGroup[5]]
Out[21]=

Direct product of a single group is nothing but that group itself:

In[22]:=
ResourceFunction["GroupDirectProduct"][AlternatingGroup[4]]
Out[22]=

The direct product with the trivial group returns a structure isomorphic to that of the group itself:

In[23]:=
IsomorphicGraphQ[
 CayleyGraph[
  ResourceFunction["GroupDirectProduct"][SymmetricGroup[4], PermutationGroup[{Cycles[{}]}]]],
 CayleyGraph[SymmetricGroup[4]]
 ]
Out[23]=

Possible Issues (2) 

For some groups, data may not be available in the Wolfram language:

In[24]:=
GroupGenerators[MonsterGroupM[]]
Out[24]=

As such, it is not possible to compute direct products of these:

In[25]:=
ResourceFunction["GroupDirectProduct"][MonsterGroupM[], CyclicGroup[3]]
Out[25]=

Neat Examples (2) 

When gcd(m,n)=1 we have that CyclicGroup[mn] is isomorphic to CyclicGroup[m]×CyclicGroup[n]:

In[26]:=
ResourceFunction["FindGroupIsomorphism"][CyclicGroup[2 3], ResourceFunction["GroupDirectProduct"][CyclicGroup[2], CyclicGroup[3]],
  1]
Out[26]=

However, otherwise this equivalence is not guaranteed:

In[27]:=
ResourceFunction["FindGroupIsomorphism"][CyclicGroup[2 4], ResourceFunction["GroupDirectProduct"][CyclicGroup[2], CyclicGroup[4]],
  1]
Out[27]=

Publisher

Naman T.

Version History

  • 1.0.0 – 01 July 2026

Related Resources

License Information