rfx
Differentiable FDTD for RF/Microwave — powered by JAX
rfx is a 3-D finite-difference time-domain (FDTD) electromagnetic simulator built in JAX. It targets RF and microwave engineers who want practical field simulation, RF workflow tooling, and native gradient support for inverse design in Python.
Current public status
Section titled “Current public status”Use rfx with two simple lanes in mind:
| Lane | Use it for | Status |
|---|---|---|
| Recommended default: uniform Cartesian Yee RF workflows | cavity and waveguide studies, patch-style resonance workflows, probes, Harminv, selected port/S-parameter workflows, and benchmarked far-field workflows | best place to start |
| Experimental / under active validation | non-uniform meshes, distributed execution, Floquet/Bloch workflows, SBP-SAT subgridding, coaxial and advanced port workflows, and inverse-design extensions | useful for experiments; check current limitations |
The docs keep advanced features visible, but they should not be read as blanket guarantees.
Why rfx
Section titled “Why rfx”| Feature | Detail |
|---|---|
| GPU acceleration | JAX/JIT execution for large 3-D grids |
| Differentiable simulation | jax.grad through time-domain workflows for inverse design |
| RF workflow tools | materials, sources, probes, ports, S-parameter helpers, Harminv, far-field utilities |
| Recommended examples | current runnable scripts under examples/crossval/ and examples/inverse_design/ |
| Experimental lanes | non-uniform mesh, distributed runs, Floquet/Bloch, SBP-SAT subgridding, coaxial/advanced ports |
Quick install
Section titled “Quick install”pip install rfx-fdtdGPU support depends on your JAX/CUDA environment:
pip install "jax[cuda12]" rfx-fdtdTen-line example
Section titled “Ten-line example”from rfx import Simulation, Box, GaussianPulse
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")Documentation by topic
Section titled “Documentation by topic”Getting Started
Section titled “Getting Started”- Installation — Python/JAX install, GPU notes, dev setup
- Quick Start — first simulation with the current high-level API
- Your First Patch Antenna — current-source resonance workflow
Modeling & Setup
Section titled “Modeling & Setup”- Simulation API —
Simulation,Result,auto_configure, ports, NTFF, and design helpers - Materials & Geometry — library materials, Debye/Lorentz, CSG shapes, PCB stackup
- Sources & Ports — point sources, lumped/wire ports, waveguide ports, experimental Floquet/coaxial surfaces
- Probes & S-Parameters — DFT probes, S-matrix helpers, Harminv, de-embedding, exports
- Non-Uniform Mesh — experimental thin-substrate workflows
- Waveguide Ports — rectangular waveguide modal workflows
- Floquet Ports — experimental Bloch-periodic unit-cell workflows
Analysis & Validation
Section titled “Analysis & Validation”- Cross-Validation & Accuracy — short public validation overview
- Convergence Study — mesh refinement workflow
- Far-Field & RCS — NTFF radiation patterns and scattering workflows
- Antenna Metrics — gain, efficiency, beamwidth, bandwidth, F/B ratio
- Visualization & Analysis — plotting, exports, post-processing
- Solver Comparison — workflow comparison vs. Meep and OpenEMS
Design & Optimization
Section titled “Design & Optimization”- Inverse Design — autodiff-driven topology, shape, and far-field optimization
- Topology Optimization — density-based inverse design
- Parametric Sweeps — sequential sweep and
jax.vmapbatch evaluation - Material Fitting — Debye/Lorentz fitting and differentiable refinement
- Patch Antenna Design — rectangular patch workflow
- Microstrip Filter Design — experimental microstrip workflow
Advanced / Experimental
Section titled “Advanced / Experimental”- Advanced Features — distributed execution, mixed precision, nonlinear materials, and research-style workflows
- Conformal PEC — Dey-Mittra method for curved conductors
- SBP-SAT Subgridding — experimental local mesh refinement
- Gradient Behavior — where gradients are strong vs noisy
- Geometry & Limitations — supported workflows and current trade-offs
Secondary hubs
Section titled “Secondary hubs”- Examples — recommended public runnable paths
- Validation — public support and validation overview
- API — curated public API contract
- Generated API — subordinate generated symbol reference