Skip to content

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.

Use rfx with two simple lanes in mind:

LaneUse it forStatus
Recommended default: uniform Cartesian Yee RF workflowscavity and waveguide studies, patch-style resonance workflows, probes, Harminv, selected port/S-parameter workflows, and benchmarked far-field workflowsbest place to start
Experimental / under active validationnon-uniform meshes, distributed execution, Floquet/Bloch workflows, SBP-SAT subgridding, coaxial and advanced port workflows, and inverse-design extensionsuseful for experiments; check current limitations

The docs keep advanced features visible, but they should not be read as blanket guarantees.


FeatureDetail
GPU accelerationJAX/JIT execution for large 3-D grids
Differentiable simulationjax.grad through time-domain workflows for inverse design
RF workflow toolsmaterials, sources, probes, ports, S-parameter helpers, Harminv, far-field utilities
Recommended examplescurrent runnable scripts under examples/crossval/ and examples/inverse_design/
Experimental lanesnon-uniform mesh, distributed runs, Floquet/Bloch, SBP-SAT subgridding, coaxial/advanced ports

Terminal window
pip install rfx-fdtd

GPU support depends on your JAX/CUDA environment:

Terminal window
pip install "jax[cuda12]" rfx-fdtd

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")

  • Examples — recommended public runnable paths
  • Validation — public support and validation overview
  • API — curated public API contract
  • Generated API — subordinate generated symbol reference