Skip to content

Warn on zero electron-phonon coupling and fix W guidance in docs - #3

Merged
aronwalsh merged 1 commit into
mainfrom
fix/wif-guidance
Aug 25, 2026
Merged

aronwalsh merged 1 commit into
mainfrom
fix/wif-guidance

Conversation

@aronwalsh

Copy link
Copy Markdown
Member

Summary

Addresses discussion in #2 (raised by @kuazhangge, diagnosed by @kavanase):

  • Warn when W = 0: calculate_capture_coefficient now emits a UserWarning when the electron-phonon coupling is 0 (the default), since C ∝ W² previously gave silently zero capture coefficients.
  • Fix misleading docs: removed the "default if unknown: 0.2 eV" advice and the "typical 0.1–0.5 eV" range. Docs now state that W must be calculated for the specific defect transition (typical literature magnitudes ~1e-4 to ~0.05 eV, see e.g. SI of https://doi.org/10.1016/j.joule.2024.05.004) and link to the CarrierCapture.jl and nonrad docs for worked examples, plus Alkauskas et al., PRB 90, 075202 (2014).
  • CLI fix: -W 0 and --Q0 0 were treated as unset (falsy check) and silently overridden by config-file values; now checked with is None.
  • Tests: added pytest.warns coverage for W=0 and a no-warning check for nonzero W.

Test plan

  • pytest tests/ — 105 passed, 53 skipped
  • Manual check: ConfigCoordinate with default W emits warning and returns 1e-127 placeholder coefficients; W=0.05 emits no warning.

🤖 Generated with Claude Code

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.
@aronwalsh
aronwalsh merged commit 271318e into main Aug 25, 2026
3 checks passed
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.

1 participant