From 570add45591327c69d063967e0eb5cca73e8fdcb Mon Sep 17 00:00:00 2001 From: shenvitor Date: Thu, 19 Oct 2023 16:16:48 +0200 Subject: [PATCH 01/39] new work out exercises --- docs/lecture02.ipynb | 1185 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1165 insertions(+), 20 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 1c62bf8..f6f6b85 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -34,32 +34,1168 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## `Three-particles-1.dat`" + "## Two particles Final States" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The standard frames: CoM frame and Lab frame" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The scattering happens in the x-z plane for both frames." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The two frames are related by a boost along the z axis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Lorentz transformations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Boost between Lab and CoM" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Only the energy and the z component change" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\\begin{pmatrix}\n", + " E^*\n", + " \\\\\n", + " p_z^*\n", + "\\end{pmatrix} =\n", + "\\begin{pmatrix}\n", + " \\gamma & \\gamma \\beta \\\\\n", + " \\gamma \\beta & \\gamma\n", + "\\end{pmatrix}\n", + "\\begin{pmatrix}\n", + " E^L\\\\\n", + " p^L_z\n", + "\\end{pmatrix}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Given the inverse relation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\\begin{pmatrix}\n", + " E^L\n", + " \\\\\n", + " p_z^L\n", + "\\end{pmatrix} =\n", + "\\begin{pmatrix}\n", + " \\gamma & -\\gamma \\beta \\\\\n", + " -\\gamma \\beta & \\gamma\n", + "\\end{pmatrix}\n", + "\\begin{pmatrix}\n", + " E^*\\\\\n", + " p^*_z\n", + "\\end{pmatrix}\n", + "$$\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta = \\frac{p^*_b}{m_b}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\gamma \\beta = \\frac{E^*_b}{m_b}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We check that it brings the target at rest in Exercise below" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: boost\n", + "Check that it brings the target at rest\n", + "\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution} boost\n", + ":class: dropdown\n", + "\n", + "By the boost from CoM frame to Lab frame, and apply if to the 4-vector of particle b (target)\n", + "\n", + "\n", + "$$\\begin{pmatrix}\n", + " E_b^*\n", + " \\\\\n", + " p_{b,z}^*\n", + "\\end{pmatrix} =\n", + "\\begin{pmatrix}\n", + " \\gamma & \\gamma \\beta \\\\\n", + " \\gamma \\beta & \\gamma\n", + "\\end{pmatrix}\n", + "\\begin{pmatrix}\n", + " E_b^L\\\\\n", + " p^L_{b,z}\n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "using the relations (3) and (4) and subsititute into (2):\n", + "\n", + "\n", + "$$\\begin{pmatrix}\n", + " E_b^L\n", + " \\\\\n", + " p_{b,z}^L\n", + "\\end{pmatrix} =\n", + "\\begin{pmatrix}\n", + " \\frac{E_b^*}{p_b^*} & -\\frac{E_b^*}{m_b} \\\\\n", + " -\\frac{E_b^*}{m_b} & \\frac{E_b^*}{p_b^*}\n", + "\\end{pmatrix}\n", + "\\begin{pmatrix}\n", + " E_b^*\\\\\n", + " p^*_{b,z}\n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "Since it's only changing in z-componenet and energy, one yields:\n", + "\n", + "\n", + "$$\\begin{pmatrix}\n", + " E_b^L\n", + " \\\\\n", + " p_{b,z}^L\n", + "\\end{pmatrix} =\n", + "% \\begin{pmatrix}\n", + "% \\frac{E_b^*}{p_b^*} & -\\frac{E_b^*}{m_b} \\\\\n", + "% -\\frac{E_b^*}{m_b} & \\frac{E_b^*}{p_b^*}\n", + "% \\end{pmatrix}\n", + "\\begin{pmatrix}\n", + " \\frac{E_b^*}{p_{b,z}^*} \\cdot E_b^* - \\frac{E_b^*}{m_b}p_{b,z}^* \\\\\n", + " -\\frac{E_b^*}{m_b} \\cdot E_b^* + \\frac{E_b^*}{p_{b,z}^*} \\cdot p_{b,z}^*\n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "When assuming $p_{b,z}=0$, then \n", + "\n", + "$$p^L_{b,z} = 0$$\n", + "\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Active Rotation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Under an active rotation, the momentum is changed and the axes are fixed" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Example: a momentum of unit length forming an angle θ with the z axis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{pmatrix}\n", + " p_x\n", + " \\\\\n", + " p_y\n", + " \\\\\n", + " p_z\n", + "\\end{pmatrix} =\n", + "\\begin{pmatrix}\n", + " sin(\\theta)\n", + " \\\\\n", + " 0\n", + " \\\\\n", + " cos(\\theta)\n", + "\\end{pmatrix}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "After a rotation of ω around y, it forms an angle θ + ω with the z axis" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "$$\n", + "\\begin{pmatrix}\n", + " p_x'\n", + " \\\\\n", + " p_y'\n", + " \\\\\n", + " p_z'\n", + "\\end{pmatrix}\n", + "=\n", + "R_y(\\omega)\n", + "\\begin{pmatrix}\n", + " p_x\n", + " \\\\\n", + " p_y\n", + " \\\\\n", + " p_z\n", + "\\end{pmatrix}\n", + "=\n", + "\\begin{pmatrix}\n", + " sin(\\theta+\\omega)\n", + " \\\\\n", + " 0\n", + " \\\\\n", + " cos(\\theta+\\omega)\n", + "\\end{pmatrix}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we check the result of the rotation above" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: rotation\n", + "Check the result of the rotation above\n", + "\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution} rotation\n", + ":class: dropdown\n", + "\n", + "Recall the rotation matrix:\n", + "\n", + "$$\n", + "R_z(\\omega)\n", + "=\n", + "\\begin{pmatrix}\n", + "cos(\\omega) & -sin(\\omega) & 0\n", + "\\\\\n", + "sin(\\omega) & cos(\\omega) & 0\n", + "\\\\\n", + "0 & 0 & 1\n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "$$\n", + "R_y(\\omega)\n", + "=\n", + "\\begin{pmatrix}\n", + "cos(\\omega) & 0 & sin(\\omega) \n", + "\\\\\n", + "0 & 1 & 0\n", + "\\\\\n", + "-sin(\\omega) &0 & cos(\\omega) \n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "Any rotation can be decomposed into rotations around z and y axes above\n", + "\n", + "\n", + "$$\n", + "R_y(\\omega)\n", + "=\n", + "\\begin{pmatrix}\n", + "1&0&0\n", + "\\\\\n", + "0 & cos(\\omega) & -sin(\\omega) \n", + "\\\\\n", + "0 & sin(\\omega) & cos(\\omega) \n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "The rotation matrix around x axes is also given for completeness.\n", + "\n", + "Thus equation (9) becomes:\n", + "\n", + "$$\n", + "\\begin{pmatrix}\n", + " p_x'\n", + " \\\\\n", + " p_y'\n", + " \\\\\n", + " p_z'\n", + "\\end{pmatrix}\n", + "=\n", + "R_y(\\omega)\n", + "\\begin{pmatrix}\n", + " p_x\n", + " \\\\\n", + " p_y\n", + " \\\\\n", + " p_z\n", + "\\end{pmatrix}\n", + "=\n", + "\\begin{pmatrix}\n", + "cos(\\omega) & 0 & sin(\\omega) \n", + "\\\\\n", + "0 & 1 & 0\n", + "\\\\\n", + "-sin(\\omega) &0 & cos(\\omega) \n", + "\\end{pmatrix}\n", + "\\begin{pmatrix}\n", + " p_x\n", + " \\\\\n", + " p_y\n", + " \\\\\n", + " p_z\n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "$$\n", + "\\begin{pmatrix}\n", + " p_x'\n", + " \\\\\n", + " p_y'\n", + " \\\\\n", + " p_z'\n", + "\\end{pmatrix}\n", + "=\n", + "\\begin{pmatrix}\n", + "p_x \\cdot cos(\\omega)+ p_z \\cdot sin(\\omega) \n", + "\\\\\n", + "p_y\n", + "\\\\\n", + "-p_x \\cdot sin(\\omega) + p_z \\cdot cos(\\omega) \n", + "\\end{pmatrix}\n", + "$$\n", + "\n", + "since \n", + "$\\begin{pmatrix}\n", + " p_x\n", + " \\\\\n", + " p_y\n", + " \\\\\n", + " p_z\n", + "\\end{pmatrix}$ =\n", + "$\\begin{pmatrix}\n", + " sin(\\theta)\n", + " \\\\\n", + " 0\n", + " \\\\\n", + " cos(\\theta)\n", + "\\end{pmatrix}\n", + "$,\n", + "and using the trigonometric identities,\n", + "thus we have:\n", + "\n", + "$$\n", + "\\begin{pmatrix}\n", + " p_x'\n", + " \\\\\n", + " p_y'\n", + " \\\\\n", + " p_z'\n", + "\\end{pmatrix}\n", + "=\n", + "\\begin{pmatrix}\n", + "sin(\\theta) \\cdot cos(\\omega)+ cos(\\theta) \\cdot sin(\\omega) \n", + "\\\\\n", + "0\n", + "\\\\\n", + "-sin(\\theta) \\cdot sin(\\omega) + cos(\\theta) \\cdot cos(\\omega) \n", + "\\end{pmatrix}\n", + "=\n", + "\\begin{pmatrix}\n", + "sin(\\theta+\\omega)\n", + "\\\\\n", + "0\n", + "\\\\\n", + "cos(\\theta+\\omega) \n", + "\\end{pmatrix}\n", + "\n", + "$$\n", + "\n", + "\n", + "\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "jp-MarkdownHeadingCollapsed": true, + "tags": [] + }, + "source": [ + "## `Two-particles-1.dat`\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The data are in the lab frame, Compute and plot the cos θL distribution\n", + "Boost to the CoM and Compute and plot\n", + "the cos θ* distribution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "jupyter": { + "source_hidden": true + }, + "mystnb": { + "code_prompt_show": "Import Python libraries" + }, + "tags": [ + "hide-cell" + ] + }, + "outputs": [], + "source": [ + "import warnings\n", + "\n", + "import gdown\n", + "import numpy as np\n", + "from IPython.display import display\n", + "\n", + "warnings.filterwarnings(\"ignore\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# https://indico.ific.uv.es/event/6803/contributions/21220/attachments/11209/15506/Two-particles-1.dat\n", + "filename = gdown.cached_download(\n", + " url=\"https://indico.ific.uv.es/event/6803/contributions/21220/attachments/11209/15506/Two-particles-1.dat\",\n", + " # path=\"data/Two-particles-1.dat\",\n", + " # md5=\"a49ebfd97ae6a02023291df665ab924c\",\n", + " quiet=True,\n", + " verify=False,\n", + ")\n", + "data = np.loadtxt(filename)\n", + "data.shape" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "jupyter": { + "outputs_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "print(data)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# p =" ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Import Python libraries" - }, - "tags": [ - "hide-cell" - ] + "tags": [] }, "outputs": [], "source": [ - "import warnings\n", + "# n_final_state = 2\n", + "# pa, p1, p2 = (data[i::4].T for i in range(n_final_state + 1))\n", + "# p0 = p1 + p2\n", + "# pb = p0 - pa" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mandelstam variables\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$ p_i^2 = m^2_i $$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$ s =(p_a + p_b)^2 = (p_1+p_2)^2 $$\n", + "$$ t =(p_a - p_1)^2 = (p_b-p_2)^2 $$\n", + "$$ u =(p_a - p_2)^2 = (p_b-p_1)^2 $$\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "s+t+u = m_a^2+m_b^2+m_1^2+m^2_2\n", + "$$ (label:mv)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: mv\n", + "Check the relation in equation {eq}`label:mv` by using $p_a+p_b=p_1+p_2$\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution} mv\n", + ":class: dropdown\n", "\n", - "import gdown\n", - "import numpy as np\n", - "from IPython.display import display\n", + "$$ s+t+u = (p_a + p_b)^2 + (p_a - p_1)^2 + (p_a - p_2)^2$$\n", "\n", - "warnings.filterwarnings(\"ignore\")" + "$$ s+t+u = p_a^2 +p_b^2 + 2 p_a p_b + p_a^2 -2 p_a p_1 + p_1^2 + p_a^2 - 2p_a p_2 +p_2^2$$\n", + "\n", + "$$\n", + "s+t+u = 3p_a^2 + p_b^2 +p_1^2 + p_2^2 + 2p_a p_b - 2p_a p_1 -2 p_a p_2\n", + "$$ (label:proving)\n", + "\n", + "from equation {eq}`label:mv` we have:\n", + "\n", + "$$ p_b = p_1 + p_2 - p_a $$\n", + "\n", + "$$ \n", + "p_a \\cdot p_b = p_a \\cdot p_1 + p_a \\cdot p_2 - p_a^2 \n", + "$$ (label:use)\n", + "\n", + "By equation {eq}`label:proving` and substitute it into equation {eq}`label:use`:\n", + "\n", + "$$\n", + "s+t+u = 3p_a^2 + p_b^2 +p_1^2 + p_2^2 + 2p_a \\cdot p_1 + 2p_a \\cdot p_2 - 2p_a^2 -2p_a p_1 -2 p_a p_2\n", + "$$\n", + "\n", + "$$\n", + "s+t+u = p_a^2 + p_b^2 +p_1^2 + p_2^2 \n", + "$$\n", + "\n", + "by the mass shell relation, and thus:\n", + "\n", + "$$s+t+u = m_a^2 + m_b^2 + m_1^2 + m_2^2$$\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "% $$ s+t+u = (p_a + p_b)^2 + (p_a - p_1)^2 + (p_a - p_2)^2$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "% $$ s+t+u = p_a^2 +p_b^2 + 2 p_a p_b + p_a^2 -2 p_a p_1 + p_1^2 + p_a^2 - 2p_a p_2 +p_2^2$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "% $$ p_b = p_1 + p_2 - p_a $$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "s+t+u = p_a^2 + p_b^2 +p_1^2 + p_2^2 \n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "by the mass shell relation, and thus:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$s+t+u = m_a^2 + m_b^2 + m_1^2 + m_2^2$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## CoM Kinematics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Every frame dependent quantities is expressed with Mandelstam variables\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "% $$t = m_a^2 +m_1^2 -2 E^*_a E^*_1 + 2|\\vec{p_a}^*| |\\vec{p_1}^*| cos \\theta^*$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Equivalent expression for the scattering angle in the CoM" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "cos \\theta^* = 1 + \\frac{t-t_{min}}{2|\\vec{v}_a^*||\\vec{p}_1^*|}\n", + "=\n", + "\\frac{s(t-u)+(m_a^2-m-b^2)(m_1^2-m_2^2)}{\\lambda^{1/2}(s,m_a^2,m_b^2)\\lambda^{1/2}(s,m_1^2,m_2^2)}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Compute $cos \\theta^L$ as a function of s,t,u" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$ cos \\theta^L $$" + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Decay into three particles\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\\theta^*_{12}+\\theta^*_{23}+\\theta^*_{31}=2 \\pi$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Check relation (33) using $s_{12}+s_{23}+s_{31}$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": { + "jp-MarkdownHeadingCollapsed": true, + "tags": [] + }, + "source": [ + "## `Three-particles-1.dat`" ] }, { @@ -81,6 +1217,15 @@ "data.shape" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(data)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -97,9 +1242,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [] }, "outputs": [], @@ -370,7 +1512,10 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true, + "tags": [] + }, "source": [ "## `Three-particles-2.dat`" ] @@ -561,7 +1706,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, From fdebf842ae702627979ce8fc4f211372e7c27796 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Fri, 20 Oct 2023 15:48:39 +0200 Subject: [PATCH 02/39] fix typo --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index e6598e6..fdf0871 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,4 +1,4 @@ -title: Solutions to STRON2020 HaSP School +title: Solutions to STRONG2020 HaSP School author: Participants of the STRONG2020 HaSP School copyright: "2023" logo: https://indico.ific.uv.es/event/6803/logo-2761386249.png From b18c399e0acf766665f955c0f95b72e76b1c013c Mon Sep 17 00:00:00 2001 From: shenvitor Date: Fri, 20 Oct 2023 16:01:34 +0200 Subject: [PATCH 03/39] add more exercise section --- docs/lecture02.ipynb | 119 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 97 insertions(+), 22 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index f6f6b85..90ad600 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -11,16 +11,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "[Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu contains a few data files containing four-momenta data samples. Our goal in this notebook is to identify which reaction was used to generate these data samples." + "[Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu contains a few data files containing four-momenta data samples. \n", + "Our goal in this notebook is to identify which reaction was used to generate these data samples." ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "remove-cell" ] @@ -342,11 +340,6 @@ "" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [] - }, { "cell_type": "markdown", "metadata": {}, @@ -805,7 +798,6 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -1076,23 +1068,23 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "$$\n", + "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "by the mass shell relation, and thus:" + "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "$$s+t+u = m_a^2 + m_b^2 + m_1^2 + m_2^2$$" + "" ] }, { @@ -1191,13 +1183,58 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "## `Three-particles-1.dat`" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: three-particles-1\n", + "File: Three-Particles-1.dat is \n", + "The data are in the lab frame, \n", + "with Format:\n", + "\n", + "Ea, pa,x, pa,y, pa,z\n", + "\n", + "E1, p1,x, p1,y, p1,z\n", + "\n", + "E2, p2,x, p2,y, p2,z \n", + "\n", + "E3, p3,x, p3,y, p3,z\n", + "\n", + ". . . .\n", + "\n", + ". . . .\n", + "\n", + ". . . .\n", + "\n", + "\n", + "Three questions to be found out.\n", + "\n", + "Which reaction is it?
", + "\n", + "\n", + "What resonances are included?
", + " \n", + "\n", + "What is the spin of the resonances?\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution-start} three-particles-1\n", + ":class: dropdown\n", + ":::" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1262,9 +1299,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -1283,9 +1317,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "mystnb": { "code_prompt_show": "Identify final state particles" }, @@ -1336,6 +1367,14 @@ "So this is a photon $\\gamma$ hitting a proton $p$ and producing a meson $\\eta$, pion $\\pi^0$, and proton $p$." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution-end} \n", + ":::" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -1513,13 +1552,49 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "## `Three-particles-2.dat`" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: three-particles-2\n", + "File: Three-Particles-2.dat is also\n", + "The data are in the lab frame, \n", + "with Format:\n", + "\n", + "Ea, pa,x, pa,y, pa,z\n", + "\n", + "E1, p1,x, p1,y, p1,z\n", + "\n", + "E2, p2,x, p2,y, p2,z \n", + "\n", + "E3, p3,x, p3,y, p3,z\n", + "\n", + ". . . .\n", + "\n", + ". . . .\n", + "\n", + ". . . .\n", + "\n", + "\n", + "Three questions to be found out.\n", + "\n", + "Which reaction is it?
", + "\n", + "\n", + "What resonances are included?
", + " \n", + "\n", + "What is the spin of the resonances?\n", + ":::" + ] + }, { "cell_type": "code", "execution_count": null, From 49b0205b55cd012d432f329d97d7eb1b81ec0263 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:15:24 +0200 Subject: [PATCH 04/39] FIX: remove MacOS line endings --- docs/lecture02.ipynb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 90ad600..76b806b 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -1216,11 +1216,9 @@ "\n", "Three questions to be found out.\n", "\n", - "Which reaction is it?
", + "Which reaction is it?\n", "\n", - "\n", - "What resonances are included?
", - " \n", + "What resonances are included? \n", "\n", "What is the spin of the resonances?\n", ":::" @@ -1585,11 +1583,9 @@ "\n", "Three questions to be found out.\n", "\n", - "Which reaction is it?
", - "\n", + "Which reaction is it?\n", "\n", - "What resonances are included?
", - " \n", + "What resonances are included? \n", "\n", "What is the spin of the resonances?\n", ":::" From e6f73461fac2994bfcc0b03f55e5a53fbe7808e4 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Tue, 24 Oct 2023 15:28:41 +0200 Subject: [PATCH 05/39] update texts --- docs/lecture02.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 76b806b..46e3dba 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -236,7 +236,7 @@ "\\end{pmatrix}\n", "$$\n", "\n", - "When assuming $p_{b,z}=0$, then \n", + "When assuming $p_{b,z}^L=0$, then $E_{b}^L = m_b$, and thus\n", "\n", "$$p^L_{b,z} = 0$$\n", "\n", From c4ce2bb2e7c56a737c834050dbf437f31c545f06 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Thu, 26 Oct 2023 16:53:53 +0200 Subject: [PATCH 06/39] new sections --- docs/conf.py | 1 + docs/lecture02.ipynb | 262 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 226 insertions(+), 37 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c356944..aa5a3c3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,6 +24,7 @@ def get_execution_mode() -> str: exclude_patterns = [ "_build", "lecture24_utilities.ipynb", + "lecture12d-phasespace.ipynb", ] extensions = [ "myst_nb", diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 46e3dba..13e6e6f 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -4,56 +4,49 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Lecture 2 – Kinematics" + "# Lecture 2 – Kinematics and Lorentz Transformations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "[Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu contains a few data files containing four-momenta data samples. \n", - "Our goal in this notebook is to identify which reaction was used to generate these data samples." + "This is a lecture note and exercises with answerings which based on [Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu " ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "remove-cell" - ] - }, - "outputs": [], + "cell_type": "markdown", + "metadata": {}, "source": [ - "%pip install -q gdown matplotlib numpy particle" + "## Experiments and Frames" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Two particles Final States" + "The standard frames: CoM frame and Lab frame" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The standard frames: CoM frame and Lab frame" + "The scattering happens in the x-z plane for both frames." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The scattering happens in the x-z plane for both frames." + "The two frames are related by a boost along the z axis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The two frames are related by a boost along the z axis" + "## Two particles Final States" ] }, { @@ -67,7 +60,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Boost between Lab and CoM" + "### Boost (between Lab and CoM)" ] }, { @@ -344,7 +337,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Active Rotation" + "### Rotation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Active Rotation" ] }, { @@ -795,17 +795,37 @@ "\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example1: Angles and Boost" + ] + }, { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ - "## `Two-particles-1.dat`\n", + "#### `Two-particles-1.dat`\n", "\n", "\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "remove-cell" + ] + }, + "outputs": [], + "source": [ + "%pip install -q gdown matplotlib numpy particle" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -844,9 +864,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [] }, "outputs": [], @@ -867,9 +884,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "outputs_hidden": true - }, "tags": [] }, "outputs": [], @@ -1091,7 +1105,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## CoM Kinematics" + "### CoM Kinematics" ] }, { @@ -1105,7 +1119,119 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "\n" + "![IMAGE](https://user-images.githubusercontent.com/17490173/278340815-e5eb448f-e620-4b67-873a-e18cd146c55a.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$p_a = (E_a^*,0,0,|\\vec{p_a}^*|)$\n", + "\n", + "$p_b = (E_b^*,0,0,-|\\vec{p_a}^*|)$\n", + "\n", + "$p_1 = (E_1^*, |\\vec{p_1}^*|sin \\theta^*,0, |\\vec{p_1}^*|cos \\theta^*)$\n", + "\n", + "$p_2 = (E_2^*, -|\\vec{p_1}^*| sin \\theta^*,0, -|\\vec{p_1}^*|cos \\theta^*)$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Invariant: \n", + "$$s = (p_a + p_b)^2 = (E_a^* + E_b^*)^2 = E_{CM}^2$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$ t = (p_a - p_1)^2 = m_a^2 + m_1^2 - 2E_a^* E_1^* + 2 |\\vec{p_a}^*| |\\vec{p_1}^*| cos \\theta^*$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$p_1^2 = [ (p_a+p_b) - p_2 ]^2$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: E2*\n", + "Check that $E_1^* = \\frac{s+m^2_1-m_2^2}{2 \\sqrt{s}}$ and $E_2^* = \\frac{s+m^2_2-m_1^2}{2 \\sqrt{s}}$\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution} E2*\n", + ":class: dropdown\n", + "\n", + "$$ \n", + "E_2^* = E_a^* + E_b^* - E_1^* = E^*_{CM} - E_1^* = \\sqrt{s} - E_1^* = \\sqrt{s} - \\sqrt{\\vec{p_1}^2 + m_1^2}\n", + "$$\n", + "\n", + "$$\n", + "E_2^{*2} = s + \\vec{p_1}^2 + m_1^2 - 2\\sqrt{s}\\sqrt{\\vec{p}^2+m_1^2}\n", + "$$\n", + "\n", + "$$\n", + "E_2^{*2} = \\vec{p_1}^2 + m_2^2\n", + "$$\n", + "\n", + "from the 2 equations of $E_2^{*2}$ above, we have:\n", + "$$\n", + "s + \\vec{p_1}^2 + m_1^2 - 2\\sqrt{s}\\sqrt{\\vec{p}^2+m_1^2} = \\vec{p_1}^2 + m_2^2\n", + "$$\n", + "\n", + "$$\n", + "s + m_1^2 - 2\\sqrt{s}\\sqrt{\\vec{p}^2+m_1^2} = m_2^2\n", + "$$\n", + "\n", + "$$\n", + "s + m_1^2 - m_2^2 = 2\\sqrt{s}E_1^* \n", + "$$\n", + "\n", + "We have E_1^* :\n", + "$$\n", + "E_1^* = \\frac{s + m_1^2 - m_2^2 }{2\\sqrt{s}}\n", + "$$\n", + "\n", + "\n", + "For E_2^* : \n", + "$$\n", + "E_2^* = \\sqrt{s} - E_1^* = \\sqrt{s} - \\frac{s + m_1^2 - m_2^2 }{2\\sqrt{s}} = \\frac{s + m_2^2 - m_1^2 }{2\\sqrt{s}}\n", + "$$\n", + "\n", + "\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{exercise}\n", + ":label: p1*\n", + "Check that $|\\vec{p_1}^*| = \\sqrt{(E_1*)^2-m_1^2} = \\frac{\\lambda^{1/2}(s,m_1^2,m_2^2)}{2 \\sqrt{s}}$, where $\\lambda(a,b,c) = a^2+b^2+c^2 - 2(ab+bc+ca)$\n", + ":::" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ":::{solution} p1*\n", + ":class: dropdown\n", + "\n", + ":::" ] }, { @@ -1115,6 +1241,13 @@ "% $$t = m_a^2 +m_1^2 -2 E^*_a E^*_1 + 2|\\vec{p_a}^*| |\\vec{p_1}^*| cos \\theta^*$$" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$ t_{min,max} = m_a^2 + m_1^2 - 2E_a^* E_1^* + 2 |\\vec{p_a}^*| |\\vec{p_1}^*| $$" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -1148,15 +1281,59 @@ ] }, { - "cell_type": "raw", + "cell_type": "markdown", "metadata": {}, - "source": [] + "source": [ + "## Three particles final states" + ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Decay into three particles\n" + "### Relevant Variables" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Reference Frame" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Gottfried-Jackson Frame" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Helicity Frame" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The Decay" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Decay into two particles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Decay into three particles\n" ] }, { @@ -1170,15 +1347,18 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Check relation (33) using $s_{12}+s_{23}+s_{31}$" + ":::{exercise}\n", + ":label: 2pi\n", + "Check relation above using $s_{12}+s_{23}+s_{31}$\n", + ":::" ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "## Dalitz Plot" + ] }, { "cell_type": "markdown", @@ -1186,7 +1366,15 @@ "tags": [] }, "source": [ - "## `Three-particles-1.dat`" + "### Exercise: `Three-particles-1.dat`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu contains a few data files containing four-momenta data samples. \n", + "Our goal in this notebook is to identify which reaction was used to generate these data samples." ] }, { @@ -1553,7 +1741,7 @@ "tags": [] }, "source": [ - "## `Three-particles-2.dat`" + "### Exercise: `Three-particles-2.dat`" ] }, { From 6a0b0384a93be780626be02fcb7f511f13294c2c Mon Sep 17 00:00:00 2001 From: shenvitor Date: Mon, 30 Oct 2023 11:11:16 +0100 Subject: [PATCH 07/39] new section --- docs/lecture02.ipynb | 95 ++------------------------------------------ 1 file changed, 4 insertions(+), 91 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 13e6e6f..bac1741 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -243,96 +243,6 @@ "" ] }, - { - "cell_type": "markdown", - "metadata": { - "tags": [] - }, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -1119,7 +1029,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![IMAGE](https://user-images.githubusercontent.com/17490173/278340815-e5eb448f-e620-4b67-873a-e18cd146c55a.png)" + "\n", + "```{image} https://user-images.githubusercontent.com/17490173/278340815-e5eb448f-e620-4b67-873a-e18cd146c55a.png\n", + ":width: 500px\n", + "```" ] }, { From 0828aa5dee8668e2e777dc44be5e7d9c5ddb18b0 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Mon, 30 Oct 2023 12:17:11 +0100 Subject: [PATCH 08/39] import data 2 particle --- docs/lecture02.ipynb | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index bac1741..4f9afd4 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -807,7 +807,36 @@ "metadata": {}, "outputs": [], "source": [ - "# p =" + "p_a = data[::3].T\n", + "p1 = data[1::3].T\n", + "p_2 = data[2::3].T" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p_b = p_a - p1 - p_2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2).std()" ] }, { From 6372a9d6cc4cdfed6c410380fe2b2c9fff6272ca Mon Sep 17 00:00:00 2001 From: shenvitor Date: Mon, 30 Oct 2023 12:22:38 +0100 Subject: [PATCH 09/39] fold section --- docs/lecture02.ipynb | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 4f9afd4..86a2d8d 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -58,7 +58,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "### Boost (between Lab and CoM)" ] @@ -245,7 +247,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "### Rotation" ] @@ -855,7 +859,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "## Mandelstam variables\n" ] @@ -1224,7 +1230,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "## Three particles final states" ] @@ -1238,7 +1246,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "## Reference Frame" ] @@ -1259,7 +1269,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "## The Decay" ] @@ -1297,7 +1309,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "## Dalitz Plot" ] From de5db5926d1acb58470c22c75f72df58251971cf Mon Sep 17 00:00:00 2001 From: shenvitor Date: Mon, 30 Oct 2023 15:58:06 +0100 Subject: [PATCH 10/39] cos theta lab plot --- docs/lecture02.ipynb | 124 +++++++++++++++++++++++++++++++++---------- 1 file changed, 96 insertions(+), 28 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 86a2d8d..74e803a 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -716,6 +716,16 @@ "### Example1: Angles and Boost" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "```{image} https://github.com/ComPWA/tensorwaves/assets/17490173/9d5e1cf4-43a9-4670-873a-0833ae024cba\n", + ":width: 500px\n", + "```\n" + ] + }, { "cell_type": "markdown", "metadata": { @@ -753,9 +763,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "mystnb": { "code_prompt_show": "Import Python libraries" }, @@ -811,9 +818,43 @@ "metadata": {}, "outputs": [], "source": [ - "p_a = data[::3].T\n", - "p1 = data[1::3].T\n", - "p_2 = data[2::3].T" + "# 4-vector\n", + "p_a = data[::3]\n", + "p_1 = data[1::3]\n", + "p_2 = data[2::3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 4-vector conservation\n", + "p_b = p_1 + p_2 - p_a\n", + "assert p_b.std(axis=0).sum().round(5) == 0\n", + "p_b.mean(axis=0).round(3)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# p_b.std(axis=0).sum().round(5)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pa = p_a.T\n", + "p1 = p_1.T\n", + "p2 = p_2.T\n", + "pb = p_b.T" ] }, { @@ -822,7 +863,7 @@ "metadata": {}, "outputs": [], "source": [ - "p_b = p_a - p1 - p_2" + "np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2)" ] }, { @@ -831,7 +872,7 @@ "metadata": {}, "outputs": [], "source": [ - "p1[0]" + "np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2).mean()" ] }, { @@ -846,15 +887,52 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ - "# n_final_state = 2\n", - "# pa, p1, p2 = (data[i::4].T for i in range(n_final_state + 1))\n", - "# p0 = p1 + p2\n", - "# pb = p0 - pa" + "p1_length = np.sqrt(p1[1] ** 2 + p1[2] ** 2 + p1[3] ** 2)\n", + "\n", + "cos_theta = p1[3] / p1_length" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_length" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cos_theta" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "# cos(theta) in lab frame\n", + "plt.hist(cos_theta, 100)\n", + "plt.show()" ] }, { @@ -1048,7 +1126,9 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "### CoM Kinematics" ] @@ -1774,9 +1854,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -1795,9 +1872,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "mystnb": { "code_prompt_show": "Identify final state particles" }, @@ -1849,9 +1923,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -1873,9 +1944,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" From 8b790aa003c55095af1746fb667f13efefa7f364 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:17:10 +0100 Subject: [PATCH 11/39] Set `navigation_with_keys` key Fixes this problem: https://github.com/shenvitor/strong2020-salamanca/actions/runs/6691457041/job/18178705939 --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index aa5a3c3..c29ee1c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -86,6 +86,7 @@ def get_execution_mode() -> str: "colab_url": "https://colab.research.google.com", "notebook_interface": "jupyterlab", }, + "navigation_with_keys": True, "path_to_docs": "docs", "repository_branch": "main", "repository_url": "https://github.com/ComPWA/strong2020-salamanca", From e083f7a27447ff12bf20efe108b122bc95e55ddf Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:39:26 +0100 Subject: [PATCH 12/39] DX: do not format notebooks with Prettier --- .prettierignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..fa65608 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.ipynb From e347f0738114439cca3f3347001dfe8c8696ce00 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:41:09 +0100 Subject: [PATCH 13/39] FIX: change rotation label --- docs/lecture02.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 74e803a..887fe3f 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -350,9 +350,8 @@ "metadata": {}, "source": [ ":::{exercise}\n", - ":label: rotation\n", + ":label: check-rotation\n", "Check the result of the rotation above\n", - "\n", ":::" ] }, @@ -360,7 +359,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - ":::{solution} rotation\n", + ":::{solution} check-rotation\n", ":class: dropdown\n", "\n", "Recall the rotation matrix:\n", From 641ce1362d540fd51ba6174fdb77c67312b78621 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:30:25 +0100 Subject: [PATCH 14/39] DOC: increase TOC level depth --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index c29ee1c..39c1b2d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -90,6 +90,7 @@ def get_execution_mode() -> str: "path_to_docs": "docs", "repository_branch": "main", "repository_url": "https://github.com/ComPWA/strong2020-salamanca", + "show_toc_level": 2, "use_issues_button": True, } html_title = "Solutions to STRONG2020 HaSP School" From 4b93726c849d4b76b4a0b1b75134ffd0de75495e Mon Sep 17 00:00:00 2001 From: shenvitor Date: Tue, 31 Oct 2023 14:23:26 +0100 Subject: [PATCH 15/39] plot CM cos theta --- docs/lecture02.ipynb | 236 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 227 insertions(+), 9 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 74e803a..739ab6e 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -747,16 +747,16 @@ }, "outputs": [], "source": [ - "%pip install -q gdown matplotlib numpy particle" + "%pip install -q gdown matplotlib numpy particle pylorentz" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The data are in the lab frame, Compute and plot the cos θL distribution\n", - "Boost to the CoM and Compute and plot\n", - "the cos θ* distribution" + "The data are in the lab frame, Compute and plot the $cosθ_L$ distribution.\n", + "\n", + "Boost to the CoM and Compute and plot the $cosθ^*$ distribution" ] }, { @@ -818,7 +818,7 @@ "metadata": {}, "outputs": [], "source": [ - "# 4-vector\n", + "# 4-vector for a+b->1+2\n", "p_a = data[::3]\n", "p_1 = data[1::3]\n", "p_2 = data[2::3]" @@ -931,7 +931,227 @@ "import matplotlib.pyplot as plt\n", "\n", "# cos(theta) in lab frame\n", - "plt.hist(cos_theta, 100)\n", + "plt.hist(cos_theta, bins=40)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from pylorentz import Momentum4" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_L = Momentum4(*p1)\n", + "pa_L = Momentum4(*pa)\n", + "pb_L = Momentum4(*pb)\n", + "p2_L = Momentum4(*p2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cm = pa_L + pb_L\n", + "p1_CM = p1_L.boost_particle(-cm)\n", + "# p1_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cos_theta_CM = p1_CM.p_z / p1_CM.p" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# cos(theta) in CM frame\n", + "plt.hist(cos_theta_CM, bins=40)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "..." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# mb\n", + "pb[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pa[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# E2 CM\n", + "E2_CM = np.sqrt(pa[3] ** 2 + pa[0] ** 2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "gamma = E2_CM / pa[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v = p1_length / E2_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1z = gamma * (p1[3] + v * p1[0])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tan_theta = p1[1] / p1z" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tan_theta" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# tan_theta\n", + "theta = np.arctan(tan_theta)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cos_theta_CM = np.cos(theta)\n", + "cos_theta_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# cos(theta) in CM frame\n", + "plt.hist(cos_theta_CM, 100)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tan_tht = p1[1] / p1[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1z_CM = p1[3] / gamma - v * E2_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tan_tht_CM = p1[1] / p1z_CM\n", + "# tan_tht_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "theta_CM = np.arctan(tan_tht_CM)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cos_tht_CM = np.cos(theta_CM)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.hist(cos_tht_CM, 100)\n", "plt.show()" ] }, @@ -1389,9 +1609,7 @@ }, { "cell_type": "markdown", - "metadata": { - "jp-MarkdownHeadingCollapsed": true - }, + "metadata": {}, "source": [ "## Dalitz Plot" ] From 267e38291a68f0caf975d8deb9b52518f7082a9d Mon Sep 17 00:00:00 2001 From: shenvitor Date: Thu, 2 Nov 2023 18:43:54 +0100 Subject: [PATCH 16/39] plot cos theta lab after boost using numpy --- docs/lecture02.ipynb | 492 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 470 insertions(+), 22 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index ca4507d..f46df7a 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -21,6 +21,13 @@ "## Experiments and Frames" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "(Particles) Kinematics is understood as the application of special relativity to elementary particle reactions" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -762,9 +769,16 @@ "cell_type": "code", "execution_count": null, "metadata": { + "editable": true, + "jupyter": { + "source_hidden": true + }, "mystnb": { "code_prompt_show": "Import Python libraries" }, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-cell" ] @@ -856,6 +870,15 @@ "pb = p_b.T" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p2.shape" + ] + }, { "cell_type": "code", "execution_count": null, @@ -934,6 +957,13 @@ "plt.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "perfroming boost using pylorentz package below:" + ] + }, { "cell_type": "code", "execution_count": null, @@ -966,6 +996,24 @@ "# p1_CM" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_CM" + ] + }, { "cell_type": "code", "execution_count": null, @@ -990,7 +1038,71 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "..." + "performing boost from calculation via numpy" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initial 4-momentum in lab frame\n", + "\n", + "p_lab = p_a + p_b\n", + "p_lab" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p_a" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p_b" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", + "pa2 = pa_length**2\n", + "pa2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Total Energy in CM frame = \\sqrt(s) = \\sqrt(p_a+p_b) = \\sqrt((Ea+mb)^2- \\vec(p_a)^2)\n", + "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", + "\n", + "E_CM = np.sqrt((pa[0] + pb[0]) ** 2 - pa_length**2)\n", + "\n", + "E_CM" ] }, { @@ -999,7 +1111,255 @@ "metadata": {}, "outputs": [], "source": [ - "# mb\n", + "# v_CM\n", + "sum = pa[0] + pb[0]\n", + "\n", + "\n", + "vx_CM = []\n", + "vy_CM = []\n", + "vz_CM = []\n", + "\n", + "for i in pa[1]:\n", + " vx_CM.append(i / sum)\n", + "for j in pa[2]:\n", + " vy_CM.append(j / sum)\n", + "for k in pa[3]:\n", + " vz_CM.append(k / sum)\n", + "\n", + "# vx_CM = [a / sum for a in pa[1]]\n", + "# vy_CM = [a / sum for a in pa[2]]\n", + "# vz_CM = [a / sum for a in pa[3]]\n", + "\n", + "v_CM = [vx_CM, vy_CM, vz_CM]\n", + "# v_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [ + "vx_CM = pa[1] / sum\n", + "vy_CM = pa[2] / sum\n", + "vz_CM = pa[3] / sum" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# gamma\n", + "\n", + "gamma = 1 / np.sqrt(1 - vx_CM**2 - vy_CM**2 - vz_CM**2)\n", + "gamma" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# v_CM = (vx_CM,vy_CM,vz_CM)\n", + "# v_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v2 = vx_CM**2 + vy_CM**2 + vz_CM**2\n", + "v2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# E1_CM\n", + "E1_CM = gamma * (p1[0] - vx_CM * p1[1] - vy_CM * p1[2] - vz_CM * p1[3])\n", + "E1_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# p1_CM =\n", + "\n", + "fx = vx_CM * p1[1]\n", + "fy = vy_CM * p1[2]\n", + "fz = vz_CM * p1[3]\n", + "\n", + "f1 = (gamma - 1) / v2\n", + "f2 = gamma * p1[0]\n", + "\n", + "# p1_CM = p1\n", + "p1x_CM = p1[1] + (f1 * fx - f2) * vx_CM\n", + "p1y_CM = p1[2] + (f1 * fy - f2) * vy_CM\n", + "p1z_CM = p1[3] + (f1 * fz - f2) * vz_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1z_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_CM = p1\n", + "p1_CM[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_CM[3] = p1z_CM\n", + "p1_CM[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_CM_length = np.sqrt(p1_CM[1] ** 2 + p1_CM[2] ** 2 + p1_CM[3] ** 2)\n", + "\n", + "cos_theta_CM_test = p1_CM[3] / p1_CM_length" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# cos(theta) in CM frame\n", + "plt.hist(cos_theta_CM_test, bins=40)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "(f1 * fz - f2) * vz_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1[3]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1[3] + (f1 * fz - f2) * vz_CM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p1_CM[3]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Test" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# pa" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# E_a\n", + "pa[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# m_b\n", "pb[0]" ] }, @@ -1009,7 +1369,26 @@ "metadata": {}, "outputs": [], "source": [ - "pa[3]" + "# m_a\n", + "pa[0] ** 2 - pa[1] ** 2 - pa[2] ** 2 - pa[3] ** 2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pa" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p_a" ] }, { @@ -1018,8 +1397,8 @@ "metadata": {}, "outputs": [], "source": [ - "# E2 CM\n", - "E2_CM = np.sqrt(pa[3] ** 2 + pa[0] ** 2)" + "m_a = pa[0] ** 2 - pa[1] ** 2 - pa[2] ** 2 - pa[3] ** 2\n", + "m_a" ] }, { @@ -1028,16 +1407,49 @@ "metadata": {}, "outputs": [], "source": [ - "gamma = E2_CM / pa[0]" + "# p_CM = (m_a+m_b,0,0,0)\n", + "m_CM = m_a + pb[0]\n", + "m_CM" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "v = p1_length / E2_CM" + "# Ea CM\n", + "# E_CM = np.sqrt(pa[3] ** 2 + pa[0] ** 2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# gamma = E/m\n", + "gamma = pa[0] / m_a\n", + "gamma" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", + "\n", + "v = pa_length / pa[0]\n", + "v" ] }, { @@ -1055,7 +1467,7 @@ "metadata": {}, "outputs": [], "source": [ - "tan_theta = p1[1] / p1z" + "p1_length" ] }, { @@ -1064,7 +1476,8 @@ "metadata": {}, "outputs": [], "source": [ - "tan_theta" + "p1_length_CM = np.sqrt(p1[1] ** 2 + p1[2] ** 2 + p1z**2)\n", + "p1_length_CM" ] }, { @@ -1073,8 +1486,15 @@ "metadata": {}, "outputs": [], "source": [ - "# tan_theta\n", - "theta = np.arctan(tan_theta)" + "cos_theta_CM_test = p1z / p1_length_CM\n", + "cos_theta_CM_test" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "..." ] }, { @@ -1083,8 +1503,7 @@ "metadata": {}, "outputs": [], "source": [ - "cos_theta_CM = np.cos(theta)\n", - "cos_theta_CM" + "# cos_theta_CM_test = p1z / p1_length" ] }, { @@ -1094,7 +1513,7 @@ "outputs": [], "source": [ "# cos(theta) in CM frame\n", - "plt.hist(cos_theta_CM, 100)\n", + "plt.hist(cos_theta_CM_test, 40)\n", "plt.show()" ] }, @@ -1104,7 +1523,7 @@ "metadata": {}, "outputs": [], "source": [ - "tan_tht = p1[1] / p1[3]" + "tan_theta = p1[1] / p1z" ] }, { @@ -1113,7 +1532,7 @@ "metadata": {}, "outputs": [], "source": [ - "p1z_CM = p1[3] / gamma - v * E2_CM" + "tan_theta" ] }, { @@ -1122,8 +1541,8 @@ "metadata": {}, "outputs": [], "source": [ - "tan_tht_CM = p1[1] / p1z_CM\n", - "# tan_tht_CM" + "# tan_theta\n", + "theta = np.arctan(tan_theta)" ] }, { @@ -1132,7 +1551,8 @@ "metadata": {}, "outputs": [], "source": [ - "theta_CM = np.arctan(tan_tht_CM)" + "cos_theta_CM = np.cos(theta)\n", + "cos_theta_CM" ] }, { @@ -1141,7 +1561,22 @@ "metadata": {}, "outputs": [], "source": [ - "cos_tht_CM = np.cos(theta_CM)" + "# cos(theta) in CM frame\n", + "plt.hist(cos_theta_CM, 100)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [ + "tan_tht = p1[1] / p1[3]" ] }, { @@ -1150,8 +1585,17 @@ "metadata": {}, "outputs": [], "source": [ - "plt.hist(cos_tht_CM, 100)\n", - "plt.show()" + "# p1z_CM = p1[3] / gamma - v * E2_CM\n", + "\n", + "# tan_tht_CM = p1[1] / p1z_CM\n", + "# # tan_tht_CM\n", + "\n", + "# theta_CM = np.arctan(tan_tht_CM)\n", + "\n", + "# cos_tht_CM = np.cos(theta_CM)\n", + "\n", + "# plt.hist(cos_tht_CM, 100)\n", + "# plt.show()" ] }, { @@ -2161,6 +2605,10 @@ "cell_type": "code", "execution_count": null, "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-input", "full-width" From f2ce5910c8ee98ac3b7a8ff967929b9b543bc5b3 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Tue, 7 Nov 2023 16:24:48 +0100 Subject: [PATCH 17/39] organise sections untill Lorentz transformation --- docs/lecture02.ipynb | 649 ++++++++++++------------------------------- 1 file changed, 174 insertions(+), 475 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index f46df7a..301745f 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -25,28 +25,64 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "(Particles) Kinematics is understood as the application of special relativity to elementary particle reactions" + "(Particles) Kinematics is understood as the application of special relativity to elementary particle reactions." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The standard frames: CoM frame and Lab frame" + "The 2 standard frames that are commonly used: Center of Mass (CoM) frame and Laboratory (Lab) frame" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The scattering happens in the x-z plane for both frames." + "For two particle a and b reation, i.e., \n", + "$a+b \\rightarrow 1 + ... + n $, they satisfy:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The two frames are related by a boost along the z axis" + "### Lab frame" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### $\\vec{p}_b = \\vec{0}$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which is the frame that the target particle b is at rest, while the beam particle a is moving." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### CoM frame" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### $\\vec{p}_a+\\vec{p}_b = \\vec{0}$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "this is the frame that the total moementum is zero, i.e., the two reaction particles has same but opposite direction momentum." ] }, { @@ -56,6 +92,33 @@ "## Two particles Final States" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### $a+b \\rightarrow 1+2$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```{image} https://github.com/ComPWA/tensorwaves/assets/17490173/9d5e1cf4-43a9-4670-873a-0833ae024cba\n", + ":width: 300px\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the case of the scattering happens in the x-z plane for both frames, the two frames are related by a boost along the z axis.\n", + "\n", + "$ \\vec{z}$ is parallel to the beam $\\vec{p}_a $\n", + "\n", + "$ \\vec{y} $ is parallel to $ \\vec{p}_a \\times \\vec{p}_1$" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -63,6 +126,13 @@ "## Lorentz transformations" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Boost and Rotation." + ] + }, { "cell_type": "markdown", "metadata": { @@ -728,7 +798,7 @@ "source": [ "\n", "```{image} https://github.com/ComPWA/tensorwaves/assets/17490173/9d5e1cf4-43a9-4670-873a-0833ae024cba\n", - ":width: 500px\n", + ":width: 300px\n", "```\n" ] }, @@ -743,10 +813,22 @@ "\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The data are in the lab frame, Compute and plot the $cosθ_L$ distribution.\n", + "\n", + "Boost to the CoM and Compute and plot the $cosθ^*$ distribution" + ] + }, { "cell_type": "code", "execution_count": null, "metadata": { + "jupyter": { + "source_hidden": true + }, "tags": [ "remove-cell" ] @@ -756,15 +838,6 @@ "%pip install -q gdown matplotlib numpy particle pylorentz" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The data are in the lab frame, Compute and plot the $cosθ_L$ distribution.\n", - "\n", - "Boost to the CoM and Compute and plot the $cosθ^*$ distribution" - ] - }, { "cell_type": "code", "execution_count": null, @@ -818,6 +891,9 @@ "cell_type": "code", "execution_count": null, "metadata": { + "jupyter": { + "source_hidden": true + }, "tags": [] }, "outputs": [], @@ -833,8 +909,18 @@ "source": [ "# 4-vector for a+b->1+2\n", "p_a = data[::3]\n", + "p_a.shape" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 4-vector for a+b->1+2\n", "p_1 = data[1::3]\n", - "p_2 = data[2::3]" + "p_1.shape" ] }, { @@ -843,10 +929,9 @@ "metadata": {}, "outputs": [], "source": [ - "# 4-vector conservation\n", - "p_b = p_1 + p_2 - p_a\n", - "assert p_b.std(axis=0).sum().round(5) == 0\n", - "p_b.mean(axis=0).round(3)" + "# 4-vector for a+b->1+2\n", + "p_2 = data[2::3]\n", + "p_2.shape" ] }, { @@ -855,7 +940,10 @@ "metadata": {}, "outputs": [], "source": [ - "# p_b.std(axis=0).sum().round(5)" + "# 4-vector conservation\n", + "p_b = p_1 + p_2 - p_a\n", + "assert p_b.std(axis=0).sum().round(5) == 0\n", + "p_b.mean(axis=0).round(3)" ] }, { @@ -864,10 +952,7 @@ "metadata": {}, "outputs": [], "source": [ - "pa = p_a.T\n", - "p1 = p_1.T\n", - "p2 = p_2.T\n", - "pb = p_b.T" + "# p_b.std(axis=0).sum().round(5)" ] }, { @@ -876,7 +961,11 @@ "metadata": {}, "outputs": [], "source": [ - "p2.shape" + "pa = p_a.T\n", + "p1 = p_1.T\n", + "p2 = p_2.T\n", + "pb = p_b.T\n", + "pb.shape" ] }, { @@ -923,7 +1012,7 @@ "metadata": {}, "outputs": [], "source": [ - "p1[3]" + "p1_length" ] }, { @@ -932,16 +1021,14 @@ "metadata": {}, "outputs": [], "source": [ - "p1_length" + "cos_theta" ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "cos_theta" + "##### cos $\\theta$ in lab frame" ] }, { @@ -953,6 +1040,8 @@ "import matplotlib.pyplot as plt\n", "\n", "# cos(theta) in lab frame\n", + "plt.title(r\"cos $\\theta$ distribution in lab frame\")\n", + "plt.xlabel(r\"cos $\\theta$\")\n", "plt.hist(cos_theta, bins=40)\n", "plt.show()" ] @@ -961,84 +1050,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "perfroming boost using pylorentz package below:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from pylorentz import Momentum4" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_L = Momentum4(*p1)\n", - "pa_L = Momentum4(*pa)\n", - "pb_L = Momentum4(*pb)\n", - "p2_L = Momentum4(*p2)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cm = pa_L + pb_L\n", - "p1_CM = p1_L.boost_particle(-cm)\n", - "# p1_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cos_theta_CM = p1_CM.p_z / p1_CM.p" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# cos(theta) in CM frame\n", - "plt.hist(cos_theta_CM, bins=40)\n", - "plt.show()" + "##### cos $\\theta$ in CoM frame" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "performing boost from calculation via numpy" + "##### Performing boost from calculation via numpy" ] }, { @@ -1048,27 +1067,8 @@ "outputs": [], "source": [ "# initial 4-momentum in lab frame\n", - "\n", "p_lab = p_a + p_b\n", - "p_lab" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p_a" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p_b" + "# p_lab" ] }, { @@ -1079,16 +1079,7 @@ "source": [ "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", "pa2 = pa_length**2\n", - "pa2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2" + "# pa2" ] }, { @@ -1099,10 +1090,8 @@ "source": [ "# Total Energy in CM frame = \\sqrt(s) = \\sqrt(p_a+p_b) = \\sqrt((Ea+mb)^2- \\vec(p_a)^2)\n", "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", - "\n", "E_CM = np.sqrt((pa[0] + pb[0]) ** 2 - pa_length**2)\n", - "\n", - "E_CM" + "# E_CM" ] }, { @@ -1114,7 +1103,6 @@ "# v_CM\n", "sum = pa[0] + pb[0]\n", "\n", - "\n", "vx_CM = []\n", "vy_CM = []\n", "vz_CM = []\n", @@ -1126,10 +1114,6 @@ "for k in pa[3]:\n", " vz_CM.append(k / sum)\n", "\n", - "# vx_CM = [a / sum for a in pa[1]]\n", - "# vy_CM = [a / sum for a in pa[2]]\n", - "# vz_CM = [a / sum for a in pa[3]]\n", - "\n", "v_CM = [vx_CM, vy_CM, vz_CM]\n", "# v_CM" ] @@ -1137,11 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "vx_CM = pa[1] / sum\n", @@ -1156,19 +1136,8 @@ "outputs": [], "source": [ "# gamma\n", - "\n", "gamma = 1 / np.sqrt(1 - vx_CM**2 - vy_CM**2 - vz_CM**2)\n", - "gamma" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# v_CM = (vx_CM,vy_CM,vz_CM)\n", - "# v_CM" + "# gamma" ] }, { @@ -1178,7 +1147,7 @@ "outputs": [], "source": [ "v2 = vx_CM**2 + vy_CM**2 + vz_CM**2\n", - "v2" + "# v2" ] }, { @@ -1189,7 +1158,7 @@ "source": [ "# E1_CM\n", "E1_CM = gamma * (p1[0] - vx_CM * p1[1] - vy_CM * p1[2] - vz_CM * p1[3])\n", - "E1_CM" + "# E1_CM" ] }, { @@ -1213,24 +1182,6 @@ "p1z_CM = p1[3] + (f1 * fz - f2) * vz_CM" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1z_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1[3]" - ] - }, { "cell_type": "code", "execution_count": null, @@ -1238,7 +1189,7 @@ "outputs": [], "source": [ "p1_CM = p1\n", - "p1_CM[3]" + "# p1_CM[3]" ] }, { @@ -1247,17 +1198,10 @@ "metadata": {}, "outputs": [], "source": [ + "p1_CM[1] = p1x_CM\n", + "p1_CM[2] = p1y_CM\n", "p1_CM[3] = p1z_CM\n", - "p1_CM[3]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_CM" + "# p1_CM[3]" ] }, { @@ -1268,7 +1212,7 @@ "source": [ "p1_CM_length = np.sqrt(p1_CM[1] ** 2 + p1_CM[2] ** 2 + p1_CM[3] ** 2)\n", "\n", - "cos_theta_CM_test = p1_CM[3] / p1_CM_length" + "cos_theta_CM = -p1_CM[3] / p1_CM_length" ] }, { @@ -1278,305 +1222,68 @@ "outputs": [], "source": [ "# cos(theta) in CM frame\n", - "plt.hist(cos_theta_CM_test, bins=40)\n", + "plt.hist(cos_theta_CM, bins=40)\n", + "plt.title(r\"cos $\\theta$ distribution in CoM frame\")\n", + "plt.xlabel(r\"cos $\\theta$\")\n", "plt.show()" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "(f1 * fz - f2) * vz_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1[3]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1[3] + (f1 * fz - f2) * vz_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_CM[3]" - ] - }, { "cell_type": "markdown", "metadata": {}, "source": [ - "#### Test" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# pa" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# E_a\n", - "pa[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# m_b\n", - "pb[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# m_a\n", - "pa[0] ** 2 - pa[1] ** 2 - pa[2] ** 2 - pa[3] ** 2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pa" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p_a" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "m_a = pa[0] ** 2 - pa[1] ** 2 - pa[2] ** 2 - pa[3] ** 2\n", - "m_a" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# p_CM = (m_a+m_b,0,0,0)\n", - "m_CM = m_a + pb[0]\n", - "m_CM" + "Perfroming boost using pylorentz package below to test the boost again:" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "# Ea CM\n", - "# E_CM = np.sqrt(pa[3] ** 2 + pa[0] ** 2)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# gamma = E/m\n", - "gamma = pa[0] / m_a\n", - "gamma" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", + "from pylorentz import Momentum4\n", "\n", - "v = pa_length / pa[0]\n", - "v" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1z = gamma * (p1[3] + v * p1[0])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_length" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_length_CM = np.sqrt(p1[1] ** 2 + p1[2] ** 2 + p1z**2)\n", - "p1_length_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cos_theta_CM_test = p1z / p1_length_CM\n", - "cos_theta_CM_test" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "..." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# cos_theta_CM_test = p1z / p1_length" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# cos(theta) in CM frame\n", - "plt.hist(cos_theta_CM_test, 40)\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tan_theta = p1[1] / p1z" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tan_theta" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# tan_theta\n", - "theta = np.arctan(tan_theta)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cos_theta_CM = np.cos(theta)\n", - "cos_theta_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# cos(theta) in CM frame\n", - "plt.hist(cos_theta_CM, 100)\n", - "plt.show()" + "data = np.loadtxt(filename)\n", + "p_a = data[::3]\n", + "p_1 = data[1::3]\n", + "p_2 = data[2::3]\n", + "p_b = p_1 + p_2 - p_a\n", + "pa = p_a.T\n", + "p1 = p_1.T\n", + "p2 = p_2.T\n", + "pb = p_b.T\n", + "\n", + "p1_Lab = Momentum4(*p1)\n", + "pa_Lab = Momentum4(*pa)\n", + "pb_Lab = Momentum4(*pb)\n", + "p2_Lab = Momentum4(*p2)\n", + "\n", + "cm = pa_Lab + pb_Lab\n", + "p1_CM_pyL = p1_Lab.boost_particle(-cm)\n", + "# p1_CM\n", + "\n", + "cos_theta_CM_pyL = p1_CM_pyL.p_z / p1_CM_pyL.p" ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - } + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "hide-input" + ] }, "outputs": [], "source": [ - "tan_tht = p1[1] / p1[3]" + "# cos(theta) in CM frame\n", + "plt.title(r\"cos $\\theta$ distribution in CoM frame\")\n", + "plt.xlabel(r\"cos $\\theta$\")\n", + "plt.hist(cos_theta_CM_pyL, bins=40)\n", + "plt.show()" ] }, { @@ -1585,17 +1292,9 @@ "metadata": {}, "outputs": [], "source": [ - "# p1z_CM = p1[3] / gamma - v * E2_CM\n", - "\n", - "# tan_tht_CM = p1[1] / p1z_CM\n", - "# # tan_tht_CM\n", - "\n", - "# theta_CM = np.arctan(tan_tht_CM)\n", - "\n", - "# cos_tht_CM = np.cos(theta_CM)\n", - "\n", - "# plt.hist(cos_tht_CM, 100)\n", - "# plt.show()" + "# check the cos theta CM in 2 different ways\n", + "np.testing.assert_allclose(cos_theta_CM, cos_theta_CM_pyL, rtol=1e-5)\n", + "print(\"test past with relative tolerance 1e-5\")" ] }, { From eb6c3c13f22e3cdf7c7d9745c9871c9da801d3db Mon Sep 17 00:00:00 2001 From: shenvitor Date: Tue, 7 Nov 2023 19:29:47 +0100 Subject: [PATCH 18/39] vectorize and clean-up code --- docs/lecture02.ipynb | 417 +++++++++++++++++++------------------------ 1 file changed, 181 insertions(+), 236 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 301745f..96946f8 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -887,42 +887,6 @@ "data.shape" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - }, - "tags": [] - }, - "outputs": [], - "source": [ - "print(data)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# 4-vector for a+b->1+2\n", - "p_a = data[::3]\n", - "p_a.shape" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# 4-vector for a+b->1+2\n", - "p_1 = data[1::3]\n", - "p_1.shape" - ] - }, { "cell_type": "code", "execution_count": null, @@ -930,8 +894,10 @@ "outputs": [], "source": [ "# 4-vector for a+b->1+2\n", - "p_2 = data[2::3]\n", - "p_2.shape" + "pa = data[::3].T\n", + "p1 = data[1::3].T\n", + "p2 = data[2::3].T\n", + "pa.shape" ] }, { @@ -941,40 +907,9 @@ "outputs": [], "source": [ "# 4-vector conservation\n", - "p_b = p_1 + p_2 - p_a\n", - "assert p_b.std(axis=0).sum().round(5) == 0\n", - "p_b.mean(axis=0).round(3)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# p_b.std(axis=0).sum().round(5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pa = p_a.T\n", - "p1 = p_1.T\n", - "p2 = p_2.T\n", - "pb = p_b.T\n", - "pb.shape" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2)" + "pb = p1 + p2 - pa\n", + "assert pb.std(axis=1).sum().round(5) == 0\n", + "pb.mean(axis=1).round(3)" ] }, { @@ -983,50 +918,80 @@ "metadata": {}, "outputs": [], "source": [ - "np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2).mean()" + "m1 = np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2)\n", + "m1.mean(), m1.std()" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "np.sqrt(p1[0] ** 2 - p1[1] ** 2 - p1[2] ** 2 - p1[3] ** 2).std()" + "# p1.shape\n", + "np.sqrt((p1[1:] ** 2).sum(axis=0))" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "p1_length = np.sqrt(p1[1] ** 2 + p1[2] ** 2 + p1[3] ** 2)\n", + "def p3_length(four_momentum: np.ndarray) -> np.ndarray:\n", + " return np.sqrt(\n", + " four_momentum[1] ** 2 + four_momentum[2] ** 2 + four_momentum[3] ** 2\n", + " )\n", "\n", + "\n", + "p1_length = p3_length(p1)\n", "cos_theta = p1[3] / p1_length" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_length" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "hide-input" + ] + }, "outputs": [], "source": [ - "cos_theta" + "p1_length_vectorized = np.sqrt(np.sum(p1[1:] ** 2, axis=0))\n", + "np.testing.assert_array_equal(p1_length, p1_length_vectorized)" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "remove-cell" + ] + }, "source": [ "##### cos $\\theta$ in lab frame" ] @@ -1034,21 +999,38 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "hide-input" + ] + }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "# cos(theta) in lab frame\n", - "plt.title(r\"cos $\\theta$ distribution in lab frame\")\n", - "plt.xlabel(r\"cos $\\theta$\")\n", + "plt.title(r\"$\\cos \\theta$ distribution in lab frame\")\n", + "plt.xlabel(r\"$\\cos \\theta$\")\n", "plt.hist(cos_theta, bins=40)\n", "plt.show()" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "##### cos $\\theta$ in CoM frame" ] @@ -1063,168 +1045,157 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "# initial 4-momentum in lab frame\n", - "p_lab = p_a + p_b\n", - "# p_lab" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", - "pa2 = pa_length**2\n", - "# pa2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Total Energy in CM frame = \\sqrt(s) = \\sqrt(p_a+p_b) = \\sqrt((Ea+mb)^2- \\vec(p_a)^2)\n", - "pa_length = np.sqrt(pa[1] ** 2 + pa[2] ** 2 + pa[3] ** 2)\n", - "E_CM = np.sqrt((pa[0] + pb[0]) ** 2 - pa_length**2)\n", - "# E_CM" + "p_CM_lab = pa + pb" ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ - "# v_CM\n", - "sum = pa[0] + pb[0]\n", + "Total Energy in CM frame\n", "\n", - "vx_CM = []\n", - "vy_CM = []\n", - "vz_CM = []\n", + "$\\sqrt{s} = \\sqrt{(E_a+m_b)^2 - |\\vec{p_a}|^2}$\n", "\n", - "for i in pa[1]:\n", - " vx_CM.append(i / sum)\n", - "for j in pa[2]:\n", - " vy_CM.append(j / sum)\n", - "for k in pa[3]:\n", - " vz_CM.append(k / sum)\n", "\n", - "v_CM = [vx_CM, vy_CM, vz_CM]\n", - "# v_CM" + "$\\sqrt{s} = \\sqrt{(E_a+E_b)^2 - |\\vec{p_a} + \\vec{p_b}|^2}$\n" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "vx_CM = pa[1] / sum\n", - "vy_CM = pa[2] / sum\n", - "vz_CM = pa[3] / sum" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "# gamma\n", - "gamma = 1 / np.sqrt(1 - vx_CM**2 - vy_CM**2 - vz_CM**2)\n", - "# gamma" + "pa_length = p3_length(pa)\n", + "E_CM = np.sqrt(p_CM_lab[0] ** 2 - pa_length**2)" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "v2 = vx_CM**2 + vy_CM**2 + vz_CM**2\n", - "# v2" + "E_CM_lab = p_CM_lab[0]\n", + "βx_CM, βy_CM, βz_CM = β_CM = pa[1:] / E_CM_lab\n", + "β2 = βx_CM**2 + βy_CM**2 + βz_CM**2\n", + "gamma = 1 / np.sqrt(1 - β2)" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "# E1_CM\n", - "E1_CM = gamma * (p1[0] - vx_CM * p1[1] - vy_CM * p1[2] - vz_CM * p1[3])\n", - "# E1_CM" + "E1_CM = gamma * (p1[0] - βx_CM * p1[1] - βy_CM * p1[2] - βz_CM * p1[3])" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "# p1_CM =\n", - "\n", - "fx = vx_CM * p1[1]\n", - "fy = vy_CM * p1[2]\n", - "fz = vz_CM * p1[3]\n", - "\n", - "f1 = (gamma - 1) / v2\n", + "p1_vec = p1[1:]\n", + "f = β_CM * p1_vec\n", + "f1 = (gamma - 1) / β2\n", "f2 = gamma * p1[0]\n", - "\n", - "# p1_CM = p1\n", - "p1x_CM = p1[1] + (f1 * fx - f2) * vx_CM\n", - "p1y_CM = p1[2] + (f1 * fy - f2) * vy_CM\n", - "p1z_CM = p1[3] + (f1 * fz - f2) * vz_CM" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "p1_CM = p1\n", - "# p1_CM[3]" + "p1_CM_vec = p1_vec + (f1 * f - f2) * β_CM" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "p1_CM[1] = p1x_CM\n", - "p1_CM[2] = p1y_CM\n", - "p1_CM[3] = p1z_CM\n", - "# p1_CM[3]" + "p1_CM = np.concatenate((E1_CM[None], p1_CM_vec))\n", + "p1_CM" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "p1_CM_length = np.sqrt(p1_CM[1] ** 2 + p1_CM[2] ** 2 + p1_CM[3] ** 2)\n", - "\n", + "p1_CM_length = p3_length(p1_CM)\n", "cos_theta_CM = -p1_CM[3] / p1_CM_length" ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "hide-input" + ] + }, "outputs": [], "source": [ - "# cos(theta) in CM frame\n", "plt.hist(cos_theta_CM, bins=40)\n", - "plt.title(r\"cos $\\theta$ distribution in CoM frame\")\n", - "plt.xlabel(r\"cos $\\theta$\")\n", + "plt.title(r\"$\\cos \\theta$ distribution in CoM frame\")\n", + "plt.xlabel(r\"$\\cos \\theta$\")\n", "plt.show()" ] }, @@ -1238,21 +1209,19 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "hide-input" + ] + }, "outputs": [], "source": [ "from pylorentz import Momentum4\n", "\n", - "data = np.loadtxt(filename)\n", - "p_a = data[::3]\n", - "p_1 = data[1::3]\n", - "p_2 = data[2::3]\n", - "p_b = p_1 + p_2 - p_a\n", - "pa = p_a.T\n", - "p1 = p_1.T\n", - "p2 = p_2.T\n", - "pb = p_b.T\n", - "\n", "p1_Lab = Momentum4(*p1)\n", "pa_Lab = Momentum4(*pa)\n", "pb_Lab = Momentum4(*pb)\n", @@ -1260,38 +1229,9 @@ "\n", "cm = pa_Lab + pb_Lab\n", "p1_CM_pyL = p1_Lab.boost_particle(-cm)\n", - "# p1_CM\n", "\n", - "cos_theta_CM_pyL = p1_CM_pyL.p_z / p1_CM_pyL.p" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "" - }, - "tags": [ - "hide-input" - ] - }, - "outputs": [], - "source": [ - "# cos(theta) in CM frame\n", - "plt.title(r\"cos $\\theta$ distribution in CoM frame\")\n", - "plt.xlabel(r\"cos $\\theta$\")\n", - "plt.hist(cos_theta_CM_pyL, bins=40)\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "cos_theta_CM_pyL = p1_CM_pyL.p_z / p1_CM_pyL.p\n", + "\n", "# check the cos theta CM in 2 different ways\n", "np.testing.assert_allclose(cos_theta_CM, cos_theta_CM_pyL, rtol=1e-5)\n", "print(\"test past with relative tolerance 1e-5\")" @@ -1300,7 +1240,12 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "source": [ "## Mandelstam variables\n" From ff503d491ce95fbd2770f7ebf87d3ad05b02ca0f Mon Sep 17 00:00:00 2001 From: shenvitor Date: Thu, 9 Nov 2023 18:03:25 +0100 Subject: [PATCH 19/39] re organise section until Mandelstam variables section --- docs/lecture02.ipynb | 572 +++++++++++++++++++++++++------------------ 1 file changed, 332 insertions(+), 240 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 96946f8..0c329a5 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -9,14 +9,27 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ - "This is a lecture note and exercises with answerings which based on [Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu " + "This is a lecture note and exercises with answering attempts which based on [Lecture 2](https://indico.ific.uv.es/event/6803/contributions/21220) by Vincent Mathieu " ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "## Experiments and Frames" ] @@ -30,14 +43,26 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ - "The 2 standard frames that are commonly used: Center of Mass (CoM) frame and Laboratory (Lab) frame" + "The 2 standard frames that are commonly used are Center of Mass (CoM) frame and Laboratory (Lab) frame" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "For two particle a and b reation, i.e., \n", "$a+b \\rightarrow 1 + ... + n $, they satisfy:" @@ -45,7 +70,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Lab frame" ] @@ -66,7 +97,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### CoM frame" ] @@ -87,7 +124,14 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "## Two particles Final States" ] @@ -121,7 +165,14 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "## Lorentz transformations" ] @@ -136,7 +187,12 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "source": [ "### Boost (between Lab and CoM)" @@ -325,7 +381,12 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "source": [ "### Rotation" @@ -371,7 +432,7 @@ " \\\\\n", " cos(\\theta)\n", "\\end{pmatrix}\n", - "$$" + "$$ (rotation_label)" ] }, { @@ -482,7 +543,7 @@ "\n", "The rotation matrix around x axes is also given for completeness.\n", "\n", - "Thus equation (9) becomes:\n", + "Thus equation {eq}`rotation_label` becomes:\n", "\n", "$$\n", "\\begin{pmatrix}\n", @@ -553,217 +614,16 @@ "\\end{pmatrix}\n", "$,\n", "and using the trigonometric identities,\n", - "thus we have:\n", - "\n", - "$$\n", - "\\begin{pmatrix}\n", - " p_x'\n", - " \\\\\n", - " p_y'\n", - " \\\\\n", - " p_z'\n", - "\\end{pmatrix}\n", - "=\n", - "\\begin{pmatrix}\n", - "sin(\\theta) \\cdot cos(\\omega)+ cos(\\theta) \\cdot sin(\\omega) \n", - "\\\\\n", - "0\n", - "\\\\\n", - "-sin(\\theta) \\cdot sin(\\omega) + cos(\\theta) \\cdot cos(\\omega) \n", - "\\end{pmatrix}\n", - "=\n", - "\\begin{pmatrix}\n", - "sin(\\theta+\\omega)\n", - "\\\\\n", - "0\n", - "\\\\\n", - "cos(\\theta+\\omega) \n", - "\\end{pmatrix}\n", - "\n", - "$$\n", - "\n", - "\n", - "\n", - ":::" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "\n" + "$$\n", + ":::" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "jp-MarkdownHeadingCollapsed": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Example1: Angles and Boost" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "\n", "```{image} https://github.com/ComPWA/tensorwaves/assets/17490173/9d5e1cf4-43a9-4670-873a-0833ae024cba\n", @@ -938,6 +810,17 @@ "np.sqrt((p1[1:] ** 2).sum(axis=0))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "because this decay happend in x-z plane, thus we can find the $\\cos \\theta$ by:\n", + "\n", + "$$\n", + "\\cos \\theta = \\frac{p_{1z}}{|\\vec{p_1}|}\n", + "$$(cos_theta_label)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1042,6 +925,16 @@ "##### Performing boost from calculation via numpy" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The total initial 4-momentum in the lab frame is given by\n", + "$$\n", + "\\vec{P} = \\vec{p}_a + \\vec{p}_b\n", + "$$" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1054,7 +947,7 @@ }, "outputs": [], "source": [ - "# initial 4-momentum in lab frame\n", + "# The total initial 4-momentum in lab frame\n", "p_CM_lab = pa + pb" ] }, @@ -1068,12 +961,20 @@ "tags": [] }, "source": [ - "Total Energy in CM frame\n", + "Total Energy in CM frame is the magnitude of the total initial 4-momentum:\n", "\n", - "$\\sqrt{s} = \\sqrt{(E_a+m_b)^2 - |\\vec{p_a}|^2}$\n", + "$$\n", + "E_{CM} = \\sqrt{\\vec{P} \\cdot \\vec{P}} = \\sqrt{(E_a+m_b)^2 - |\\vec{p_a}|^2} = \\sqrt{s}\n", + "$$\n", + "\n", + "This is valid, as we know that $\\sqrt{s}$ is the total energy in CoM frame of the colliding particles, in this case: for two particle final state of reaction $a+b \\rightarrow 1+2$\n", + "\n", + "$$\n", + "E_{CM} = \\sqrt{s} = \\sqrt{(E_a+E_b)^2 - |\\vec{p_a} + \\vec{p_b}|^2} = \\sqrt{(E_a+m_b)^2 - |\\vec{p_a}|^2}\n", + "$$\n", "\n", "\n", - "$\\sqrt{s} = \\sqrt{(E_a+E_b)^2 - |\\vec{p_a} + \\vec{p_b}|^2}$\n" + "\n" ] }, { @@ -1110,6 +1011,21 @@ "gamma = 1 / np.sqrt(1 - β2)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Find the transformed energy $E_1$ in CoM frame by Lorentz boost for $p^{0}_1$ :\n", + "$$\n", + "E_{1,CM} = \\gamma(E_1 - \\vec{\\beta} \\cdot \\vec{p}_1)\n", + "$$\n", + "where \n", + "$$\n", + "\\gamma = \\frac{1}{\\sqrt{1-\\beta^2}}\n", + "$$\n", + "and $\\beta$ is the velocity here" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1125,6 +1041,16 @@ "E1_CM = gamma * (p1[0] - βx_CM * p1[1] - βy_CM * p1[2] - βz_CM * p1[3])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And now for the transformed momentum vector $\\vec{p}_1$ in CoM frame by Lorentz boost for $p_1^{i}$, where i = 1,2,3, with:\n", + "$$\n", + "\\vec{p}_{1,CM} = \\vec{p}_1 + (\\frac{\\gamma -1}{\\beta^2}(\\vec{\\beta} \\cdot \\vec{p}_1)- \\gamma E_1) \\vec{\\beta}\n", + "$$" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1160,6 +1086,13 @@ "p1_CM" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Similarily, the equation {eq}`cos_theta_label` is still hold, and thus we find the $\\cos \\theta_{CM}$:" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1237,6 +1170,27 @@ "print(\"test past with relative tolerance 1e-5\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "hide-input", + "hide-cell" + ] + }, + "outputs": [], + "source": [ + "plt.hist(cos_theta_CM_pyL, bins=40)\n", + "plt.title(r\"$\\cos \\theta$ distribution in CoM frame\")\n", + "plt.xlabel(r\"$\\cos \\theta$\")\n", + "plt.show()" + ] + }, { "cell_type": "markdown", "metadata": { @@ -1253,20 +1207,85 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "We have the mass-shell relation:" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "$$ p_i^2 = m^2_i $$" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "The Mandelstam variables s, t, and u are Lorentz invariants. Their definition are:" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "$$ s =(p_a + p_b)^2 = (p_1+p_2)^2 $$\n", "$$ t =(p_a - p_1)^2 = (p_b-p_2)^2 $$\n", "$$ u =(p_a - p_2)^2 = (p_b-p_1)^2 $$\n" ] }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "\n", + "```{image} https://github.com/ComPWA/strong2020-salamanca/assets/17490173/4daa6f59-615d-4950-b7ba-e8a93f04253c\n", + ":width: 300px\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -1292,7 +1311,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ ":::{exercise}\n", ":label: mv\n", @@ -1302,7 +1327,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ ":::{solution} mv\n", ":class: dropdown\n", @@ -1348,7 +1379,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "% $$ s+t+u = (p_a + p_b)^2 + (p_a - p_1)^2 + (p_a - p_2)^2$$" ] @@ -1362,7 +1399,16 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "\n", + "When we have a final state with two particles ($n=2$), we can define one $xz$ plane that is spanned by the momenta of the two final state particles in the Lab frame. The CoM frame and the Lab frame can now be related by a boost along the $z$-axis (the direction of particle $a$).\n", "\n", - "$ \\vec{z}$ is parallel to the beam $\\vec{p}_a $\n", + "With this definition of the x-z plane, we have:\n", + "- $\\vec{z}$ is parallel to the beam $\\vec{p}_a$\n", + "- $\\vec{y} $ is parallel to $ \\vec{p}_a \\times \\vec{p}_1$\n", "\n", - "$ \\vec{y} $ is parallel to $ \\vec{p}_a \\times \\vec{p}_1$" + "" ] }, { @@ -2272,6 +2227,10 @@ "cell_type": "code", "execution_count": null, "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-input", "full-width" From 2543cd37e327e222a2f9472d9e8c8296723814ed Mon Sep 17 00:00:00 2001 From: shenvitor Date: Fri, 17 Nov 2023 22:41:09 +0100 Subject: [PATCH 37/39] writing change until boost section --- docs/lecture02.ipynb | 73 +++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index c092013..4da8c93 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -2,7 +2,13 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "# Lecture 2 – Kinematics and Lorentz Transformations" ] @@ -119,14 +125,11 @@ }, "source": [ "\n", - "When we have a final state with two particles ($n=2$), we can define one $xz$ plane that is spanned by the momenta of the two final state particles in the Lab frame. The CoM frame and the Lab frame can now be related by a boost along the $z$-axis (the direction of particle $a$).\n", + "When we have a final state with two particles ($n=2$), we can define one $x-z$ plane that is spanned by the momenta of the two final state particles in the Lab frame. The CoM frame and the Lab frame can now be related by a boost along the $z$-axis (the direction of particle $a$).\n", "\n", "With this definition of the x-z plane, we have:\n", "- $\\vec{z}$ is parallel to the beam $\\vec{p}_a$\n", - "- $\\vec{y} $ is parallel to $ \\vec{p}_a \\times \\vec{p}_1$\n", - "\n", - "" + "- $\\vec{y} $ is parallel to $ \\vec{p}_a \\times \\vec{p}_1$" ] }, { @@ -144,9 +147,15 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ - "Boost and Rotation." + "The Lorentz transformation, which includes both boosts (velocity changes) and rotations, is crucial for understanding how the properties of particles, such as position and time, transform between different inertial frames in relative motion." ] }, { @@ -164,14 +173,26 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ - "Only the energy and the z component change" + "Only the energy and the $z$ component of the four-momenta changes, so we can write the Lorentz boost with a 2D matrix." ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "$$\\begin{pmatrix}\n", " E^*\n", @@ -242,16 +263,28 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "$$\n", - "\\gamma \\beta = \\frac{E^*_b}{m_b}\n", + "\\gamma \\beta = \\frac{E^*_b}{m_b}.\n", "$$" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "We check that it brings the target at rest in Exercise below" ] @@ -268,7 +301,7 @@ "source": [ ":::{exercise}\n", ":label: boost-exercise\n", - "Check that it brings the target at rest\n", + "Check that the above boost definition brings the target at rest in the lab frame.\n", ":::" ] }, @@ -285,7 +318,7 @@ ":::{solution} boost-exercise\n", ":class: dropdown\n", "\n", - "By the boost from CoM frame to Lab frame, and apply if to the 4-vector of particle b (target)\n", + "From CoM frame to Lab frame, we apply the boost to the 4-vector of particle b (target)\n", "\n", "\n", "$$\\begin{pmatrix}\n", @@ -347,7 +380,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "" ] From 14a0acd4fd540f52963676c335920452a05aacf1 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Mon, 27 Nov 2023 16:36:58 +0100 Subject: [PATCH 38/39] lec2 update from some of the comment round 2 --- docs/lecture02.ipynb | 235 +++++++++++++++++-------------------------- 1 file changed, 94 insertions(+), 141 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 4da8c93..9dc9ee3 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -50,27 +50,34 @@ }, "source": [ "Particle kinematics is the application of special relativity to elementary particle reactions.\n", + "In experiments, the \"beam\" collides onto the \"target\" with high energy to create other particles.\n", + "\n", + "Each particle has a 4-vector $p^{\\mu}$:\n", + "\n", + "$$\n", + "p^{\\mu} = (E, p_x, p_y, p_z) = (E, \\vec{p}) \n", + "$$\n", "\n", "Two frames that are commonly used are the Center of Mass (CoM) frame and the laboratory (Lab) frame.\n", "\n", - "For a two-particle reaction,\n", - "$a+b \\to 1 + ... + n$, the frames satisfy the following relations." + "For a two-particle reaction, $a+b \\to 1 + ... + n$, the frames satisfy the following relations. \n", + "- **Lab frame**: $\\vec{p}_b = \\vec{0}$
\n", + " Target particle $b$ is at rest, while beam particle $a$ is moving.\n", + "- **CoM frame**: $\\vec{p}_a+\\vec{p}_b = \\vec{0}$
\n", + " The total momentum is zero, i.e., the momenta of the two initial state particles have opposite direction." ] }, { "cell_type": "markdown", - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "" - }, - "tags": [] - }, + "metadata": {}, "source": [ - "- **Lab frame**: $\\vec{p}_b = \\vec{0}$
\n", - " Target particle $b$ is at rest, while beam particle $a$ is moving.\n", - "- **CoM frame**: $\\vec{p}_a+\\vec{p}_b = \\vec{0}$
\n", - " The total momentum is zero, i.e., the momenta of the two initial state particles have opposite direction." + "Masses can be defined as a Lorentz invariant quantity (unaffected by reference frame):\n", + "\n", + "$$\n", + " p^2_i = E^2_i = |\\vec{p}_i|^2 = m^2_i\n", + "$$\n", + "\n", + "where $p$ is the 4-vector, $E$ is the energy, $\\vec{p}$ is the three vector, and $m$ is the mass." ] }, { @@ -96,7 +103,7 @@ "tags": [] }, "source": [ - "We now see a simple situation of two-body decay ($n=2$), i.e., $a+b \\rightarrow 1+2$" + "Let us now consider the case of a two-body decay ($n=2$), i.e., $a+b \\rightarrow 1+2$." ] }, { @@ -109,7 +116,10 @@ "tags": [] }, "source": [ - "```{image} https://github.com/ComPWA/tensorwaves/assets/17490173/9d5e1cf4-43a9-4670-873a-0833ae024cba\n", + "```{image} https://github.com/ComPWA/strong2020-salamanca/assets/29308176/d1cac039-0c13-4d28-b537-4ba2f66064b6\n", + ":width: 300px\n", + "```\n", + "```{image} https://github.com/ComPWA/strong2020-salamanca/assets/29308176/7665969c-31a9-4b65-9ce9-318e2ca6fdb3\n", ":width: 300px\n", "```" ] @@ -124,10 +134,9 @@ "tags": [] }, "source": [ - "\n", - "When we have a final state with two particles ($n=2$), we can define one $x-z$ plane that is spanned by the momenta of the two final state particles in the Lab frame. The CoM frame and the Lab frame can now be related by a boost along the $z$-axis (the direction of particle $a$).\n", + "When we have a final state with two particles ($n=2$), we can define one $xz$ plane that is spanned by the momenta of the two final state particles in the Lab frame. The CoM frame and the Lab frame can now be related by a boost along the $z$-axis (the direction of particle $a$).\n", "\n", - "With this definition of the x-z plane, we have:\n", + "With this definition of the $xz$ plane, we have:\n", "- $\\vec{z}$ is parallel to the beam $\\vec{p}_a$\n", "- $\\vec{y} $ is parallel to $ \\vec{p}_a \\times \\vec{p}_1$" ] @@ -155,7 +164,7 @@ "tags": [] }, "source": [ - "The Lorentz transformation, which includes both boosts (velocity changes) and rotations, is crucial for understanding how the properties of particles, such as position and time, transform between different inertial frames in relative motion." + "Lorentz transformations, can be factorized into rotations and boosts along one axis (or arbitrary direction) and are required for transforming particle properties, such as position and time, between different inertial frames in relative motion." ] }, { @@ -168,7 +177,7 @@ "tags": [] }, "source": [ - "### Boost (between Lab and CoM)" + "### Boost along one axis" ] }, { @@ -181,7 +190,7 @@ "tags": [] }, "source": [ - "Only the energy and the $z$ component of the four-momenta changes, so we can write the Lorentz boost with a 2D matrix." + "When we boost in the direction of the $z$ axis, only the energy and the $z$ component of the four-momenta changes, so we can express the Lorentz boost as a 2D matrix:" ] }, { @@ -206,7 +215,7 @@ "\\begin{pmatrix}\n", " E^L\\\\\n", " p^L_z\n", - "\\end{pmatrix}\n", + "\\end{pmatrix},\n", "$$" ] }, @@ -214,7 +223,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Given the inverse relation" + "and its inverse relation," ] }, { @@ -233,8 +242,8 @@ "\\begin{pmatrix}\n", " E^*\\\\\n", " p^*_z\n", - "\\end{pmatrix}\n", - "$$\n", + "\\end{pmatrix},\n", + "$$ (inverse_relation)\n", "\n" ] }, @@ -242,7 +251,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "With " + "with " ] }, { @@ -251,7 +260,7 @@ "source": [ "$$\n", "\\beta = \\frac{p^*_b}{m_b}\n", - "$$" + "$$ (beta_label)" ] }, { @@ -273,20 +282,7 @@ "source": [ "$$\n", "\\gamma \\beta = \\frac{E^*_b}{m_b}.\n", - "$$" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "" - }, - "tags": [] - }, - "source": [ - "We check that it brings the target at rest in Exercise below" + "$$ (gammabeta_label)" ] }, { @@ -336,7 +332,7 @@ "\\end{pmatrix}\n", "$$\n", "\n", - "using the relations (3) and (4) and subsititute into (2):\n", + "using the relations {eq}`beta_label` and {eq}`gammabeta_label` and subsititute into {eq}`inverse_relation`:\n", "\n", "\n", "$$\\begin{pmatrix}\n", @@ -372,7 +368,7 @@ "\\end{pmatrix}\n", "$$\n", "\n", - "When assuming $p_{b,z}^L=0$, then $E_{b}^L = m_b$, and thus\n", + "If $p_{b,z}^L=0$ holds, then $E_{b}^L = m_b$, and thus\n", "\n", "$$p^L_{b,z} = 0$$\n", ":::" @@ -401,28 +397,21 @@ "tags": [] }, "source": [ - "### Rotation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Active Rotation" + "### Rotations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Under an active rotation, the momentum is changed and the axes are fixed" + "We use active rotations instead of passive rotations. Under an active rotation, the momentum is changed and the axes are fixed" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Example: a momentum of unit length forming an angle θ with the z axis" + "Example: if we rotate a momentum of unit length over the $z$ axis with an angle $\\theta$, we get:" ] }, { @@ -438,12 +427,12 @@ " p_z\n", "\\end{pmatrix} =\n", "\\begin{pmatrix}\n", - " sin(\\theta)\n", + " \\sin(\\theta)\n", " \\\\\n", " 0\n", " \\\\\n", - " cos(\\theta)\n", - "\\end{pmatrix}\n", + " \\cos(\\theta)\n", + "\\end{pmatrix}.\n", "$$ (rotation_label)" ] }, @@ -451,7 +440,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "After a rotation of ω around y, it forms an angle θ + ω with the z axis" + "After a rotation of $\\omega$ around the $y$ axis, the rotated momentum forms an angle $\\theta + \\omega$ with the $z$ axis, we get:" ] }, { @@ -479,22 +468,15 @@ "\\end{pmatrix}\n", "=\n", "\\begin{pmatrix}\n", - " sin(\\theta+\\omega)\n", + " \\sin(\\theta+\\omega)\n", " \\\\\n", " 0\n", " \\\\\n", - " cos(\\theta+\\omega)\n", - "\\end{pmatrix}\n", + " \\cos(\\theta+\\omega)\n", + "\\end{pmatrix}.\n", "$$" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now we check the result of the rotation above" - ] - }, { "cell_type": "markdown", "metadata": { @@ -524,16 +506,14 @@ ":::{solution} check-rotation\n", ":class: dropdown\n", "\n", - "Recall the rotation matrix:\n", + "Recall the rotation matrices, any rotation can be decomposed into rotations around $z$ and $y$ axes:\n", "\n", "$$\n", "R_z(\\omega)\n", "=\n", "\\begin{pmatrix}\n", - "cos(\\omega) & -sin(\\omega) & 0\n", - "\\\\\n", - "sin(\\omega) & cos(\\omega) & 0\n", - "\\\\\n", + "\\cos(\\omega) & -\\sin(\\omega) & 0 \\\\\n", + "\\sin(\\omega) & \\cos(\\omega) & 0 \\\\\n", "0 & 0 & 1\n", "\\end{pmatrix}\n", "$$\n", @@ -542,99 +522,76 @@ "R_y(\\omega)\n", "=\n", "\\begin{pmatrix}\n", - "cos(\\omega) & 0 & sin(\\omega) \n", - "\\\\\n", - "0 & 1 & 0\n", - "\\\\\n", - "-sin(\\omega) &0 & cos(\\omega) \n", + "\\cos(\\omega) & 0 & \\sin(\\omega) \\\\\n", + "0 & 1 & 0 \\\\\n", + "-\\sin(\\omega) &0 & \\cos(\\omega) \n", "\\end{pmatrix}\n", "$$\n", "\n", - "Any rotation can be decomposed into rotations around z and y axes above\n", - "\n", + "The rotation matrix around $x$ axes is also given for completeness:\n", "\n", "$$\n", - "R_y(\\omega)\n", + "R_x(\\omega)\n", "=\n", "\\begin{pmatrix}\n", - "1&0&0\n", - "\\\\\n", - "0 & cos(\\omega) & -sin(\\omega) \n", - "\\\\\n", - "0 & sin(\\omega) & cos(\\omega) \n", + "1&0&0 \\\\\n", + "0 & \\cos(\\omega) & -\\sin(\\omega) \\\\\n", + "0 & \\sin(\\omega) & \\cos(\\omega) \n", "\\end{pmatrix}\n", "$$\n", "\n", - "The rotation matrix around x axes is also given for completeness.\n", - "\n", - "Thus equation {eq}`rotation_label` becomes:\n", + "With this, we can rewrite equation {eq}`rotation_label` as:\n", "\n", "$$\n", "\\begin{pmatrix}\n", - " p_x'\n", - " \\\\\n", - " p_y'\n", - " \\\\\n", + " p_x' \\\\\n", + " p_y' \\\\\n", " p_z'\n", "\\end{pmatrix}\n", "=\n", "R_y(\\omega)\n", "\\begin{pmatrix}\n", - " p_x\n", - " \\\\\n", - " p_y\n", - " \\\\\n", + " p_x \\\\\n", + " p_y \\\\\n", " p_z\n", "\\end{pmatrix}\n", "=\n", "\\begin{pmatrix}\n", - "cos(\\omega) & 0 & sin(\\omega) \n", - "\\\\\n", - "0 & 1 & 0\n", - "\\\\\n", - "-sin(\\omega) &0 & cos(\\omega) \n", + "\\cos(\\omega) & 0 & \\sin(\\omega) \\\\\n", + "0 & 1 & 0 \\\\\n", + "-\\sin(\\omega) &0 & \\cos(\\omega) \n", "\\end{pmatrix}\n", "\\begin{pmatrix}\n", - " p_x\n", - " \\\\\n", - " p_y\n", - " \\\\\n", + " p_x \\\\\n", + " p_y \\\\\n", " p_z\n", "\\end{pmatrix}\n", "$$\n", "\n", "$$\n", "\\begin{pmatrix}\n", - " p_x'\n", - " \\\\\n", - " p_y'\n", - " \\\\\n", + " p_x' \\\\\n", + " p_y' \\\\\n", " p_z'\n", "\\end{pmatrix}\n", "=\n", "\\begin{pmatrix}\n", - "p_x \\cdot cos(\\omega)+ p_z \\cdot sin(\\omega) \n", - "\\\\\n", - "p_y\n", - "\\\\\n", - "-p_x \\cdot sin(\\omega) + p_z \\cdot cos(\\omega) \n", + "p_x \\cdot \\cos(\\omega)+ p_z \\cdot \\sin(\\omega) \\\\\n", + "p_y \\\\\n", + "-p_x \\cdot \\sin(\\omega) + p_z \\cdot \\cos(\\omega) \n", "\\end{pmatrix}\n", "$$\n", "\n", "since \n", "$\\begin{pmatrix}\n", - " p_x\n", - " \\\\\n", - " p_y\n", - " \\\\\n", + " p_x \\\\\n", + " p_y \\\\\n", " p_z\n", "\\end{pmatrix}$ =\n", "$\\begin{pmatrix}\n", - " sin(\\theta)\n", - " \\\\\n", - " 0\n", - " \\\\\n", - " cos(\\theta)\n", + " \\sin(\\theta) \\\\\n", + " 0 \\\\\n", + " \\cos(\\theta)\n", "\\end{pmatrix}\n", "$,\n", "and using the trigonometric identities,\n", @@ -642,27 +599,21 @@ "\n", "$$\n", "\\begin{pmatrix}\n", - " p_x'\n", - " \\\\\n", - " p_y'\n", - " \\\\\n", + " p_x' \\\\\n", + " p_y' \\\\\n", " p_z'\n", "\\end{pmatrix} \n", "=\n", "\\begin{pmatrix}\n", - "sin(\\theta) \\cdot cos(\\omega)+ cos(\\theta) \\cdot sin(\\omega) \n", - "\\\\\n", - "0\n", - "\\\\\n", - "-sin(\\theta) \\cdot sin(\\omega) + cos(\\theta) \\cdot cos(\\omega) \n", + "\\sin(\\theta) \\cdot \\cos(\\omega)+ \\cos(\\theta) \\cdot \\sin(\\omega) \\\\\n", + "0 \\\\\n", + "-\\sin(\\theta) \\cdot \\sin(\\omega) + \\cos(\\theta) \\cdot \\cos(\\omega) \n", "\\end{pmatrix}\n", "=\n", "\\begin{pmatrix}\n", - "sin(\\theta+\\omega)\n", - "\\\\\n", - "0\n", - "\\\\\n", - "cos(\\theta+\\omega) \n", + "\\sin(\\theta+\\omega) \\\\\n", + "0 \\\\\n", + "\\cos(\\theta+\\omega) \n", "\\end{pmatrix}\n", "$$\n", ":::" @@ -678,7 +629,7 @@ "tags": [] }, "source": [ - "### Example1: Angles and Boost" + "### Example with data" ] }, { @@ -691,10 +642,12 @@ "tags": [] }, "source": [ - "\n", - "```{image} https://github.com/ComPWA/tensorwaves/assets/17490173/9d5e1cf4-43a9-4670-873a-0833ae024cba\n", + "```{image} https://github.com/ComPWA/strong2020-salamanca/assets/29308176/d1cac039-0c13-4d28-b537-4ba2f66064b6\n", ":width: 300px\n", - "```\n" + "```\n", + "```{image} https://github.com/ComPWA/strong2020-salamanca/assets/29308176/7665969c-31a9-4b65-9ce9-318e2ca6fdb3\n", + ":width: 300px\n", + "```" ] }, { From 7aca6afbf139c8398c39bfce307b4007470ab5e0 Mon Sep 17 00:00:00 2001 From: shenvitor Date: Tue, 28 Nov 2023 16:57:05 +0100 Subject: [PATCH 39/39] another update of round2 --- docs/lecture02.ipynb | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/lecture02.ipynb b/docs/lecture02.ipynb index 9dc9ee3..bf85121 100644 --- a/docs/lecture02.ipynb +++ b/docs/lecture02.ipynb @@ -334,6 +334,9 @@ "\n", "using the relations {eq}`beta_label` and {eq}`gammabeta_label` and subsititute into {eq}`inverse_relation`:\n", "\n", + "$$\n", + "\\gamma = \\frac{\\gamma \\beta}{\\beta} = \\frac{E_b^* m_b}{m_b p_b^*} = \\frac{E_b^*}{p_b^*}\n", + "$$\n", "\n", "$$\\begin{pmatrix}\n", " E_b^L\n", @@ -368,9 +371,16 @@ "\\end{pmatrix}\n", "$$\n", "\n", - "If $p_{b,z}^L=0$ holds, then $E_{b}^L = m_b$, and thus\n", + "If particle $b$ is at rest after inverse-boost, that means the xyz component of momentum of particle $b$ is zero: $p_{b,x}^L = p_{b,y}^L = p_{b,z}^L=0$.\n", + "We have already assume $p_{b,x}^* = p_{b,y}^* = 0$, and thus $p_{b,x}^L = p_{b,y}^L = 0$.\n", + "\n", + "In order to have $p_{b,z}^L=0$,\n", + " $ p_{b,z}^L = -\\frac{E_b^*}{m_b} \\cdot E_b^* + \\frac{E_b^*}{p_{b,z}^*} \\cdot p_{b,z}^* = 0$ must hold.\n", + "\n", + "Therefore, only when $\\frac{E_b^*}{m_b} = 1$ or $E_b^* = m_b$ \n", "\n", - "$$p^L_{b,z} = 0$$\n", + "$ \\rightarrow p_{b,z}^L =0$.\n", + "Under this condition, the particle is at rest after inverse-boosted to rest frame.\n", ":::" ] }, @@ -675,6 +685,9 @@ "execution_count": null, "metadata": { "editable": true, + "jupyter": { + "source_hidden": true + }, "slideshow": { "slide_type": "" }, @@ -728,8 +741,8 @@ "# https://indico.ific.uv.es/event/6803/contributions/21220/attachments/11209/15506/Two-particles-1.dat\n", "filename = gdown.cached_download(\n", " url=\"https://indico.ific.uv.es/event/6803/contributions/21220/attachments/11209/15506/Two-particles-1.dat\",\n", - " # path=\"data/Two-particles-1.dat\",\n", - " # md5=\"a49ebfd97ae6a02023291df665ab924c\",\n", + " path=\"data/Two-particles-1.dat\",\n", + " md5=\"324f71ee88928915f13de5840ac5ede2\",\n", " quiet=True,\n", " verify=False,\n", ")\n", @@ -2434,9 +2447,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "mystnb": { "code_prompt_show": "Identify final state particles" }, @@ -2488,9 +2498,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -2512,9 +2519,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width"