# rfx

Channel: release; package: 1.8.0; source: 7d1e97331656dd74ad0f5471653ac0c5effdff70

Page: https://remilab.ai/rfx/versions/v1.8.0/
Source: https://github.com/bk-squared/rfx/blob/7d1e97331656dd74ad0f5471653ac0c5effdff70/docs/public/index.mdx

rfx is a 3-D finite-difference time-domain (FDTD) electromagnetic simulator built in JAX. These docs focus on maintained user workflows with explicit support boundaries.

## Supported workflows

Start with the **uniform Cartesian Yee FDTD solver**. The table summarizes the
documented workflows and their limits:

| Configuration | Documented use |
|---|---|
| **Uniform Yee RF workflows** | recommended default for tutorials, examples, probes, Harminv, selected S-parameter calculations, and far-field calculations |
| **Rectangular waveguide S-matrices** | validated within the documented rectangular-guide geometry, mesh, and frequency limits |
| **Lumped, wire, and microstrip-line port workflows** | available through their matching calculators; validation scope follows the support matrix |
| **Coaxial line reflection** | float32 precision, nonperiodic 3D second-order uniform Yee grid, CPML on all six boundary faces with positive thickness on both z faces, `cpml_axes="z"`, and exactly one `face="top"` coaxial port; see [Sources and Ports](https://remilab.ai/rfx/versions/v1.8.0/api/sources-ports/) for the self-contained calculator limits |
| **Differentiable design loops** | use proxy objectives, gradient checks, and documented validation before treating a design result as evidence |
| **Studio, CLI, and MCP experiments** | versioned local CPU runs, append-only revisions, replay bundles, and server-approved MCP actions; see the guide for the current UI scope |

If a capability is not listed here or on the [Support Boundaries](https://remilab.ai/rfx/versions/v1.8.0/api/support-boundaries/) page, treat it as outside the documented public support scope until that page lists it.

---

## Why rfx

| Feature | Detail |
|---|---|
| **GPU acceleration** | JAX/JIT execution for large 3-D grids |
| **Differentiable workflows** | `jax.grad` through selected JAX-traced objectives; validate the final RF observable within its documented limits |
| **RF workflow tools** | materials, sources, probes, ports, S-parameter helpers, Harminv, far-field utilities |
| **Recommended examples** | the ordered tutorials under `examples/tutorials/` (start at `examples/README.md`), plus the inverse-design examples |
| **Documented limits** | support follows the stated geometry, mesh, frequency, and calculator constraints, not every importable symbol |

---

## Quick install

```bash
pip install rfx-fdtd
```

GPU support depends on your JAX/CUDA environment:

```bash
pip install "jax[cuda12]" rfx-fdtd
```

---

## Minimal example

```python
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),
    amplitude_kind="current",   # amperes; required from 1.9, the default from 2.0
)
sim.add_probe((0.11, 0.03, 0.025), "ez")

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

result = sim.run(n_steps=1200)
print(result.time_series.shape)
```

This records a dielectric pulse response without making a resonance or Q
claim. Resolve any preflight warning introduced by model changes. Use the
[First Patch tutorial](https://remilab.ai/rfx/versions/v1.8.0/guide/first-patch/) for a patch model that passes preflight and
the checks required before reporting resonance or Q.

---

## Documentation by topic

### Getting Started

- [Installation](https://remilab.ai/rfx/versions/v1.8.0/guide/installation/) — Python/JAX install, GPU notes, dev setup
- [Quick Start](https://remilab.ai/rfx/versions/v1.8.0/guide/quickstart/) — first simulation with the current high-level API
- [Your First Patch Antenna](https://remilab.ai/rfx/versions/v1.8.0/guide/first-patch/) — build a model, run a short check, and learn what is required before reporting RF results
- [Studio, CLI, and MCP Experiments](https://remilab.ai/rfx/versions/v1.8.0/guide/studio-experiments/) — local UI, versioned CPU runs, replay, and MCP approvals

### Modeling & Setup

- [Simulation API](https://remilab.ai/rfx/versions/v1.8.0/guide/api-reference/) — `Simulation`, `Result`, `auto_configure`, ports, NTFF, and design helpers
- [Materials & Geometry](https://remilab.ai/rfx/versions/v1.8.0/guide/materials-geometry/) — library materials, Debye/Lorentz, CSG shapes, PCB stackup
- [Sources & Ports](https://remilab.ai/rfx/versions/v1.8.0/guide/sources-ports/) — point sources, lumped/wire ports, microstrip-line ports, waveguide ports, and coaxial-line reflection for exactly one `face="top"` port within its stated limits
- [Probes & S-Parameters](https://remilab.ai/rfx/versions/v1.8.0/guide/probes-sparams/) — DFT probes, S-matrix helpers, Harminv, de-embedding, exports
- [Memory Reduction](https://remilab.ai/rfx/versions/v1.8.0/guide/memory-reduction/) — reduce FDTD/AD memory while preserving validation boundaries
- [ADI Solver (experimental)](https://remilab.ai/rfx/versions/v1.8.0/guide/adi-solver/) — unconditionally stable ADI-FDTD for stiff meshes, its timestep-vs-accuracy trade, and what is validated
- [Waveguide Ports](https://remilab.ai/rfx/versions/v1.8.0/guide/waveguide-ports/) — rectangular waveguide modal workflows

### Analysis & Validation

- [Cross-Validation & Accuracy](https://remilab.ai/rfx/versions/v1.8.0/guide/validation/) — which page carries which kind of validation evidence
- [Benchmarks](https://remilab.ai/rfx/versions/v1.8.0/guide/benchmarks/) — quantitative benchmark summary
- [Convergence Study](https://remilab.ai/rfx/versions/v1.8.0/guide/tutorial-convergence/) — mesh refinement workflow
- [Far-Field & RCS](https://remilab.ai/rfx/versions/v1.8.0/guide/farfield-rcs/) — NTFF radiation patterns and scattering workflows
- [Visualization & Analysis](https://remilab.ai/rfx/versions/v1.8.0/guide/visualization-and-analysis/) — plotting, exports, post-processing

### Design & Optimization

- [Autodiff and Adjoint Background](https://remilab.ai/rfx/versions/v1.8.0/guide/autodiff-adjoint/) — Meep-informed gradient concepts for microwave engineers
- [Inverse Design](https://remilab.ai/rfx/versions/v1.8.0/guide/inverse-design/) — autodiff-driven optimization with documented proxy objectives
- [Gradient Behavior](https://remilab.ai/rfx/versions/v1.8.0/guide/gradient-behavior/) — where gradients are usually well behaved vs noisy
- [Parametric Sweeps](https://remilab.ai/rfx/versions/v1.8.0/guide/parametric-sweeps/) — sequential sweep and `jax.vmap` design-space exploration
- [Patch Antenna Design](https://remilab.ai/rfx/versions/v1.8.0/guide/tutorial-patch-antenna/) — rectangular patch workflow

### Secondary hubs

- [Examples](https://remilab.ai/rfx/versions/v1.8.0/examples/) — recommended public runnable paths
- [Validation](https://remilab.ai/rfx/versions/v1.8.0/validation/) — public support and validation overview
- [Gallery](https://remilab.ai/rfx/versions/v1.8.0/gallery/) — examples with their RF evidence and limits stated on each page
- [API](https://remilab.ai/rfx/versions/v1.8.0/api/) — curated public API contract
