Closed redeboer closed 1 year ago
StateTransitionManager.find_solutions crashes on certain allowed_intermediate_particles.
StateTransitionManager.find_solutions
allowed_intermediate_particles
from expertsystem.reaction import StateTransitionManager, InteractionTypes stm = StateTransitionManager( initial_state=[("Y(4260)", [-1, +1])], final_state=["D0", "D~0", "pi0", "pi0"], allowed_intermediate_particles=["D"], # <--- HERE number_of_threads=1, ) stm.set_allowed_interaction_types([InteractionTypes.Strong]) stm.add_final_state_grouping([["D0", "pi0"], ["D~0", "pi0"]]) problem_sets = stm.create_problem_sets() result = stm.find_solutions(problem_sets) # exception
Note: same behaviour if you use: ["D(0)", "D(2)", "D*"]
["D(0)", "D(2)", "D*"]
The weird thing is that this does not happen if you select "D*" (D star):
"D*"
stm = StateTransitionManager( initial_state=[("Y(4260)", [-1, +1])], final_state=["D0", "D~0", "pi0", "pi0"], allowed_intermediate_particles=["D*"], # <--- HERE number_of_threads=1, ) stm.set_allowed_interaction_types([InteractionTypes.Strong]) stm.add_final_state_grouping([["D0", "pi0"], ["D~0", "pi0"]]) problem_sets = stm.create_problem_sets() result = stm.find_solutions(problem_sets) len(result.transitions) # 14
but neither if you take any particle:
stm = StateTransitionManager( initial_state=[("Y(4260)", [-1, +1])], final_state=["D0", "D~0", "pi0", "pi0"], # <--- NOTHING HERE number_of_threads=1, ) stm.set_allowed_interaction_types([InteractionTypes.Strong]) stm.add_final_state_grouping([["D0", "pi0"], ["D~0", "pi0"]]) problem_sets = stm.create_problem_sets() result = stm.find_solutions(problem_sets) len(result.transitions) # 76
I would say the latter should give the expected result.
Should happen on any system. Tried it on both 0.6.9 (ed932d7) and master (1caa526).
master
And whats the precise error message?
Bug description
StateTransitionManager.find_solutions
crashes on certainallowed_intermediate_particles
.How to reproduce?
Note: same behaviour if you use:
["D(0)", "D(2)", "D*"]
Expected behavior
The weird thing is that this does not happen if you select
"D*"
(D star):but neither if you take any particle:
I would say the latter should give the expected result.
System info
Should happen on any system. Tried it on both 0.6.9 (ed932d7) and
master
(1caa526).