Skip to content

feat(py): forward self-consistency options through the sweeps - #11

Open
reneotten wants to merge 1 commit into
mainfrom
feat/sweep-sc-options
Open

feat(py): forward self-consistency options through the sweeps#11
reneotten wants to merge 1 commit into
mainfrom
feat/sweep-sc-options

Conversation

@reneotten

Copy link
Copy Markdown
Owner

feat(py): forward self-consistency options through the sweeps

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.

`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants