TIDY3D
LEARNING CENTER

Backward Brillouin scattering in a thin-film lithium niobate waveguide

Stimulated Brillouin scattering (SBS) couples light to gigahertz sound. In backward SBS, a forward-propagating pump at \(\omega_p\) scatters off a co-propagating acoustic wave into a backward-propagating Stokes wave at \(\omega_s=\omega_p-\Omega\). Momentum conservation fixes the acoustic wavevector to \(q=\beta_p+\beta_s\approx 2\beta_p\). In thin-film lithium niobate (LN), the large photoelastic coefficients and the strong optical confinement make this interaction efficient, and the crystal anisotropy makes the gain depend strongly on how the waveguide is oriented in the crystal.

In this notebook, we demonstrate a complete workflow for computing the Brillouin gain of an LN waveguide. We solve the optical mode with Tidy3D’s local mode solver and the elastic modes of the waveguide cross-section with the open-source finite-element package NGSolve. We then evaluate the photoelastic, moving-boundary, and roto-optic overlap integrals to obtain the normalized gain \(G_B/Q_m\). For a free-standing waveguide, the peak gain is about 0.12 \(\text{W}^{-1}\text{m}^{-1}\) in Z-cut and about 0.65 \(\text{W}^{-1}\text{m}^{-1}\) in X-cut near \(\theta_X=45^\circ\), and the photoelastic effect dominates. The overlap integrals agree with direct Tidy3D perturbation solves to better than 1%. The geometry and material constants follow C. C. Rodrigues, R. O. Zurita, T. P. M. Alegre, and G. S. Wiederhecker, “Stimulated Brillouin scattering by surface acoustic waves in lithium niobate waveguides,” J. Opt. Soc. Am. B (2023).

The workflow has these steps:

  1. Simulation setup
  2. Optical mode with Tidy3D
  3. Elastic modes with NGSolve
  4. Brillouin gain from overlap integrals
  5. Validation against direct mode solves of the deformed waveguide
  6. Z-cut orientation sweep
  7. X-cut orientation sweep
  8. Waveguide on a silica substrate

Both solvers run locally, so this notebook does not consume FlexCredits. It needs pip install ngsolve in addition to tidy3d[extras], which provides the subpixel averaging for local mode solves.

For more integrated photonic examples, please visit our examples page. If you are new to the finite-difference time-domain (FDTD) method, we highly recommend going through our FDTD101 tutorials.

Schematic of a lithium niobate ridge waveguide on silica

import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse as sp
import tidy3d as td
from matplotlib.collections import LineCollection
from matplotlib.path import Path
from netgen.occ import Glue, OCCGeometry, WorkPlane
from ngsolve import CF, H1, BilinearForm, Conj, GridFunction, Integrate, Mesh, dx, grad
from scipy.interpolate import RegularGridInterpolator
from scipy.optimize import brentq, linear_sum_assignment
from scipy.sparse.linalg import eigsh

Simulation Setup

The waveguide is a trapezoidal LN core with a 650 nm top width, a 550 nm thickness, and \(15^\circ\) sidewalls, operated at \(\lambda_0 = 1.55\ \mu\text{m}\). All lengths are in microns. Overlap integrals are evaluated in SI units, so we keep the conversion factor UM at hand.

lda0 = 1.55  # free-space wavelength (um)
freq0 = td.C_0 / lda0  # optical frequency (Hz)

w_top = 0.65  # waveguide top width (um)
t_wg = 0.55  # LN core thickness (um)
sidewall = 15.0  # sidewall angle from vertical (deg)

EPS0 = 8.8541878128e-12  # vacuum permittivity (F/m)
UM = 1e-6  # one micron in meters

Materials and Crystal Orientation

LN is uniaxial. We take its ordinary and extraordinary indices from the D. E. Zelmon, D. L. Small, and D. Jundt, J. Opt. Soc. Am. B 14, 3319 (1997) entry of the Tidy3D material library, and the fused-silica index from its lossless Palik entry. The overlap integrals need the indices as plain numbers, so we evaluate the library models at the operating frequency.

ln_lib = td.material_library["LiNbO3"]["Zelmon1997"](optical_axis=2)
sio2_lib = td.material_library["SiO2"]["Palik_NoLoss"]

n_o = float(np.sqrt(np.real(ln_lib.xx.eps_model(freq0))))
n_e = float(np.sqrt(np.real(ln_lib.zz.eps_model(freq0))))
n_sio2 = float(np.sqrt(np.real(sio2_lib.eps_model(freq0))))
print(f"LN: n_o = {n_o:.4f}, n_e = {n_e:.4f};  SiO2: n = {n_sio2:.4f}")
LN: n_o = 2.2111, n_e = 2.1376;  SiO2: n = 1.4440

The elastic stiffness \(C_{IJ}\) and photoelastic tensor \(p_{IJ}\) of LN (trigonal class \(3m\)) are given in Voigt notation in the crystal axes. We convert them to full rank-4 tensors, which makes any crystal rotation a single einsum and avoids the factor-of-two pitfalls of rotating Voigt matrices. The photoelastic tensor pairs with engineering strain, \(\Delta(\varepsilon^{-1})_I = p_{IJ} S_J\), so no extra factors are needed. For silica, we build isotropic tensors from the bulk velocities and the photoelastic constants \(p_{11}\) and \(p_{12}\).

VOIGT = [[0, 5, 4], [5, 1, 3], [4, 3, 2]]  # (i, j) -> Voigt index


def voigt_to_full(M: np.ndarray) -> np.ndarray:
    """Convert a 6x6 Voigt matrix to a rank-4 tensor."""
    T = np.empty((3, 3, 3, 3))
    for i, j, k, l in np.ndindex(3, 3, 3, 3):
        T[i, j, k, l] = M[VOIGT[i][j], VOIGT[k][l]]
    return T


# LN elastic stiffness (Pa) and density (kg/m^3)
c11, c12, c13, c14, c33, c44 = 198.83e9, 54.64e9, 68.23e9, 7.83e9, 235.71e9, 59.86e9
C_ln = voigt_to_full(
    np.array(
        [
            [c11, c12, c13, c14, 0, 0],
            [c12, c11, c13, -c14, 0, 0],
            [c13, c13, c33, 0, 0, 0],
            [c14, -c14, 0, c44, 0, 0],
            [0, 0, 0, 0, c44, c14],
            [0, 0, 0, 0, c14, (c11 - c12) / 2],
        ]
    )
)
rho_ln = 4643.0

# LN photoelastic tensor
p11, p12, p13, p14, p31, p33, p41, p44 = -0.026, 0.088, 0.134, -0.083, 0.177, 0.07, -0.151, 0.145
p_ln = voigt_to_full(
    np.array(
        [
            [p11, p12, p13, p14, 0, 0],
            [p12, p11, p13, -p14, 0, 0],
            [p31, p31, p33, 0, 0, 0],
            [p41, -p41, 0, p44, 0, 0],
            [0, 0, 0, 0, p44, p41],
            [0, 0, 0, 0, p14, (p11 - p12) / 2],
        ]
    )
)
eps_ln = np.diag([n_o**2, n_o**2, n_e**2])  # relative permittivity in crystal axes

# fused silica
rho_sio2, vl_sio2, vs_sio2 = 2203.0, 5969.0, 3763.0  # density, longitudinal/shear velocity
delta = np.eye(3)
dd = np.einsum("ij,kl->ijkl", delta, delta)
sym = np.einsum("ik,jl->ijkl", delta, delta) + np.einsum("il,jk->ijkl", delta, delta)
C_sio2 = rho_sio2 * (vl_sio2**2 - 2 * vs_sio2**2) * dd + rho_sio2 * vs_sio2**2 * sym
p_sio2 = 0.271 * dd + 0.5 * (0.121 - 0.271) * sym
eps_sio2 = n_sio2**2 * np.eye(3)

We use a lab frame with \(x\) horizontal, \(y\) normal to the chip, and \(z\) along the waveguide. A rotation matrix whose columns are the crystal axes expressed in lab coordinates transforms every tensor. For Z-cut, the crystal \(Z\) axis points along \(y\). For X-cut, the crystal \(X\) axis points along \(y\), and at \(\theta_X=0\) the optic axis lies along the propagation direction. In both cases the waveguide direction is set by an extra rotation about \(y\) by \(\theta_Z\) or \(\theta_X\).

def rot4(R: np.ndarray, T: np.ndarray) -> np.ndarray:
    """Rotate a rank-4 tensor."""
    return np.einsum("ia,jb,kc,ld,abcd->ijkl", R, R, R, R, T)


def ry(theta_deg: float) -> np.ndarray:
    """Rotation about the lab y axis."""
    c, s = np.cos(np.deg2rad(theta_deg)), np.sin(np.deg2rad(theta_deg))
    return np.array([[c, 0, s], [0, 1, 0], [-s, 0, c]])


R_ZCUT = np.array([[1, 0, 0], [0, 0, 1], [0, -1, 0]], float)  # crystal Z along y
R_XCUT = np.array([[0, -1, 0], [1, 0, 0], [0, 0, 1]], float)  # crystal X along y, Z along z


def ln_lab(R: np.ndarray) -> tuple:
    """LN stiffness, photoelastic tensor, and relative permittivity in the lab frame."""
    return rot4(R, C_ln), rot4(R, p_ln), R @ eps_ln @ R.T


# sanity check: Z-cut tensors have threefold symmetry about y
C_a, p_a, _ = ln_lab(ry(10) @ R_ZCUT)
C_b, p_b, _ = ln_lab(ry(130) @ R_ZCUT)
print("threefold symmetry:", np.allclose(C_a, C_b, atol=1e-3 * c11), np.allclose(p_a, p_b, atol=1e-9))
threefold symmetry: True True

Optical Mode with Tidy3D

We solve the fundamental TE mode with a ModeSimulation. The waveguide is a PolySlab extruded along \(z\). Its LN medium is an AnisotropicMedium when the permittivity is diagonal in the lab frame, which is always the case for Z-cut. Otherwise it is a FullyAnisotropicMedium. A MeshOverrideStructure refines the grid to 2.5 nm around the core, because the moving-boundary integral needs accurate fields right at the interfaces.

def trapezoid(w: float, t: float, angle_deg: float) -> list:
    """Vertices (counterclockwise) of a trapezoid with top width w, bottom on y=0."""
    dx_side = t * np.tan(np.deg2rad(angle_deg))
    return [(w / 2 + dx_side, 0.0), (w / 2, t), (-w / 2, t), (-w / 2 - dx_side, 0.0)]


wg_verts = trapezoid(w_top, t_wg, sidewall)


def make_mode_sim(eps_r: np.ndarray, verts: list = wg_verts, substrate: bool = False, dl: float = 0.0025) -> td.ModeSimulation:
    """Mode simulation of an LN polygon in air or on a silica half-space."""
    if np.allclose(eps_r, np.diag(np.diag(eps_r))):
        ln_medium = td.AnisotropicMedium(
            xx=td.Medium(permittivity=eps_r[0, 0]),
            yy=td.Medium(permittivity=eps_r[1, 1]),
            zz=td.Medium(permittivity=eps_r[2, 2]),
        )
    else:
        ln_medium = td.FullyAnisotropicMedium(permittivity=eps_r)
    structures = [
        td.Structure(
            geometry=td.PolySlab(vertices=verts, axis=2, slab_bounds=(-td.inf, td.inf)), medium=ln_medium
        )
    ]
    if substrate:
        structures.insert(
            0,
            td.Structure(
                geometry=td.Box(center=(0, -2, 0), size=(td.inf, 4, td.inf)),
                medium=td.Medium(permittivity=n_sio2**2),
            ),
        )
    v = np.array(verts)
    refine = td.MeshOverrideStructure(
        geometry=td.Box.from_bounds((v[:, 0].min() - 0.1, v[:, 1].min() - 0.1, -td.inf), (v[:, 0].max() + 0.1, v[:, 1].max() + 0.1, td.inf)),
        dl=(dl, dl, None),
    )
    return td.ModeSimulation(
        size=(4, 4, 0),
        center=(0, t_wg / 2, 0),
        structures=structures,
        grid_spec=td.GridSpec.auto(wavelength=lda0, min_steps_per_wvl=40, override_structures=[refine]),
        mode_spec=td.ModeSpec(
            num_modes=2,
            target_neff=2.0,
            sort_spec=td.ModeSortSpec(filter_key="TE_fraction", filter_reference=0.5),  # TE-like modes first
            precision="double",
        ),
        freqs=[freq0],
        plane=td.Box(center=(0, t_wg / 2, 0), size=(4, 4, 0)),
        colocate=True,
    )


eps_z = ln_lab(R_ZCUT)[2]
mode_sim = make_mode_sim(eps_z)

Before solving, we check the cross-section.

fig, ax = plt.subplots(1, 1, figsize=(6, 4))
mode_sim.plot_eps(z=0, freq=freq0, ax=ax)
ax.set_xlim(-1, 1)
ax.set_ylim(-0.5, 1)
plt.show()

The mode solver runs locally. We collect the colocated fields, convert them from \(\text{V}/\mu\text{m}\) and \(\text{A}/\mu\text{m}\) to SI units, and derive the acoustic wavevector \(q=2\beta\) required for backward scattering.

def mode_fields(mode_sim_data: td.ModeSimulationData) -> dict:
    """Fundamental-mode E, H (SI units) on the solver grid, plus n_eff."""
    modes = mode_sim_data.modes

    def comp(name):
        return np.asarray(modes.field_components[name].isel(f=0, mode_index=0).squeeze()).astype(complex) / UM

    return dict(
        x=np.asarray(modes.field_components["Ex"].x) * UM,
        y=np.asarray(modes.field_components["Ex"].y) * UM,
        E=np.stack([comp(c) for c in ("Ex", "Ey", "Ez")]),
        H=np.stack([comp(c) for c in ("Hx", "Hy", "Hz")]),
        n_eff=float(np.real(modes.n_eff.isel(f=0, mode_index=0))),
    )


mode_data = mode_sim.run_local()
opt = mode_fields(mode_data)
q_ac = 2 * 2 * np.pi * opt["n_eff"] / lda0  # acoustic wavevector (1/um)
print(f"n_eff = {opt['n_eff']:.5f},  q = {q_ac:.3f} 1/um,  acoustic wavelength = {2 * np.pi / q_ac * 1e3:.1f} nm")
n_eff = 1.77353,  q = 14.379 1/um,  acoustic wavelength = 437.0 nm
fig, ax = plt.subplots(1, 1, figsize=(6, 4))
mode_data.plot_field("E", val="abs^2", mode_index=0, f=freq0, ax=ax)
ax.set_xlim(-1, 1)
ax.set_ylim(-0.5, 1)
plt.show()

Elastic Modes with NGSolve

The elastic displacement \(\mathbf{u}\) obeys \(\rho\Omega^2\mathbf{u} + \nabla\cdot(\mathbf{C}:\nabla\mathbf{u})=0\). Because the waveguide is uniform along \(z\), we write \(\mathbf{u}(x,y)\,e^{iqz}\), which replaces \(\partial_z\) by \(iq\) and leaves a 2D eigenproblem on the cross-section. Its weak form is

\[\int \mathbf{S}(\mathbf{v})^* : \mathbf{C} : \mathbf{S}(\mathbf{u})\,dA = \Omega^2 \int \rho\,\mathbf{v}^*\cdot\mathbf{u}\,dA,\]

where the strain \(\mathbf{S}\) contains \(iq\) in its \(z\) components. Free surfaces need no special treatment, because the traction-free condition is the natural boundary condition of this form. We assemble the stiffness and mass matrices with third-order Lagrange elements and solve the Hermitian generalized eigenproblem with shift-invert around a target frequency. Lengths stay in microns, so the eigenvalue is \(\Omega^2\times10^{-12}\).

VO = [(0, 0), (1, 1), (2, 2), (1, 2), (0, 2), (0, 1)]


def polygon_face(verts: list, name: str):
    """OCC face from a closed polygon."""
    wp = WorkPlane().MoveTo(*verts[0])
    for p in verts[1:]:
        wp.LineTo(*p)
    face = wp.Close().Face()
    face.name = name
    return face


class ElasticModes:
    """Elastic modes u(x,y)exp(iqz) of a cross-section made of anisotropic regions."""

    def __init__(self, regions: list, q: float, order: int = 3, maxh: float = 0.03, fine: dict = None):
        faces = [polygon_face(verts, name) for name, verts, _, _ in regions]
        shape = Glue(faces) if len(faces) > 1 else faces[0]
        for f in shape.faces:
            if fine and f.name in fine:
                f.maxh = fine[f.name]
        self.mesh = Mesh(OCCGeometry(shape, dim=2).GenerateMesh(maxh=maxh))
        self.q = q
        mats = self.mesh.GetMaterials()
        props = {name: (np.array([[C[i, j, k, l] for (k, l) in VO] for (i, j) in VO]), rho) for name, _, C, rho in regions}
        self.rho = CF([props[m][1] for m in mats])
        Cv = [CF([props[m][0][I, J] for m in mats]) for I in range(6) for J in range(6)]

        V = H1(self.mesh, order=order, complex=True)
        self.fes = V * V * V
        (u0, u1, u2), (v0, v1, v2) = self.fes.TnT()

        def strain(us, s):  # Voigt engineering strain, s=-1 for the conjugated test function
            G = [[grad(f)[0], grad(f)[1], s * 1j * q * f] for f in us]
            return [G[0][0], G[1][1], G[2][2], G[1][2] + G[2][1], G[0][2] + G[2][0], G[0][1] + G[1][0]]

        Su, Sv = strain((u0, u1, u2), 1), strain((v0, v1, v2), -1)
        a = BilinearForm(self.fes)
        a += sum(Sv[I] * Cv[6 * I + J] * Su[J] for I in range(6) for J in range(6)) * dx
        m = BilinearForm(self.fes)
        m += self.rho * (u0 * v0 + u1 * v1 + u2 * v2) * dx
        a.Assemble()
        m.Assemble()
        self.A, self.M = self._csr(a.mat), self._csr(m.mat)

    @staticmethod
    def _csr(mat):
        vals, cols, rows = mat.CSR()
        return sp.csr_matrix((np.array(vals), np.array(cols), np.array(rows)), shape=(mat.height, mat.width))

    def solve(self, f_target_ghz: float, n: int = 10) -> np.ndarray:
        """Modes closest to the target frequency; returns frequencies (GHz)."""
        sigma = (2 * np.pi * f_target_ghz * 1e9) ** 2 * 1e-12
        lam, vec = eigsh(self.A, k=n, M=self.M, sigma=sigma, which="LM")
        order = np.argsort(lam)
        self.Omega = np.sqrt(lam[order]) * 1e6  # rad/s
        self.vecs = vec[:, order]
        return self.Omega / (2 * np.pi * 1e9)

    def gridfunction(self, i: int) -> GridFunction:
        g = GridFunction(self.fes)
        g.vec.FV().NumPy()[:] = self.vecs[:, i]
        return g

    def fields(self, i: int, x: np.ndarray, y: np.ndarray) -> tuple:
        """Displacement u (3, N) and gradient G[k, l] = d_l u_k (3, 3, N) in 1/um at points (um)."""
        g = self.gridfunction(i)
        pts = self.mesh(np.asarray(x), np.asarray(y))
        u = np.array([g.components[k](pts)[:, 0] for k in range(3)])
        G = np.empty((3, 3, len(x)), complex)
        for k in range(3):
            gr = grad(g.components[k])(pts)
            G[k, 0], G[k, 1], G[k, 2] = gr[:, 0], gr[:, 1], 1j * self.q * u[k]
        return u, G

    def mass_integral(self, i: int, region: str = ".*") -> float:
        """Integral of rho |u|^2 over the given regions (um^2 kg/m^3)."""
        g = self.gridfunction(i)
        uu = sum(g.components[k] * Conj(g.components[k]) for k in range(3))
        return Integrate(self.rho * uu, self.mesh, definedon=self.mesh.Materials(region)).real

We solve the free-standing Z-cut waveguide at \(\theta_Z=0\) for the ten modes closest to 7 GHz.

C_z, p_z, eps_z = ln_lab(R_ZCUT)
elastic = ElasticModes([("LN", wg_verts, C_z, rho_ln)], q_ac)
f_modes = elastic.solve(7.0, 10)
print("mode frequencies (GHz):", np.round(f_modes, 4))
mode frequencies (GHz): [7.1953 7.2627 7.7036 8.0907 8.3574 8.439  8.5724 8.8239 8.9667 9.2161]

We plot the displacement magnitude of the four lowest modes, with arrows for the in-plane displacement.

def area_grid(verts: list, h: float) -> tuple:
    """Uniform sample points (um) inside a polygon."""
    v = np.array(verts)
    xs = np.arange(v[:, 0].min() + h / 2, v[:, 0].max(), h)
    ys = np.arange(v[:, 1].min() + h / 2, v[:, 1].max(), h)
    X, Y = np.meshgrid(xs, ys, indexing="ij")
    inside = Path(v).contains_points(np.c_[X.ravel(), Y.ravel()], radius=-1e-9)
    return X.ravel()[inside], Y.ravel()[inside]


Xp, Yp = area_grid(wg_verts, 0.01)  # fine grid for the color map
Xq, Yq = area_grid(wg_verts, 0.07)  # coarse grid for the arrows
fig, axes = plt.subplots(1, 4, figsize=(16, 3.6))
for i, ax in enumerate(axes):
    u, _ = elastic.fields(i, Xp, Yp)
    mag = np.sqrt((np.abs(u) ** 2).sum(0))
    ax.scatter(Xp, Yp, c=mag / mag.max(), s=4, cmap="magma", marker="s")
    k = np.argmax(np.abs(u).max(1))  # dominant displacement component
    ph = u[k, np.argmax(np.abs(u[k]))]
    ph = ph / abs(ph)  # global phase that makes the dominant component real at its peak
    uq, _ = elastic.fields(i, Xq, Yq)
    ax.quiver(Xq, Yq, (uq[0] * np.conj(ph)).real, (uq[1] * np.conj(ph)).real, color="w", scale=12 * mag.max())
    ax.set_title(f"{f_modes[i]:.3f} GHz")
    ax.set_aspect("equal")
    ax.set_xlabel(r"x ($\mu m$)")
axes[0].set_ylabel(r"y ($\mu m$)")
plt.tight_layout()
plt.show()

Brillouin Gain from Overlap Integrals

Coupled-mode theory gives the peak backward SBS gain normalized by the mechanical quality factor:

\[\frac{G_B}{Q_m} = \frac{2\omega_p\,|Q_{PE}+Q_{MB}+Q_{RO}|^2}{P_p P_s\,\Omega^2 \int\rho|\mathbf{u}|^2 dA},\qquad P=2\int \mathrm{Re}(\mathbf{E}\times\mathbf{H}^*)\cdot\hat{z}\,dA.\]

The arbitrary amplitudes of the optical and elastic modes cancel. Reporting \(G_B/Q_m\) removes the dependence on the poorly known acoustic loss. Each coupling term is an overlap \(Q=\int \mathbf{E}_p^*\cdot\delta\varepsilon\cdot\mathbf{E}_s\,dA\) of the two optical fields with the permittivity change caused by the sound:

  • Photoelastic (PE). Strain changes the inverse permittivity, \(\Delta(\varepsilon^{-1})_{ij}=p_{ijkl}S_{kl}\), so \(\delta\varepsilon_{PE}=-\varepsilon(\mathbf{p}:\mathbf{S})\varepsilon/\varepsilon_0\).
  • Roto-optic (RO). A local rotation \(R_{ij}=\tfrac{1}{2}(\partial_j u_i-\partial_i u_j)\) of an anisotropic crystal gives \(\delta\varepsilon_{RO}=R\varepsilon-\varepsilon R\).
  • Moving boundary (MB). Each interface moves by \(\mathbf{u}\cdot\hat{n}\). Because \(E_\perp\) jumps across an interface, the overlap must use the continuous components \(\mathbf{E}_\parallel\) and \(D_\perp\). For anisotropic media this is the generalization of C. Kottke, A. Farjadpour, and S. G. Johnson, Phys. Rev. E 77, 036611 (2008). For isotropic media it reduces to \(\Delta\varepsilon|\mathbf{E}_\parallel|^2-\Delta(\varepsilon^{-1})|D_\perp|^2\) (C. Wolff et al., Phys. Rev. A 92, 013836 (2015)).

The backward Stokes field is the time-reversed pump, \(\mathbf{E}_s=\mathbf{E}_p^*\). This is exact for any lossless anisotropic medium. For a guided mode, \(E_z\) is \(90^\circ\) out of phase with \(E_x\), so time reversal flips the sign of every \(E_z E_z\) product. Backward and forward scattering therefore weight the longitudinal field with opposite signs.

We evaluate the area integrals on a 2 nm grid inside each region, interpolating Tidy3D’s fields at the sample points. For the boundary integral, we sample the continuous components two and four grid cells inside the interface and extrapolate linearly to it. This keeps the samples clear of the subpixel-averaged cells at the interface.

def optical_power(opt: dict) -> float:
    """P = 2 int Re(E x H*)_z dA (W)."""
    E, H = opt["E"], opt["H"]
    Sz = np.real(E[0] * np.conj(H[1]) - E[1] * np.conj(H[0]))
    return 2 * np.trapezoid(np.trapezoid(Sz, opt["y"], axis=1), opt["x"])


def efield_interpolator(opt: dict):
    """Linear interpolator of the complex E field at points given in meters."""
    f = [RegularGridInterpolator((opt["x"], opt["y"]), opt["E"][c]) for c in range(3)]
    return lambda xm, ym: np.array([g(np.c_[xm, ym]) for g in f])


def interface(a, b, normal, eps_in, eps_out, n_per_um: int = 400) -> dict:
    """Sample points along a straight interface; the normal points from 'in' to 'out'."""
    a, b, normal = (np.asarray(v, float) for v in (a, b, normal))
    d = b - a
    L = np.hypot(*d)
    n = max(int(L * n_per_um), 8)
    s = (np.arange(n) + 0.5) / n
    return dict(pts=a + s[:, None] * d, nrm=np.tile(normal, (n, 1)), tan=np.tile(d / L, (n, 1)),
                dl=np.full(n, L / n), eps_in=eps_in, eps_out=eps_out)


def polygon_interfaces(verts: list, eps_in, eps_out, keep=lambda a, b: True) -> list:
    """Interfaces along the edges of a counterclockwise polygon (outward normals)."""
    v = np.array(verts, float)
    out = []
    for a, b in zip(v, np.roll(v, -1, axis=0)):
        if keep(a, b):
            d = (b - a) / np.hypot(*(b - a))
            out.append(interface(a, b, (d[1], -d[0]), eps_in, eps_out))
    return out


def kottke(eps_loc: np.ndarray) -> tuple:
    """Moving-boundary quantities for a relative permittivity in the local (n, t, z) frame."""
    e = eps_loc
    return (EPS0 * (e[1:, 1:] - np.outer(e[1:, 0], e[0, 1:]) / e[0, 0]),
            1 / (EPS0 * e[0, 0]), e[0, 1:] / e[0, 0], e[1:, 0] / e[0, 0])


def overlaps(opt, elastic, i, pe_regions, interfaces, h=0.002, delta=0.005, backward=True):
    """Q_PE, Q_RO, Q_MB (SI) and max|u| for elastic mode i."""
    Efun = efield_interpolator(opt)
    stokes = np.conj if backward else (lambda a: a)
    Q_pe = Q_ro = Q_mb = 0j
    umax = 0.0
    for verts, p_lab, eps_r in pe_regions:
        X, Y = area_grid(verts, h)
        u, G = elastic.fields(i, X, Y)
        G = G / UM
        S = 0.5 * (G + G.transpose(1, 0, 2))
        R = 0.5 * (G - G.transpose(1, 0, 2))
        Ep = Efun(X * UM, Y * UM)
        Es = stokes(Ep)
        d_pe = -EPS0 * np.einsum("ia,abn,bj->ijn", eps_r, np.einsum("ijkl,kln->ijn", p_lab, S), eps_r)
        d_ro = EPS0 * (np.einsum("ikn,kj->ijn", R, eps_r) - np.einsum("ik,kjn->ijn", eps_r, R))
        dA = (h * UM) ** 2
        Q_pe += np.einsum("in,ijn,jn->", Ep.conj(), d_pe, Es) * dA
        Q_ro += np.einsum("in,ijn,jn->", Ep.conj(), d_ro, Es) * dA
        umax = max(umax, np.sqrt((np.abs(u) ** 2).sum(0)).max())
    for itf in interfaces:
        pts, nrm, tan, dl = itf["pts"], itf["nrm"], itf["tan"], itf["dl"]
        ub, _ = elastic.fields(i, pts[:, 0] - 1e-5 * nrm[:, 0], pts[:, 1] - 1e-5 * nrm[:, 1])
        umax = max(umax, np.sqrt((np.abs(ub) ** 2).sum(0)).max())
        E1, E2 = (Efun((pts[:, 0] - s * delta * nrm[:, 0]) * UM, (pts[:, 1] - s * delta * nrm[:, 1]) * UM) for s in (1, 2))
        Eb = 2 * E1 - E2  # linear extrapolation to the interface
        for k in range(len(pts)):
            Qf = np.array([[nrm[k, 0], nrm[k, 1], 0], [tan[k, 0], tan[k, 1], 0], [0, 0, 1.0]])
            tI, iI, cnI, ctI = kottke(Qf @ itf["eps_in"] @ Qf.T)
            tO, iO, cnO, ctO = kottke(Qf @ itf["eps_out"] @ Qf.T)
            Ep_l, Es_l = Qf @ Eb[:, k], Qf @ stokes(Eb[:, k])
            Dp = EPS0 * (Qf @ itf["eps_in"] @ Eb[:, k])[0]
            Ds = EPS0 * (Qf @ itf["eps_in"] @ stokes(Eb[:, k]))[0]
            bracket = (Ep_l[1:].conj() @ (tI - tO) @ Es_l[1:] - (iI - iO) * Dp.conj() * Ds
                       + Dp.conj() * ((cnI - cnO) @ Es_l[1:]) + (Ep_l[1:].conj() @ (ctI - ctO)) * Ds)
            Q_mb += (ub[0, k] * nrm[k, 0] + ub[1, k] * nrm[k, 1]) * bracket * dl[k] * UM
    return Q_pe, Q_ro, Q_mb, umax


def sbs_gain(opt, elastic, i, pe_regions, interfaces, mass_region=".*", **kwargs) -> dict:
    """Normalized backward SBS gain G_B/Q_m (1/(W m)) split into its contributions."""
    Q_pe, Q_ro, Q_mb, umax = overlaps(opt, elastic, i, pe_regions, interfaces, **kwargs)
    P = optical_power(opt)
    Om = elastic.Omega[i]
    m_int = elastic.mass_integral(i, mass_region) * UM**2
    pref = 2 * (2 * np.pi * freq0) / (P**2 * Om**2 * m_int)
    return dict(f=Om / (2 * np.pi * 1e9), m_eff=m_int / umax**2, PE=pref * abs(Q_pe) ** 2, MB=pref * abs(Q_mb) ** 2,
                RO=pref * abs(Q_ro) ** 2, total=pref * abs(Q_pe + Q_mb + Q_ro) ** 2, Q=(Q_pe, Q_mb, Q_ro), P=P)

For the free-standing waveguide, the photoelastic and roto-optic integrals run over the LN core, and the moving boundary runs along all four faces, with air outside.

def floating_gain(opt, elastic, i, p_lab, eps_r, **kwargs) -> dict:
    """Gain of the free-standing waveguide."""
    return sbs_gain(opt, elastic, i, [(wg_verts, p_lab, eps_r)], polygon_interfaces(wg_verts, eps_r, np.eye(3)), **kwargs)


gains = [floating_gain(opt, elastic, i, p_z, eps_z) for i in range(len(f_modes))]
print("  f (GHz)   m_eff (kg/m)   G_PE      G_MB      G_RO      G_total   (1/(W m))")
for g in gains:
    print(f"  {g['f']:7.4f}   {g['m_eff']:.3e}    {g['PE']:.4f}    {g['MB']:.5f}   {g['RO']:.1e}   {g['total']:.4f}")
  f (GHz)   m_eff (kg/m)   G_PE      G_MB      G_RO      G_total   (1/(W m))
   7.1953   1.655e-10    0.1144    0.00113   3.6e-06   0.1175
   7.2627   1.170e-10    0.0000    0.00000   1.1e-13   0.0000
   7.7036   1.780e-10    0.0756    0.00031   7.1e-07   0.0785
   8.0907   3.290e-10    0.0000    0.00000   4.6e-15   0.0000
   8.3574   2.578e-10    0.0000    0.00000   1.4e-15   0.0000
   8.4390   3.676e-10    0.0257    0.00199   6.1e-07   0.0135
   8.5724   5.888e-10    0.0037    0.00425   1.3e-06   0.0068
   8.8239   3.750e-10    0.0000    0.00000   2.8e-15   0.0000
   8.9667   3.179e-10    0.0027    0.00020   9.6e-07   0.0041
   9.2161   1.974e-10    0.0093    0.00202   2.0e-07   0.0037
fig, ax = plt.subplots(1, 1, figsize=(8, 3.5))
fs = np.array([g["f"] for g in gains])
ax.bar(fs - 0.012, [g["PE"] for g in gains], width=0.024, label="Photoelastic only")
ax.bar(fs + 0.012, [g["total"] for g in gains], width=0.024, label="Total")
ax.set_xlabel("Frequency (GHz)")
ax.set_ylabel(r"$G_B/Q_m$ (W$^{-1}$m$^{-1}$)")
ax.set_title(r"Free-standing Z-cut waveguide, $\theta_Z=0$")
ax.legend()
plt.tight_layout()
plt.show()

Validation Against Direct Mode Solves of the Deformed Waveguide

The overlap integrals are first-order perturbation theory, so we can test them against Tidy3D directly. For forward scattering (\(\mathbf{E}_s=\mathbf{E}_p\), \(q=0\)), the overlap of a static deformation predicts the effective-index shift \(\Delta n_\mathrm{eff}=c\,Q/(4P_\mathrm{avg})\). We apply a uniform in-plane dilation \(\mathbf{u}=s\,(x,y,0)\) with \(s=2\times10^{-3}\). Tidy3D then gives the photoelastic shift by solving with the strained permittivity, and the moving-boundary shift by solving the scaled geometry. To keep the strained medium diagonal, we use only the \(i=j\) entries of \(\mathbf{p}\) on both sides of the comparison.

s_dil = 2e-3


class Dilation:
    """Static deformation u = s (x, y, 0) with the same interface as ElasticModes."""

    Omega = np.array([1.0])
    q = 0.0

    def fields(self, i, x, y):
        x, y = np.asarray(x), np.asarray(y)
        u = s_dil * np.array([x, y, 0 * x]) * UM
        G = np.zeros((3, 3, len(x)), complex)
        G[0, 0] = G[1, 1] = s_dil * UM
        return u, G

    def mass_integral(self, i, region=".*"):
        return 1.0


p_diag = p_z * np.eye(3)[:, :, None, None]
deps = -eps_z @ np.einsum("ijkl,kl->ij", p_diag, np.diag([s_dil, s_dil, 0])) @ eps_z
g_dil = sbs_gain(opt, Dilation(), 0, [(wg_verts, p_diag, eps_z)], polygon_interfaces(wg_verts, eps_z, np.eye(3)), backward=False)
pred_pe, pred_mb = (td.C_0 * UM * np.real(Q) / g_dil["P"] for Q in g_dil["Q"][:2])


def n_eff_of(eps_r: np.ndarray, scale: float = 1.0) -> float:
    """n_eff for a given permittivity, with the cross-section scaled about the origin."""
    verts = trapezoid(w_top * scale, t_wg * scale, sidewall)
    return mode_fields(make_mode_sim(eps_r, verts=verts).run_local())["n_eff"]


dn_pe = (n_eff_of(eps_z + deps) - n_eff_of(eps_z - deps)) / 2
dn_mb = (n_eff_of(eps_z, 1 + s_dil) - n_eff_of(eps_z, 1 - s_dil)) / 2
print(f"photoelastic:     overlap {pred_pe:+.4e}   direct Tidy3D {dn_pe:+.4e}   ratio {pred_pe / dn_pe:.4f}")
print(f"moving boundary:  overlap {pred_mb:+.4e}   direct Tidy3D {dn_mb:+.4e}   ratio {pred_mb / dn_mb:.4f}")
photoelastic:     overlap -1.4930e-03   direct Tidy3D -1.4925e-03   ratio 1.0003
moving boundary:  overlap +1.5144e-03   direct Tidy3D +1.5030e-03   ratio 1.0076

Z-cut Orientation Sweep

Rotating the waveguide in the plane of a Z-cut film leaves the optical permittivity unchanged, since the optic axis stays vertical, so a single optical mode serves the whole sweep. The stiffness and photoelastic tensors, however, rotate with the waveguide. Because of LN’s threefold symmetry, together with the mirror symmetry of the trapezoid, the results repeat every \(60^\circ\), so we sweep \(\theta_Z\) from \(0^\circ\) to \(60^\circ\).

To draw each elastic mode as a continuous curve over the sweep, we track it from one angle to the next by its shape. We sample every mode on a coarse grid inside the core and pair the modes at neighboring angles with the largest normalized overlap \(|\langle\mathbf{u}_i,\mathbf{u}_j\rangle|\), using an optimal one-to-one assignment. Following the mode shape, rather than the frequency order, keeps a curve on the same physical mode where branches cross. Each curve is colored by the gain along it.

Xs, Ys = area_grid(wg_verts, 0.05)  # sample points for mode tracking


def track_branches(theta: np.ndarray, shapes: np.ndarray, min_overlap: float = 0.5) -> np.ndarray:
    """Branch label for every sweep point, matching mode shapes between neighboring angles."""
    shapes = shapes / np.linalg.norm(shapes, axis=1, keepdims=True)
    angles = np.unique(theta)
    branch = -np.ones(len(theta), int)
    prev = np.flatnonzero(theta == angles[0])
    branch[prev] = np.arange(len(prev))
    n_branch = len(prev)
    for a in angles[1:]:
        cur = np.flatnonzero(theta == a)
        overlap = np.abs(shapes[prev].conj() @ shapes[cur].T)
        for r, c in zip(*linear_sum_assignment(-overlap)):
            if overlap[r, c] > min_overlap:
                branch[cur[c]] = branch[prev[r]]
        for j in cur[branch[cur] < 0]:  # modes entering the frequency window start new branches
            branch[j] = n_branch
            n_branch += 1
        prev = cur
    return branch


def plot_branches(ax, theta: np.ndarray, freq: np.ndarray, gain: np.ndarray, branch: np.ndarray):
    """Draw mode branches as curves colored by the gain; returns the color mappable."""
    norm = plt.Normalize(0, gain.max())
    for b in np.unique(branch):
        k = np.flatnonzero(branch == b)
        k = k[np.argsort(theta[k])]
        if len(k) > 1:
            pts = np.c_[theta[k], freq[k]]
            lines = LineCollection(np.stack([pts[:-1], pts[1:]], axis=1), cmap="viridis", norm=norm, linewidths=2.5)
            lines.set_array(0.5 * (gain[k][:-1] + gain[k][1:]))
            ax.add_collection(lines)
    return ax.scatter(theta, freq, c=gain, cmap="viridis", norm=norm, s=10, zorder=3)

We now sweep the orientation and record the frequency, gain, and sampled shape of every mode.

thetas_z = np.arange(0, 61, 5)
sweep_z, shapes_z = [], []
for th in thetas_z:
    C_r, p_r, eps_r = ln_lab(ry(th) @ R_ZCUT)
    el = ElasticModes([("LN", wg_verts, C_r, rho_ln)], q_ac)
    el.solve(7.0, 10)
    for i in range(10):
        g = floating_gain(opt, el, i, p_r, eps_r)
        sweep_z.append((th, g["f"], g["PE"], g["total"]))
        shapes_z.append(el.fields(i, Xs, Ys)[0].ravel())
sweep_z = np.array(sweep_z)
branch_z = track_branches(sweep_z[:, 0], np.array(shapes_z))
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(13, 4))
sc = plot_branches(ax1, sweep_z[:, 0], sweep_z[:, 1], sweep_z[:, 3], branch_z)
fig.colorbar(sc, ax=ax1, label=r"$G_B/Q_m$ (W$^{-1}$m$^{-1}$)")
ax1.set_xlim(0, 60)
ax1.set_xlabel(r"$\theta_Z$ (deg)")
ax1.set_ylabel("Frequency (GHz)")
for col, label, style in ((3, "Total", "o-"), (2, "Photoelastic only", "s--")):
    ax2.plot(thetas_z, [sweep_z[sweep_z[:, 0] == th, col].max() for th in thetas_z], style, label=label, mfc="none")
ax2.set_xlabel(r"$\theta_Z$ (deg)")
ax2.set_ylabel(r"Peak $G_B/Q_m$ (W$^{-1}$m$^{-1}$)")
ax2.legend()
plt.tight_layout()
plt.show()

X-cut Orientation Sweep

In X-cut, rotating the waveguide by \(\theta_X\) tilts the optic axis between the propagation direction and the transverse direction. Away from \(0^\circ\) and \(90^\circ\), the lab-frame permittivity acquires an \(\varepsilon_{xz}\) term, and we need the fully anisotropic medium. That medium is staircased in the mode solver, which shifts \(n_\mathrm{eff}\) by an amount proportional to the cell size. We use a 5 nm grid and calibrate this offset once at \(\theta_X=0\), where the exact diagonal solve is available. The moving-boundary samples then sit two cells, or 10 nm, inside the interfaces. Because \(\varepsilon\) is no longer mirror symmetric in \(z\), the time-reversed Stokes field \(\mathbf{E}_p^*\) is the only correct choice here.

dl_x = 0.005


def make_mode_sim_full(eps_r: np.ndarray) -> td.ModeSimulation:
    """Mode simulation that always uses the fully anisotropic medium."""
    msim = make_mode_sim(eps_r, dl=dl_x)
    ln_medium = td.FullyAnisotropicMedium(permittivity=eps_r)
    return msim.updated_copy(structures=[msim.structures[0].updated_copy(medium=ln_medium)])


eps_x0 = ln_lab(R_XCUT)[2]
offset = mode_fields(make_mode_sim_full(eps_x0).run_local())["n_eff"] - mode_fields(make_mode_sim(eps_x0, dl=dl_x).run_local())["n_eff"]
print(f"staircase offset of the fully anisotropic solve at {dl_x * 1e3:.0f} nm: {offset:+.5f}")

thetas_x = np.arange(0, 181, 5)
sweep_x, shapes_x = [], []
for th in thetas_x:
    C_r, p_r, eps_r = ln_lab(ry(th) @ R_XCUT)
    diagonal = np.allclose(eps_r, np.diag(np.diag(eps_r)))
    opt_x = mode_fields((make_mode_sim(eps_r, dl=dl_x) if diagonal else make_mode_sim_full(eps_r)).run_local())
    n_eff = opt_x["n_eff"] - (0 if diagonal else offset)
    el = ElasticModes([("LN", wg_verts, C_r, rho_ln)], 4 * np.pi * n_eff / lda0)
    el.solve(7.0, 10)
    for i in range(10):
        g = floating_gain(opt_x, el, i, p_r, eps_r, delta=2 * dl_x)
        sweep_x.append((th, n_eff, g["f"], g["PE"], g["total"]))
        shapes_x.append(el.fields(i, Xs, Ys)[0].ravel())
sweep_x = np.array(sweep_x)
branch_x = track_branches(sweep_x[:, 0], np.array(shapes_x))
staircase offset of the fully anisotropic solve at 5 nm: +0.00298
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(13, 4))
sc = plot_branches(ax1, sweep_x[:, 0], sweep_x[:, 2], sweep_x[:, 4], branch_x)
fig.colorbar(sc, ax=ax1, label=r"$G_B/Q_m$ (W$^{-1}$m$^{-1}$)")
ax1.set_xlim(0, 180)
ax1.set_xlabel(r"$\theta_X$ (deg)")
ax1.set_ylabel("Frequency (GHz)")
for col, label, style in ((4, "Total", "o-"), (3, "Photoelastic only", "s--")):
    ax2.plot(thetas_x, [sweep_x[sweep_x[:, 0] == th, col].max() for th in thetas_x], style, label=label, mfc="none")
ax2.set_xlabel(r"$\theta_X$ (deg)")
ax2.set_ylabel(r"Peak $G_B/Q_m$ (W$^{-1}$m$^{-1}$)")
ax2.legend()
plt.tight_layout()
plt.show()

Waveguide on a Silica Substrate

In practice the LN strip sits on silica. The substrate can carry acoustic energy away, so a waveguide mode stays guided only if it is slower than every wave the substrate supports. For a free silica surface, the slowest of these is the Rayleigh surface wave. We compute its velocity \(v_R\) from the Rayleigh equation and compare it with the phase velocity \(v=\Omega/q\) of each waveguide mode.

def rayleigh_velocity(vl: float, vs: float) -> float:
    """Rayleigh surface-wave velocity of an isotropic half-space."""
    k = vs / vl
    f = lambda x: (2 - x**2) ** 2 - 4 * np.sqrt(1 - (k * x) ** 2) * np.sqrt(1 - x**2)
    return vs * brentq(f, 0.5, 0.9999)


v_r = rayleigh_velocity(vl_sio2, vs_sio2)
print(f"silica: shear velocity {vs_sio2:.0f} m/s, Rayleigh velocity {v_r:.0f} m/s")
silica: shear velocity 3763 m/s, Rayleigh velocity 3409 m/s

Guided modes decay into the substrate, so a closed substrate block that is large compared with the decay length gives their frequencies and gains without absorbing boundaries. We use a \(6\ \mu\text{m} \times 3\ \mu\text{m}\) silica block with a coarser mesh away from the core. Leaky modes, which are faster than \(v_R\), would need a perfectly matched layer (PML) around the substrate and a robust non-Hermitian eigensolver, and are not treated here. The coupling now includes the silica photoelasticity and three kinds of moving interface: LN/air, LN/silica, and the silica/air surface beside the waveguide.

def rect(x0, y0, x1, y1):
    return [(x0, y0), (x1, y0), (x1, y1), (x0, y1)]


opt_sub = mode_fields(make_mode_sim(eps_z, substrate=True).run_local())
q_sub = 4 * np.pi * opt_sub["n_eff"] / lda0
print(f"n_eff on silica = {opt_sub['n_eff']:.5f}")

elastic_sub = ElasticModes(
    [("LN", wg_verts, C_z, rho_ln), ("SiO2", rect(-3, -3, 3, 0), C_sio2, rho_sio2)],
    q_sub, maxh=0.1, fine={"LN": 0.03},
)
f_sub = elastic_sub.solve(7.6, 12)

bottom = lambda a, b: abs(a[1]) < 1e-12 and abs(b[1]) < 1e-12
r_bot = wg_verts[0][0]
sub_interfaces = (
    polygon_interfaces(wg_verts, eps_z, np.eye(3), keep=lambda a, b: not bottom(a, b))
    + polygon_interfaces(wg_verts, eps_z, eps_sio2, keep=bottom)
    + [interface((-1.9, 0), (-r_bot, 0), (0, 1), eps_sio2, np.eye(3)),
       interface((r_bot, 0), (1.9, 0), (0, 1), eps_sio2, np.eye(3))]
)
sub_pe = [(wg_verts, p_z, eps_z), (rect(-1.9, -1.6, 1.9, 0), p_sio2, eps_sio2)]

print("  f (GHz)   v (m/s)   LN energy   G_PE      G_MB      G_total   (1/(W m))")
for i in range(len(f_sub)):
    ln_frac = elastic_sub.mass_integral(i, "LN") / elastic_sub.mass_integral(i)
    v_ph = elastic_sub.Omega[i] / (q_sub / UM)
    if ln_frac > 0.5 and v_ph < v_r:
        g = sbs_gain(opt_sub, elastic_sub, i, sub_pe, sub_interfaces)
        print(f"  {g['f']:7.4f}   {v_ph:7.0f}   {ln_frac:9.2f}   {g['PE']:.4f}    {g['MB']:.5f}   {g['total']:.4f}")
n_eff on silica = 1.79719
  f (GHz)   v (m/s)   LN energy   G_PE      G_MB      G_total   (1/(W m))
   7.7861      3358        0.97   0.1338    0.00005   0.1378

The guided surface acoustic wave stays confined to the LN film because its phase velocity lies below the Rayleigh velocity of the silica surface, so neither the bulk waves nor the surface wave of the substrate can carry its energy away.