FEAT: add generate_qn_transitions function - #383
Open
grayson-helmholz wants to merge 3 commits into
Open
grayson-helmholz wants to merge 3 commits into
grayson-helmholz wants to merge 3 commits into
Conversation
redeboer
added this pull request to stack #386
September 15, 2026 14:29
redeboer
self-requested a review
September 15, 2026 14:41
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
✨ New features
generate_qn_transitions()is the quantum-number-level counterpart ofgenerate_transitions(). It chainscreate_qn_problem_sets(spin_projections=False)withfind_qn_transitions()and returns aQNReactionInfo. Because the spin-projection combinatorics is avoided both in the problem sets and in the constraint problem, it stays feasible for many-body final states, wheregenerate_transitions()takes impractically long.QNReactionInfocollects the resultingQNTransitions. Its initial and final states areParticleinstances, while each intermediate state stays a property map of the quantum numbers that any particle appearing there must carry. It offersget_intermediate_quantum_numbers()to list those distinct sets andgroup_by_topology(), mirroringReactionInfo.find_qn_transitions()andcollect_qn_transitions()take an optionalparticle_dbwith which they resolve the external states, which are fully determined by theirpid, toParticleinstances. Intermediate states are deliberately left as property maps, since they stand for a set of allowed states rather than one particle.create_qn_problem_sets()acceptsallowed_interaction_types(for instance"strong"or["em", "weak"]), which restricts the interaction types of the default or giveninteraction_configwithout the caller having to build anInteractionConfigby hand. The given config is copied rather than mutated.⚙️ Enhancements
collapse_graphs()(thecollapse="topology"rendering option) now handles states that are quantum-number property maps. Such a state is reduced to the newQuantumNumberSignature, which renders as the PDG-style1⁺(1⁻⁻)instead of full property maps. The signature has both a plain and a LaTeX rendering, and the label formatters gained asuperscript()method for it.QNReactionInfowherever they accept aReactionInfo, so quantum-number transitions can be visualized with the usualqrules.ioentry points.to_state_definitions()moved from a private helper inqrulesto the public API ofqrules.combinatorics, since the quantum-number workflow needs the same normalization of a single state definition into a list.Squash commit messages