Verification-first, differentiable electrothermal FEM for silicon photonics.
femx connects electrical conduction, Joule heating, thermal transport, thermo-optic material
updates, waveguide modes, and FDTDX optical objectives through explicit numerical contracts.
- JAX provides native differentiable finite-element operators and implicit adjoints.
- Elmer provides an independently executed open-source FEM reference.
- FDTDX consumes explicit material, mode, source, detector, and result contracts.
Research preview: APIs, evidence schemas, and experimental distributed interfaces may change before the first stable release.
Native JAX and locked external Elmer independently solve the same coarse Gmsh Tet4 problem at 5 mA. No displayed temperature or parity field is rescaled from the retained 15 mA result.
| Direct 5 mA reference | Value |
|---|---|
| Mesh | 12,761 nodes; 71,808 Tet4 cells |
| Voltage | 0.229573 V |
| Joule power | 1.14786 mW |
| Peak temperature rise | 18.2608 K |
| Maximum JAX-Elmer temperature difference | |
| Relative |
|
| Maximum conductor-potential difference |
This 3D same-discretization parity result is solver evidence for an uncalibrated,
constant-property benchmark. The
modeled thermal domain is 20 um by 20 um, contains only 0.5 um of silicon below the 2 um BOX, fixes
the bottom at 300 K, uses adiabatic sides, and applies top convection to 300 K with
The original 15 mA source-reproduction reaches a 164.348 K peak rise and is retained for source traceability, not as a recommended operating point. See the direct 5 mA method and open fields, thermal-scope note, original 15 mA bundle, and earlier 2D adjoint reference.
A separate CPU float64 study crosses 20, 40, and 80 um square domains with 0.5, 5, and 50 um modeled silicon depths while holding material values and the mesh-size policy fixed. The widest, deepest case differs from the source envelope by -1.41 percent in peak K/mW and -3.23 percent in ring-mean K/mW. Width and depth interact; this bounded study is not formal domain convergence or device calibration. The complete case evidence is public.
- Solver-neutral problem, mesh, material, artifact, and validation contracts.
- JAX-native steady heat, current, Joule-heating, and electrothermal paths.
- Independent same-mesh checks against separately installed Elmer.
- Residual-defined differentiation with finite-difference or independent-adjoint checks.
- Explicit FEM-to-Yee mode transfer and FDTDX interoperability.
- Experimental distributed JAX paths with bounded physical TPU evidence.
Process success, numerical convergence, and scientific validation are reported separately. A test or completed executable does not by itself establish a physical claim.
| Capability | Status |
|---|---|
| 2D steady heat and current FEM | Available and cross-validated |
| 2D electrothermal coupling and implicit adjoint | Available for the documented subset |
| 3D Tet4 current, Joule heating, and steady heat | Available for the constant-property forward subset |
| 3D ring-heater JAX-Elmer field parity | Available on the public coarse mesh |
| Three-level 3D ring-heater mesh sensitivity | Available through 3,179,879 Tet4 cells |
| 2D waveguide port modes and documented eigen-adjoints | Available for the lossless PEC subset |
| FEM-to-Yee transfer and FDTDX consumers | Available for the documented contracts |
| Distributed scalar and electrothermal JAX paths | Experimental; bounded TPU evidence retained |
| 3D ring-heater FDTDX resonance response | In development |
Transient thermal analysis, foundry-calibrated prediction, and a continuum-converged ring-heater value are not currently claimed.
femx supports Python 3.11 to 3.14. Install the published development release from PyPI with:
pip install "femx==0.1.0.dev0"
femx doctorFor an editable source checkout, install uv and run:
git clone https://github.com/yspkm/femx.git
cd femx
uv sync --locked --extra jax --extra artifacts --extra meshing
uv run femx doctorThe optional jax, artifacts, and meshing extras may be selected for workflows that need them.
Gmsh, Elmer, and FDTDX remain separately installed external tools.
Run the portable public CI selection with:
uv run pytest -m "unit or architecture"Elmer comparison requires JAX float64. Set JAX_ENABLE_X64=1 before importing JAX.
prepared = femx.prepare(problem, backend, request=prepare_request)
solution = femx.solve(prepared, backend, request=solve_request)Problem contains solver-neutral physics. PreparedProblem binds one exact backend payload, and
Solution records fields, observables, convergence, and validation state. femx does not silently
change the backend, precision, mesh, element family, or scalar type.
- Roadmap
- Materials and provenance
- FDTDX interoperability
- Tet4 scalar H1 formulation
- Steady heat formulation
- Steady current formulation
- Electrothermal coupling
- Port eigenmode formulation
- Contributing
For reproducible work, record the exact femx version or source commit together with external solver revisions, mesh and material identities, numerical policy, and the relevant evidence artifact.
femx is distributed under the MIT License.
Elmer, FDTDX, JAX, and Gmsh are separate projects with their own licenses; femx does not vendor
their implementations.
We gratefully acknowledge Google's TPU Research Cloud (TRC) program for providing access to Cloud
TPU resources that supported the development and distributed validation of femx.

