Plasmonic metalens on the end face of a single-mode fiber#
Focusing light at the tip of an optical fiber, without any bulk optics, is a recurring need in optical trapping and fiber-based sensing. Zeisberger et al., Plasmonic Metalens-Enhanced Single-Mode Fibers: A Pathway Toward Remote Light Focusing, Adv. Photonics Res. 2, 2100100 (2021), demonstrated this with a plasmonic metalens written by electron beam lithography directly on the end face of a commercial single-mode step-index fiber (Nufern 630-HP). The device has three parts:
the single-mode fiber, carrying the fundamental mode at \(\lambda = 650\) nm (mode field diameter about 5 \(\mu\text{m}\));
a 420 \(\mu\text{m}\) long coreless silica spacer spliced to the fiber, where the mode expands freely as a Gaussian beam to a \(1/e^2\) diameter of 48 \(\mu\text{m}\);
the metalens: a gold film with about 5000 nanoslots (140 nm by 60 nm, pitch 250 nm) arranged on a square lattice inside a 20 \(\mu\text{m}\) diameter circle.
Each nanoslot acts as a dipole antenna that transmits the field polarized along its short axis and blocks the field polarized along its long axis. Rotating the slot by an angle \(\beta(r)\) imprints a geometric (Pancharatnam-Berry) phase \(2\beta\) on the cross-polarized circular component of the transmitted light. Choosing \(\beta(r) = \Delta\Phi(r)/2\) with the hyperbolic lens phase \(\Delta\Phi(r) = \frac{2\pi}{\lambda}\left[f - \sqrt{r^2 + f^2}\right]\) turns the array into a lens with focal length \(f = 30\) \(\mu\text{m}\) and numerical aperture \(\mathrm{NA} = \sin(\arctan(D/2f)) = 0.32\). The authors measured the focal spot with a scanning near-field microscope and found a focus at \(z \approx 30\) \(\mu\text{m}\) with NA close to 0.3, in agreement with their design.
In this notebook we reproduce the two simulation steps of the paper with Tidy3D:
Nanoslot unit cell. The transmission spectra of a single slot in a periodic lattice for light polarized along the short (\(T_S\)) and long (\(T_L\)) axes, and their ratio \(\Delta T = T_S / T_L\) (Figure 2b,c of the paper). The paper reports \(T_S = 0.332\), \(T_L = 0.036\) and \(\Delta T = 9.1\) at 650 nm.
Full metalens. The complete 20 \(\mu\text{m}\) lens with all its nanoslots, illuminated by the expanded Gaussian beam coming from the silica spacer, with the focal spot and the intensity distribution around the focus obtained by projecting the near fields above the gold film (Figures 5 and 6 of the paper).
The paper could not simulate the full lens with a finite-element solver and resorted to an approximate model of independent dipoles. Here the full device is simulated rigorously with FDTD.

Setup#
[1]:
import numpy as np
import matplotlib.pyplot as plt
import tidy3d as td
from tidy3d import web
nm = 1e-3 # 1 nm in Tidy3D units (um)
wavelength = 650 * nm
freq0 = td.C_0 / wavelength
# materials: Johnson & Christy gold from the material library, lossless silica
au = td.material_library["Au"]["JohnsonChristy1972"]
sio2 = td.Medium(permittivity=1.46**2)
air = td.Medium(permittivity=1.0)
# nanoslot geometry (paper: L = 140 nm, B = 60 nm, pitch = 250 nm)
L_slot = 140 * nm
B_slot = 60 * nm
d_au = 60 * nm
pitch = 250 * nm
rc_slot = 20 * nm # corner radius of the slot
folder_name = "FiberMetalens"
Nanoslot Unit Cell: Transmission Spectra (Figure 2b,c)#
The first step is the response of a single nanoslot in a periodic lattice. The slot is a rounded rectangle of 140 nm by 60 nm cut through a free-standing gold film, simulated in a periodic cell of 350 nm with a PlaneWave at normal incidence. Two simulations are needed, one for each linear polarization: \(T_L\) for the electric field along the long axis of the slot and \(T_S\) for the field along the short axis. The transmitted power is recorded with a DiffractionMonitor, whose power is normalized to the incident wave, and FieldMonitor objects record the fields at 650 nm in the propagation plane and in the plane of the film.
The plasmonic resonance of the slot is sensitive to the discretization of the metal, so a MeshOverrideStructure imposes a uniform grid of 1.25 nm in the plane and 0.5 nm across the film thickness. These values were verified by a convergence test.
[2]:
# spectral range of the unit cell study
lambdas = np.linspace(0.4, 0.8, 81)
freqs = td.C_0 / lambdas
freq_src = (freqs.max() + freqs.min()) / 2
fwidth_uc = (freqs.max() - freqs.min()) / 2
# unit-cell model: free-standing gold film in air (gold film 0 < z < d_uc), period pitch_uc
pitch_uc = 350 * nm
d_uc = 58 * nm
z_min, z_max = -0.8, 0.8
z_src = -0.5
z_mon_t = 0.5
gold_film = td.Structure(
geometry=td.Box.from_bounds(rmin=(-td.inf, -td.inf, 0), rmax=(td.inf, td.inf, d_uc)),
medium=au,
)
def slot_vertices(L, B, rc, n_arc=12):
# rounded rectangle L x B with corner radius rc, long axis along x
xc, yc = L / 2 - rc, B / 2 - rc
pts = []
for cx, cy, t0 in ((xc, yc, 0.0), (-xc, yc, np.pi / 2), (-xc, -yc, np.pi), (xc, -yc, 1.5 * np.pi)):
for t in np.linspace(t0, t0 + np.pi / 2, n_arc):
pts.append((cx + rc * np.cos(t), cy + rc * np.sin(t)))
return np.array(pts)
# the slot: long axis along x, filled with air
slot = td.Structure(
geometry=td.PolySlab(vertices=slot_vertices(L_slot, B_slot, rc_slot).tolist(), slab_bounds=(0, d_uc), axis=2),
medium=air,
)
# transmission through a diffraction monitor; sum of orders = power normalized to the incident wave
monitor_t = td.DiffractionMonitor(
center=(0, 0, z_mon_t), size=(td.inf, td.inf, 0), freqs=freqs, name="T", normal_dir="+"
)
# field monitors in the propagation plane (xz) and in the transverse plane (xy, mid-film)
monitor_xz = td.FieldMonitor(center=(0, 0, 0), size=(td.inf, 0, td.inf), freqs=[freq0], name="xz")
monitor_xy = td.FieldMonitor(
center=(0, 0, d_uc / 2), size=(td.inf, td.inf, 0), freqs=[freq0], name="xy"
)
# uniform cells in and around the gold film
dl_film = 1.25 * nm
dz_film = 0.5 * nm
mesh_film = td.MeshOverrideStructure(
geometry=td.Box.from_bounds(
rmin=(-td.inf, -td.inf, -50 * nm), rmax=(td.inf, td.inf, d_uc + 50 * nm)
),
dl=(dl_film, dl_film, dz_film),
)
def make_sim_unit_cell(pol_angle):
source = td.PlaneWave(
source_time=td.GaussianPulse(freq0=freq_src, fwidth=fwidth_uc),
center=(0, 0, z_src),
size=(td.inf, td.inf, 0),
direction="+",
pol_angle=pol_angle,
)
return td.Simulation(
center=(0, 0, (z_min + z_max) / 2),
size=(pitch_uc, pitch_uc, z_max - z_min),
structures=[gold_film, slot],
sources=[source],
monitors=[monitor_t, monitor_xz, monitor_xy],
grid_spec=td.GridSpec.auto(
wavelength=wavelength, min_steps_per_wvl=20, override_structures=[mesh_film]
),
boundary_spec=td.BoundarySpec(
x=td.Boundary.periodic(), y=td.Boundary.periodic(), z=td.Boundary.pml()
),
run_time=3e-13,
)
# E along x = long axis of the slot (T_L); E along y = short axis (T_S)
sim_L = make_sim_unit_cell(pol_angle=0)
sim_S = make_sim_unit_cell(pol_angle=np.pi / 2)
Visualize the unit cell and the grid across the film.
[3]:
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(15, 5))
sim_S.plot(z=d_uc / 2, ax=ax1)
sim_S.plot_grid(z=d_uc / 2, ax=ax1)
ax1.set_title("xy, mid-film, with grid")
sim_S.plot(y=0, ax=ax2)
ax2.set_title("xz")
sim_S.plot(y=0, ax=ax3)
sim_S.plot_grid(y=0, ax=ax3)
ax3.set_xlim(-pitch_uc / 2, pitch_uc / 2)
ax3.set_ylim(-0.1, d_uc + 0.1)
ax3.set_title("xz, zoom on the film, with grid")
plt.show()
print(sim_S.grid.num_cells, "cells per axis;", sim_S.num_cells / 1e6, "M cells")
[280, 280, 407] cells per axis; 31.9088 M cells
The curves of Figure 2b,c of the paper were digitized and are loaded here as reference.
[4]:
# reference curves digitized from Figure 2b,c of the paper (wavelength in nm -> um)
ref_dir = "assets"
ref_TS = np.loadtxt(f"{ref_dir}/fig2b_short.txt")
ref_TL = np.loadtxt(f"{ref_dir}/fig2b_long.txt")
ref_dT = np.loadtxt(f"{ref_dir}/fig2c_ratio.txt")
Estimate the cost of the two simulations before running them.
[5]:
job_L = web.Job(simulation=sim_L, task_name="nanoslot_TL", folder_name=folder_name, verbose=False)
job_S = web.Job(simulation=sim_S, task_name="nanoslot_TS", folder_name=folder_name, verbose=False)
cost_L = job_L.estimate_cost(verbose=False)
cost_S = job_S.estimate_cost(verbose=False)
print(f"estimated cost: T_L {cost_L:.3f} FC, T_S {cost_S:.3f} FC")
estimated cost: T_L 3.892 FC, T_S 3.892 FC
Run the two simulations.
[6]:
sim_data_L = job_L.run(path="data/nanoslot_TL.hdf5")
sim_data_S = job_S.run(path="data/nanoslot_TS.hdf5")
Compare the transmission spectra and their ratio with the paper. The ratio \(\Delta T = T_S / T_L\) peaks at the operation wavelength of 650 nm.
[7]:
T_L = sim_data_L["T"].power.sum(dim=["orders_x", "orders_y"])
T_S = sim_data_S["T"].power.sum(dim=["orders_x", "orders_y"])
dT = T_S / T_L
lam = td.C_0 / T_L.f
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11, 4))
ax1.plot(lam, T_L, color="green", label="$T_L$ (E along long axis)")
ax1.plot(lam, T_S, color="purple", label="$T_S$ (E along short axis)")
ax1.plot(ref_TL[:, 0] * nm, ref_TL[:, 1], color="green", ls="--", label="$T_L$ paper")
ax1.plot(ref_TS[:, 0] * nm, ref_TS[:, 1], color="purple", ls="--", label="$T_S$ paper")
ax1.axvline(wavelength, color="gray", ls="--", lw=0.8)
ax1.set_xlabel("wavelength (um)")
ax1.set_ylabel("transmission")
ax1.legend()
ax2.plot(lam, dT, color="k", label="Tidy3D")
ax2.plot(ref_dT[:, 0] * nm, ref_dT[:, 1], color="k", ls="--", label="paper")
ax2.axvline(wavelength, color="gray", ls="--", lw=0.8)
ax2.legend()
ax2.set_xlabel("wavelength (um)")
ax2.set_ylabel("$\\Delta T = T_S / T_L$")
plt.show()
The field distribution at 650 nm for the \(T_S\) polarization shows the resonance of the slot: the field is concentrated inside the aperture and at its edges.
[8]:
def field_abs(data, **sel):
E2 = sum(abs(getattr(data, c).sel(f=freq0).sel(**sel, method="nearest")) ** 2 for c in ("Ex", "Ey", "Ez"))
return np.sqrt(E2).squeeze()
E_xz = field_abs(sim_data_S["xz"], y=0)
E_xy = field_abs(sim_data_S["xy"], z=d_uc / 2)
vmax = float(max(E_xz.max(), E_xy.max()))
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11, 4.5), constrained_layout=True, gridspec_kw={"width_ratios": [1, 1]})
im = ax1.pcolormesh(E_xz.x / nm, E_xz.z / nm, E_xz.T, cmap="magma", shading="gouraud", vmin=0, vmax=vmax)
for x0, x1 in ((-pitch_uc / 2, -L_slot / 2), (L_slot / 2, pitch_uc / 2)):
ax1.plot(np.array([x0, x1, x1, x0, x0]) / nm, np.array([0, 0, d_uc, d_uc, 0]) / nm, color="w", lw=0.8)
ax1.set_xlim(-pitch_uc / 2 / nm, pitch_uc / 2 / nm)
ax1.set_ylim(-100, 160)
ax1.set_aspect("equal")
ax1.set_xlabel("x (nm)")
ax1.set_ylabel("z (nm)")
ax1.set_title("y = 0 (slot long axis), $T_S$ polarization")
ax2.pcolormesh(E_xy.x / nm, E_xy.y / nm, E_xy.T, cmap="magma", shading="gouraud", vmin=0, vmax=vmax)
v = slot_vertices(L_slot, B_slot, rc_slot) / nm
ax2.plot(np.r_[v[:, 0], v[0, 0]], np.r_[v[:, 1], v[0, 1]], color="w", lw=0.8)
ax2.set_xlim(-pitch_uc / 2 / nm, pitch_uc / 2 / nm)
ax2.set_ylim(-pitch_uc / 2 / nm, pitch_uc / 2 / nm)
ax2.set_aspect("equal")
ax2.set_xlabel("x (nm)")
ax2.set_ylabel("y (nm)")
ax2.set_title("z = d/2 (mid-film)")
fig.colorbar(im, ax=[ax1, ax2], label="|E| (a.u.)", shrink=0.85)
plt.show()
Full Plasmonic Metalens#
The paper replaces the full lens with an array of independent dipoles, since a finite-element simulation of 5000 plasmonic slots was out of reach. Here the complete lens is simulated with FDTD, using 10 nm cells in the lens plane (25 per lattice period) and across the gold film. The domain is only about 2 \(\mu\text{m}\) tall in \(z\), because the near fields above the film are projected to the focal region with a FieldProjectionCartesianMonitor.
The spacer is not simulated. The illumination is a GaussianBeam source placed in the silica 0.6 \(\mu\text{m}\) below the film. It is defined by the beam waist, \(w_0 = 2.48\) \(\mu\text{m}\), and by the waist position, set 420 \(\mu\text{m}\) below the film at the fiber end face (Figure 3 of the paper). The source thus injects the beam already expanded by the spacer, with a \(1/e^2\) diameter of 48 \(\mu\text{m}\) at the film. Circular polarization is obtained from two orthogonal linearly polarized beams with a 90Β° phase difference, and the sign of that phase selects whether the lens focuses or defocuses.
We start with the lens geometry. The slots sit on a square lattice with a 250 nm pitch inside the 20 \(\mu\text{m}\) aperture, and the slot at radius \(r\) is rotated by \(\beta(r) = \Delta\Phi(r)/2\), which imprints the hyperbolic lens phase. Each slot is a PolySlab with the same rounded outline used in the unit cell, and all 5025 slots are combined in a single GeometryGroup. The parameters of the incident beam are also defined here.
[9]:
# lens design (paper: D = 20 um, f = 30 um, pitch = 250 nm)
D_lens = 20.0
f_lens = 30.0
NA_design = np.sin(np.arctan(D_lens / (2 * f_lens)))
print(f"design NA = {NA_design:.3f}")
# incident beam inside the silica spacer (paper, Fig. 3): waist 2.48 um, 420 um behind the film
w0_beam = 2.48
z_waist = 420.0
# handedness of the circular polarization: +1 -> y lags x by 90 deg, -1 -> the opposite
handedness = -1
def lens_phase(r):
return (2 * np.pi / wavelength) * (f_lens - np.sqrt(r**2 + f_lens**2))
# square lattice of slots inside the circle of diameter D_lens
n_max = int(np.ceil(D_lens / 2 / pitch))
ii = np.arange(-n_max, n_max + 1)
xs, ys = np.meshgrid(ii * pitch, ii * pitch, indexing="ij")
xs, ys = xs.flatten(), ys.flatten()
rs = np.sqrt(xs**2 + ys**2)
inside = rs <= D_lens / 2
xs, ys, rs = xs[inside], ys[inside], rs[inside]
betas = lens_phase(rs) / 2
print(f"{len(xs)} nanoslots")
# slot outline rotated by beta about its center
vertices_origin = slot_vertices(L_slot, B_slot, rc_slot)
rotation = np.array([[np.cos(betas), -np.sin(betas)], [np.sin(betas), np.cos(betas)]])
vertices = np.einsum("ij, jkn -> nik", vertices_origin, rotation) + np.stack([xs, ys], axis=-1)[:, None, :]
slots = td.Structure(
geometry=td.GeometryGroup(
geometries=[td.PolySlab(vertices=v.tolist(), slab_bounds=(0, d_au), axis=2) for v in vertices]
),
medium=air,
)
design NA = 0.316
5025 nanoslots
Compare the phase profile and the slot positions with Figure 2a of the paper.
[10]:
# reference phase profile digitized from Figure 2a of the paper (line and slot positions)
ref_phase_line = np.loadtxt(f"{ref_dir}/fig2a_phase_line.txt")
ref_phase_dots = np.loadtxt(f"{ref_dir}/fig2a_phase_dots.txt")
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11, 4))
r_plot = np.linspace(0, D_lens / 2, 400)
ax1.plot(r_plot, np.mod(lens_phase(r_plot) / (2 * np.pi), 1), label="$\\Delta\\Phi/2\\pi$ mod 1, this notebook")
ax1.plot(rs[ys == 0], np.mod(betas[ys == 0] / np.pi, 1), "r.", ms=4, label="slots on the x axis")
ax1.plot(ref_phase_line[:, 0], ref_phase_line[:, 1], "k--", lw=1, label="paper, Fig. 2a line")
ax1.plot(ref_phase_dots[:, 0], ref_phase_dots[:, 1], "ko", ms=4, mfc="none", label="paper, Fig. 2a dots")
ax1.set_xlabel("r (um)")
ax1.set_ylabel("phase shift / $2\\pi$")
ax1.legend(fontsize=8)
ax2.quiver(xs, ys, np.cos(betas), np.sin(betas), color="k", pivot="middle", headwidth=1, headlength=0, headaxislength=0, scale=60)
ax2.set_aspect("equal")
ax2.set_xlim(-2.5, 2.5)
ax2.set_ylim(-2.5, 2.5)
ax2.set_xlabel("x (um)")
ax2.set_ylabel("y (um)")
ax2.set_title("slot orientations, central 5 um")
plt.show()
Build the simulation: the gold film sits on the silica spacer, the domain in \(z\) extends about one wavelength on each side of the film, and the lateral boundaries use Absorber layers, which stay stable where the gold film crosses them. The near-field monitor is placed 0.4 \(\mu\text{m}\) above the film and feeds the projection to the focal plane.
[11]:
# device: gold film on the silica spacer (z < 0), air above
substrate = td.Structure(
geometry=td.Box.from_bounds(rmin=(-td.inf, -td.inf, -100), rmax=(td.inf, td.inf, 0)),
medium=sio2,
)
gold_film = td.Structure(
geometry=td.Box.from_bounds(rmin=(-td.inf, -td.inf, 0), rmax=(td.inf, td.inf, d_au)),
medium=au,
)
# domain
buffer_xy = wavelength
Lxy = D_lens + 2 * buffer_xy
z_min_lens, z_max_lens = -1.0, 1.3
z_src_lens = -0.6
z_near = 0.4
fwidth_lens = freq0 / 10
run_time_lens = 50 / fwidth_lens
# grid: uniform in x and y matched to the lattice, automatic in z with 10 nm cells across the gold film
dl_xy = pitch / 25
mesh_film_lens = td.MeshOverrideStructure(
geometry=td.Box.from_bounds(rmin=(-td.inf, -td.inf, -20 * nm), rmax=(td.inf, td.inf, d_au + 20 * nm)),
dl=(None, None, 10 * nm),
)
grid_spec_lens = td.GridSpec(
grid_x=td.UniformGrid(dl=dl_xy),
grid_y=td.UniformGrid(dl=dl_xy),
grid_z=td.AutoGrid(min_steps_per_wvl=20),
wavelength=wavelength,
override_structures=[mesh_film_lens],
)
# circularly polarized Gaussian beam injected from the silica side
pulse_x = td.GaussianPulse(freq0=freq0, fwidth=fwidth_lens, phase=0)
pulse_y = td.GaussianPulse(freq0=freq0, fwidth=fwidth_lens, phase=handedness * np.pi / 2)
beam_x = td.GaussianBeam(
center=(0, 0, z_src_lens),
size=(td.inf, td.inf, 0),
source_time=pulse_x,
direction="+",
pol_angle=0,
waist_radius=w0_beam,
waist_distance=z_waist - (0 - z_src_lens),
)
beam_y = beam_x.updated_copy(source_time=pulse_y, pol_angle=np.pi / 2)
# monitors: near fields just above the film (for projections) and focal plane by exact projection
monitor_near = td.FieldMonitor(
center=(0, 0, z_near), size=(td.inf, td.inf, 0), freqs=[freq0], name="near", colocate=False
)
xs_focal = np.linspace(-3, 3, 121)
monitor_focal = td.FieldProjectionCartesianMonitor(
center=(0, 0, z_near),
size=(td.inf, td.inf, 0),
freqs=[freq0],
name="focal_plane",
proj_axis=2,
proj_distance=f_lens - z_near,
x=xs_focal,
y=xs_focal,
custom_origin=(0, 0, z_near),
far_field_approx=False,
)
sim_lens = td.Simulation(
center=(0, 0, (z_min_lens + z_max_lens) / 2),
size=(Lxy, Lxy, z_max_lens - z_min_lens),
structures=[substrate, gold_film, slots],
sources=[beam_x, beam_y],
monitors=[monitor_near, monitor_focal],
grid_spec=grid_spec_lens,
boundary_spec=td.BoundarySpec(x=td.Boundary.absorber(), y=td.Boundary.absorber(), z=td.Boundary.pml()),
run_time=run_time_lens,
)
print(sim_lens.grid.num_cells, "cells per axis;", sim_lens.num_cells / 1e6, "M cells")
[2210, 2210, 120] cells per axis; 586.092 M cells
Visualize the simulation setup and the grid at the center and at the edge of the lens.
[12]:
fig, axs = plt.subplots(2, 2, figsize=(13, 11))
sim_lens.plot(z=d_au / 2, ax=axs[0, 0])
axs[0, 0].set_title("xy, mid-film, whole lens")
sim_lens.plot(z=d_au / 2, ax=axs[0, 1])
sim_lens.plot_grid(z=d_au / 2, ax=axs[0, 1])
axs[0, 1].set_xlim(-0.6, 0.6)
axs[0, 1].set_ylim(-0.6, 0.6)
axs[0, 1].set_title("xy, mid-film, center, with grid")
sim_lens.plot(y=0, ax=axs[1, 0])
axs[1, 0].set_title("xz")
sim_lens.plot(y=0, ax=axs[1, 1])
sim_lens.plot_grid(y=0, ax=axs[1, 1])
axs[1, 1].set_xlim(9.4, 10.6)
axs[1, 1].set_ylim(-0.15, 0.2)
axs[1, 1].set_title("xz, lens edge, with grid")
plt.show()
A closer look at the center of the lens shows the orientation pattern of the slots.
[13]:
fig, ax = plt.subplots(figsize=(10, 10))
sim_lens.plot(z=d_au / 2, ax=ax)
ax.set_xlim(-5, 5)
ax.set_ylim(-5, 5)
ax.set_title("xy, mid-film, central 10 um")
plt.show()
The cuts through the focus in Figure 6 of the paper, simulated and measured, were digitized and are loaded here as reference.
[14]:
# reference cuts through the focus digitized from Figure 6 of the paper
ref_6a = {k: np.loadtxt(f"{ref_dir}/fig6a_{k}.txt") for k in ("sim", "exp", "fit")}
ref_6b = {k: np.loadtxt(f"{ref_dir}/fig6b_{k}.txt") for k in ("sim", "exp", "fit")}
Estimate the cost before running the simulation.
[15]:
job_lens = web.Job(simulation=sim_lens, task_name="fiber_metalens", folder_name=folder_name, verbose=False)
cost_lens = job_lens.estimate_cost(verbose=False)
print(f"estimated cost: {cost_lens:.2f} FC")
estimated cost: 11.41 FC
Run the simulation.
[16]:
sim_data_lens = job_lens.run(path="data/fiber_metalens.hdf5")
The focal plane is obtained from the projection monitor. For the intensity distribution around the focus, the near fields are projected locally with a FieldProjector to the plane \(y = 0\), which gives the \(r\)-\(z\) map of Figure 5d of the paper from the same simulation data.
[17]:
# focal plane (Figure 5c)
E_focal = sim_data_lens["focal_plane"].fields_cartesian.sel(f=freq0)
I_focal = (abs(E_focal.Ex) ** 2 + abs(E_focal.Ey) ** 2 + abs(E_focal.Ez) ** 2).squeeze()
# r-z map around the focus (Figure 5d): project the near fields to the plane y = 0
projector = td.FieldProjector.from_near_field_monitors(
sim_data=sim_data_lens, near_monitors=[monitor_near], normal_dirs=["+"], pts_per_wavelength=10
)
zs_axial = np.arange(15, 45.01, 0.5)
monitor_rz = td.FieldProjectionCartesianMonitor(
center=(0, 0, z_near),
size=(td.inf, td.inf, 0),
freqs=[freq0],
name="rz_plane",
proj_axis=1,
proj_distance=0,
x=xs_focal,
y=zs_axial - z_near,
custom_origin=(0, 0, z_near),
far_field_approx=False,
)
E_rz = projector.project_fields(monitor_rz).fields_cartesian.sel(f=freq0)
I_rz = (abs(E_rz.Ex) ** 2 + abs(E_rz.Ey) ** 2 + abs(E_rz.Ez) ** 2).squeeze().transpose("z", "x").values
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4.5))
ax1.pcolormesh(xs_focal, xs_focal, (I_focal / I_focal.max()).T, cmap="inferno", shading="auto")
ax1.set_aspect("equal")
ax1.set_xlabel("x (um)")
ax1.set_ylabel("y (um)")
ax1.set_title(f"focal plane, z = {f_lens} um")
ax2.pcolormesh(zs_axial, xs_focal, (I_rz / I_rz.max()).T, cmap="inferno", shading="auto")
ax2.set_xlabel("z (um)")
ax2.set_ylabel("x (um)")
ax2.set_title("xz through the axis")
plt.show()
Computing projected fields ββββββββββββββββββββββββββββββββββββββββ 100% 0:03:32
The radial and axial cuts through the focus are compared with the simulated and measured curves of the paper.
[18]:
# cuts through the focus (Figure 6): radial at the plane of maximum intensity, axial on the axis
I_axis = I_rz[:, np.argmin(abs(xs_focal))]
iz0 = np.argmax(I_axis)
z0 = zs_axial[iz0]
I_rad = I_rz[iz0, :]
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11, 4))
ax1.plot(xs_focal, I_rad / I_rad.max(), color="k", label="Tidy3D")
ax1.plot(ref_6a["sim"][:, 0], ref_6a["sim"][:, 1], color="green", ls="--", label="paper sim.")
ax1.plot(ref_6a["exp"][:, 0], ref_6a["exp"][:, 1], color="purple", ls="--", label="paper exp.")
ax1.plot(ref_6a["fit"][:, 0], ref_6a["fit"][:, 1], color="violet", ls=":", label="paper fit")
ax1.set_xlabel("r (um)")
ax1.set_ylabel("norm. intensity")
ax1.set_title(f"z = z0 = {z0:.1f} um")
ax1.legend()
ax2.plot(zs_axial, I_axis / I_axis.max(), color="k", label="Tidy3D")
ax2.plot(ref_6b["sim"][:, 0], ref_6b["sim"][:, 1], color="green", ls="--", label="paper sim.")
ax2.plot(ref_6b["exp"][:, 0], ref_6b["exp"][:, 1], color="purple", ls="--", label="paper exp.")
ax2.plot(ref_6b["fit"][:, 0], ref_6b["fit"][:, 1], color="violet", ls=":", label="paper fit")
ax2.set_xlabel("z (um)")
ax2.set_ylabel("norm. intensity")
ax2.set_title("r = 0")
ax2.legend()
plt.show()