JAX-native 3D FDTD electromagnetic simulator for RF engineering
Project description
rfx
██████╗ ███████╗██╗ ██╗
██╔══██╗██╔════╝╚██╗██╔╝
██████╔╝█████╗ ╚███╔╝
██╔══██╗██╔══╝ ██╔██╗
██║ ██║██║ ██╔╝ ██╗
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
Differentiable 3D FDTD electromagnetic simulator for RF and microwave engineering — powered by JAX.
v1.5.0 — 500+ tests, GPU-benchmarked (7,309 Mcells/s on RTX 4090), published RF benchmarks, and expanded preflight/crossval tooling.
Project status (April 2026):
rfxis still in active validation and early conceptualization. Treat the currentmainbranch as an initial-stage release rather than a finalized, fully qualified simulator; the support surface, validation evidence, and higher-level workflows will continue to be tightened and expanded in upcoming iterations.
At a Glance
Current correctness-bearing support is centered on the uniform Cartesian Yee
reference lane. Non-uniform graded-z, distributed execution, SBP-SAT
subgridding, and Floquet/Bloch workflows should be treated according to
docs/guides/support_matrix.md, not as blanket guarantees.
| GPU-accelerated | 7,309 Mcells/s on RTX 4090, 5,249 on A6000 via jax.lax.scan JIT |
| Differentiable | jax.grad through full time-stepping for inverse design |
| Topology optimization | Density-based with filtering, projection, and beta continuation |
| Conformal PEC | Dey-Mittra method for 2nd-order accuracy on curved conductors |
| Multi-GPU | Single-host multi-GPU distributed FDTD with 1D slab decomposition (experimental lane) |
| SBP-SAT subgridding | JIT-compiled local mesh refinement (experimental in 3D) |
| Multi-mode ports | Analytical TE/TM eigenmodes for waveguide S-matrix |
| Floquet ports | Phased-array unit-cell analysis with Bloch periodic BC (experimental lane) |
| Accuracy validated | 5-case benchmark against Balanis/Pozar (patch 1.97%, cavity 0.016%) |
| 500+ tests | CI with ruff lint + pytest, 0 xfails |
Installation
pip install rfx-fdtd
GPU support (JAX + CUDA):
pip install "jax[cuda12]" rfx-fdtd
For development:
git clone https://github.com/bk-squared/rfx.git
cd rfx && pip install -e ".[all]"
Quick Start
from rfx import Simulation, Box, GaussianPulse
# 2.4 GHz patch antenna on FR4
sim = Simulation(freq_max=4e9, domain=(0.08, 0.06, 0.025), boundary="cpml")
sim.add(Box((0.0, 0.0, 0.0), (0.08, 0.06, 0.0016)), material="fr4")
sim.add(Box((0.02, 0.01, 0.0016), (0.049, 0.049, 0.0016)), material="pec")
sim.add(Box((0.0, 0.0, 0.0), (0.08, 0.06, 0.0)), material="pec")
sim.add_source((0.029, 0.03, 0.0008), "ez",
waveform=GaussianPulse(f0=2.4e9, bandwidth=0.8))
sim.add_probe((0.029, 0.03, 0.0008), "ez")
result = sim.run(n_steps=8000)
modes = result.find_resonances(freq_range=(1.5e9, 3.5e9))
print(f"Resonance: {modes[0].freq/1e9:.4f} GHz Q={modes[0].Q:.0f}")
GPU Performance (Measured)
| GPU | VRAM | Peak Mcells/s (200^3) |
|---|---|---|
| RTX 4090 | 24 GB | 7,309 |
| RTX 3090 | 24 GB | 5,847 |
| RTX A6000 | 48 GB | 5,249 |
| Grid | RTX 4090 | RTX 3090 | A6000 |
|---|---|---|---|
| 50^3 (125K) | 751 | 455 | 483 |
| 100^3 (1M) | 5,332 | 2,502 | 2,410 |
| 150^3 (3.4M) | 6,258 | 4,797 | 4,158 |
| 200^3 (8M) | 7,309 | 5,847 | 5,249 |
Gradient (reverse-mode AD): ~3-4x forward pass with jax.checkpoint.
Accuracy Validation
Benchmarked against Balanis "Antenna Theory" and Pozar "Microwave Engineering":
| Structure | Reference | Error |
|---|---|---|
| Patch antenna resonance | Balanis Ch 14 | 1.97% |
| WR-90 TE10 cutoff | Analytical | 0.60% |
| Dielectric cavity TM110 | Analytical | 0.016% |
| Microstrip Z0 | Hammerstad-Jensen | 0.47% |
| Coupled-line filter | Pozar Ch 8 | 22.5% (formula limitation) |
Cross-validation vs Meep/OpenEMS: 0.000-0.007% on cavities and waveguides.
Key Features
Core Simulator
- 3D/2D Yee FDTD with CFS-CPML (kappa=5.0, < -40 dB reflectivity)
- Conformal PEC via Dey-Mittra (2nd-order on curved surfaces)
- SBP-SAT subgridding with JIT (experimental in 3D, stable in 1D/2D)
- Non-uniform z-mesh for thin substrates (shadow qualification lane)
- Multi-GPU via jax.pmap (experimental distributed lane)
- Mixed precision (float16 fields, 2x memory reduction)
- Auto-configuration from geometry + frequency range
Sources & Ports
- GaussianPulse, ModulatedGaussian, CW, custom waveforms
- Lumped/wire ports, lumped RLC (series/parallel ADE)
- Multi-mode waveguide ports (analytical TE/TM eigenmodes)
- Floquet ports with Bloch periodic BC (experimental lane)
- Oblique TFSF (2D TMz + TEz auxiliary grids)
Materials
- Debye/Lorentz/Drude dispersive, Kerr nonlinear (chi3)
- Subpixel smoothing, thin conductor correction
- Material fitting: CSV import, Debye/Lorentz pole fitting
- Differentiable material fitting (jax.grad through FDTD)
- Library: pec, fr4, rogers4003c, copper, alumina, water_20c, ...
Analysis & Optimization
- S-parameters (lumped, wire, waveguide N-port)
- Harminv resonance extraction (MPM)
- Far-field, RCS, radiation patterns, polarization
- Antenna metrics: gain, efficiency, HPBW, F/B ratio, bandwidth
- Topology optimization (density filter + projection + beta schedule)
- Parametric sweep + jax.vmap batch evaluation
- Smith chart, de-embedding, Touchstone I/O (.s2p/.s4p/.snp)
- Auto convergence study with Richardson extrapolation
Geometry & Workflow
- Box, Sphere, Cylinder (CSG), Via, CurvedPatch
- PCB stackup builder (2-layer, 4-layer presets)
- RIS unit cell workflow
- Pre-AMR error indicator + neural surrogate export
- Field animation (GIF/MP4)
- Streamlit web dashboard
Documentation
Full documentation: remilab.ai/rfx
Repo-level support and reference-lane contract artifacts:
docs/guides/support_matrix.mddocs/guides/reference_lane_contract.md
Canonical public-doc sources in this repo:
docs/public/index.mdx— public/rfx/landing pagedocs/public/guide/— public guide pagesdocs/agent/— public AI-agent pagesdocs/guides/public_docs_architecture.md— ownership, sync, and deploy rules
Public docs maintenance workflow
- Edit the source pages in
docs/public/index.mdx,docs/public/guide/, ordocs/agent/. - Validate the source tree:
python scripts/check_public_docs_manifest.py - Export the updated snapshot to gitops:
python scripts/export_public_docs_to_gitops.py - Keep the source repo CI in sync with
.github/workflows/public-docs-source.yml.
Source-side CI for this flow lives in:
.github/workflows/public-docs-source.yml
Gitops-side snapshot/build CI lives in the deploy repo:
remilab-sites-gitops/.github/workflows/rfx-public-docs-sync.yml
Tutorials
- Patch Antenna Design — Complete 2.4 GHz design flow
- Microstrip Filter — Coupled-line BPF from Pozar
- Convergence Study — Mesh independence methodology
Guides
Citation
@software{kim_rfx_2026,
author = {Byungkwan Kim},
title = {rfx: JAX-based differentiable 3D FDTD simulator for RF engineering},
institution = {REMI Lab, Chungnam National University},
year = {2026},
version = {1.5.0},
url = {https://github.com/bk-squared/rfx}
}
License
MIT License. See LICENSE.
Acknowledgments
Developed by Byungkwan Kim at the Radar & ElectroMagnetic Intelligence (REMI) Laboratory, Chungnam National University.
AI-Assisted Development
This project was developed with AI coding assistants orchestrated via oh-my-claudecode:
- Claude (Anthropic) — Architecture design, physics validation, cross-validation, code review, documentation
- Codex (OpenAI) — Feature implementation, test generation, review, debugging
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rfx_fdtd-1.6.2.tar.gz.
File metadata
- Download URL: rfx_fdtd-1.6.2.tar.gz
- Upload date:
- Size: 624.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7bd391d50c6a5d6b0ece4a889bc97345ccfe84635ce699c92335024607ad4a7
|
|
| MD5 |
804c33def38d82e3242fb5ec675d93a3
|
|
| BLAKE2b-256 |
5da703f85b5aac5d20a87d423d7fb72d75138dca48f88051a64bdc93e246a9fe
|
File details
Details for the file rfx_fdtd-1.6.2-py3-none-any.whl.
File metadata
- Download URL: rfx_fdtd-1.6.2-py3-none-any.whl
- Upload date:
- Size: 398.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
833653720d8317ec92e9ff120471b61ad58aa84f2ffaeabce9c8c1b7ea349dde
|
|
| MD5 |
683f7aeffa51d232a35b7cee4b0928d0
|
|
| BLAKE2b-256 |
58bf411f7c2446efa042d9ef290c8f49f40dc4060853da34d77c03e31b8295a7
|