Add spin_pols_iter to iterate over a process' spin/pol combinations #118
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.
As the title says, this adds an iterator to yield all possible combinations of spins and polarizations allowed by a process' set
spin_pols()
. For example:The above is also a
jldoctest
.As a side-note I also added an alias of
SyncedPol
toSyncedPolarization
.The code is not incredibly concise and also not incredibly fast, but for the reasonable cases that I tested
@benchmark
reports well under 1ms. Since I don't think this iterator would be the critical path of anything this should be fine.The only problem I could see is that due to everything using
Tuple
s in its arguments, the compile time is relatively large. If this becomes a problem we could change it to usingVector
s instead, likely trading some runtime for much better compile time.Fixes #107