ComPWA / qrules

Rule-based particle reaction problem solver on a quantum number level
https://qrules.rtfd.io
Apache License 2.0
9 stars 5 forks source link

CSPSolver generates undesired `edge_properties` after filtering #301

Closed grayson-helmholz closed 2 weeks ago

grayson-helmholz commented 4 weeks ago

As mentioned in https://github.com/ComPWA/qrules/pull/287#discussion_r1822254734, the CSPSolver generates, under some unknown circumstances, solutions with edge_properties which are not related to the the specified rules and qunatum numbers in the QNProblemSet, fed into CSPSolver.find_solutions.

For example

stm = qrules.StateTransitionManager(
    initial_state=["J/psi(1S)"],
    final_state=["K0", "Sigma+", "p~"],
    formalism="canonical-helicity",
)
stm.set_allowed_interaction_types([InteractionType.STRONG, InteractionType.EM])

qn_solutions = stm.find_quantum_number_transitions(problem_sets)

strong_qn_solutions = qn_solutions[3600.0]
qn_problem_set, qn_result = strong_qn_solutions[0]

problem_sets = stm.create_problem_sets()
filtered_qn_problem_set = filter_quantum_number_problem_set(
    qn_problem_set,
    edge_rules={spin_validity},
    node_rules={spin_magnitude_conservation, parity_conservation},
    edge_properties={
        EdgeQuantumNumbers.spin_magnitude,
        EdgeQuantumNumbers.parity,
    },
    node_properties={
        NodeQuantumNumbers.l_magnitude,
        NodeQuantumNumbers.s_magnitude,
    }
)

solver = CSPSolver([
    qrules.system_control.create_edge_properties(part)
    for part in qrules.particle.load_pdg()
])

filtered_qn_solutions = solver.find_solutions(filtered_qn_problem_set)
filtered_qn_result = filtered_qn_solutions.solutions[3]

gives edges with additional (mass, width, charge and isospin, c_parity, g_parity, pid) when only (parity and spin_magnitude) are expected. This is almost the complete set of properties.

grayson-helmholz commented 2 weeks ago

addressed in #287 which reopened #278