Skip to main content

rfx

██████╗ ███████╗██╗  ██╗
██╔══██╗██╔════╝╚██╗██╔╝
██████╔╝█████╗   ╚███╔╝
██╔══██╗██╔══╝   ██╔██╗
██║  ██║██║     ██╔╝ ██╗
╚═╝  ╚═╝╚═╝     ╚═╝  ╚═╝

Differentiable 3D FDTD electromagnetic simulator for RF and microwave engineering — powered by JAX.

Start with the uniform Cartesian Yee solver. Feature support and its limits live in the support matrix; per-port-family S-parameter limits live in the S-parameter support matrix.

License Tests PyPI Docs

At a Glance

GPU-accelerated 200³ grid on an RTX 4090: 7,266 Mcells/s with PEC walls, 2,087 Mcells/s with CPML absorbers — an open-boundary simulation pays the absorber, so quote the second for antenna/scattering work. Measured by marginal-cost differencing (scripts/diagnostics/gpu_throughput_bench.py); see the benchmark guide for other cards.
Differentiable jax.grad through the time-domain solver for sensitivity and inverse design
RF workflow tools materials, sources, probes, ports, S-parameters, Harminv, far-field / RCS
Per-family S-parameters lumped/wire, microstrip, rectangular waveguide, and coaxial paths use distinct calculators
Preflight + fidelity guards sim.fidelity_report() shows declared-vs-rasterized geometry before a solve; sim.preflight() surfaces setup errors and support-boundary issues
Supervisable long runs report_every=N prints step count, elapsed time, rate, and ETA on supported uniform and single-device non-uniform runs when checkpointing is compatible
Cross-validated public cases mapped to Meep / OpenEMS / Palace / analytic references, each with a reproduce command

Installation

pip install rfx-fdtd                  # CPU
pip install "jax[cuda12]" rfx-fdtd    # GPU (JAX + CUDA)

Development install:

git clone https://github.com/bk-squared/rfx.git
cd rfx && pip install -e ".[all]"

Quick Start

from rfx import Box, GaussianPulse, Simulation

sim = Simulation(
    freq_max=5e9,
    domain=(0.14, 0.06, 0.05),
    dx=2e-3,
    boundary="cpml",
    cpml_layers=8,
)
sim.add_material("slab", eps_r=2.2, sigma=0.01)
sim.add(Box((0.07, 0.018, 0.018), (0.09, 0.042, 0.032)), material="slab")
sim.add_source(
    (0.03, 0.03, 0.025),
    "ez",
    waveform=GaussianPulse(f0=3e9, bandwidth=0.8),
)
sim.add_probe((0.11, 0.03, 0.025), "ez")

sim.fidelity_report()
preflight = sim.preflight()
print(preflight.format())
preflight.raise_for_failure()

result = sim.run(n_steps=1200, report_every=200)
print(result.time_series.shape)

fidelity_report() describes how each entity rasterizes; it does not predict RF error. Progress reporting is off by default and does not change returned arrays.

For a real antenna workflow — including the mesh, time-window, and reference checks required before reporting RF results — follow the First Patch tutorial.

Interfaces

Beyond the Python API:

  • Dashboardpip install "rfx-fdtd[dashboard]" && rfx-dashboard: browser GUI for building, running, and inspecting a simulation.
  • Experiment CLIrfx experiment run <spec.json>: versioned CPU runs from a strict JSON spec, with submit/status/cancel.
  • Studio + MCPpip install "rfx-fdtd[studio]" && rfx studio: local app with append-only experiment revisions, approval-gated MCP actions, and an optional LLM Design Copilot.

The Experiment CLI and Studio/MCP share the same ExperimentSpec format. Details, safety model, and remote deployment: Studio, CLI, and MCP Experiments.

Differentiable Design

JAX-traced objectives for inverse design — sensitivity calculations through the discrete solver, validated per port family. Runnable examples with finite-difference cross-checks live in examples/inverse_design/; background in the Autodiff and Adjoint guide.

Validation

Every public cross-validation case is mapped to a named analytic or external reference with a reproduce command and acceptance gates. Start with Cross-Validation and Accuracy for the support limits, then Benchmarks for the per-case numbers. The CPU-feasible subset runs locally:

PYTHONPATH=. python scripts/run_crossval_cpu.py

Exit codes: 0 all gates passed, 1 a gate failed, 2 a required external reference was unavailable (inconclusive, not silently green).

Documentation

Full documentation: remilab.ai/rfx

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},
  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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rfx_fdtd-1.7.0.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rfx_fdtd-1.7.0-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file rfx_fdtd-1.7.0.tar.gz.

File metadata

  • Download URL: rfx_fdtd-1.7.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for rfx_fdtd-1.7.0.tar.gz
Algorithm Hash digest
SHA256 e43ef416e298a4cd898ea49f3c7a2f5cabcf564dd3bc197a04af4bb1e39e11e6
MD5 6ddb8113fcc02e5f47967f6f86f1c91d
BLAKE2b-256 7a5d0156b771657bfdbdf705804f8fd7a354b4e5ae5ea9d64f483590c2c1764b

See more details on using hashes here.

File details

Details for the file rfx_fdtd-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: rfx_fdtd-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for rfx_fdtd-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddf3398c280090520558d4cb6b4be7612a4a772a41cf9d364cddd9f05ec0f424
MD5 1849fa9017f56ed29432b9bf21b75874
BLAKE2b-256 7ce64c45fe9c2c14d7c7088b59b4f0d92fb55022914aa3a6647092d3a59747be

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.7.0 This release

2 files

1.6.6

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page