Skip to content

Installation

Terminal window
pip install rfx-fdtd

rfx requires Python 3.10+ and installs JAX, NumPy, SciPy, matplotlib, and h5py.

The package name on PyPI is rfx-fdtd, while the Python import remains:

import rfx

For the packaged local Studio, background experiment CLI, and Model Context Protocol (MCP) server, install the Studio extra:

Terminal window
pip install "rfx-fdtd[studio]"
rfx studio --workspace .rfx-studio

See Studio, CLI, and MCP Experiments for the current UI scope, shared-workspace rules, replay, approvals, and remote deployment requirements.

After installing, confirm the environment can actually run a simulation.

First run the bundled diagnostics command:

Terminal window
rfx-diagnose

It prints a PASS / WARN / FAIL report (Python and rfx versions, the JAX backend and devices, core dependencies, optional extras) and finishes with a tiny end-to-end FDTD run. It exits 0 only when every critical check passes; WARN lines (CPU-only backend, x64 disabled) are informational.

The diagnostic’s final short run is the installed-package execution check. Examples under examples/ are available only from a source checkout; they are not installed as wheel data.

Terminal window
pip install --upgrade "jax[cuda12]"
python -c "import jax; print(jax.devices())"

See the official JAX installation guide for CUDA/cuDNN details.

Terminal window
git clone https://github.com/bk-squared/rfx.git
cd rfx
pip install -e ".[dev]"
python examples/quickstart/hello_world.py

The hello-world script builds a tiny box, injects one pulse, records one field probe, and prints a short finite-data summary.

The dev extra includes:

  • pytest
  • pytest-xdist
  • ruff
  • Python: 3.10 / 3.11 / 3.12
  • CPU: modern x86_64
  • GPU: NVIDIA + CUDA 12+ for acceleration
  • RAM: 4 GB minimum, 16 GB+ recommended for larger 3D runs

From a source checkout with the development install above, run examples/quickstart/hello_world.py, then follow the ordered tutorials in examples/tutorials/; examples/README.md lists the sequence. For a wheel-only install, use rfx-diagnose as the execution check because the wheel does not include examples/.