Author: A. M. Wojciechowski, Jagiellonian University, Krakow, Poland
A fluorescent emitter within a fraction of a wavelength of a glass surface sends most of its light into the glass, and a large part of it at angles beyond the critical angle. This supercritical-angle fluorescence (SAF) comes from the near field of the emitter: waves with an in-plane wavevector $k_\parallel > n_\mathrm{env} k_0$ cannot propagate in the environment, but become propagating waves in a denser medium. Conventional optical fibers (NA of 0.2 to 0.5) cannot guide it, so it is lost into the cladding.
A step-index fiber guides every wave with $k_\parallel \le \mathrm{NA}\,k_0$. If its numerical aperture exceeds the refractive index of the environment, $\mathrm{NA} > n_\mathrm{env}$, part of the supercritical band is guided as well. This notebook shows this for a nitrogen-vacancy (NV) center in a 140 nm nanodiamond on the facet of a fiber with a lead-bismuth-gallate glass core ($n_\mathrm{core} = 1.908$) and a borosilicate cladding ($n_\mathrm{clad} = 1.524$), i.e. $\mathrm{NA} = 1.149$, in air.
The simulations reproduce the results of A. M. Wojciechowski et al., "Supercritical light collection in ultra-high-numerical-aperture fiber bundles for wide-field quantum magnetic endoscopy" (in preparation; link to be added): $\beta = 0.48$ for the NA = 1.15 fiber in air, nine times more than for an NA = 0.5 fiber, and $\beta = 0.22$ in water, where $\mathrm{NA} < n_\mathrm{env}$.
What You Will Do¶
- Analytical model. A plane-wave (Lukosz-Kunz) calculation, which runs in seconds on a laptop, explains why an NA > 1 fiber helps and predicts the result of the 3D simulation. Doing this first is good practice: it tells you what the expensive simulation should give, so you can recognize a wrong setup.
- FDTD setup. A 3D finite-difference time-domain model of a dipole inside a nanodiamond touching the fiber facet. Each modeling choice is explained: how the fiber is terminated, how the mesh is refined, where the monitors are and why.
- Running or loading. The simulations run on the Tidy3D cloud and cost FlexCredits. You can instead load the published results. Mirror symmetry can cut the cost about fourfold.
- Analysis. Coupling efficiency $\beta$, emission-rate (Purcell) factor $F$, field maps and the momentum spectrum of the light entering the glass, each compared with the model.
- Variations. Water, a conventional fiber, and how to set up your own configuration.
Before You Start¶
-
Software: Tidy3D 2.11 or newer (the published data were written with 2.11.2; older versions cannot read them), which needs Python 3.10 to 3.14, plus NumPy, SciPy and Matplotlib. Running new simulations also needs a Tidy3D account and API key (
tidy3d configure --apikey=...); loading saved results does not. - Cost: the main configuration (two dipole orientations plus a small reference run) has about 270 million grid cells and 40 000 time steps per run. Always estimate the cost before starting.
- Units: Tidy3D uses micrometers for lengths and hertz for frequencies; this notebook follows that convention.
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import quad # numerical integration for the analytical model
import tidy3d as td # simulation objects: structures, sources, monitors, Simulation
from tidy3d import web # cloud interface: upload, cost estimate, run, download
trapz = getattr(np, "trapezoid", None) or np.trapz # trapezoidal rule (renamed in NumPy 2)
print("Tidy3D version:", td.__version__)
Tidy3D version: 2.12.2
Physical Parameters¶
- Wavelength. NV centers emit broadly between about 600 and 800 nm. We simulate at the center of this band, 700 nm. The capture changes by only a few percent across the band (Supplementary Information of the paper), because it relies on geometry, not on a resonance.
- Source bandwidth. FDTD runs in the time domain: the dipole is driven by a short Gaussian pulse, and the monitors Fourier-transform the fields at the frequencies we ask for. A pulse with a bandwidth of one tenth of the center frequency is short enough for the simulation to finish quickly and narrow enough that all quantities are well defined at 700 nm.
- Refractive indices. Core and cladding indices are the Sellmeier values of the two glasses at 700 nm. Dispersion is irrelevant at a single frequency, so constant (non-dispersive) media are used. The reference "conventional" fiber has NA = 0.5, typical of high-NA multimode fibers and earlier fiber bundles.
LAM0 = 0.70 # central wavelength (um), middle of the NV emission band
F0 = td.C_0 / LAM0 # corresponding frequency (Hz); td.C_0 is the speed of light in um/s
FWIDTH = F0 / 10 # Gaussian pulse bandwidth (Hz), about 70 nm in wavelength
N_CORE, N_CLAD = 1.908, 1.524 # NA > 1 fiber (Sellmeier values at 700 nm)
N_CORE_LOW, N_CLAD_LOW = 1.600, 1.520 # conventional reference fiber, NA = 0.50
N_ND = 2.4 # diamond
N_WATER = 1.333 # for the aqueous environment
# numerical aperture of a step-index fiber: NA = sqrt(n_core^2 - n_clad^2)
print(f"NA = {np.sqrt(N_CORE**2 - N_CLAD**2):.3f} (this fiber; 1.149 with the unrounded Sellmeier indices), "
f"{np.sqrt(N_CORE_LOW**2 - N_CLAD_LOW**2):.2f} (reference)")
NA = 1.148 (this fiber; 1.149 with the unrounded Sellmeier indices), 0.50 (reference)
Analytical Model: The Momentum-Space Picture¶
The key variable is the component of the wavevector parallel to the facet, written as a multiple of the free-space wavenumber: $q = k_\parallel/k_0$. A flat interface conserves $q$, so every plane wave keeps its $q$ when it crosses the facet and, in a straight step-index fiber, while it travels along the core. This lets us sort the emitted light by $q$:
- $q < n_\mathrm{env}$ (subcritical). These waves propagate in the environment as well as in the glass. They form the familiar cone of light inside the critical angle.
- $n_\mathrm{env} < q \le n_\mathrm{core}$ (supercritical, SAF). In the environment these waves are evanescent: they belong to the near field of the emitter and decay over a fraction of a wavelength, as $\exp(-2k_0 d\sqrt{q^2 - n_\mathrm{env}^2})$ for an emitter at distance $d$. Only if the emitter is close to the facet does the glass "catch" them and turn them into propagating waves beyond the critical angle. The boundary $q = n_\mathrm{env}$ is called the light line of the environment.
- Guiding. A ray inside the core with in-plane wavevector $q$ is totally reflected at the core-cladding boundary if $q \le \mathrm{NA}$. So the fiber keeps everything with $q \le \mathrm{NA}$ and loses the rest into the cladding.
Treating the fiber core as a half-space (its radius is many wavelengths), the fraction of the emitted power that ends up guided is
$$\eta_\mathrm{acc} = \frac{P_\mathrm{glass}(q \le \mathrm{NA})}{P_\mathrm{tot}},$$
where $P_\mathrm{tot}$ includes the power emitted back into the environment. If $\mathrm{NA} \le n_\mathrm{env}$, only subcritical light is guided. If $\mathrm{NA} > n_\mathrm{env}$, the acceptance reaches past the light line into the supercritical band, where (as the plot below shows) the emission into the glass is strongest.
The functions below implement the classical Lukosz-Kunz expressions for a dipole near a planar interface. They use reciprocity: the power a dipole sends into a given direction equals (up to constants) the field that a plane wave arriving from that direction produces at the dipole, which follows from the Fresnel coefficients. F is the total emission rate relative to the same dipole in the homogeneous environment; H is a dipole parallel to the facet (averaged over its azimuth), V a dipole perpendicular to it.
Orientation average. An NV center emits through two orthogonal dipoles perpendicular to its symmetry axis; in randomly oriented nanodiamonds this averages to an isotropic emitter, i.e. $(2H + V)/3$ for both the guided and the total power.
def dipole_spectrum(n_glass, d, lam=0.70, n_env=1.0):
"""Lukosz-Kunz model: dipole in a medium n_env at distance d (um) from a half-space n_glass.
Returns two functions of q = k_par/k0:
down(q) -> (dP_H/dq, dP_V/dq) into the glass, up(q) -> the same into the environment,
in units of the power P0 of the same dipole in the homogeneous environment.
H is averaged over the azimuth (horizontal dipole), V is the vertical dipole.
"""
k0d = 2 * np.pi * d / lam # dipole-interface distance in units of 1/k0
n1, n2 = n_env, n_glass
def kz(n, q):
# normal wavevector component (units of k0); imaginary for evanescent waves (q > n)
return np.sqrt(complex(n * n - q * q))
def down(q):
# emission into the glass, by reciprocity: field of a plane wave arriving from the glass at the dipole
k1, k2 = kz(n1, q), kz(n2, q)
ts = 2 * k2 / (k2 + k1) # Fresnel transmission glass -> environment, s
tp = 2 * n1 * n2 * k2 / (n1**2 * k2 + n2**2 * k1) # and p polarization (electric field)
decay = abs(np.exp(1j * k1 * k0d))**2 # 1 for q < n_env, near-field decay for q > n_env
V = abs(tp)**2 * (q / n1)**2 * decay
H = 0.5 * (abs(ts)**2 + abs(tp)**2 * abs(k1 / n1)**2) * decay
f = 0.75 * q / (n1 * k2.real) if k2.real > 0 else 0.0 # solid angle -> dq, normalized to P0
return f * H, f * V
def up(q):
# emission back into the environment: incident plus reflected wave at the dipole
k1, k2 = kz(n1, q), kz(n2, q)
rs = (k1 - k2) / (k1 + k2)
rp = (n2**2 * k1 - n1**2 * k2) / (n2**2 * k1 + n1**2 * k2)
e = np.exp(2j * k1 * k0d)
V = abs((q / n1) * (1 + rp * e))**2
H = 0.5 * (abs(1 + rs * e)**2 + abs((k1 / n1) * (1 - rp * e))**2)
f = 0.75 * q / (n1 * k1.real) if k1.real > 0 else 0.0
return f * H, f * V
return down, up
def capture(n_core, NA, d, lam=0.70, n_env=1.0):
"""Momentum-acceptance fraction eta_acc (guided power / total power) and total rate F = P_tot/P0
for H, V and orientation-averaged dipoles; guided = emission into the core with q <= NA."""
down, up = dipole_spectrum(n_core, d, lam, n_env)
def integ(fn, a, b, i):
if b <= a:
return 0.0
pts = [p for p in (n_env,) if a < p < b]
return quad(lambda q: fn(q)[i], a, b, points=pts or None, limit=500)[0]
out = {}
for i, lab in ((0, "H"), (1, "V")):
tot = integ(down, 0, n_core, i) + integ(up, 0, n_env, i)
out[lab] = (integ(down, 0, min(NA, n_core), i), tot)
acc = (2 * out["H"][0] + out["V"][0]) / 3
tot = (2 * out["H"][1] + out["V"][1]) / 3
return dict(eta_H=out["H"][0] / out["H"][1], eta_V=out["V"][0] / out["V"][1], eta=acc / tot,
F_H=out["H"][1], F_V=out["V"][1], F=tot)
def k_spectrum(x, y, Ex, Ey, Hx, Hy, lam=0.70, q_max=2.0, nbins=100, pad=2):
"""Axial Poynting flux per unit normalized in-plane wavevector q = k_par/k0, from tangential fields
sampled on a uniform (x, y) grid (um). Returns bin centres and dP/dq (same units as the flux).
Zero padding (pad) refines the k grid: for a window of width L the native spacing is dq = lam / L."""
dx, dy = x[1] - x[0], y[1] - y[0]
nx, ny = len(x) * pad, len(y) * pad
F = lambda a: np.fft.fftshift(np.fft.fft2(a, s=(nx, ny))) * dx * dy
eX, eY, hX, hY = F(Ex), F(Ey), F(Hx), F(Hy)
Sk = 0.5 * np.real(eX * np.conj(hY) - eY * np.conj(hX)) # flux density in k space
kx = np.fft.fftshift(np.fft.fftfreq(nx, dx)) * 2 * np.pi
ky = np.fft.fftshift(np.fft.fftfreq(ny, dy)) * 2 * np.pi
dk = (kx[1] - kx[0]) * (ky[1] - ky[0])
KX, KY = np.meshgrid(kx, ky, indexing="ij")
q = np.hypot(KX, KY) / (2 * np.pi / lam)
edges = np.linspace(0, q_max, nbins + 1)
P, _ = np.histogram(q, bins=edges, weights=Sk * dk / (2 * np.pi)**2) # Parseval
return 0.5 * (edges[1:] + edges[:-1]), P / np.diff(edges)
Check the model against the reference values of the paper (dipole at the center of a 140 nm nanodiamond, $d$ = 70 nm). The left plot shows the design rule: how the capture depends on the fiber NA, in air and in water. The right plot reproduces Fig. 1b of the paper: the power entering the glass per unit $q$, colored by what the NA = 1.15 fiber does with it.
# reference values used in the paper (d = 70 nm: dipole at the center of a 140 nm nanodiamond)
for label, n, NA, env in [("NA 1.15, air", N_CORE, 1.149, 1.0), ("NA 1.15, water", N_CORE, 1.149, N_WATER),
("NA 0.50, air", N_CORE_LOW, 0.50, 1.0)]:
r = capture(n, NA, 0.07, n_env=env)
print(f"{label:15s} eta_acc = {r['eta']:.3f} (H {r['eta_H']:.3f}, V {r['eta_V']:.3f}), F = {r['F']:.2f}")
# left: design rule - capture versus NA for the same core glass, in air and in water
NAs = np.linspace(0.2, 1.9, 60)
fig, ax = plt.subplots(1, 2, figsize=(10, 3.6))
for env, ls in ((1.0, "-"), (N_WATER, "--")):
ax[0].plot(NAs, [capture(N_CORE, na, 0.07, n_env=env)["eta"] for na in NAs], ls, label=f"n_env = {env:g}")
ax[0].axvline(env, color="grey", lw=0.8, ls=ls) # NA = n_env: the acceptance reaches the light line
ax[0].set(xlabel="fiber NA", ylabel=r"$\eta_\mathrm{acc}$", title=r"$n_\mathrm{core}$ = 1.908, d = 70 nm")
ax[0].legend()
# right: emission into the glass per unit q, orientation average (2H + V)/3, in units of P0 (as in Fig. 1b)
q = np.linspace(0.001, N_CORE - 0.001, 800)
spec = lambda n, d: np.array([(2 * dipole_spectrum(n, d)[0](x)[0] + dipole_spectrum(n, d)[0](x)[1]) / 3 for x in q])
dP = spec(N_CORE, 1e-6) # dipole at the interface, d -> 0
ax[1].plot(q, dP, "k", label=f"d → 0 (F = {capture(N_CORE, N_CORE, 1e-6)['F']:.2f})")
ax[1].plot(q, spec(N_CORE, 0.07), "k--", lw=1, label="d = 70 nm")
q15 = q[q < 1.5]
ax[1].plot(q15, np.array([(2 * dipole_spectrum(1.5, 1e-6)[0](x)[0] + dipole_spectrum(1.5, 1e-6)[0](x)[1]) / 3 for x in q15]),
color="grey", label=f"glass n = 1.50, d → 0 (F = {capture(1.5, 1.5, 1e-6)['F']:.2f})")
ax[1].fill_between(q, dP, where=q <= 1, color="tab:green", alpha=0.3, label="guided, subcritical")
ax[1].fill_between(q, dP, where=(q > 1) & (q <= 1.149), color="tab:blue", alpha=0.3, label="guided, supercritical")
ax[1].fill_between(q, dP, where=q > 1.149, color="tab:orange", alpha=0.3, label="beyond the fiber cutoff")
ax[1].set(xlabel=r"$q = k_\parallel/k_0$", ylabel=r"$dP/dq$ ($P_0$)", title="orientation average, air (cf. Fig. 1b)")
ax[1].legend(fontsize=8)
plt.tight_layout(); plt.show()
NA 1.15, air eta_acc = 0.479 (H 0.453, V 0.509), F = 1.28 NA 1.15, water eta_acc = 0.212 (H 0.277, V 0.114), F = 1.11 NA 0.50, air eta_acc = 0.052 (H 0.086, V 0.008), F = 1.22
How to read the plots.
- Left: the capture rises steeply once the NA exceeds the index of the environment (vertical lines). Below that point, raising the NA only widens the acceptance within the subcritical cone. Above it, the acceptance reaches the strong supercritical band. In water ($n_\mathrm{env} = 1.33$) the same fiber stays below the light line and loses this advantage.
- Right: the sharp maximum at $q = 1$ is the light line of air. Everything to its right (blue and orange) is near-field light that only a medium denser than air can collect. The NA = 1.15 fiber guides the green and blue parts. The dashed curve shows that, 70 nm away from the facet, the supercritical part is already reduced, because the near field decays with distance.
Expected numbers: $\eta_\mathrm{acc} = 0.48$ (air), 0.21 (water), 0.05 (NA = 0.5). The FDTD simulation should come close to these if it is set up correctly.
FDTD Setup¶
The analytical model treats the core as a half-space and the emitter as a bare dipole. The 3D simulation tests both simplifications: a finite core embedded in a cladding, and a dipole inside a high-index nanodiamond that touches the facet.
Geometry¶
- Fiber for $z > 0$: a cylindrical core (radius 2.5 $\mu\text{m}$) inside a cladding that fills the rest of the half-space. The real core radius of the bundle is 5 $\mu\text{m}$; 2.5 $\mu\text{m}$ keeps the domain small and is still many wavelengths wide, so the fiber remains strongly multimode.
- The fiber runs through the PML. The perfectly matched layer (PML) absorbs outgoing waves at the edge of the domain. If the fiber ended inside the domain, its far facet would reflect part of the guided light back towards the dipole. That would form a weak cavity and falsify both the guided power and the emission rate. Extending the core and cladding into the PML (here, structures 20 times longer than the domain) makes the fiber effectively semi-infinite.
- Environment (air or water) for $z < 0$, set as the background medium of the simulation.
- Nanodiamond: a 140 nm sphere with $n = 2.4$ touching the facet. The NV center is a classical PointDipole on the fiber axis, either at the center of the particle ($d$ = 70 nm from the facet) or 10 nm from the facet (an NV close to the contact point).
Mesh¶
Tidy3D builds a non-uniform mesh automatically (GridSpec), here with at least 20 cells per wavelength in each material (about 15 nm in diamond). That is too coarse to resolve a 140 nm sphere and the steep near field of the dipole, so a MeshOverrideStructure refines the mesh around the nanodiamond to 8 nm (3 nm for $d$ = 10 nm, where the dipole sits close to the diamond-glass contact). Note the price: the time step of an FDTD simulation is set by its smallest cell (Courant stability condition), so a finer local mesh increases the number of time steps for the whole domain. Refining further (2 nm) changed the results by less than 0.1% in the paper, so these values are converged.
Monitors: What We Measure and Why¶
-
P_tot: net flux out of a closed box (0.4 $\mu\text{m}$) around the dipole and the nanodiamond, recorded by a FluxMonitor. In a lossless structure, all power emitted by the dipole must leave any closed surface around it, so this is the total emitted power. The box may cross the facet; only enclosing the source matters. -
P_core_z5,P_core_z10: flux through a square enclosing the core at $z$ = 5 and 10 $\mu\text{m}$ behind the facet. Light outside the fiber acceptance refracts out of the core into the cladding within a few micrometers, so at sufficient depth only guided light remains inside the square. This is the guided power. Comparing two depths checks that the value has converged (in the later runs of the paper also 14 $\mu\text{m}$). -
P_all_z...: flux through the whole cross-section at the same depths, for comparison. -
P_glass,xy_facet: flux and fields on a plane 0.3 $\mu\text{m}$ behind the facet: the total power entering the glass and, via a Fourier transform, its momentum spectrum, analyzed in Field Maps and Momentum Spectrum below. -
xz,xy_deep: FieldMonitor maps for visualization.
All monitors record frequency-domain fields at the center frequency $f_0$. Tidy3D normalizes them to the source spectrum, so ratios of fluxes from the same run are directly meaningful.
From these, the coupling efficiency is $\beta = P_\mathrm{core}/P_\mathrm{tot}$, the FDTD counterpart of $\eta_\mathrm{acc}$.
Dipole Orientations¶
For a dipole on the axis of a rotationally symmetric fiber, x and y orientations are equivalent. Two runs therefore suffice: horizontal (H, Ex) and vertical (V, Ez). The orientation average is $(2P_\mathrm{H} + P_\mathrm{V})/3$, taken separately for the guided and the total power before dividing.
def make_sim(pol="Ez", d=0.07, n_core=N_CORE, n_clad=N_CLAD, n_env=1.0, with_nd=True,
nd_diam=0.14, core_r=2.5, sim_xy=10.0, z_env=1.5, z_fiber=15.0,
guided_z=(5.0, 10.0, 14.0), deep_field_z=12.0, dl_fine=0.008, steps_per_wvl=20):
"""Dipole at the facet of a step-index fiber.
Coordinates: facet at z = 0, fiber for z > 0 (passing through the +z PML), environment for z < 0,
dipole at (0, 0, -d) on the fiber axis.
pol dipole orientation: "Ex" (horizontal) or "Ez" (vertical)
d dipole-facet distance (um); with a nanodiamond it must lie inside it (0 < d <= nd_diam)
n_core/clad fiber indices; None = same as the environment (no fiber, e.g. for the Purcell reference)
n_env environment index (1.0 air, 1.333 water)
with_nd include the nanodiamond sphere (n = 2.4) touching the facet
sim_xy lateral size of the domain (um); z_env, z_fiber: extent below and above the facet
guided_z depths (um) of the guided-power monitors
dl_fine cell size (um) of the local mesh around the nanodiamond
"""
n_core = n_env if n_core is None else n_core
n_clad = n_env if n_clad is None else n_clad
if with_nd and not 0 < d <= nd_diam:
raise ValueError("with a nanodiamond the dipole must lie inside it (0 < d <= nd_diam)")
zmin, zmax = -z_env, z_fiber
big = 20.0 * (zmax - zmin) # much longer than the domain -> runs through the PML
# --- structures: cladding half-space, core cylinder (later structures override earlier ones), nanodiamond
structures = [
td.Structure(geometry=td.Box(center=(0, 0, big / 2), size=(td.inf, td.inf, big)),
medium=td.Medium(permittivity=n_clad**2, name="clad"), name="clad"),
td.Structure(geometry=td.Cylinder(center=(0, 0, big / 2), radius=core_r, length=big, axis=2),
medium=td.Medium(permittivity=n_core**2, name="core"), name="core"),
]
refine_center = (0, 0, -d)
if with_nd:
structures.append(td.Structure(geometry=td.Sphere(center=(0, 0, -nd_diam / 2), radius=nd_diam / 2),
medium=td.Medium(permittivity=N_ND**2, name="diamond"), name="nd"))
refine_center = (0, 0, -nd_diam / 2)
# --- local mesh refinement around the nanodiamond (the automatic mesh is too coarse there)
refine = td.MeshOverrideStructure(geometry=td.Box(center=refine_center, size=(0.3, 0.3, 0.3)),
dl=(dl_fine, dl_fine, dl_fine))
# --- source: classical point dipole (the NV center), driven by a Gaussian pulse centered at 700 nm
source = td.PointDipole(center=(0, 0, -d), polarization=pol, name="dipole",
source_time=td.GaussianPulse(freq0=F0, fwidth=FWIDTH))
# --- monitors (frequency domain, at f0)
box = 0.40 # closed box around the dipole and the nanodiamond
monitors = [
td.FluxMonitor(center=(0, 0, -d), size=(box, box, box), freqs=[F0], name="P_tot"), # total emitted power
td.FluxMonitor(center=(0, 0, 0.3), size=(sim_xy, sim_xy, 0), freqs=[F0], name="P_glass"), # power into the glass
td.FieldMonitor(center=(0, 0, (zmin + zmax) / 2), size=(sim_xy, 0, zmax - zmin), freqs=[F0], name="xz"),
td.FieldMonitor(center=(0, 0, 0.3), size=(sim_xy, sim_xy, 0), freqs=[F0], name="xy_facet"), # k spectrum
]
if deep_field_z is not None and deep_field_z < z_fiber:
monitors.append(td.FieldMonitor(center=(0, 0, deep_field_z), size=(sim_xy, sim_xy, 0),
freqs=[F0], name="xy_deep"))
for z in guided_z: # guided power at several depths (convergence check)
monitors += [
td.FluxMonitor(center=(0, 0, z), size=(2 * core_r, 2 * core_r, 0), freqs=[F0], name=f"P_core_z{z:g}"),
td.FluxMonitor(center=(0, 0, z), size=(sim_xy, sim_xy, 0), freqs=[F0], name=f"P_all_z{z:g}"),
]
return td.Simulation(
center=(0, 0, (zmin + zmax) / 2),
size=(sim_xy, sim_xy, zmax - zmin),
medium=td.Medium(permittivity=n_env**2, name="environment"), # background = environment
structures=structures,
sources=[source],
monitors=monitors,
grid_spec=td.GridSpec.auto(min_steps_per_wvl=steps_per_wvl, wavelength=LAM0,
override_structures=[refine]),
boundary_spec=td.BoundarySpec.all_sides(boundary=td.PML()), # absorbing boundaries on all sides
run_time=6e-13, # upper limit (s): several transit times of guided light through 15 um of core
shutoff=1e-6, # stop earlier, once the field energy has decayed to 1e-6 of its maximum
)
Always look at a simulation before running it. The next cell builds the main configuration and plots it. Check that
- the core (dark blue) and the cladding (light blue) fill the domain above the facet and reach its top edge, where they continue into the PML,
- the nanodiamond (pink) touches the facet at $z = 0$ and the dipole (red arrow) sits inside it,
- the local mesh (gray lines, right plot) resolves the sphere with many cells,
- the flux monitors (green: the box around the dipole and the planes in the fiber) are where you expect them.
The figure is drawn from the Simulation object itself (its structures, monitors, source and grid), so it shows what will be simulated. Tidy3D's built-in sim.plot(y=0) gives the same view in its own colors and also marks the PML; use it to check that no monitor lies inside the PML.
Tidy3D also prints validation warnings when the simulation is built; read them. The printed number of cells and time steps is what the cost scales with.
# --- plotting helpers: the model drawn with matplotlib (colors chosen for clarity) ---
from matplotlib.patches import Rectangle, Circle, FancyArrowPatch
COLORS = dict(env_air="white", env_water="#eaf5fb", clad="#cfe3f5", core="#5b9bd5", diamond="#f4a6c8",
monitor="#2ca02c", dipole="#d62728", mesh="black")
def plot_setup(sim, ax, xlim=None, zlim=None, mesh=False, labels=True):
# cross-section y = 0 of the fiber model, drawn with matplotlib patches
(x0, _, z0), (x1, _, z1) = sim.bounds
xlim = xlim or (x0, x1)
zlim = zlim or (z0, z1)
n_env = sim.medium.permittivity ** 0.5
ax.add_patch(Rectangle((x0, z0), x1 - x0, z1 - z0, color=COLORS["env_air"] if n_env < 1.01 else COLORS["env_water"], zorder=0))
st = {s.name: s for s in sim.structures}
clad_n = st["clad"].medium.permittivity ** 0.5
if abs(clad_n - n_env) > 1e-6: # a fiber is present
ax.add_patch(Rectangle((x0, 0), x1 - x0, z1, color=COLORS["clad"], zorder=1))
r = st["core"].geometry.radius
ax.add_patch(Rectangle((-r, 0), 2 * r, z1, color=COLORS["core"], zorder=2))
ax.axhline(0, color="0.3", lw=0.6, zorder=3)
if "nd" in st:
g = st["nd"].geometry
ax.add_patch(Circle((g.center[0], g.center[2]), g.radius, facecolor=COLORS["diamond"], edgecolor="#c2185b",
lw=0.8, zorder=4))
if mesh: # grid lines of the FDTD mesh
b = sim.grid.boundaries
for xv in b.x:
if xlim[0] <= xv <= xlim[1]:
ax.plot([xv, xv], zlim, color=COLORS["mesh"], lw=0.3, alpha=0.35, zorder=5)
for zv in b.z:
if zlim[0] <= zv <= zlim[1]:
ax.plot(xlim, [zv, zv], color=COLORS["mesh"], lw=0.3, alpha=0.35, zorder=5)
for m in sim.monitors: # monitors in the plane y = 0
(cx, cy, cz), (sx, sy, sz) = m.center, m.size
if sy == 0: # the x-z field monitor itself
continue
if sz == 0: # planes normal to z
full = sx >= (x1 - x0) - 1e-9
is_flux = m.name.startswith("P_") # field monitors: dotted
ax.plot([cx - sx / 2, cx + sx / 2], [cz, cz], color=COLORS["monitor"], lw=0.8 if full else 2.0,
ls=("--" if is_flux else ":") if full else "-", zorder=6)
if labels and not full and xlim[1] - xlim[0] > 2:
ax.text(cx + sx / 2 + 0.1, cz, m.name, color=COLORS["monitor"], fontsize=7, va="center", zorder=7)
else: # closed flux box
ax.add_patch(Rectangle((cx - sx / 2, cz - sz / 2), sx, sz, fill=False, edgecolor=COLORS["monitor"],
lw=1.2, zorder=6))
src = sim.sources[0] # the dipole
L = 0.08 * (zlim[1] - zlim[0])
dx, dz = {"Ex": (L, 0), "Ey": (0, 0), "Ez": (0, L)}[src.polarization]
x, z = src.center[0], src.center[2]
ax.add_patch(FancyArrowPatch((x - dx / 2, z - dz / 2), (x + dx / 2, z + dz / 2), arrowstyle="-|>",
mutation_scale=10, color=COLORS["dipole"], lw=1.5, zorder=8))
ax.plot(x, z, "o", color=COLORS["dipole"], ms=3, zorder=8)
ax.set(xlim=xlim, ylim=zlim, xlabel="x (um)", ylabel="z (um)", aspect="equal")
def setup_legend(ax, n_env=1.0):
from matplotlib.patches import Patch
from matplotlib.lines import Line2D
h = [Patch(facecolor=COLORS["core"], label="core"), Patch(facecolor=COLORS["clad"], label="cladding"),
Patch(facecolor=COLORS["env_air"] if n_env < 1.01 else COLORS["env_water"], edgecolor="0.6",
label="air" if n_env < 1.01 else "water"),
Patch(facecolor=COLORS["diamond"], edgecolor="#c2185b", label="nanodiamond"),
Line2D([], [], color=COLORS["monitor"], lw=2, label="flux monitors"),
Line2D([], [], color=COLORS["dipole"], marker="o", ms=4, lw=1.5, label="dipole")]
ax.legend(handles=h, loc="center left", bbox_to_anchor=(1.02, 0.5), fontsize=8, frameon=False)
# The configuration behind the main result: NA 1.15 fiber in air, dipole at the center of the nanodiamond,
# horizontal and vertical orientation, plus the same nanodiamond without the fiber (Purcell reference).
# The reference needs no fiber, so a small domain suffices; a dipole at the centre of a sphere radiates
# the same for every orientation, so one orientation suffices.
NOFIBER = dict(n_core=None, n_clad=None, sim_xy=3.0, z_env=1.5, z_fiber=1.5, guided_z=(1.0,), deep_field_z=None)
sims = {
"highNA_air_d70_ND_Ex": make_sim("Ex", d=0.07),
"highNA_air_d70_ND_Ez": make_sim("Ez", d=0.07),
"ND_no_fibre_Ez": make_sim("Ez", d=0.07, **NOFIBER),
}
sim = sims["highNA_air_d70_ND_Ez"]
fig, ax = plt.subplots(1, 2, figsize=(11, 4.5))
plot_setup(sim, ax[0])
ax[0].set_title("model, cross-section y = 0\n(core and cladding continue into the PML)", fontsize=9)
plot_setup(sim, ax[1], xlim=(-0.3, 0.3), zlim=(-0.3, 0.3), mesh=True, labels=False)
ax[1].set_title("nanodiamond and local mesh", fontsize=9)
setup_legend(ax[1])
plt.tight_layout(); plt.show()
# Tidy3D's own view shows the structures exactly as the solver sees them, including the PML (hatched):
# sim.plot(y=0); sim.plot_grid(y=0)
for name, s in sims.items():
print(f"{name:24s} {s.num_cells / 1e6:6.1f} M cells, {s.num_time_steps} time steps")
highNA_air_d70_ND_Ex 269.4 M cells, 39927 time steps highNA_air_d70_ND_Ez 269.4 M cells, 39927 time steps ND_no_fibre_Ez 3.1 M cells, 39927 time steps
Running the Simulations or Loading Published Results¶
The simulations run on the Tidy3D cloud. The workflow is
- Batch collects the simulations into one job;
-
batch.estimate_cost()uploads them and returns the maximum cost in FlexCredits: uploading and estimating are free, nothing is run yet; -
batch.run(path_dir=...)starts the runs, waits for them and downloads the results as.hdf5files named after the tasks.
The estimate assumes the full run_time. The automatic shutoff usually stops the runs earlier, which lowers the final bill.
Loading instead of running. Set RUN_ON_SERVER = False and point DATA_DIR to a folder with the .hdf5 files (for example the data published with the paper). Each file is read with SimulationData.from_file, which needs a Tidy3D version at least as new as the one that wrote the file.
RUN_ON_SERVER = True # True: run the batch (costs FlexCredits); False: load downloaded results
DATA_DIR = "fdtd" # folder with <task name>.hdf5 files
if RUN_ON_SERVER:
batch = web.Batch(simulations=sims, folder_name="NA_gt_1_fiber") # folder name in your Tidy3D web account
batch.estimate_cost() # check this before continuing!
batch_data = batch.run(path_dir=DATA_DIR) # runs, waits, downloads
results = {name: batch_data[name] for name in sims}
else:
results = {name: td.SimulationData.from_file(f"{DATA_DIR}/{name}.hdf5") for name in sims}
17:03:28 -03 No Flexcredit cost for the whole batch as all simulations were restored from local cache.
Found all simulations in cache.
17:03:29 -03 WARNING: Warning messages were found in the solver log. For more information, check 'SimulationData.log' or use 'web.download_log(task_id)'.
Reducing the Cost with Mirror Symmetry¶
The runs of the paper were done without symmetry. For a dipole on the axis of the fiber, however, the structure is symmetric under the mirror planes $x = 0$ and $y = 0$, and so is the field of a dipole oriented along $x$ or $z$. Tidy3D can then compute only one quarter of the domain (the symmetry field of Simulation), which cuts the cost about fourfold. The sign of each symmetry follows the tangential electric field on the mirror plane: -1 (odd, "PEC") where it vanishes, +1 (even, "PMC") where it does not.
- x-dipole: $E_y$ and $E_z$ are odd in $x$, $E_x$ and $E_z$ are even in $y$, so
symmetry = (-1, 1, 0); - z-dipole: the field is even in both $x$ and $y$, so
symmetry = (1, 1, 0); - no symmetry along $z$ (fiber on one side, environment on the other).
An emitter off the axis (e.g. at $x = 2.3$ $\mu\text{m}$) keeps only the $y = 0$ plane. A wrong sign gives wrong results without an error message, so compare one symmetric run with a full one (e.g. with the data loaded above) before using symmetry for a whole batch. Field monitors still return the full cross-sections.
SYMMETRY = {"Ex": (-1, 1, 0), "Ey": (1, -1, 0), "Ez": (1, 1, 0)} # dipole on the fiber axis
# updated_copy returns a new Simulation with one field changed; the original stays untouched
sims_sym = {name: s.updated_copy(symmetry=SYMMETRY[name[-2:]]) for name, s in sims.items()}
def grid_points(s):
try:
return s.num_computational_grid_points # accounts for symmetry
except AttributeError:
return s.num_cells
for name in sims:
print(f"{name:24s} full: {grid_points(sims[name]) / 1e6:6.1f} M with symmetry: {grid_points(sims_sym[name]) / 1e6:6.1f} M")
if RUN_ON_SERVER:
# check the signs on one configuration before using symmetry everywhere
test = web.run(sims_sym["highNA_air_d70_ND_Ex"], task_name="highNA_air_d70_ND_Ex_sym", path=f"{DATA_DIR}/sym_test.hdf5")
beta = lambda sd: float(np.squeeze(sd["P_core_z10"].flux.values / sd["P_tot"].flux.values))
print(f"beta_H with symmetry: {beta(test):.4f} without: {beta(results['highNA_air_d70_ND_Ex']):.4f}")
highNA_air_d70_ND_Ex full: 272.0 M with symmetry: 68.5 M highNA_air_d70_ND_Ez full: 272.0 M with symmetry: 68.5 M ND_no_fibre_Ez full: 3.2 M with symmetry: 0.8 M
17:03:31 -03 Created task 'highNA_air_d70_ND_Ex_sym' with resource_id 'fdve-002d058e-2a5c-4c42-9a9f-05c82254f6fc' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId=fdve-002d058e-2a5 c-4c42-9a9f-05c82254f6fc'.
Task folder: 'default'.
17:03:35 -03 Estimated FlexCredit cost: 0.815. This assumes the FDTD solver runs for the full simulation time; if early shutoff is reached, the billed cost can be lower. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
17:03:37 -03 status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
17:03:52 -03 starting up solver
running solver
17:06:15 -03 early shutoff detected at 25%, exiting.
17:06:16 -03 status = postprocess
17:06:20 -03 status = success
17:06:22 -03 View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId=fdve-002d058e-2a5 c-4c42-9a9f-05c82254f6fc'.
17:06:27 -03 Loading results from fdtd/sym_test.hdf5
beta_H with symmetry: 0.4570 without: 0.4570
Coupling Efficiency and Emission Rate¶
Each monitor in the results is accessed by its name, e.g. sim_data["P_tot"].flux, which returns the flux at the monitor frequency. From these:
- Coupling efficiency $\beta = P_\mathrm{core}/P_\mathrm{tot}$ for each orientation, and the orientation average $(2P_\mathrm{core,H} + P_\mathrm{core,V})/(2P_\mathrm{tot,H} + P_\mathrm{tot,V})$.
- Convergence with depth. If $\beta$ at 5 and 10 $\mu\text{m}$ differs by more than a few percent, unguided light is still inside the core region at 5 $\mu\text{m}$ and the fiber section must be longer.
- Emission-rate (Purcell) factor $F = P_\mathrm{tot}/P_\mathrm{tot,ref}$, where the reference is the same nanodiamond without the fiber. The nanodiamond itself already changes the emission of the dipole (a dipole inside a high-index sphere radiates differently from one in air); dividing by this reference isolates the effect of the fiber. The reference run uses the same local mesh, so discretization errors largely cancel.
def flux(sim_data, name):
# flux recorded by a FluxMonitor at its (single) frequency, as a plain number
return float(np.squeeze(sim_data[name].flux.values))
def coupling(sim_data, z=10.0):
# total power, power entering the glass, guided power at depth z, and beta for one orientation
p_tot = flux(sim_data, "P_tot")
return dict(P_tot=p_tot, P_glass=flux(sim_data, "P_glass"), P_core=flux(sim_data, f"P_core_z{z:g}"),
beta=flux(sim_data, f"P_core_z{z:g}") / p_tot)
H, V = results["highNA_air_d70_ND_Ex"], results["highNA_air_d70_ND_Ez"]
# convergence: beta at every depth that was recorded in these data
z_planes = sorted(float(k[len("P_core_z"):]) for k in H.monitor_data if k.startswith("P_core_z"))
for z in z_planes:
cH, cV = coupling(H, z), coupling(V, z)
beta = (2 * cH["P_core"] + cV["P_core"]) / (2 * cH["P_tot"] + cV["P_tot"])
print(f"z = {z:4.1f} um: beta_H = {cH['beta']:.3f} beta_V = {cV['beta']:.3f} beta (average) = {beta:.3f}")
# emission rate relative to the same nanodiamond without the fiber
p_ref = flux(results["ND_no_fibre_Ez"], "P_tot")
cH, cV = coupling(H), coupling(V)
print(f"\nPurcell factor relative to the nanodiamond without the fiber: F_H = {cH['P_tot'] / p_ref:.2f}, "
f"F_V = {cV['P_tot'] / p_ref:.2f}, average = {(2 * cH['P_tot'] + cV['P_tot']) / (3 * p_ref):.2f}")
# the analytical prediction for comparison (bare dipole, no nanodiamond)
model = capture(N_CORE, 1.149, 0.07)
print(f"analytical model (bare dipole, d = 70 nm): eta_acc = {model['eta']:.3f} "
f"(H {model['eta_H']:.3f}, V {model['eta_V']:.3f})")
z = 5.0 um: beta_H = 0.464 beta_V = 0.495 beta (average) = 0.480 z = 10.0 um: beta_H = 0.457 beta_V = 0.498 beta (average) = 0.478 z = 14.0 um: beta_H = 0.436 beta_V = 0.484 beta (average) = 0.460 Purcell factor relative to the nanodiamond without the fiber: F_H = 1.18, F_V = 2.48, average = 1.61 analytical model (bare dipole, d = 70 nm): eta_acc = 0.479 (H 0.453, V 0.509)
What to expect (values of the paper): $\beta_\mathrm{H} = 0.457$, $\beta_\mathrm{V} = 0.498$, orientation average 0.478, equal to the analytical $\eta_\mathrm{acc}$, and $F_\mathrm{V} = 2.48$, $F = 1.61$ on average.
Interpretation. The nanodiamond hardly changes the capture: a dipole inside a sphere much smaller than the wavelength radiates outside it much like a dipole at its center, so the half-space model applies. The vertical dipole, which radiates mostly sideways and is nearly invisible to conventional optics, is captured best: its emission is concentrated near the light line, exactly where the NA > 1 fiber extends its acceptance. Its emission rate is also enhanced most, because the dense glass offers it more optical states to radiate into.
Field Maps and Momentum Spectrum¶
Field maps. The cross-section through the fiber axis shows the intensity $|E|^2$ on a logarithmic (dB) scale, normalized to the brightest point inside the fiber (the field at the dipole itself is singular and would saturate the scale). Look for
- light confined between the core boundaries (dashed lines) and traveling upward: the guided part;
- beams leaving the core at oblique angles into the cladding: light beyond the fiber cutoff ($q > \mathrm{NA}$);
- the weak emission back into air below the facet.
def field_intensity_xz(sim_data, name="xz"):
# |E|^2 on the x-z monitor; the monitor stores each component on the simulation grid
m = sim_data[name]
comps = [getattr(m, c).isel(f=0).squeeze() for c in ("Ex", "Ey", "Ez")] # drop the frequency and y axes
I = sum(abs(c.values)**2 for c in comps)
return comps[0].x.values, comps[0].z.values, I
fig, ax = plt.subplots(1, 2, figsize=(9, 5))
for a, (lab, data) in zip(ax, (("horizontal (x)", H), ("vertical (z)", V))):
x, z, I = field_intensity_xz(data)
ref = I[:, z > 0.5].max() # normalize to the brightest point inside the fiber, not at the dipole
im = a.pcolormesh(x, z, 10 * np.log10(I.T / ref), vmin=-30, vmax=0, cmap="magma", shading="auto")
a.axvline(-2.5, color="w", ls="--", lw=0.7); a.axvline(2.5, color="w", ls="--", lw=0.7) # core boundary
a.axhline(0, color="w", lw=0.7) # facet
a.set(xlabel="x (um)", ylabel="z (um)", title=f"{lab} dipole, d = 70 nm", aspect="equal")
fig.colorbar(im, ax=ax, label="|E|^2 (dB, relative to the maximum in the fiber)")
plt.show()
Momentum spectrum. To see which $q$ the light entering the glass carries, we decompose the field on the plane 0.3 $\mu\text{m}$ behind the facet into plane waves:
- interpolate the tangential fields $E_x, E_y, H_x, H_y$ onto a uniform grid (the simulation grid is non-uniform because of the local refinement);
- Fourier-transform them in $x$ and $y$ (zero-padded to refine the $k$ grid; the native spacing is $\Delta q = \lambda/L$ for a window of width $L$);
- compute the axial Poynting flux of each plane-wave component, $S_z(k_x, k_y) = \tfrac{1}{2}\mathrm{Re}(E_x H_y^* - E_y H_x^*)$;
- sum it in rings of constant $|k_\parallel|$ to obtain $dP/dq$.
By Parseval's theorem the integral of $dP/dq$ equals the flux through the plane. Each curve is normalized to unit area, so the shapes of FDTD and model can be compared directly.
def tangential_fields(sim_data, name="xy_facet", n=512):
# tangential E and H on a uniform n x n grid (the monitor grid is non-uniform near the refinement);
# real and imaginary parts are interpolated separately
m = sim_data[name]
x0 = m.Ex.x.values
xs = np.linspace(x0.min(), x0.max(), n, endpoint=False)
out = []
for c in ("Ex", "Ey", "Hx", "Hy"):
a = getattr(m, c).isel(f=0).squeeze()
re = a.real.interp(x=xs, y=xs).values
im = a.imag.interp(x=xs, y=xs).values
out.append(np.nan_to_num(re + 1j * im))
return xs, xs, out
fig, ax = plt.subplots(figsize=(6, 4))
for lab, data, col in (("H", H, "tab:blue"), ("V", V, "tab:purple")):
x, y, (Ex, Ey, Hx, Hy) = tangential_fields(data)
q, dPdq = k_spectrum(x, y, Ex, Ey, Hx, Hy, LAM0, q_max=2.0, nbins=40)
ax.step(q, dPdq / trapz(dPdq, q), where="mid", color=col, label=f"FDTD, {lab}")
down, _ = dipole_spectrum(N_CORE, 0.07) # the model for the same distance
qq = np.linspace(0.001, N_CORE - 0.001, 800)
for i, (lab, col) in enumerate((("H", "tab:blue"), ("V", "tab:purple"))):
m = np.array([down(v)[i] for v in qq])
ax.plot(qq, m / trapz(m, qq), "--", color=col, label=f"model, {lab}")
ax.axvspan(0, 1, color="tab:green", alpha=0.12); ax.axvspan(1, 1.149, color="tab:blue", alpha=0.12)
ax.axvspan(1.149, 2.0, color="tab:orange", alpha=0.12)
ax.set(xlabel=r"$q = k_\parallel/k_0$", ylabel=r"$dP/dq$ (normalized)", xlim=(0, 2))
ax.legend(); plt.show()
How to read it. The FDTD histograms follow the model, including the sharp maximum of the vertical dipole at the light line $q = 1$. The green band is guided by any fiber with NA $\ge$ 1, the blue band only because NA > 1, and the orange part lies beyond the fiber cutoff and leaks into the cladding (the oblique beams in the field maps above). The agreement confirms that the momentum-space picture of the analytical model describes the full 3D problem.
Other Configurations¶
The paper compares the following runs. Each configuration needs the Ex and Ez orientations; the planar substrate is used only for a field map, and the Purcell references only need the orientations listed.
| configuration | $\beta$ (FDTD) | $\eta_\mathrm{acc}$ (model) | $F$ (FDTD, average) |
|---|---|---|---|
| NA 1.15, air, d = 70 nm | 0.478 | 0.478 | 1.61 |
| NA 0.50, air, d = 70 nm | 0.053 | 0.052 | 1.44 |
| NA 1.15, water, d = 70 nm | 0.220 | 0.212 | 1.19 |
| NA 1.15, air, d = 10 nm | 0.30 to 0.36 | 0.352 | 4.22 |
- NA = 0.5 fiber: captures only part of the subcritical cone and almost nothing from the vertical dipole ($\beta_\mathrm{V} \approx 0.01$).
- Water: the light line moves to $q = 1.33$, beyond the fiber NA. The acceptance window then contains only light that also propagates in water; the near-field advantage disappears and $\beta$ drops below half.
- $d$ = 10 nm: the near field at the facet is stronger: the emission rate is four times that of the nanodiamond without the fiber, but more of the light lies beyond the cutoff, so $\beta$ decreases. The runs need a 3 nm mesh and are the most expensive, so estimate the cost first.
The cell below defines all configurations in one dictionary and builds the requested ones. With RUN_ON_SERVER = False it loads the water and NA = 0.5 results and prints $\beta$ and $F$.
# name: keyword arguments of make_sim (plus "pols" if not both orientations are needed)
RUNS = {
"highNA_air_d70_ND": dict(d=0.07),
"highNA_air_d70_noND": dict(d=0.07, with_nd=False), # bare dipole: direct test of the model
"highNA_air_d10_ND": dict(d=0.01, dl_fine=0.003), # shallow NV: 3 nm mesh
"highNA_water_d70_ND": dict(d=0.07, n_env=N_WATER),
"lowNA_air_d70_ND": dict(d=0.07, n_core=N_CORE_LOW, n_clad=N_CLAD_LOW),
"planar_air_d70_ND": dict(d=0.07, n_clad=N_CORE, pols=("Ez",)), # core = cladding: no guiding, map only
"ND_no_fibre": dict(d=0.07, pols=("Ez",), **NOFIBER), # Purcell references
"ND_no_fibre_water": dict(d=0.07, n_env=N_WATER, pols=("Ez",), **NOFIBER),
"ND_no_fibre_d10": dict(d=0.01, dl_fine=0.003, **NOFIBER), # off-center dipole: Ex and Ez needed
}
def build_all(runs=RUNS, pols=("Ex", "Ez"), only=None):
# one Simulation per configuration and orientation, named "<configuration>_<orientation>"
sims = {}
for name, kw in runs.items():
if only is not None and name not in only:
continue
kw = dict(kw)
for pol in kw.pop("pols", pols):
sims[f"{name}_{pol}"] = make_sim(pol=pol, **kw)
return sims
all_sims = build_all(only=["lowNA_air_d70_ND", "highNA_water_d70_ND", "ND_no_fibre_water"])
if RUN_ON_SERVER:
batch_all = web.Batch(simulations=all_sims, folder_name="NA_gt_1_fiber_more")
batch_all.estimate_cost()
# data_all = batch_all.run(path_dir=DATA_DIR)
else:
data_all = {name: td.SimulationData.from_file(f"{DATA_DIR}/{name}.hdf5") for name in all_sims}
for cfg, ref in (("lowNA_air_d70_ND", "ND_no_fibre"), ("highNA_water_d70_ND", "ND_no_fibre_water")):
h, v = coupling(data_all[f"{cfg}_Ex"]), coupling(data_all[f"{cfg}_Ez"])
beta = (2 * h["P_core"] + v["P_core"]) / (2 * h["P_tot"] + v["P_tot"])
p_ref = flux(data_all[f"{ref}_Ez"], "P_tot") if f"{ref}_Ez" in data_all else flux(results["ND_no_fibre_Ez"], "P_tot")
print(f"{cfg:22s} beta_H = {h['beta']:.3f} beta_V = {v['beta']:.3f} beta = {beta:.3f} "
f"F = {(2 * h['P_tot'] + v['P_tot']) / (3 * p_ref):.2f}")
17:07:59 -03 Maximum FlexCredit cost: 11.074 for the whole batch.
Your Own Configuration¶
The analytical model is the cheapest way to explore a design; run FDTD only to confirm the most interesting case. As an example, consider the same core glass with a low-index polymer cladding ($n \approx 1.30$, e.g. an amorphous fluoropolymer), which raises the NA to about 1.40, above the index of water. The model predicts whether this restores the near-field gain in water; the FDTD simulation is then one call of make_sim.
n_clad_new = 1.30
NA_new = np.sqrt(N_CORE**2 - n_clad_new**2)
for env in (1.0, N_WATER):
old, new = capture(N_CORE, 1.149, 0.07, n_env=env), capture(N_CORE, NA_new, 0.07, n_env=env)
print(f"n_env = {env:5.3f}: eta_acc = {old['eta']:.3f} (NA 1.15) -> {new['eta']:.3f} (NA {NA_new:.2f})")
# the corresponding FDTD setup (not run here): water, polymer cladding, both orientations
my_sims = {f"polyclad_water_d70_ND_{p}": make_sim(p, d=0.07, n_clad=n_clad_new, n_env=N_WATER) for p in ("Ex", "Ez")}
# web.Batch(simulations=my_sims, folder_name="NA_gt_1_fiber_polyclad").estimate_cost()
n_env = 1.000: eta_acc = 0.479 (NA 1.15) -> 0.636 (NA 1.40) n_env = 1.333: eta_acc = 0.212 (NA 1.15) -> 0.452 (NA 1.40)
Common Pitfalls¶
- A fiber that ends inside the domain reflects guided light back to the emitter and distorts both $\beta$ and $F$. Let the fiber run through the PML.
- Too coarse a mesh around the emitter misrepresents the near field, which is exactly the part this problem is about. Refine locally and check convergence by refining once more.
- A flux box that does not enclose the source (or the whole nanodiamond) does not measure the emitted power.
- Guided power measured too close to the facet still contains unguided light. Compare two or more depths.
- Monitors inside the PML give meaningless results; Tidy3D warns about this.
- Wrong symmetry signs give wrong results without an error. Test one case against a full simulation.
- Version mismatch: results saved with a newer Tidy3D cannot be loaded with an older one; upgrade the client.
Summary¶
- A fiber with $\mathrm{NA} > n_\mathrm{env}$ guides part of the supercritical (near-field) emission of a nanoscale emitter on its facet, without any resonant structure: $\beta \approx 0.48$ for NA = 1.15 in air, against 0.05 for NA = 0.5.
- The half-space (Lukosz-Kunz) model predicts $\beta$ within a few percent; the core index sets how much light enters the glass, the NA how much of it stays guided.
- In water ($n_\mathrm{env} = 1.33 > \mathrm{NA}$) the advantage disappears; near-field capture then requires NA > 1.33.
References
- W. Lukosz and R. E. Kunz, J. Opt. Soc. Am. 67, 1607 (1977); 67, 1615 (1977); W. Lukosz, J. Opt. Soc. Am. 69, 1495 (1979).
- A. W. Snyder and J. D. Love, Optical Waveguide Theory (Chapman and Hall, 1983).
- A. M. Wojciechowski et al., "Supercritical light collection in ultra-high-numerical-aperture fiber bundles for wide-field quantum magnetic endoscopy" (in preparation; link and DOI to be added).