Skip to content

PhotonHub

3D FDTD for photonics, with a Python client. Describe a simulation as a small validated object, get a cost estimate before you run, execute it on CPU or GPU, and read results back as labelled xarray arrays.

import photonhub as ph

sim = ph.Simulation(
    size_um=(3.0, 3.0, 3.0),
    grid=ph.UniformMesh(dl_um=0.06),
    run=ph.RunSpec(n_steps=1500),
    sources=[ph.PointDipole(center_um=(1.5, 1.5, 1.5), polarization="Ez",
                            source_time=ph.GaussianPulse(freq0_hz=1.934e14,
                                                         fwidth_hz=4e13))],
    monitors=[ph.SnapshotMonitor(name="snapshot", fields=("Ez",))],
)

print(sim.cost_estimate().summary())   # dollars, memory, wall time, no solver needed
data = ph.run_local(sim)               # -> RunResult of xarray objects

Get started

Install the SDK, build your first scene, and run it.

Install · Quickstart

API reference

The supported SDK namespaces, generated from the installed package.

Browse the reference

Guides

How the pieces fit, remote GPU runs, and the schema contract.

Concepts · Cloud GPU

What you are installing

PhotonHub is three separable pieces. Knowing which one you are holding explains most of what follows.

Piece What it is Licence
SDK (import photonhub as ph) Pure-Python client: builds and validates the scene, prices it, runs it, loads results. Apache-2.0, public
Solver (phsolver) The compiled C++ FDTD engine that actually steps the fields. Proprietary, separately distributed
Cloud (ph.cloud) Client for remote GPU execution against a hosted service. Apache-2.0 client; the service is invitation-gated

A Simulation is the contract between them. The same object runs locally against a phsolver binary or remotely through ph.cloud, and returns the same RunResult structure either way. Comparing numerical results also requires matching engine revisions and settings. See Engine provenance.

Beta status

PhotonHub is in an invitation-gated beta. There is no uninvited public signup. The SDK requires Python 3.11 or newer and is published on PyPI (see Install; the public source mirror carries unreleased revisions). The solver binary is distributed to invited participants. Nothing on this site is a pricing, capacity, uptime, or availability commitment.

What the solver does

Three-dimensional finite-difference time-domain on a Yee grid, with:

  • Boundaries: CPML, adiabatic absorbers, periodic and Bloch (constant-k oblique incidence), PEC/PMC symmetry planes.
  • Materials: non-dispersive, Lorentz and Drude poles via ADE, anisotropic tensors, tabulated permittivity, and a built-in dispersive library of 20 materials.
  • Sources: point dipoles, plane waves, closed TF/SF boxes, guided-mode launches, focused Gaussian beams, and imported fields.
  • Subpixel smoothing: Kottke–Farjadpour–Johnson tensor averaging at material interfaces: exact and second-order on axis-aligned and waveguide walls; on curved 3-D bodies the current diagonal blend is an approximation (see Concepts).
  • Analysis: mode solvers, S-matrix assembly, EME, near-to-far-field projection, resonance extraction by harmonic inversion, and continuous adjoint inverse design.

The analysis layer is Python and ships in the SDK; see the analysis reference.

Need help? Use Troubleshooting, read Known limitations, or contact beta@leapfield.ai.