From a8f2d7f58e68701f11404f12bdb02e65d5c63454 Mon Sep 17 00:00:00 2001 From: Remco de Boer Date: Fri, 19 Mar 2021 14:15:29 +0100 Subject: [PATCH] docs: add Mandelstam variable illustration --- cspell.json | 6 ++- docs/theory/introduction.ipynb | 97 ++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/cspell.json b/cspell.json index 23aa3376..d5343472 100644 --- a/cspell.json +++ b/cspell.json @@ -84,6 +84,9 @@ "doctests", "eval", "expertsystem", + "figsize", + "fontsize", + "frameon", "genindex", "graphviz", "htmlcov", @@ -137,6 +140,7 @@ "venv", "xlabel", "xlim", - "ylabel" + "ylabel", + "ylim" ] } \ No newline at end of file diff --git a/docs/theory/introduction.ipynb b/docs/theory/introduction.ipynb index bdf693cf..07bd8fcb 100644 --- a/docs/theory/introduction.ipynb +++ b/docs/theory/introduction.ipynb @@ -192,6 +192,103 @@ "source": [ "## Isobar model" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Mandelstam variables" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [ + "hide-input" + ] + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "from feynman import Diagram\n", + "\n", + "fig, ax = plt.subplots(1, 3, figsize=(9, 3), frameon=False, tight_layout=True)\n", + "fig.patch.set_visible(False)\n", + "for a in ax:\n", + " a.axis(\"off\")\n", + " a.set_xlim(0, 1)\n", + " a.set_ylim(0, 0.8)\n", + "\n", + "s_channel = Diagram(ax[0])\n", + "# Vertices\n", + "v_p1 = s_channel.vertex(xy=(0.1, 0.7), marker=\"\")\n", + "v_p2 = s_channel.vertex(v_p1.xy, dy=-0.6, marker=\"\")\n", + "v_p3 = s_channel.vertex(v_p1.xy, dx=0.8, marker=\"\")\n", + "v_p4 = s_channel.vertex(v_p3.xy, dy=-0.6, marker=\"\")\n", + "v1 = s_channel.vertex(v_p1.xy, dx=0.2, dy=-0.3, marker=\"\")\n", + "v2 = s_channel.vertex(v_p3.xy, dx=-0.2, dy=-0.3, marker=\"\")\n", + "# Lines\n", + "p1 = s_channel.line(v_p1, v1, arrow=False)\n", + "p2 = s_channel.line(v1, v_p2, arrow=False)\n", + "interaction = s_channel.line(v1, v2, style=\"dotted\", arrow=False)\n", + "e4 = s_channel.line(v2, v_p3, arrow=False)\n", + "e5 = s_channel.line(v_p4, v2, arrow=False)\n", + "# Labels\n", + "v_p1.text(\"$p_1$\", x=-0.06, y=0)\n", + "v_p2.text(\"$p_2$\", x=-0.06, y=0)\n", + "v_p3.text(\"$p_3$\", x=+0.06, y=0)\n", + "v_p4.text(\"$p_4$\", x=+0.06, y=0)\n", + "s_channel.text(0.5, 0, \"$s$-channel\", fontsize=15)\n", + "s_channel.plot();\n", + "\n", + "t_channel = Diagram(ax[1])\n", + "# Vertices\n", + "v_p1 = t_channel.vertex(xy=(0.1, 0.7), marker=\"\")\n", + "v_p2 = t_channel.vertex(v_p1.xy, dy=-0.6, marker=\"\")\n", + "v_p3 = t_channel.vertex(v_p1.xy, dx=0.8, marker=\"\")\n", + "v_p4 = t_channel.vertex(v_p3.xy, dy=-0.6, marker=\"\")\n", + "v1 = t_channel.vertex(v_p1.xy, dx=0.4, dy=-0.15, marker=\"\")\n", + "v2 = t_channel.vertex(v_p2.xy, dx=0.4, dy=+0.15, marker=\"\")\n", + "# Lines\n", + "p1 = t_channel.line(v_p1, v1, arrow=False)\n", + "p2 = t_channel.line(v1, v_p3, arrow=False)\n", + "interaction = t_channel.line(v1, v2, style=\"dotted\", arrow=False)\n", + "e4 = t_channel.line(v2, v_p2, arrow=False)\n", + "e5 = t_channel.line(v_p4, v2, arrow=False)\n", + "# Labels\n", + "v_p1.text(\"$p_1$\", x=-0.06, y=0)\n", + "v_p2.text(\"$p_2$\", x=-0.06, y=0)\n", + "v_p3.text(\"$p_3$\", x=+0.06, y=0)\n", + "v_p4.text(\"$p_4$\", x=+0.06, y=0)\n", + "t_channel.text(0.5, 0, \"$t$-channel\", fontsize=15)\n", + "t_channel.plot();\n", + "\n", + "u_channel = Diagram(ax[2])\n", + "# Vertices\n", + "v_p1 = u_channel.vertex(xy=(0.1, 0.7), marker=\"\")\n", + "v_p2 = u_channel.vertex(v_p1.xy, dy=-0.6, marker=\"\")\n", + "v_p3 = u_channel.vertex(v_p1.xy, dx=0.8, marker=\"\")\n", + "v_p4 = u_channel.vertex(v_p3.xy, dy=-0.6, marker=\"\")\n", + "v1 = u_channel.vertex(v_p1.xy, dx=0.4, dy=-0.15, marker=\"\")\n", + "v2 = u_channel.vertex(v_p2.xy, dx=0.4, dy=+0.15, marker=\"\")\n", + "# Lines\n", + "p1 = u_channel.line(v_p1, v1, arrow=False)\n", + "p2 = u_channel.line(v1, v_p4, arrow=False)\n", + "interaction = u_channel.line(v1, v2, style=\"dotted\", arrow=False)\n", + "e4 = u_channel.line(v2, v_p2, arrow=False)\n", + "e5 = u_channel.line(v_p3, v2, arrow=False)\n", + "# Labels\n", + "v_p1.text(\"$p_1$\", x=-0.06, y=0)\n", + "v_p2.text(\"$p_2$\", x=-0.06, y=0)\n", + "v_p3.text(\"$p_3$\", x=+0.06, y=0)\n", + "v_p4.text(\"$p_4$\", x=+0.06, y=0)\n", + "u_channel.text(0.5, 0, \"$u$-channel\", fontsize=15)\n", + "u_channel.plot();" + ] } ], "metadata": {