From e774af9aefbf6d12842d3a1442b5f4875e11f288 Mon Sep 17 00:00:00 2001 From: Vitor Shen <17490173+shenvitor@users.noreply.github.com> Date: Thu, 16 May 2024 17:39:43 +0200 Subject: [PATCH] pgamma virtual state generation! --- docs/pgamma-state.ipynb | 150 +++++++++++++++++++++++++++++++++++++--- pixi.lock | 17 +++++ pixi.toml | 1 + 3 files changed, 157 insertions(+), 11 deletions(-) diff --git a/docs/pgamma-state.ipynb b/docs/pgamma-state.ipynb index 92e5d8e..b00a1db 100644 --- a/docs/pgamma-state.ipynb +++ b/docs/pgamma-state.ipynb @@ -84,7 +84,10 @@ }, "outputs": [], "source": [ - "from qrules.particle import load_pdg" + "from qrules.particle import load_pdg\n", + "\n", + "particle_db = load_pdg()\n", + "print(\"Number of loaded particles:\", len(particle_db))" ] }, { @@ -100,24 +103,17 @@ }, "outputs": [], "source": [ - "particle_db = load_pdg()\n", - "print(\"Number of loaded particles:\", len(particle_db))" + "particle_db.find(2212)" ] }, { "cell_type": "code", "execution_count": null, "id": "7", - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "" - }, - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ - "particle_db.find(2212)" + "particle_db.find(\"p\")" ] }, { @@ -140,6 +136,16 @@ "cell_type": "code", "execution_count": null, "id": "9", + "metadata": {}, + "outputs": [], + "source": [ + "particle_db.find(\"gamma\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10", "metadata": { "editable": true, "slideshow": { @@ -148,6 +154,128 @@ "tags": [] }, "outputs": [], + "source": [ + "from IPython.display import Math\n", + "\n", + "sigmas = particle_db.filter(\n", + " lambda p: p.name.startswith(\"p\") and p.mass == 0.93827208816 and p.charge == 1\n", + ")\n", + "Math(\", \".join(p.latex for p in sigmas))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], + "source": [ + "from IPython.display import Math\n", + "\n", + "sigmas = particle_db.filter(lambda p: p.name.startswith(\"gamma\"))\n", + "Math(\", \".join(p.latex for p in sigmas))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], + "source": [ + "proton = particle_db[\"p\"]\n", + "proton" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], + "source": [ + "gamma = particle_db[\"gamma\"]\n", + "gamma" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], + "source": [ + "from qrules.particle import Particle, Spin\n", + "\n", + "pgamma = Particle(\n", + " name=\"p\",\n", + " latex=r\"p \\gamma\",\n", + " spin=0.5,\n", + " mass=4.101931071854584,\n", + " charge=1,\n", + " isospin=Spin(1 / 2, +1 / 2),\n", + " baryon_number=1,\n", + " parity=-1,\n", + " pid=99999999,\n", + ")\n", + "pgamma" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "15", + "metadata": {}, + "outputs": [], + "source": [ + "pgamma_s3over2 = Particle(\n", + " name=\"pgamma\",\n", + " latex=R\"p \\gamma (s3/2)\",\n", + " spin=1.5,\n", + " mass=4.101931071854584,\n", + " charge=1,\n", + " isospin=Spin(1 / 2, +1 / 2),\n", + " baryon_number=1,\n", + " parity=-1,\n", + " pid=99999999,\n", + ")\n", + "pgamma_s3over2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], + "source": [ + "pgamma_s3over2.latex" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "17", + "metadata": {}, + "outputs": [], + "source": [ + "pgamma.latex" + ] + }, + { + "cell_type": "markdown", + "id": "18", + "metadata": {}, + "source": [ + "The `pgamma` virtual state generated via `QRules` will be used in later stages!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "19", + "metadata": {}, + "outputs": [], "source": [] } ], diff --git a/pixi.lock b/pixi.lock index b8edcff..1f31ac1 100644 --- a/pixi.lock +++ b/pixi.lock @@ -111,6 +111,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab-git-0.50.0-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab-lsp-5.1.0-pyhd8ed1ab_2.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab-myst-2.4.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab_code_formatter-2.2.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab_pygments-0.3.0-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab_server-2.27.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyterlab_widgets-3.0.10-pyhd8ed1ab_0.conda @@ -2320,6 +2321,22 @@ packages: - pkg:pypi/jupyterlab-myst size: 2127008 timestamp: 1714146125212 +- kind: conda + name: jupyterlab_code_formatter + version: 2.2.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/jupyterlab_code_formatter-2.2.1-pyhd8ed1ab_0.conda + sha256: 8873858a9d3b730a1d6a199be6d4fa67367837d6fa55aa8fe464040522cd906d + md5: d67b33450635a2ad1b55d48838eb1eca + depends: + - jupyter_server >=1.21,<3 + - python >=3.7 + license: MIT + license_family: MIT + size: 28923 + timestamp: 1684681885304 - kind: conda name: jupyterlab_pygments version: 0.3.0 diff --git a/pixi.toml b/pixi.toml index a2de7b2..c8b913e 100644 --- a/pixi.toml +++ b/pixi.toml @@ -31,6 +31,7 @@ jupyterlab = ">=4.2.0,<4.3" jupyterlab-git = ">=0.50.0,<0.51" jupyterlab-lsp = ">=5.1.0,<5.2" jupyterlab-myst = ">=2.4.2,<2.5" +jupyterlab_code_formatter = ">=2.2.1,<2.3" myst-nb = ">=1.1.0,<1.2" numpy = ">=1.26.4,<1.27" pre-commit = ">=3.7.1,<3.8"