Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSPSolver generates undesired edge_properties after filtering #301

Open
grayson-helmholz opened this issue Nov 5, 2024 · 0 comments
Open
Assignees
Labels
🐛 Bug Something isn't working

Comments

@grayson-helmholz
Copy link
Contributor

grayson-helmholz commented Nov 5, 2024

As mentioned in #287 (comment), 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant