Warn on zero electron-phonon coupling and fix W guidance in docs - #3
Merged
Merged
Conversation
The default W=0.0 silently produced identically zero capture coefficients (C ∝ W²). Now calculate_capture_coefficient emits a UserWarning when W is 0, pointing users to the documentation. Docs previously recommended 0.2 eV as a default W and quoted a typical range of 0.1-0.5 eV. There is no meaningful default: W must be calculated for the specific defect transition, and literature values typically span ~1e-4 to ~0.05 eV. Docs now say so and link to the CarrierCapture.jl and nonrad documentation for worked examples, plus Alkauskas et al. PRB 90, 075202 (2014). Also fix CLI falsy checks so explicit '-W 0' and '--Q0 0' are not silently overridden by config-file values. Addresses discussion in #2.
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
Addresses discussion in #2 (raised by @kuazhangge, diagnosed by @kavanase):
calculate_capture_coefficientnow emits aUserWarningwhen the electron-phonon coupling is 0 (the default), sinceC ∝ W²previously gave silently zero capture coefficients.-W 0and--Q0 0were treated as unset (falsy check) and silently overridden by config-file values; now checked withis None.pytest.warnscoverage for W=0 and a no-warning check for nonzero W.Test plan
pytest tests/— 105 passed, 53 skippedConfigCoordinatewith default W emits warning and returns 1e-127 placeholder coefficients; W=0.05 emits no warning.🤖 Generated with Claude Code