Skip to content

Commit

Permalink
add STM section
Browse files Browse the repository at this point in the history
  • Loading branch information
shenvitor committed Jun 4, 2024
1 parent 87ca2d1 commit 5bd71ca
Showing 1 changed file with 147 additions and 0 deletions.
147 changes: 147 additions & 0 deletions docs/pgamma-state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,153 @@
"cell_type": "code",
"execution_count": null,
"id": "43",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"from qrules import InteractionType, StateTransitionManager\n",
"\n",
"stm = StateTransitionManager(\n",
" initial_state=[\"pgamma\"],\n",
" final_state=[\"eta\", \"pi0\", \"p\"],\n",
" formalism=\"canonical-helicity\",\n",
" particle_db=particle_db,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "44",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"problem_sets = stm.create_problem_sets()\n",
"sorted(problem_sets, reverse=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "45",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"from qrules import io\n",
"\n",
"some_problem_set = problem_sets[60.0][0]\n",
"dot = io.asdot(some_problem_set, render_node=True)\n",
"graphviz.Source(dot)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "46",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"some_problem_set = problem_sets[1][0]\n",
"dot = io.asdot(some_problem_set, render_node=True)\n",
"graphviz.Source(dot)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "47",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"some_problem_set = problem_sets[0.0001][1]\n",
"dot = io.asdot(some_problem_set, render_node=True)\n",
"graphviz.Source(dot)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "48",
"metadata": {},
"outputs": [],
"source": [
"reaction = stm.find_solutions(problem_sets)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "49",
"metadata": {},
"outputs": [],
"source": [
"print(\"found\", len(reaction.transitions), \"solutions!\")\n",
"reaction.get_intermediate_particles().names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "50",
"metadata": {},
"outputs": [],
"source": [
"stm.set_allowed_interaction_types([InteractionType.STRONG])\n",
"problem_sets = stm.create_problem_sets()\n",
"reaction = stm.find_solutions(problem_sets)\n",
"\n",
"print(\"found\", len(reaction.transitions), \"solutions!\")\n",
"reaction.get_intermediate_particles().names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "51",
"metadata": {},
"outputs": [],
"source": [
"stm.set_allowed_interaction_types([InteractionType.STRONG, InteractionType.EM])\n",
"problem_sets = stm.create_problem_sets()\n",
"reaction = stm.find_solutions(problem_sets)\n",
"\n",
"print(\"found\", len(reaction.transitions), \"solutions!\")\n",
"reaction.get_intermediate_particles().names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "52",
"metadata": {},
"outputs": [],
"source": []
Expand Down

0 comments on commit 5bd71ca

Please sign in to comment.