PN Junction model from Sze - #242
Open
mdmaas wants to merge 6 commits into
Open
Conversation
mdmaas
requested review from
cdaunt,
flaport,
joamatab,
nikosavola and
vvahidd
as code owners
August 26, 2026 03:03
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #242 +/- ##
==========================================
+ Coverage 59.98% 61.99% +2.01%
==========================================
Files 94 106 +12
Lines 13334 15382 +2048
Branches 2703 3028 +325
==========================================
+ Hits 7998 9536 +1538
- Misses 4439 4869 +430
- Partials 897 977 +80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Implements a PN-junction depletion model for the 2D TW-MZM workflow, replacing the hand-picked junction capacitance with textbook physics. Builds on #233 (contains its commits; this PR shrinks to the feature commit once #233 merges).
Formulas (Sze & Ng, Physics of Semiconductor Devices, 3rd ed., Wiley, ch. 2)
Built-in voltage:
Abrupt-junction depletion width under reverse bias$V_R$ :
Asymmetric split of the depletion into the two sides:
Linearly graded junction (grade constant$a = |dN/dx|$ ):
Depletion capacitance:
Doping concentrations use the industry-standard$\mathrm{cm^{-3}}$ ; lengths in µm.
User API
Two representation modes, auto-selected from$W$ vs the flanking doped sections — high-res when $W \ge \tfrac{1}{5}\min(\text{P flank},\text{N flank})$ , capacitance otherwise (manual override via
mode=):The profile builder returns the doped regions, the P/N regions, and the junction metadata (widths/capacitance/chosen mode):
Demo
The 2d_twmzm notebook now illustrates this: the default junction ($N_A=N_D=10^{18},\mathrm{cm^{-3}}$ , $V_R=0$ , with $T$ and $n_i$ exposed as user parameters) gives $W \approx 50$ nm and auto-selects high-res mode — the depletion strip is drawn on the actual mesh. A doping sweep in the demo shows $W$ crossing back below the threshold into capacitance mode at heavier doping.
Also fixed
build_doped_cross_section()never registered the merged doping/rib materials onstack.materials, so doped domains silently resolved to eps=1.0 without conductivity in generated Palace configs (visible in prior demo artifacts). Now registered, with regression test.Tests
41 new tests: physics values/limits/scalings and error paths, profile geometry/materials/auto-mode boundary cases, and end-to-end Palace checks (Impedance$C_s$ value in capacitance mode; junction dielectric domain group with $\varepsilon = 11.9$ /no conductivity in high-res mode).