Skip to content

BREAK: decouple CSPSolver from particle database - #378

Open
grayson-helmholz wants to merge 1 commit into
merge-rule-prioritiesfrom
solver-without-particle-db
Open

grayson-helmholz wants to merge 1 commit into
merge-rule-prioritiesfrom
solver-without-particle-db

Conversation

@grayson-helmholz

@grayson-helmholz grayson-helmholz commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Interface changes

CSPSolver no longer matches its solutions against a particle database. It solves for quantum numbers only, and the matching step moved to the new public function complete_intermediate_states(), which takes a QNResult, its QNProblemSet, and the allowed intermediate states. Re-validating the rules that the solver could not execute moved along with it, since those rules can only run once the intermediate states are complete.

Old name New name
CSPSolver(allowed_intermediate_states) CSPSolver(), followed by complete_intermediate_states(result, problem_set, allowed_intermediate_states)

solve() in qrules.workflow performs both steps, so the high-level API is unaffected.

⚙️ Enhancements

  • A CSPSolver can now run without a particle database at all. Its solutions carry just the quantum numbers that were solved for, which is what lets later steps work with intermediate states that no particle needs to match.
  • _insert_allowed_states() skips intermediate edges for which the solver produced no state instead of raising a KeyError, so partial solutions can be completed.

Squash commit messages

* FEAT: add complete_intermediate_states function

@redeboer
redeboer added this pull request to stack #386 September 15, 2026 14:29
@redeboer redeboer changed the title BREAK: move particle-database matching out of CSPSolver BREAK: decouple CSPSolver from particle database Sep 15, 2026
@redeboer redeboer added ⚠️ Interface Breaking changes to the API ⚙️ Enhancement Improvements and optimizations of existing features labels Sep 15, 2026
@redeboer
redeboer self-requested a review September 15, 2026 14:40
@redeboer redeboer added this to the 0.11.0 milestone Sep 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ Enhancement Improvements and optimizations of existing features ⚠️ Interface Breaking changes to the API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move particle-database matching out of the CSP solver

2 participants