diff --git a/docs/pgamma-state.ipynb b/docs/pgamma-state.ipynb index b77f6f0..24fa056 100644 --- a/docs/pgamma-state.ipynb +++ b/docs/pgamma-state.ipynb @@ -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": []