{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "1929bec1-9377-41c1-bb36-2a511407b9e8", "metadata": {}, "outputs": [], "source": [ "import os \n", "import sys\n", "sys.path.insert(0, os.path.abspath('../..'))\n", "\n", "import sympy as sp\n", "import numpy as np\n", "import itertools as it\n", "import pysymmpol as sy\n", "import pysymmpol.utils as ut\n", "from IPython.display import display, Latex" ] }, { "cell_type": "markdown", "id": "86504a6c-e227-457c-ba5c-3959591b29a3", "metadata": {}, "source": [ "## Class: ConjugacyClass" ] }, { "cell_type": "markdown", "id": "b2f3f507-30ec-4da2-a57f-ff00a135b57f", "metadata": { "jp-MarkdownHeadingCollapsed": true }, "source": [ "We initialize the ConjugacyClass class with **ConjugacyClass(conjugacy_class: dict)**. \n", "In order to avoind confusion with the YoungDiagram case, we enter a dictionary to be more \n", "explicit about what we are defining. \n", "\n", "Otherwise, we would face problems like this: Consider the partition (3,2,1). Its conjugacy class \n", "vector is (1:1 ,2:1 ,3:1). If we omit the keys, one could interprets it as the partition (1,1,1).\n", "In fact, the partition (1,1,1) is represented as the conjugacy class (1:3), and the conjugacy class \n", "(3,2,1) is the partition (3,2,2,1,1,1). So, in order to avoid this type of problem, we represent \n", "the conjugacy classes as explicitly as possible, and the best way to accomplish this is with \n", "dictionaries. " ] }, { "cell_type": "code", "execution_count": 8, "id": "cda9c487-a5ae-4c5c-b5b3-24cf3c64b6e8", "metadata": {}, "outputs": [], "source": [ "# An effective way to initialize the class in the correct form\n", "vector1 = dict(enumerate((1,3,2,1),1))" ] }, { "cell_type": "code", "execution_count": 9, "id": "b10a33f9-f6e5-455d-962d-60881836c7b2", "metadata": {}, "outputs": [], "source": [ "conjugacy_class = sy.ConjugacyClass(vector1)" ] }, { "cell_type": "code", "execution_count": 10, "id": "778f3d4d-9c88-4b31-8869-8cb67859e2cc", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "[1, 2, 3, 4]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(vector1.keys())" ] }, { "cell_type": "markdown", "id": "b6e0ae70-e94f-4530-833d-b4774ea2875e", "metadata": {}, "source": [ "Getters and methods of the young diagram class are also available." ] }, { "cell_type": "code", "execution_count": 11, "id": "fb34b8f9-747e-49d8-b6ef-29680799940a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "conjugacy_class.columns" ] }, { "cell_type": "code", "execution_count": 12, "id": "af54bcad-6ad0-4931-8756-0bb0402df025", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "conjugacy_class.rows" ] }, { "cell_type": "code", "execution_count": 13, "id": "12cb7b7d-d82f-4e1f-9f1d-c5b8c9b02809", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1, 3, 2, 1)" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "conjugacy_class.conjugacy # This one is different, it gives the conjugacy class we are considering" ] }, { "cell_type": "code", "execution_count": 14, "id": "20b4d519-47cc-43f6-9d9f-e8c8b10af966", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "17" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "conjugacy_class.boxes" ] }, { "cell_type": "code", "execution_count": 17, "id": "577a6a2a-889a-4af3-85c4-0911fc0ec943", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "🎯 \n", "🎯 🎯 \n", "🎯 🎯 \n", "🎯 🎯 \n", "🎯 🎯 🎯 \n", "🎯 🎯 🎯 \n", "🎯 🎯 🎯 🎯 \n" ] } ], "source": [ "conjugacy_class.draw_diagram(3)" ] }, { "cell_type": "code", "execution_count": 18, "id": "4292859f-eebb-40dc-98db-8c4e688c8684", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4, 3, 3, 2, 2, 2, 1)" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "conjugacy_class.conjugacy_partition() # This one translates this cycle into a partition notation" ] }, { "cell_type": "code", "execution_count": null, "id": "6e52d2cc-944e-465a-bd26-ab375ca77b2a", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 5 }