-
Notifications
You must be signed in to change notification settings - Fork 5
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
BREAK: remove spin projections in cons rules #282
Merged
grayson-helmholz
merged 18 commits into
main
from
remove_spin-projections_in_cons-rules
Aug 26, 2024
Merged
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f190b2f
Added '*.swp' (temporary vim-files) to .gitignore
grayson-helmholz 67b6747
Added test-skeleton for Issue#272
grayson-helmholz 631f692
created QNP-setter and its test
grayson-helmholz c18d411
inlined fixture-arguments, function-renaming
grayson-helmholz 5a997d0
iss272: faulty filters for QNProblemSet
grayson-helmholz ad5ea05
FIX: stabilize test fixture
redeboer 6fbf83b
added pid&spin_projection -> non-zero results
grayson-helmholz 557ec57
cleanup of test_solving.py
grayson-helmholz e54289e
changed tuple to set in test-case
grayson-helmholz a045be5
removed projections from spin-mag.-cons.
grayson-helmholz 5ea1aea
removed spin-proj. from test_solving&test_spin
grayson-helmholz 1ce3c7f
Merge remote-tracking branch 'origin/main' into remove_spin-projectio…
grayson-helmholz 8d3b815
Revert "Added '*.swp' (temporary vim-files) to .gitignore"
grayson-helmholz a4335a5
removed test_solving.py -> smaller diff
grayson-helmholz 23b4d36
adapted conservation.ipynb to spin-proj.-removal
grayson-helmholz bb80469
corrected keyw.-args in conservation.ipynb
grayson-helmholz 5bcfb9b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7ed7693
MAINT: reduce diff
redeboer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,18 @@ | |
spin_magnitude_conservation, | ||
) | ||
from qrules.particle import Spin | ||
from qrules.quantum_numbers import EdgeQuantumNumbers | ||
|
||
_SpinRuleInputType = Tuple[List[SpinEdgeInput], List[SpinEdgeInput], SpinNodeInput] | ||
_SpinMagnitudeRuleInputType = Tuple[ | ||
List[EdgeQuantumNumbers.spin_magnitude], | ||
List[EdgeQuantumNumbers.spin_magnitude], | ||
SpinNodeInput, | ||
] | ||
_SpinRuleInputType = Tuple[ | ||
List[SpinEdgeInput], | ||
List[SpinEdgeInput], | ||
SpinNodeInput, | ||
] | ||
|
||
|
||
def __create_two_body_decay_spin_data( | ||
|
@@ -119,13 +129,7 @@ def test_spin_all_defined(rule_input: _SpinRuleInputType, expected: bool) -> Non | |
("rule_input", "expected"), | ||
[ | ||
( | ||
__create_two_body_decay_spin_data( | ||
in_spin=Spin(1, 1), | ||
out_spin1=Spin(spin2_mag, 0), | ||
out_spin2=Spin(1, -1), | ||
angular_momentum=Spin(ang_mom_mag, 0), | ||
coupled_spin=Spin(coupled_spin_mag, -1), | ||
), | ||
([1], [spin2_mag, 1], SpinNodeInput(ang_mom_mag, 0, coupled_spin_mag, -1)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kind of hard to read this test, but it was already like that unfortunately |
||
True, | ||
) | ||
for spin2_mag, ang_mom_mag, coupled_spin_mag in zip( | ||
|
@@ -134,13 +138,7 @@ def test_spin_all_defined(rule_input: _SpinRuleInputType, expected: bool) -> Non | |
] | ||
+ [ | ||
( | ||
__create_two_body_decay_spin_data( | ||
in_spin=Spin(1, 1), | ||
out_spin1=Spin(spin2_mag, 0), | ||
out_spin2=Spin(1, -1), | ||
angular_momentum=Spin(ang_mom_mag, 0), | ||
coupled_spin=Spin(coupled_spin_mag, 0), | ||
), | ||
([1], [spin2_mag, 1], SpinNodeInput(ang_mom_mag, 0, coupled_spin_mag, 0)), | ||
False, | ||
) | ||
for spin2_mag, ang_mom_mag, coupled_spin_mag in zip( | ||
|
@@ -149,6 +147,6 @@ def test_spin_all_defined(rule_input: _SpinRuleInputType, expected: bool) -> Non | |
], | ||
) | ||
def test_spin_ignore_z_component( | ||
rule_input: _SpinRuleInputType, expected: bool | ||
rule_input: _SpinMagnitudeRuleInputType, expected: bool | ||
) -> None: | ||
assert spin_magnitude_conservation(*rule_input) is expected # type: ignore[arg-type] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I realize now is that this rule seems to be checking two things and therefore needs$L$ and $S$ of the nodes. It would be better to split that.
Maybe we should write an issue for this if this rule can be split up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also not really a suitable class name:
qrules/src/qrules/conservation_rules.py
Lines 467 to 470 in a045be5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah seems fishy to me. @grayson-helmholz could you post an issue to split this rule into spin magnitude and$LS$ magnitude.