Skip to content

Commit

Permalink
FIX: simplify factors
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Jan 13, 2023
1 parent 44117c6 commit b44214c
Showing 1 changed file with 146 additions and 18 deletions.
164 changes: 146 additions & 18 deletions docs/collect-wigners.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"jupyter": {
"source_hidden": true
Expand Down Expand Up @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"jupyter": {
"source_hidden": true
Expand All @@ -63,7 +63,26 @@
"hide-input"
]
},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"| name | LaTeX | $J^P$ | mass (MeV) | width (MeV) |\n",
"| --- | --- | --- | --- | --- |\n",
"| Lambda(c)+ | $\\Lambda_{c}^{+}$ | $\\frac{1}{2}^+$ | 2,286 | 0 |\n",
"| p | $p$ | $\\frac{1}{2}^+$ | 938 | 0 |\n",
"| pi+ | $\\pi^{+}$ | $0^-$ | 139 | 0 |\n",
"| K- | $K^{-}$ | $0^-$ | 493 | 0 |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"PDG = qrules.load_pdg()\n",
"PARTICLE_DB = {\n",
Expand Down Expand Up @@ -96,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"jupyter": {
"source_hidden": true
Expand All @@ -108,7 +127,34 @@
"hide-input"
]
},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"| name | LaTeX | $J^P$ | mass (MeV) | width (MeV) |\n",
"| --- | --- | --- | --- | --- |\n",
"| Lambda(1405) | $\\Lambda(1404)$ | $\\frac{1}{2}^-$ | 1,405 | 50 |\n",
"| Lambda(1520) | $\\Lambda(1520)$ | $\\frac{3}{2}^-$ | 1,519 | 16 |\n",
"| Lambda(1600) | $\\Lambda(1600)$ | $\\frac{1}{2}^+$ | 1,600 | 200 |\n",
"| Lambda(1670) | $\\Lambda(1670)$ | $\\frac{1}{2}^-$ | 1,674 | 30 |\n",
"| Lambda(1690) | $\\Lambda(1690)$ | $\\frac{3}{2}^-$ | 1,690 | 70 |\n",
"| Lambda(2000) | $\\Lambda(2000)$ | $\\frac{1}{2}^-$ | 2,000 | 210 |\n",
"| Delta(1232)+ | $\\Delta(1232)^{+}$ | $\\frac{3}{2}^+$ | 1,232 | 117 |\n",
"| Delta(1600)+ | $\\Delta(1600)^{+}$ | $\\frac{3}{2}^+$ | 1,570 | 250 |\n",
"| Delta(1700)+ | $\\Delta(1700)^{+}$ | $\\frac{3}{2}^-$ | 1,710 | 300 |\n",
"| K(0)*(700)+ | $K_{0}^{*}(700)^{+}$ | $0^+$ | 845 | 468 |\n",
"| K*(892)0 | $K^{*}(892)^{0}$ | $1^-$ | 895 | 47 |\n",
"| K(2)*(1430)0 | $K_{2}^{*}(1430)^{0}$ | $2^+$ | 1,432 | 109 |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"resonance_names = [\n",
" \"Lambda(1405)\",\n",
Expand All @@ -130,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"jupyter": {
"source_hidden": true
Expand All @@ -142,7 +188,34 @@
"hide-input"
]
},
"outputs": [],
"outputs": [
{
"data": {
"text/latex": [
"\\begin{array}{c}\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=0} \\Lambda(1404)\\left[\\frac{1}{2}^-\\right] \\xrightarrow[S=1/2]{L=0} K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=3/2]{L=1} \\Lambda(1520)\\left[\\frac{3}{2}^-\\right] \\xrightarrow[S=1/2]{L=2} K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=0} \\Lambda(1600)\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=1} K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=0} \\Lambda(1670)\\left[\\frac{1}{2}^-\\right] \\xrightarrow[S=1/2]{L=0} K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=3/2]{L=1} \\Lambda(1690)\\left[\\frac{3}{2}^-\\right] \\xrightarrow[S=1/2]{L=2} K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=0} \\Lambda(2000)\\left[\\frac{1}{2}^-\\right] \\xrightarrow[S=1/2]{L=0} K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=3/2]{L=1} \\Delta(1232)^{+}\\left[\\frac{3}{2}^+\\right] \\xrightarrow[S=1/2]{L=1} p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] K^{-}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=3/2]{L=1} \\Delta(1600)^{+}\\left[\\frac{3}{2}^+\\right] \\xrightarrow[S=1/2]{L=1} p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] K^{-}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=3/2]{L=1} \\Delta(1700)^{+}\\left[\\frac{3}{2}^-\\right] \\xrightarrow[S=1/2]{L=2} p\\left[\\frac{1}{2}^+\\right] \\pi^{+}\\left[0^-\\right] K^{-}\\left[0^-\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=0} K_{0}^{*}(700)^{+}\\left[0^+\\right] \\xrightarrow[S=0]{L=0} \\pi^{+}\\left[0^-\\right] K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=1/2]{L=0} K^{*}(892)^{0}\\left[1^-\\right] \\xrightarrow[S=0]{L=1} \\pi^{+}\\left[0^-\\right] K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\\\\n",
" \\Lambda_{c}^{+}\\left[\\frac{1}{2}^+\\right] \\xrightarrow[S=3/2]{L=1} K_{2}^{*}(1430)^{0}\\left[2^+\\right] \\xrightarrow[S=0]{L=2} \\pi^{+}\\left[0^-\\right] K^{-}\\left[0^-\\right] p\\left[\\frac{1}{2}^+\\right] \\\\\n",
"\\end{array}"
],
"text/plain": [
"<IPython.core.display.Latex object>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def load_three_body_decay(\n",
" resonance_names: Iterable[str],\n",
Expand Down Expand Up @@ -221,7 +294,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"mystnb": {
"code_prompt_show": "Define dynamics builder that returns a symbol only"
Expand Down Expand Up @@ -271,14 +344,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {
"tags": [
"full-width",
"hide-input"
]
},
"outputs": [],
"outputs": [
{
"data": {
"text/latex": [
"$\\displaystyle \\sum_{\\lambda_{0}=-1/2}^{1/2} \\sum_{\\lambda_{1}=-1/2}^{1/2} \\sum_{\\lambda_{2}=0} \\sum_{\\lambda_{3}=0}{\\left|{\\sum_{\\lambda_0^{\\prime}=-1/2}^{1/2} \\sum_{\\lambda_1^{\\prime}=-1/2}^{1/2} \\sum_{\\lambda_2^{\\prime}=0} \\sum_{\\lambda_3^{\\prime}=0}{A^{1}_{\\lambda_0^{\\prime}, \\lambda_1^{\\prime}, \\lambda_2^{\\prime}, \\lambda_3^{\\prime}} d^{\\frac{1}{2}}_{\\lambda_1^{\\prime},\\lambda_{1}}\\left(\\zeta^1_{1(1)}\\right) d^{\\frac{1}{2}}_{\\lambda_{0},\\lambda_0^{\\prime}}\\left(\\zeta^0_{1(1)}\\right) + A^{2}_{\\lambda_0^{\\prime}, \\lambda_1^{\\prime}, \\lambda_2^{\\prime}, \\lambda_3^{\\prime}} d^{\\frac{1}{2}}_{\\lambda_1^{\\prime},\\lambda_{1}}\\left(\\zeta^1_{2(1)}\\right) d^{\\frac{1}{2}}_{\\lambda_{0},\\lambda_0^{\\prime}}\\left(\\zeta^0_{2(1)}\\right) + A^{3}_{\\lambda_0^{\\prime}, \\lambda_1^{\\prime}, \\lambda_2^{\\prime}, \\lambda_3^{\\prime}} d^{\\frac{1}{2}}_{\\lambda_1^{\\prime},\\lambda_{1}}\\left(\\zeta^1_{3(1)}\\right) d^{\\frac{1}{2}}_{\\lambda_{0},\\lambda_0^{\\prime}}\\left(\\zeta^0_{3(1)}\\right)}}\\right|^{2}}$"
],
"text/plain": [
"PoolSum(Abs(PoolSum(A^1[\\lambda_0^{\\prime}, \\lambda_1^{\\prime}, \\lambda_2^{\\prime}, \\lambda_3^{\\prime}]*WignerD(1/2, \\lambda_1^{\\prime}, lambda1, 0, \\zeta^1_{1(1)}, 0)*WignerD(1/2, lambda0, \\lambda_0^{\\prime}, 0, \\zeta^0_{1(1)}, 0) + A^2[\\lambda_0^{\\prime}, \\lambda_1^{\\prime}, \\lambda_2^{\\prime}, \\lambda_3^{\\prime}]*WignerD(1/2, \\lambda_1^{\\prime}, lambda1, 0, \\zeta^1_{2(1)}, 0)*WignerD(1/2, lambda0, \\lambda_0^{\\prime}, 0, \\zeta^0_{2(1)}, 0) + A^3[\\lambda_0^{\\prime}, \\lambda_1^{\\prime}, \\lambda_2^{\\prime}, \\lambda_3^{\\prime}]*WignerD(1/2, \\lambda_1^{\\prime}, lambda1, 0, \\zeta^1_{3(1)}, 0)*WignerD(1/2, lambda0, \\lambda_0^{\\prime}, 0, \\zeta^0_{3(1)}, 0), (\\lambda_0^{\\prime}, (-1/2, 1/2)), (\\lambda_1^{\\prime}, (-1/2, 1/2)), (\\lambda_2^{\\prime}, (0,)), (\\lambda_3^{\\prime}, (0,))))**2, (lambda0, (-1/2, 1/2)), (lambda1, (-1/2, 1/2)), (lambda2, (0,)), (lambda3, (0,)))"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model_builder = DalitzPlotDecompositionBuilder(DECAY, min_ls=(False, True))\n",
"for chain in model_builder.decay.chains:\n",
Expand All @@ -289,7 +376,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {
"mystnb": {
"code_prompt_show": "Set all couplings to one"
Expand All @@ -298,7 +385,27 @@
"hide-input"
]
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-5576909796351536528.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-5147167766190701663.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0+3794963735732275668.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0+1891526491921064931.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-4786397281461125801.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-4483384253665846016.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-6135427758016384197.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-2033597028278369610.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-5279309075788847128.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-1155169879847640849.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0-4564301318613152657.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0+2282801685165076840.pkl not found, performing doit()...\n",
"Cached expression file /home/redeboer/.sympy-cache/pythonhashseed-0+5864924897008292644.pkl not found, performing doit()...\n"
]
}
],
"source": [
"couplings_to_one = {s: 1 for s in model.parameter_defaults if \"mathcal\" in str(s)}\n",
"\n",
Expand All @@ -313,11 +420,8 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {
"jupyter": {
"source_hidden": true
},
"mystnb": {
"code_prompt_show": "Collect Wigner-D functions"
},
Expand All @@ -326,14 +430,38 @@
"full-width"
]
},
"outputs": [],
"outputs": [
{
"data": {
"text/latex": [
"\n",
"\\begin{eqnarray}\n",
"X_{0}^{0,1/2;0,0}\\left(\\sigma_{1}\\right) &:& 1 \\\\\n",
"X_{1}^{0,1/2;1,0}\\left(\\sigma_{1}\\right) &:& \\frac{1}{3} \\\\\n",
"X_{2}^{1,3/2;2,0}\\left(\\sigma_{1}\\right) &:& \\frac{2}{5} - \\frac{3 \\sin^{2}{\\left(\\theta_{23} \\right)}}{10} \\\\\n",
"X_{1/2}^{0,1/2;0,1/2}\\left(\\sigma_{2}\\right) &:& 9 \\\\\n",
"X_{1/2}^{0,1/2;1,1/2}\\left(\\sigma_{2}\\right) &:& 1 \\\\\n",
"X_{3/2}^{1,3/2;2,1/2}\\left(\\sigma_{2}\\right) &:& 4 - 3 \\sin^{2}{\\left(\\theta_{31} \\right)} \\\\\n",
"X_{3/2}^{1,3/2;1,1/2}\\left(\\sigma_{3}\\right) &:& 4 - 3 \\sin^{2}{\\left(\\theta_{12} \\right)} \\\\\n",
"X_{3/2}^{1,3/2;2,1/2}\\left(\\sigma_{3}\\right) &:& 1 - \\frac{3 \\sin^{2}{\\left(\\theta_{12} \\right)}}{4} \\\\\n",
"\\end{eqnarray}"
],
"text/plain": [
"<IPython.core.display.Latex object>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"src = R\"\"\"\n",
"\\begin{eqnarray}\n",
"\"\"\"\n",
"for x in dynamic_symbols:\n",
" filter_substitutions = {s: 1 if s == x else 0 for s in dynamic_symbols}\n",
" factor = full_expression.xreplace(filter_substitutions)\n",
" factor = full_expression.xreplace(filter_substitutions).simplify()\n",
" src += Rf\"{sp.latex(x)} &:& {sp.latex(factor)} \\\\\" \"\\n\"\n",
"src += R\"\\end{eqnarray}\"\n",
"Latex(src)"
Expand Down

0 comments on commit b44214c

Please sign in to comment.