 GroupTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Group Theory : GroupTheory/DrawCayleyTable

GroupTheory

 DrawCayleyTable
 draw the Cayley table of a finite group

 Calling Sequence DrawCayleyTable(G, opts)

Parameters

 G - group data structure opts - (optional) equations of the form keyword = value, as explained below

Options

 • assignelements = name
 Specifying assignelements = x causes Maple to assign the list of elements to the name x, in the order in which the elements occur in the Cayley table. If x already has an assigned value, it will typically be necessary to use quotes to prevent evaluation of x: one can do so by specifying assignelements = 'x'.
 • collect = truefalse
 If collect is false, then the group elements are ordered arbitrarily. If collect is true, then the ordering of the group elements depends on the presence and values of the conjugacy, cosets, and subgroups options. See their descriptions below for details.
 If none of the options conjugacy, cosets, and subgroups are given, but collect is true, then a black vertical line and a black horizontal line divide the table into four quadrants. The upper left quadrant forms the Cayley Table for the center subgroup.  In other words, the elements in the center are left of (above) the vertical (horizontal) black line, and elements not in the center are right of (below) the vertical (horizontal) black line.
 Specifying just collect is equivalent to specifying collect = true. By default, collect is true.
 • colors = list or palette
 If given as a list, colors must be a list of colors [c1,c2,..] to be used for the group elements. colors can also be given as a ColorTools palette object or palette name.
 The presence and values of the conjugacy, cosets, subgroups, and symmetry options determines how exactly the group elements are colored. Each of these options determines a grouping of elements; each group of elements gets a different color. If none of the options is given, the groups are simply all the individual group elements.
 The colors specified in colors are used in order for the groups given; if there are more groups of elements than colors, the palette will be extended automatically; see ColorTools/Palette and ColorTools/ExpandPalette for more information. Lists of colors are automatically converted to a palette. Note: extending a palette can be a slow operation; if you need a large palette, it is most efficient to generate sufficient colors yourself.
 Individual colors should be specified in a way that ColorTools[Color] recognizes.
 The default value is a somewhat lighter version of what plots[setcolors] returns.
 • conjugacy = truefalse
 If conjugacy = true then elements are colored identically if and only if the elements are conjugate. Specifying just conjugacy is equivalent to specifying conjugacy = true. By default, conjugacy = false.
 If collect = true and conjugacy = true, then the elements in the same conjugacy class will be collected together. To be precise, if there are conjugacy classes C1,C2,... then the elements in C1 will be first in the list of elements, then the elements in C2 will be next, and so forth.
 • cosets = subgroup, list or set
 If cosets = H, the elements of G are partitioned into cosets using the subgroup defined by H. Elements are then colored identically if and only if they are in the same partition. H can be specified as a group data structure obtained using Subgroup, or with a list or set of generators (which will in turn be passed to Subgroup).
 If collect = true and the cosets option is specified, the elements in the same coset will be collected together. To be precise, if there are cosets H1,H2,... then the elements in H1 will be first in the list of elements, then the elements in H2 will be next, and so forth.
 • cosettype = right or left
 If cosettype = right then the cosets formed using cosets option will formed by multiplication on the right by the coset representative, i.e. Hg. Similarly, if cosettype = left, multiplication is on the left by the coset representative, i.e. gH. By default, cosettype = left.
 • font = list
 This option defines the font for all labels on the Cayley table. The font is specified as explained in plot/options.
 • fontcolor = [color1, color2]
 This option defines the color for the labels on the Cayley table. The first color is used for sites where the background is light, the second where the background is dark. color1 and color2 should be specified in a way that ColorTools[Color] recognizes. The default is $\left["black","white"\right]$.
 • labels = name or proc
 If labels is given as a procedure, then that procedure must accept as input an element of G and a positive integer; the integer is the number of the element in the order used. It should return the label to be used for the group element.
 If labels is given as a name, the value must be one of literal, words, letters, numbers, or none. Use
 – literal for any group. Group elements are directly converted to displayable format, using the print operation as returned by the command GroupTheory[Operations].
 – words for any group where GroupTheory[Labels] returns a list. Group elements are expressed in terms of the labeled generators.
 – letters only if the number of elements is less than or equal to 26. The elements are labeled with lowercase letters. The identity is labeled 'e'; the other elements are labeled with the remaining letters from 'a' to 'z'.
 – numbers for any group. The elements are labeled with positive integers, starting with '1' for the identity.
 – none for any group. No labels are displayed.
 For groups of more than 26 elements, the default is labels=none. For groups of 15 to 26 elements, the default is labels=letters. For fewer than 15 elements, if labels=words is valid for a group, that is the default. Otherwise, Maple uses a heuristic to determine if the literal labels would be too wide for the plot with the default size options; if so, it uses labels=letters, otherwise labels=literal.
 • legend = truefalse
 If legend = true, below the Cayley table, a legend of which labels correspond to which elements appears in the plot. Otherwise, if legend = false, nothing appears. Specifying just legend is equivalent to specifying legend = true. By default, legend = false.
 • order = truefalse
 If order = true then on the leftmost side where the elements are labeled by row, the order of each element appears to the left of its label. Otherwise, if order = false, nothing appears. Specifying just order is equivalent to specifying order = true. By default, order = false.
 • render3d = truefalse
 If render3d = true then the output will be a three-dimensional plot, and each entry in the Cayley table will be a block, instead of a square. Otherwise, if render3d = false, then output will be a two-dimensional plot. Specifying just render3d is equivalent to specifying render3d = true. By default, render3d = false.
 • subgroups = list
 The list must be a list of subgroups of G. Each subgroup will be assigned a color. Elements in the same subgroup are colored according to the subgroup's assigned color. A legend of the subgroup colors automatically appears on the right-hand side. If an element is in none of the specified subgroups, it is assigned the color black in 2-D and a gradient color in 3-D.
 – If render3d = true, then for elements occurring in multiple subgroups, a stack of blocks is displayed, one block for each subgroup the element is a member of (each block in its corresponding color). This can be seen by rotating the image.
 – If render3d = false, an element in multiple subgroups is colored by blending each subgroup color.
 If collect = true and subgroups is specified, then elements in the same subgroup will be collected together. To be precise, if there are subgroups H1,H2,... then the elements in H1 will be first in the list of elements, then the elements in H2 will be next, and so forth. This will be reflected in the drawing of the Cayley Table itself.
 If an element is in multiple subgroups, then it is collected with the first subgroup in which the element is found in the list prescribed by the option subgroups. For example, if an element s is found in subgroups H2,H3, and H5, then s will be collected with elements from H2.
 • symmetry = truefalse
 If symmetry = true, then if two elements a,b in G commute, then the Cayley table entries of ab and ba are colored as the first specified color in colors. If the elements do not commute, then the entries are colored as the second color. Otherwise, if symmetry = false, the elements are colored according to whichever other method of coloring is selected. Specifying just symmetry is equivalent to specifying symmetry = true. By default, symmetry = false.
 • title = expr
 The given expression is typeset as the title above the Cayley table.
 • titlefont = list
 The title is printed with this font.  The font is specified as explained in plot/options.
 • Any additional options are passed to $\mathrm{plots}\left[\mathrm{display}\right]$.

Description

 • The command DrawCayleyTable accepts a finite group G and returns a plot of the Cayley table of G.  The element labels are written along the left and top edge of the table. The (i,j) entry of the table represents the product of the element at the left of row i, and the element at the top of column j.  Hence, the entry is the product ij.  Each element of G is assigned a color, so if the element appears anywhere in the table, that entry is colored the element's assigned color. The black horizontal and vertical lines designate the center.  See option center for details.
 • The returned plot is by default two-dimensional, but can be returned as a 3-D object. In this case, each table entry is a cube, instead of a square.
 • For the options subgroups and cosets, to specify a subgroup H of G, H must be subgroup data structure, or a list or set of generators of a subgroup that is accepted by the Subgroup command.
 • At most one of the options conjugacy, cosets, subgroups, and symmetry can be active. (These options all determine the method of coloring of the elements.)
 An error will be thrown if this condition is violated.
 For an option to be 'active' means to have the value true for the conjugacy, and symmetry options; for the cosets, and subgroups options, it means to be included in the calling sequence.
 • To label elements without using the labels option, most types of groups allow one to specify labels for the generators in the group constructor, using equations. For example, instead of constructing a permutation group as $\mathrm{PermutationGroup}\left(\left[\left[\left[1,2\right]\right],\left[\left[1,2,3\right]\right]\right]\right)$, one can label the generators by constructing the group as $\mathrm{PermutationGroup}\left(\left[{a}_{1}=\left[\left[1,2\right]\right],{a}_{2}=\left[\left[1,2,3\right]\right]\right]\right)$. All other elements will be written as products of these generators, and hence of these labels.

Examples

 > with(GroupTheory):

We draw the Cayley table of the Symmetric Group on 3 letters.

 > G := < a, b | a^2, b^3, (a.b)^2 = 1 >;
 ${\mathrm{GroupTheory}}{:-}{\mathrm{FPGroup}}{}\left(\left[{a}{,}{b}\right]{,}\left\{\left[{a}{,}{a}\right]{,}\left[{b}{,}{b}{,}{b}\right]{,}\left[{a}{,}{b}{,}{a}{,}{b}\right]\right\}\right)$ (1)
 > DrawCayleyTable(G); We can obtain the list of elements as well.

 > G := PermutationGroup({ [[1,2,3,4]] });
 ${\mathrm{GroupTheory}}{:-}{\mathrm{PermutationGroup}}{}\left(\left\{{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right\}{,}{\mathrm{degree}}{=}{4}\right)$ (2)
 > DrawCayleyTable(G, 'assignelements = elements'); > elements;
 $\left[{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right]$ (3)

There exist various labelling options. For smaller groups, Maple displays the elements explicitly or expresses them in terms of generator names.

 > G := CustomGroup({1}, . = proc(a,b) a+b mod 2; end proc, / = (x -> x));
 ${\mathrm{GroupTheory}}{:-}{\mathrm{CustomGroup}}{}\left(\left[{1}\right]{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right)$ (4)
 > DrawCayleyTable(DirectProduct(G,G)); Specifying labels=numbers or labels=letters (the default used below) is useful when there are many elements. If there are far too many elements, try labels=none.

 > DrawCayleyTable(DicyclicGroup(4)); We partition the Symmetric Group on 4 letters by the Klein 4 group. Recall that the collection of resulting cosets form a group isomorphic to Symmetric Group on 3 letters. We specify H as a set of generators.

 > G := SymmetricGroup(4);
 ${\mathrm{GroupTheory}}{:-}{\mathrm{SymmetricGroup}}{}\left({4}\right)$ (5)
 > H := { Perm([[1,2],[3,4]]), Perm([[1,3],[2,4]]) };
 $\left\{{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right\}$ (6)
 > DrawCayleyTable(G, cosets = H); Since H is a normal subgroup, the entries all form blocks, effectively giving the Cayley table of the quotient group. If we take a non-normal subgroup, we don't have that effect.

 > H := {Perm([[1, 2, 3, 4]]), Perm([[1, 3], [2, 4]])};
 $\left\{{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right\}$ (7)
 > DrawCayleyTable(G, cosets = H); We partition the Quaternions into its conjugacy classes.

 > G := QuaternionGroup();
 ${\mathrm{GroupTheory}}{:-}{\mathrm{QuaternionGroup}}{}\left({\mathrm{form}}{=}{"permgroup"}\right)$ (8)
 > DrawCayleyTable(G, conjugacy = true, title = "With Conjugacy Classes collected"); Above, the conjugacy classes are collected. If we set this option to be false we instead obtain the original Cayley Table but elements are now colored according to conjugacy class.

 > DrawCayleyTable(G, conjugacy = true, collect = false, title = "With Conjugacy Classes NOT collected"); > DrawCayleyTable(G, collect = false, title = "Original Cayley table"); Now, we draw the direct product of CyclicGroup(4) and CyclicGroup(2) and highlight elements belonging to various subgroups. Elements in the multiple subgroups are blended with the same color. Using the 3-D display can be helpful here.

 > G1 := CustomGroup({1}, . = ((a,b) -> a + b mod 4), / = (a -> (-a) mod 4)):
 > G2 := CustomGroup({1}, . = ((a,b) -> a + b mod 2), / = (x -> x)):
 > G := DirectProduct(G1,G2):
 > H1 := { [2,1] }:
 > H2 := { [2,0] }:
 > H3 := { [3,0], [2,0] }:
 > DrawCayleyTable(G,subgroups = [H1,H2,H3], colors=[Red, Green, Black, Beige]); > DrawCayleyTable(G,subgroups = [H1,H2,H3], colors=[Red, Green, Black, Beige], render3d = true); We can, for example, use the derived series to give us a number of subgroups as well.

 > G := SymmetricGroup(4);
 ${\mathrm{GroupTheory}}{:-}{\mathrm{SymmetricGroup}}{}\left({4}\right)$ (9)
 > ds := DerivedSeries(G);
 ${\mathrm{GroupTheory}}{:-}{\mathrm{DerivedSeries}}{}\left({\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right)$ (10)
 > DrawCayleyTable(G, subgroups=[ds, ds, ds, ds], render3d = true); For AlternatingGroup(4), we highlight noncommutative and commutative entries in different colors. An entry is noncommutative if in the table, ab is not equal to ba. As we can see, the elements in the center have rows and columns which are entirely filled with the color representing commutative multiplication.

 > G := AlternatingGroup(4);
 ${\mathrm{GroupTheory}}{:-}{\mathrm{AlternatingGroup}}{}\left({4}\right)$ (11)
 > DrawCayleyTable(G, symmetry = true); If we want to see the actual permutations, it looks best if we scale the size up somewhat.

 > DrawCayleyTable(G, symmetry = true, labels = literal, size = [900, 800]); >

Compatibility

 • The GroupTheory[DrawCayleyTable] command was introduced in Maple 17.