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

FEAT: implement quantum problem set filter #287

Merged
merged 38 commits into from
Nov 6, 2024
Merged

Conversation

grayson-helmholz
Copy link
Contributor

@grayson-helmholz grayson-helmholz commented Oct 4, 2024

As CSPSolver.find_solutions() just takes a general QNProblemSet it should be possible
to reduce the set of constraints (i.e. conservation rules) the solver takes into account for
finding the solutions of a decay.
A possible way to implement this is to use the StateTransitionManager to generate the
full set of rules for a certain decay and just filter it to contain only the desired
constraints before passing it to CSPSolver.

Closes #297

Tip

See preview of the modified documentation here.

@grayson-helmholz grayson-helmholz linked an issue Oct 4, 2024 that may be closed by this pull request
@redeboer redeboer added the ✨ Feature New feature added to the package label Oct 4, 2024
@redeboer redeboer self-requested a review October 4, 2024 13:05
@redeboer redeboer changed the title Filter quantum numbers FEAT: implement quantum problem set filter Oct 4, 2024
Copy link
Member

@redeboer redeboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported remaining review comments from #278

tests/unit/test_solving.py Show resolved Hide resolved
tests/unit/test_solving.py Show resolved Hide resolved
src/qrules/quantum_numbers.py Outdated Show resolved Hide resolved
tests/unit/test_solving.py Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
Copy link
Member

@redeboer redeboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that it's working 🙌

(After offline discussion):
Let's expose this filter_quantum_number_problem_set() function and write an example with visualization in the "Conservation rules" notebook. If that turns out to look concise, illustrative, and useable enough, we can keep this new function in the API.

Perhaps the example can be without C-parity conservation? As opposed to the test.

tests/unit/test_solving.py Outdated Show resolved Hide resolved
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@grayson-helmholz grayson-helmholz marked this pull request as ready for review October 29, 2024 16:06
Copy link
Member

@redeboer redeboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! The new section in the documentation is particularly good 👌
Some final smaller changes are suggested below.

docs/usage/reaction.ipynb Outdated Show resolved Hide resolved
tests/unit/test_solving.py Outdated Show resolved Hide resolved
tests/unit/test_solving.py Outdated Show resolved Hide resolved
tests/unit/test_solving.py Outdated Show resolved Hide resolved
docs/usage/visualize.ipynb Outdated Show resolved Hide resolved
docs/usage/visualize.ipynb Show resolved Hide resolved
docs/usage/visualize.ipynb Outdated Show resolved Hide resolved
docs/usage/visualize.ipynb Outdated Show resolved Hide resolved
src/qrules/quantum_numbers.py Show resolved Hide resolved
src/qrules/quantum_numbers.py Show resolved Hide resolved
Copy link
Member

@redeboer redeboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! 🥇

@redeboer redeboer merged commit 846d4ad into main Nov 6, 2024
16 checks passed
@redeboer redeboer deleted the filter_quantum_numbers branch November 6, 2024 08:30
@grayson-helmholz grayson-helmholz linked an issue Nov 18, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New feature added to the package
Projects
None yet
2 participants