Skip to content

2D TW-MZM cross-section with PN junction and CPW electrodes - #193

Open
mdmaas wants to merge 6 commits into
gdsfactory:mainfrom
EpsilonForge:2d_twmzm
Open

2D TW-MZM cross-section with PN junction and CPW electrodes#193
mdmaas wants to merge 6 commits into
gdsfactory:mainfrom
EpsilonForge:2d_twmzm

Conversation

@mdmaas

@mdmaas mdmaas commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

2D travelling-wave Mach-Zehnder modulator (TW-MZM) cross-section for Palace BoundaryMode analysis (RF + optical), with a PN junction modelled as doped semiconductors (finite Drude conductivity) and CPW electrodes.

Commits (history rebased from 23 to 4)

  1. feat: TW-MZM cross-section with PN junction, CPW electrodes, and graded doping
    Initial cross-section build, doping gradient/vias, native 2D BoundaryMode mesh fixes.
  2. feat: rewrite plot_fields_2d on PyVista with zoom, physical-group filtering, and per-face colors
    Self-contained visualization rework of the 2D field renderer.
  3. feat: generic cross-section assembly, impedance boundary API, and lumped PN capacitance
    build_doped_cross_section(), make_doping_profile(), plot_plane_section(), ImpedanceBoundaryConfig, PN junction lumped capacitance, palace-cpu bump.
  4. fix: align tests and CI with changed APIs and defaults
    Apptainer default, plot_fields_2d return type, Palace parallel defaults, ty/ruff cleanups.

Scope

  • 29 files changed: ~17 source, 8 tests, notebook + jupytext pair, pyproject.toml.
  • New notebook nbs/palace_2d_twmzm.ipynb: simplified TW-MZM cross-section (SOI rib, 400 nm / 90 nm slab, CPW signal 20 um / gap 20 um / ground 40 um), 50 GHz RF + 1550 nm optical BoundaryModeSim runs.
  • Doping regions modelled as semiconductors with finite Drude conductivity; graded N+/P+ contact profiles via make_doping_profile().
  • Fix: emit Conductivity entry for shaped dielectrics with finite sigma.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.90148% with 285 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.66%. Comparing base (d7a2ef6) to head (5389c89).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/gsim/palace/base.py 50.86% 50 Missing and 7 partials ⚠️
src/gsim/palace/field_viz.py 35.06% 45 Missing and 5 partials ⚠️
src/gsim/palace/mesh/generator.py 57.98% 38 Missing and 12 partials ⚠️
src/gsim/palace/mesh/config_generator.py 25.86% 41 Missing and 2 partials ⚠️
src/gsim/common/cross_section.py 51.38% 30 Missing and 5 partials ⚠️
src/gsim/viz.py 86.34% 23 Missing and 5 partials ⚠️
src/gsim/palace/models/ports.py 55.00% 9 Missing ⚠️
src/gsim/palace/runtime.py 10.00% 9 Missing ⚠️
src/gsim/palace/plane_section.py 93.93% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
+ Coverage   57.19%   57.66%   +0.46%     
==========================================
  Files          69       71       +2     
  Lines       11506    12235     +729     
  Branches     2395     2543     +148     
==========================================
+ Hits         6581     7055     +474     
- Misses       4194     4422     +228     
- Partials      731      758      +27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mdmaas

mdmaas commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

I think the geometry is looking reasonable. This is the overall structure for the RF simulation:

twmzm_mesh

and zooming in to the region below the electrodes is the optical rib waveguide:

twmzm_zoom

…l override

- interactive param is tri-state (None/True/False): explicit True forces a live
  view, False forces static, None follows set_interactive_mode (off by default)
- notebook live views render as one widget per plot on the single shared trame
  server (server-side by default; GSIM_TRAME_BACKEND / set_trame_backend to
  switch to client-side vtk.js)
- keep live plotters in a registry (interactive_views/close_interactive_views/
  close_interactive_view) so multiple views coexist without concurrent servers
- front-facing camera for plot_mesh on planar meshes; plot_fields_2d camera
  preserved through the interactive path
- fall back to a static image if a trame widget cannot be created
@mdmaas mdmaas changed the title [WIP] 2D TW-MZM cross-section with PN junction and CPW electrodes 2D TW-MZM cross-section with PN junction and CPW electrodes Aug 10, 2026
@mdmaas

mdmaas commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@vvahidd I think we could merge this PR, while I continue working on the optical SIM and the overlap integral in future PRs on the notebook, in order to prevent this branch from diverging from the main package too much.

The changes are structured around two main goals

  • 2d cross section solver and utilities
  • Enhanced 2d visualization

Adds a simplified all-dielectric cross-section for the TW-MZM optical
analysis and makes the Palace 2D background medium configurable.

- build_optical_cross_section(): minimal LayerStack where rib/slab/PN
  all map to plain Si, embedded in a single uniform SiO2 cladding.
- set_airbox(material=...): retunes the native-2D BoundaryMode background
  from air to a cladding material (e.g. "sio2"); default unchanged.
  The unclaimed domain merges into one SiO2 physical group, so no air
  volume is emitted. mesh() margin overrides now preserve the material.
- Palace boundary-mode configs resolve material dispersion at the
  operating frequency (Sellmeier Si/SiO2 at 1550 nm) like driven sims.
- Quiet trame's debug INFO logging while live views are built.
- Notebook: split RF/optical components, run the optical sim on the
  all-Si rib+slab+PN stack in a uniform SiO2 background, and fix the
  optical mode-plot cell (field + physical-group constants).
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