Make CSP variable creation driven by the quantum numbers declared in the QNProblemSet (facts keys for outer edges, qn_domains for intermediate edges), rather than by the union of all registered rules' required quantum numbers intersected with the settings domains.
Today the variables come from rule requirements (src/qrules/solving.py:605-797, src/qrules/argument_handling.py:301-336), and rules only decide executability afterwards. As a result, omitting spin_projection from the facts still spawns spin-projection variables on the intermediate edges. Also fix the wart whereby Optional rule-input fields are counted as required in get_required_qns (src/qrules/argument_handling.py:320-329) yet excluded by the executability check, so "optional" quantum numbers still create variables.
Promote the semantics of filter_quantum_number_problem_set (src/qrules/solving.py:104-181) from a post-hoc filter to the way problem sets are defined. Behavior change: rules that cannot execute against the declared facts are reported through the existing not-executed-rules mechanism.
Make CSP variable creation driven by the quantum numbers declared in the
QNProblemSet(facts keys for outer edges,qn_domainsfor intermediate edges), rather than by the union of all registered rules' required quantum numbers intersected with the settings domains.Today the variables come from rule requirements (
src/qrules/solving.py:605-797,src/qrules/argument_handling.py:301-336), and rules only decide executability afterwards. As a result, omittingspin_projectionfrom the facts still spawns spin-projection variables on the intermediate edges. Also fix the wart wherebyOptionalrule-input fields are counted as required inget_required_qns(src/qrules/argument_handling.py:320-329) yet excluded by the executability check, so "optional" quantum numbers still create variables.Promote the semantics of
filter_quantum_number_problem_set(src/qrules/solving.py:104-181) from a post-hoc filter to the way problem sets are defined. Behavior change: rules that cannot execute against the declared facts are reported through the existing not-executed-rules mechanism.