feat(py): forward self-consistency options through the sweeps - #11
Open
reneotten wants to merge 1 commit into
Open
feat(py): forward self-consistency options through the sweeps#11reneotten wants to merge 1 commit into
reneotten wants to merge 1 commit into
Conversation
`sweep_v_g` / `sweep_v_ds` took a bare `self_consistent: bool` and always
built `SelfConsistentOptions::default()`. Anything a user had tuned on
`solve_self_consistent` -- `mixing`, `eta`, `tolerance`, `max_iterations` --
was silently discarded for every bias point in the sweep, so a device that
only converges with e.g. a gentler mixing could not be swept at all, and the
failure looked like a solver bug rather than a dropped argument.
Both sweeps now take the same four options as `solve_self_consistent`, with
identical defaults, forwarded per bias point. `self_consistent` keeps its
default of false, so existing positional calls are unaffected.
Verified that the options actually reach the loop: `mixing=5.0` is now
rejected ("mixing must be in (0, 1]") and `max_iterations=1` with a tight
tolerance reports non-convergence, where both were previously ignored.
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.
feat(py): forward self-consistency options through the sweeps
sweep_v_g/sweep_v_dstook a bareself_consistent: booland alwaysbuilt
SelfConsistentOptions::default(). Anything a user had tuned onsolve_self_consistent--mixing,eta,tolerance,max_iterations--was silently discarded for every bias point in the sweep, so a device that
only converges with e.g. a gentler mixing could not be swept at all, and the
failure looked like a solver bug rather than a dropped argument.
Both sweeps now take the same four options as
solve_self_consistent, withidentical defaults, forwarded per bias point.
self_consistentkeeps itsdefault of false, so existing positional calls are unaffected.
Verified that the options actually reach the loop:
mixing=5.0is nowrejected ("mixing must be in (0, 1]") and
max_iterations=1with a tighttolerance reports non-convergence, where both were previously ignored.