.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/abstract_algebra/characters/plot_01_frobenius_character_tables.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_abstract_algebra_characters_plot_01_frobenius_character_tables.py: Frobenius's character tables ============================ In 1896 Frobenius attached to each finite group a square table of numbers: one row per irreducible character :math:`\chi(g) = \operatorname{tr}\rho(g)`, one column per conjugacy class. The rows are orthonormal, the squares of the first column sum to :math:`|G|`, and the table encodes much of the group's structure in a handful of numbers. Here the tables are computed by Burnside's algorithm, from the class multiplication constants alone, without constructing any representation. .. GENERATED FROM PYTHON SOURCE LINES 16-28 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from mathematicskit.abstract_algebra import DihedralGroup, PermutationGroup, QuaternionGroup, character_table def show(name, result): print(f"{name}: class sizes {result.class_sizes}, degrees {result.degrees}") for row in result.table: print(" " + " ".join(f"{z.real:6.3f}" if abs(z.imag) < 1e-9 else f"{z.real:+.2f}{z.imag:+.2f}i" for z in row)) .. GENERATED FROM PYTHON SOURCE LINES 29-31 S_4, the rotations of a cube ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 31-39 .. code-block:: Python s4 = character_table(PermutationGroup(4)) show("S_4", s4) sizes = np.array(s4.class_sizes) gram = (s4.table * sizes) @ s4.table.conj().T / 24 print(f"row orthogonality: max | - delta_ij| = {np.abs(gram - np.eye(5)).max():.1e}") print(f"sum of squared degrees = {sum(d**2 for d in s4.degrees)} = |S_4|") .. rst-class:: sphx-glr-script-out .. code-block:: none S_4: class sizes [1, 3, 6, 8, 6], degrees [1, 1, 2, 3, 3] 1.000 1.000 1.000 1.000 1.000 1.000 1.000 -1.000 1.000 -1.000 2.000 2.000 0.000 -1.000 0.000 3.000 -1.000 1.000 0.000 -1.000 3.000 -1.000 -1.000 0.000 1.000 row orthogonality: max | - delta_ij| = 0.0e+00 sum of squared degrees = 24 = |S_4| .. GENERATED FROM PYTHON SOURCE LINES 40-48 Two groups, one table ----------------------- The dihedral group :math:`D_4` (symmetries of a square) and the quaternion group :math:`Q_8` are not isomorphic: :math:`D_4` has five elements of order 2, :math:`Q_8` only one. Yet their character tables are identical, a classic warning that the table does not determine the group. .. GENERATED FROM PYTHON SOURCE LINES 48-56 .. code-block:: Python d4, q8 = character_table(DihedralGroup(4)), character_table(QuaternionGroup()) show("D_4", d4) show("Q_8", q8) print(f"identical tables: {np.allclose(d4.table, q8.table)}") for name, group in (("D_4", DihedralGroup(4)), ("Q_8", QuaternionGroup())): print(f"elements of order 2 in {name}: {sum(group.element_order(g) == 2 for g in group.elements)}") .. rst-class:: sphx-glr-script-out .. code-block:: none D_4: class sizes [1, 1, 2, 2, 2], degrees [1, 1, 1, 1, 2] 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 -1.000 -1.000 1.000 1.000 -1.000 1.000 -1.000 1.000 1.000 -1.000 -1.000 1.000 2.000 -2.000 0.000 0.000 0.000 Q_8: class sizes [1, 1, 2, 2, 2], degrees [1, 1, 1, 1, 2] 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 -1.000 -1.000 1.000 1.000 -1.000 1.000 -1.000 1.000 1.000 -1.000 -1.000 1.000 2.000 -2.000 0.000 0.000 0.000 identical tables: True elements of order 2 in D_4: 5 elements of order 2 in Q_8: 1 .. GENERATED FROM PYTHON SOURCE LINES 57-64 A_5 and the golden ratio -------------------------- The rotation group of the icosahedron is :math:`A_5`. Its two three-dimensional characters take the values :math:`(1 \pm \sqrt5)/2` on the two classes of 5-cycles, the golden ratio of the icosahedron's geometry. .. GENERATED FROM PYTHON SOURCE LINES 64-69 .. code-block:: Python a5_group = PermutationGroup(5, generators=[(1, 2, 0, 3, 4), (0, 1, 3, 4, 2)]) a5 = character_table(a5_group) show("A_5", a5) .. rst-class:: sphx-glr-script-out .. code-block:: none A_5: class sizes [1, 15, 20, 12, 12], degrees [1, 3, 3, 4, 5] 1.000 1.000 1.000 1.000 1.000 3.000 -1.000 0.000 1.618 -0.618 3.000 -1.000 0.000 -0.618 1.618 4.000 0.000 1.000 -1.000 -1.000 5.000 1.000 -1.000 0.000 0.000 .. GENERATED FROM PYTHON SOURCE LINES 70-72 The tables as images ---------------------- .. GENERATED FROM PYTHON SOURCE LINES 72-85 .. code-block:: Python fig, axes = plt.subplots(1, 4, figsize=(17, 4.2)) for ax, (name, result) in zip(axes, [("$S_4$", s4), ("$D_4$", d4), ("$Q_8$", q8), ("$A_5$", a5)], strict=True): values = result.table.real image = ax.imshow(values, cmap="RdBu_r", vmin=-5, vmax=5) for (i, j), v in np.ndenumerate(values): ax.text(j, i, f"{v:.3g}", ha="center", va="center", fontsize=9) ax.set_xticks(range(len(result.classes)), [f"|C|={c}" for c in result.class_sizes], fontsize=8) ax.set_yticks(range(len(result.classes)), [rf"$\chi_{i + 1}$" for i in range(len(result.classes))]) ax.set_title(f"{name}, order {sum(result.class_sizes)}") fig.colorbar(image, ax=axes, shrink=0.8) plt.show() .. image-sg:: /api/gallery/abstract_algebra/characters/images/sphx_glr_plot_01_frobenius_character_tables_001.png :alt: $S_4$, order 24, $D_4$, order 8, $Q_8$, order 8, $A_5$, order 60 :srcset: /api/gallery/abstract_algebra/characters/images/sphx_glr_plot_01_frobenius_character_tables_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.746 seconds) .. _sphx_glr_download_api_gallery_abstract_algebra_characters_plot_01_frobenius_character_tables.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../../lite/lab/index.html?path=api/gallery/abstract_algebra/characters/plot_01_frobenius_character_tables.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_frobenius_character_tables.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_frobenius_character_tables.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_frobenius_character_tables.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_