Repository navigation
Keep the given order of Matsubara sampling points - #87
Merged
Merged
Conversation
The C library orders Matsubara sampling points ascending. MatsubaraSampling kept `sampling_points` in the caller's order but returned evaluate() and expected fit() data in the sorted order, so custom points given in any other order silently mismatched the data (plain, positive-only, augmented and DLR bases alike). The wrapper now hands the C library sorted points and permutes the data between the two orders, as TauSampling already follows the given order. Default points are sorted already and take no extra work. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The docstrings said the unfolded default τ points are symmetric about 0. For an odd number of points one of them is β/2, which has no partner, so reversing the unfolded points maps τ to -τ only for an even number; reversing the folded default points maps τ to β - τ in every case. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
MatsubaraSamplingwith custom points given in any order but ascending returnedevaluateresults and expectedfitdata in a different order fromsampling_points. Results were silently wrong for the caller's data order.The C library orders Matsubara points ascending internally, while the wrapper kept
sampling_pointsin the caller's order.This follows up #86, found while fixing the tutorial notebooks.
Changes
evaluateandfit, on any axis.TauSamplingalready follows the given order since Enrich the tests, fix the wrapper defects they expose, and document the conventions #86.condis unchanged, since a row permutation does not change it.MatsubaraSamplingstates that points may be given in any order.Tests
tests/test_boundary.pychecks that shuffled default points giveevaluateequal togl @ basis.uhat(points)and afitround trip, along axis 0 and axis 1. It covers:positive_only;All five cases failed before the fix. The full suite gives 350 passed, 5 xfailed (was 345 passed, 5 xfailed).
🤖 Generated with Claude Code