{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "ae32a5a2-a3e8-422e-b3c7-a81d220eda9d", "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": "c7dfe4ed-72d2-40a3-a701-93f3e49a1cf0", "metadata": { "jp-MarkdownHeadingCollapsed": true }, "source": [ "# Class: SchurPolynomial" ] }, { "cell_type": "markdown", "id": "ac8ef389-f1ff-4796-a32c-60e1c601dd63", "metadata": {}, "source": [ "Let us now consider the Schur polynomials. We can initialize the SchurPolynomials class as: sy.SchurPolynomial(young: YoungDiagram)" ] }, { "cell_type": "code", "execution_count": 3, "id": "88cdb597-c278-470b-87ba-3c820fc040a8", "metadata": {}, "outputs": [], "source": [ "par = (3, 2, 1) # define a partition\n", "yg = sy.YoungDiagram(par) # Initialize an object, YoungDiagram\n", "sch = sy.SchurPolynomial(yg) # Initialize the Schur polynomial" ] }, { "cell_type": "code", "execution_count": 4, "id": "6fd4f0e6-909c-48a1-b8f3-d45a66f3f23d", "metadata": {}, "outputs": [], "source": [ "t = ut.create_miwa(yg.boxes) # using the function in the utils module\n", "tt = tuple(t.values())" ] }, { "cell_type": "markdown", "id": "f969c391-2be1-4b05-84c6-178417e30b16", "metadata": {}, "source": [ "To get the explicit expression for the polynomial, one can use the method .explicit(t). As before, it accepts tuples and dictionaries. " ] }, { "cell_type": "code", "execution_count": 7, "id": "ed183a61-8b95-4102-b538-9b3c543e1c95", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\frac{t_{1}^{6}}{45} - \\frac{t_{1}^{3} t_{3}}{3} + t_{1} t_{5} - t_{3}^{2}$" ], "text/plain": [ "t1**6/45 - t1**3*t3/3 + t1*t5 - t3**2" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sch.explicit(t)" ] }, { "cell_type": "markdown", "id": "1cbd112d-d40e-4bdc-a5b1-82ce9528ca9b", "metadata": {}, "source": [ "As before, one can get the sympy polynomials as" ] }, { "cell_type": "code", "execution_count": 10, "id": "095b3e05-ee98-4b78-89e8-1c878a73af88", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\operatorname{Poly}{\\left( \\frac{1}{45} t_{1}^{6} - \\frac{1}{3} t_{1}^{3}t_{3} + t_{1}t_{5} - t_{3}^{2}, t_{1}, t_{3}, t_{5}, domain=\\mathbb{Q} \\right)}$" ], "text/plain": [ "Poly(1/45*t1**6 - 1/3*t1**3*t3 + t1*t5 - t3**2, t1, t3, t5, domain='QQ')" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sch.explicit(tt, True)" ] }, { "cell_type": "markdown", "id": "f2b497e3-95b6-4cfb-bf83-4689a2f6be86", "metadata": {}, "source": [ "One can also express the Schur polynomials in terms of the coordinates x:" ] }, { "cell_type": "code", "execution_count": 26, "id": "bbc1e73f-d021-485a-9f0f-868c1f7d4bdb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(x1 + x2 + x3,\n", " x1**2/2 + x2**2/2 + x3**2/2,\n", " x1**3/3 + x2**3/3 + x3**3/3,\n", " x1**4/4 + x2**4/4 + x3**4/4,\n", " x1**5/5 + x2**5/5 + x3**5/5,\n", " x1**6/6 + x2**6/6 + x3**6/6)" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Suppose we have x = (x1, x2, x3), \n", "m = 3 # minimum to give a non trivial \n", "tx = ut.tx_power_sum(yg.boxes, m)\n", "tx" ] }, { "cell_type": "code", "execution_count": 27, "id": "8d137942-6ed8-4475-ba45-c08cc0b55f87", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle x_{1}^{3} x_{2}^{2} x_{3} + x_{1}^{3} x_{2} x_{3}^{2} + x_{1}^{2} x_{2}^{3} x_{3} + 2 x_{1}^{2} x_{2}^{2} x_{3}^{2} + x_{1}^{2} x_{2} x_{3}^{3} + x_{1} x_{2}^{3} x_{3}^{2} + x_{1} x_{2}^{2} x_{3}^{3}$" ], "text/plain": [ "x1**3*x2**2*x3 + x1**3*x2*x3**2 + x1**2*x2**3*x3 + 2*x1**2*x2**2*x3**2 + x1**2*x2*x3**3 + x1*x2**3*x3**2 + x1*x2**2*x3**3" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sch.explicit(tx)" ] }, { "cell_type": "markdown", "id": "a95cdc21-0dc5-4b96-acf6-e4998c9f4450", "metadata": { "jp-MarkdownHeadingCollapsed": true }, "source": [ "## Generate Schur polynomials for a given level n" ] }, { "cell_type": "markdown", "id": "58772de8-355d-4fa6-9866-9abf42f9c0ac", "metadata": {}, "source": [ "One can easily generate all Schur polynomials for a given level n as follows:" ] }, { "cell_type": "code", "execution_count": 49, "id": "103ea948-f04f-4fb0-8fa4-08389bbcf5ba", "metadata": {}, "outputs": [], "source": [ "# Define a function to list the polynomials\n", "def list_schur(n):\n", " states = sy.State(n).partition_states()\n", " for a in states:\n", " yg = sy.YoungDiagram(a)\n", " sch = sy.SchurPolynomial(yg)\n", " t = ut.create_miwa(yg.boxes)\n", " print(f'-- Schur[{a}] --')\n", " display(sch.explicit(t))" ] }, { "cell_type": "code", "execution_count": 50, "id": "b763fbce-9253-408f-95d6-df2a309946c3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- Schur[(1, 1)] --\n" ] }, { "data": { "text/latex": [ "$\\displaystyle \\frac{t_{1}^{2}}{2} - t_{2}$" ], "text/plain": [ "t1**2/2 - t2" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "-- Schur[(2, 0)] --\n" ] }, { "data": { "text/latex": [ "$\\displaystyle \\frac{t_{1}^{2}}{2} + t_{2}$" ], "text/plain": [ "t1**2/2 + t2" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "list_schur(2)" ] }, { "cell_type": "markdown", "id": "92968a26-1f97-43b8-87a9-ce642bdd641e", "metadata": {}, "source": [ "## Skew-Schur Polynomials" ] }, { "cell_type": "markdown", "id": "ab462a1c-69d6-4bd5-96b2-49b6f3388e9c", "metadata": {}, "source": [ "In order to define the Schur polynomials, we need to consider a secong Young diagram $\\mu$ that is contained in $\\lambda$, we write $\\mu \\subseteq \\lambda$. We can use the method constains(mu) to test the subset relation between the partitions. " ] }, { "cell_type": "code", "execution_count": 85, "id": "a86ae362-923a-466f-ae7e-a0d27cf625df", "metadata": {}, "outputs": [], "source": [ "yg1 = sy.YoungDiagram((4,3,2,2,1))\n", "yg2 = sy.YoungDiagram((3,2,1))\n", "t = ut.create_miwa(yg1.boxes)" ] }, { "cell_type": "code", "execution_count": 86, "id": "5f3b0a44-7ff3-4494-8563-2bc3e590f647", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 86, "metadata": {}, "output_type": "execute_result" } ], "source": [ "yg1.contains(yg2)" ] }, { "cell_type": "code", "execution_count": 87, "id": "c12d627d-1ab0-44f4-b747-7e4c1416c01c", "metadata": {}, "outputs": [], "source": [ "# We find skew Schur polynomials with the skew_schur method\n", "sch1 = sy.SchurPolynomial(yg1)\n", "sch2 = sy.SchurPolynomial(yg2)" ] }, { "cell_type": "code", "execution_count": 88, "id": "950600f6-1e95-455e-a046-a51f9d3b8792", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 88, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sch.skew_schur(t, yg1) # bacause yg2 does not contain yg1" ] }, { "cell_type": "code", "execution_count": 89, "id": "da9b9288-0172-42b9-bbab-82f3f8719160", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle t_{1}^{2} \\cdot \\left(\\frac{5 t_{1}^{4}}{24} - \\frac{t_{1}^{2} t_{2}}{2} - t_{1} t_{3} + \\frac{t_{2}^{2}}{2} + t_{4}\\right)$" ], "text/plain": [ "t1**2*(5*t1**4/24 - t1**2*t2/2 - t1*t3 + t2**2/2 + t4)" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sch1.skew_schur(t, yg2) " ] }, { "cell_type": "code", "execution_count": null, "id": "e63b4115-c3be-4553-b39f-d5d60a5114f4", "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 }