Waveguide crosstalk (EME)

Waveguide crosstalk (EME)#

In this notebook, we reproduce Fig. 4.19 of , which calculates the maximum cross talk between strips waveguides of different dimensions.

First, we setup a coupled waveguide system:

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import shapely
from meshwell.model import Model
from meshwell.polysurface import PolySurface
from skfem import Basis, ElementTriP0, Mesh
from skfem.io.meshio import from_meshio

from femwell.maxwell.waveguide import compute_modes
from femwell.visualization import plot_domains

First, we precisely extract the refractive index of silicon at 1.55 um using a Lorentz fit:

si_data = np.loadtxt("../reference_data/Palik/palik_silicon.txt", skiprows=1)
c = 299792458  # m/s


def ncore(wl):
    # Assume wl provided in um
    wl_m = wl * 1e-6
    eps = 7.9874
    eps_lorentz = 3.6880
    w0 = 3.9328e15
    return np.sqrt(eps + eps_lorentz * w0**2 / (w0**2 - (2 * np.pi * c / wl_m) ** 2))


wls = np.linspace(1.100, 1.800, 1000)

plt.scatter(si_data[:, 0] * 1e-3, si_data[:, 1], label="data")
plt.plot(wls, ncore(wls), label="Lorentz")
plt.xlim([1.100, 1.800])
plt.ylim([3.45, 3.55])
plt.xlabel("Wavelength (um)")
plt.ylabel("n")
plt.legend()
plt.title("Silicon")
Text(0.5, 1.0, 'Silicon')
../../_images/fdfc50b13e4066ec5501bda6a977166a4e2d31a2ab56a9646650d89c956620db.png
def coupled_waveguides_crosstalk(
    width_A: float = 0.5,
    width_B: float = 0.5,
    gap: float = 1.0,
    thickness: float = 0.22,
    core_index: float = ncore(1.55),
    clad_index: float = 1.444,
    wavelength: float = 1.55,
    simulation_padding: float = 2.0,
    plot_geometry: bool = False,
    plot_modes: bool = False,
):
    # Define mesh
    waveguide_A_polygon = shapely.geometry.box(-width_A - gap / 2, 0, -gap / 2, thickness)
    waveguide_B_polygon = shapely.geometry.box(gap / 2, 0, width_B + gap / 2, thickness)
    cladding_polygon = shapely.geometry.box(
        -width_A / 2 - gap / 2 - simulation_padding,
        -simulation_padding,
        width_B / 2 + gap / 2 + simulation_padding,
        simulation_padding + thickness,
    )

    model = Model()

    waveguide_A = PolySurface(
        polygons=waveguide_A_polygon,
        model=model,
        physical_name="waveguide_A",
        resolution={"resolution": 0.05, "DistMax": 1.0, "SizeMax": 0.2},
        mesh_order=1,
    )
    waveguide_B = PolySurface(
        polygons=waveguide_B_polygon,
        model=model,
        physical_name="waveguide_B",
        resolution={"resolution": 0.05, "DistMax": 1.0, "SizeMax": 0.2},
        mesh_order=1,
    )
    cladding = PolySurface(
        polygons=cladding_polygon,
        model=model,
        physical_name="cladding",
        mesh_order=2,
    )

    mesh = from_meshio(
        model.mesh(
            entities_list=[waveguide_A, waveguide_B, cladding],
            filename="mesh.msh",
            default_characteristic_length=0.2,
        )
    )

    basis0 = Basis(mesh, ElementTriP0(), intorder=4)

    # Solve for mode A in isolation
    epsilon = basis0.zeros(dtype=complex)
    for subdomain, n in {
        "waveguide_A": core_index,
        "waveguide_B": clad_index,
        "cladding": clad_index,
    }.items():
        epsilon[basis0.get_dofs(elements=subdomain)] = n**2

    if plot_geometry:
        mesh.draw().show()
        plt.show()
        plot_domains(mesh)
        plt.show()

        fig, axs = plt.subplots(1, 2)
        for ax in axs:
            ax.set_aspect(1)
        axs[0].set_title(r"$\Re\epsilon$, waveguide A")
        basis0.plot(epsilon.real, colorbar=True, ax=axs[0])
        axs[1].set_title(r"$\Im\epsilon$, waveguide A")
        basis0.plot(epsilon.imag, shading="gouraud", colorbar=True, ax=axs[1])
        plt.show()

    # Get modes
    modes_A = compute_modes(
        basis0,
        epsilon,
        wavelength=wavelength,
        num_modes=1,
        order=2,
        radius=np.inf,
    )
    beta_A = np.real(modes_A[0].n_eff) * 2 * np.pi / wavelength

    if plot_modes:
        modes_A[0].plot(modes_A[0].E.real, colorbar=True, direction="x")
        plt.show()

    # Solve for mode B in isolation
    epsilon = basis0.zeros(dtype=complex)
    for subdomain, n in {
        "waveguide_A": clad_index,
        "waveguide_B": core_index,
        "cladding": clad_index,
    }.items():
        epsilon[basis0.get_dofs(elements=subdomain)] = n**2

    if plot_geometry:
        mesh.draw().show()
        plt.show()
        plot_domains(mesh)
        plt.show()

        fig, axs = plt.subplots(1, 2)
        for ax in axs:
            ax.set_aspect(1)
        axs[0].set_title(r"$\Re\epsilon$, waveguide B")
        basis0.plot(epsilon.real, colorbar=True, ax=axs[0])
        axs[1].set_title(r"$\Im\epsilon$, waveguide B")
        basis0.plot(epsilon.imag, shading="gouraud", colorbar=True, ax=axs[1])
        plt.show()

    # We do not need B in this formulation
    # modes_B = compute_modes(
    #     basis0,
    #     epsilon,
    #     wavelength=wavelength,
    #     num_modes=1,
    #     order=2,
    #     radius=np.inf,
    # )
    # beta_B = np.real(modes_B[0].n_eff) * 2 * np.pi / wavelength

    # if plot_modes:
    #     modes_B[0].plot(modes_B[0].E.real, colorbar=True, direction="x")
    #     plt.show()

    # Solve for hybrid modes
    epsilon = basis0.zeros(dtype=complex)
    for subdomain, n in {
        "waveguide_A": core_index,
        "waveguide_B": core_index,
        "cladding": clad_index,
    }.items():
        epsilon[basis0.get_dofs(elements=subdomain)] = n**2

    if plot_geometry:
        mesh.draw().show()
        plt.show()
        plot_domains(mesh)
        plt.show()

        fig, axs = plt.subplots(1, 2)
        for ax in axs:
            ax.set_aspect(1)
        axs[0].set_title(r"$\Re\epsilon$, coupler")
        basis0.plot(epsilon.real, colorbar=True, ax=axs[0])
        axs[1].set_title(r"$\Im\epsilon$, coupler")
        basis0.plot(epsilon.imag, shading="gouraud", colorbar=True, ax=axs[1])
        plt.show()

    modes_full = compute_modes(
        basis0,
        epsilon,
        wavelength=wavelength,
        num_modes=2,
        order=2,
        radius=np.inf,
    )
    beta_full_1 = np.real(modes_full[0].n_eff) * 2 * np.pi / wavelength
    beta_full_2 = np.real(modes_full[1].n_eff) * 2 * np.pi / wavelength

    if plot_modes:
        modes_full[0].plot(modes_full[0].E.real, colorbar=True, direction="x")
        plt.show()
        modes_full[1].plot(modes_full[1].E.real, colorbar=True, direction="x")
        plt.show()

    # Overlap integrals
    A_into_1 = np.abs(modes_A[0].calculate_overlap(modes_full[0])) ** 2
    A_into_2 = np.abs(modes_A[0].calculate_overlap(modes_full[1])) ** 2

    coeff1 = np.sqrt(A_into_1) / np.sqrt(A_into_1 + A_into_2)  # normalize
    coeff2 = np.sqrt(A_into_2) / np.sqrt(A_into_1 + A_into_2)  # normalize

    # Worst case EME crosstalk calculation
    # Cross talk as defined in the book: 0 dB is full cross-talk
    # return 10*np.log10(1 - (np.abs(coeff1) ** 4 + np.abs(coeff2) ** 4 - 2 * np.abs(coeff1)**2 * np.abs(coeff2)**2))
    return coeff1, coeff2, beta_full_1, beta_full_2

Some functions to manipulate the returned overlap coefficients and betas:

def PA(coeff1, coeff2, beta_full_1, beta_full_2, L, wavelength=1.55):
    """Power in waveguide A vs propagation length"""
    return (
        np.abs(coeff1) ** 4
        + np.abs(coeff2) ** 4
        + 2 * np.abs(coeff1) ** 2 * np.abs(coeff2) ** 2 * np.cos((beta_full_2 - beta_full_1) * L)
    )


def PB(coeff1, coeff2, beta_full_1, beta_full_2, L):
    """Power in waveguide B vs propagation length"""
    return 1 - PA(coeff1, coeff2, beta_full_1, beta_full_2, L)


def dB(lin: float = 0.0):
    """Conversion to dB"""
    return 10 * np.log10(lin)

Run the simulation for two gaps and two sets of widths:

coeff1s = {}
coeff2s = {}
beta_full_1s = {}
beta_full_2s = {}

width_A = 0.5
widths_B = [0.4, 0.5]
gaps = [0.2, 0.4]

for width_B in widths_B:
    for gap in gaps:
        coeff1, coeff2, beta_full_1, beta_full_2 = coupled_waveguides_crosstalk(
            width_A=width_A,
            width_B=width_B,
            gap=gap,
            thickness=0.22,
            core_index=3.48,
            clad_index=1.44,
            wavelength=1.55,
            simulation_padding=3.0,
            plot_geometry=True,
            plot_modes=True,
        )

        coeff1s[(width_B, gap)] = coeff1
        coeff2s[(width_B, gap)] = coeff2
        beta_full_1s[(width_B, gap)] = beta_full_1
        beta_full_2s[(width_B, gap)] = beta_full_2
Hide code cell output
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference - Performing intersection of shapes                                                                                
Info    : [ 80%] Difference - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments - Performing intersection of shapes                                                                                
Info    : [ 80%] Fragments - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference                                                                                  
Info    : [ 20%] Difference                                                                                  
Info    : [ 30%] Difference                                                                                  
Info    : [ 40%] Difference                                                                                  
Info    : [ 50%] Difference                                                                                  
Info    : [ 60%] Difference                                                                                  
Info    : [ 70%] Difference                                                                                  
Info    : [ 80%] Difference - Making faces                                                                                
Info    : [ 90%] Difference - Adding holes                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments                                                                                  
Info    : [ 40%] Fragments                                                                                  
Info    : [ 70%] Fragments                                                                                  
Info    : [ 80%] Fragments - Splitting faces                                                                                
                                                                                
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 3 (Line)
Info    : [  0%] Meshing curve 1 (Line)
Info    : [  0%] Meshing curve 4 (Line)
Info    : [  0%] Meshing curve 5 (Line)
Info    : [ 20%] Meshing curve 6 (Line)
Info    : [ 20%] Meshing curve 2 (Line)
Info    : [ 30%] Meshing curve 7 (Line)
Info    : [ 30%] Meshing curve 8 (Line)
Info    : [ 50%] Meshing curve 9 (Line)
Info    : [ 50%] Meshing curve 10 (Line)
Info    : [ 50%] Meshing curve 11 (Line)
Info    : [ 50%] Meshing curve 12 (Line)
Info    : Done meshing 1D (Wall 0.00247822s, CPU 0.00554s)
Info    : Meshing 2D...
Info    : [  0%] Meshing surface 3 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 1 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 2 (Plane, Frontal-Delaunay)
Info    : Done meshing 2D (Wall 0.0707484s, CPU 0.095994s)
Info    : 2983 nodes 6032 elements
Info    : Writing 'mesh.msh'...
Info    : Done writing 'mesh.msh'
Info    : Writing '/tmp/tmp5ilw3tn2/mesh.msh'...
Info    : Done writing '/tmp/tmp5ilw3tn2/mesh.msh'
../../_images/70ed5ee5b9b83f0021592d88b7720b2048234e6ba24764358f7813324e8bbce6.png ../../_images/117f505218ca3230707a69decc2b07c1e0ea9b4372f0682cbb462ef7401fbd17.png ../../_images/51e8f5ef61236057fe07cbfdd74bb4c104b764aa66169a8f207f8dbb38c48f8a.png ../../_images/f64bc63d3b87a47197fdeb0a3940520eeda5d8b04238192d72c6d7cd2b404478.png ../../_images/70ed5ee5b9b83f0021592d88b7720b2048234e6ba24764358f7813324e8bbce6.png ../../_images/117f505218ca3230707a69decc2b07c1e0ea9b4372f0682cbb462ef7401fbd17.png ../../_images/7f62126f03be3ce57f6640643569eaaeea5ec8b49c15e69a92d7832fe6e07e77.png ../../_images/70ed5ee5b9b83f0021592d88b7720b2048234e6ba24764358f7813324e8bbce6.png ../../_images/117f505218ca3230707a69decc2b07c1e0ea9b4372f0682cbb462ef7401fbd17.png ../../_images/8ba3d003d871886ed2f6a9cc51ce900783c7805311418dcc83f801b0b3e70464.png ../../_images/3713bd5c26baaaa9c1a3957a0ffc12b612d9e9d8960d20461ae49e18c4be304a.png ../../_images/5cabb26fd1ec3748ba28d177d8635492c8a8eba2a5666da8cf824a41f1af5334.png
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference - Performing intersection of shapes                                                                                
Info    : [ 80%] Difference - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments - Performing intersection of shapes                                                                                
Info    : [ 80%] Fragments - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference                                                                                  
Info    : [ 20%] Difference                                                                                  
Info    : [ 30%] Difference                                                                                  
Info    : [ 40%] Difference                                                                                  
Info    : [ 50%] Difference                                                                                  
Info    : [ 60%] Difference                                                                                  
Info    : [ 70%] Difference                                                                                  
Info    : [ 80%] Difference - Making faces                                                                                
Info    : [ 90%] Difference - Adding holes                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments                                                                                  
Info    : [ 40%] Fragments                                                                                  
Info    : [ 70%] Fragments                                                                                  
Info    : [ 80%] Fragments - Splitting faces                                                                                
                                                                                
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 1 (Line)
Info    : [  0%] Meshing curve 3 (Line)
Info    : [  0%] Meshing curve 2 (Line)
Info    : [  0%] Meshing curve 4 (Line)
Info    : [ 10%] Meshing curve 5 (Line)
Info    : [ 10%] Meshing curve 6 (Line)
Info    : [ 10%] Meshing curve 7 (Line)
Info    : [ 40%] Meshing curve 8 (Line)
Info    : [ 40%] Meshing curve 9 (Line)
Info    : [ 40%] Meshing curve 10 (Line)
Info    : [ 60%] Meshing curve 11 (Line)
Info    : [ 60%] Meshing curve 12 (Line)
Info    : Done meshing 1D (Wall 0.00269032s, CPU 0.006815s)
Info    : Meshing 2D...
Info    : [  0%] Meshing surface 2 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 1 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 3 (Plane, Frontal-Delaunay)
Info    : Done meshing 2D (Wall 0.0748793s, CPU 0.103867s)
Info    : 3175 nodes 6416 elements
Info    : Writing 'mesh.msh'...
Info    : Done writing 'mesh.msh'
Info    : Writing '/tmp/tmpw2fwmma_/mesh.msh'...
Info    : Done writing '/tmp/tmpw2fwmma_/mesh.msh'
Warning : Logger already started - ignoring
../../_images/fcf1a4e238d0e748501b87878f4dc68fc18fa0f3522dc2903121aab2b540866f.png ../../_images/dfa7b998dba2f453e02af180448db45a32e58c26f763df9fa41c20e8532f3437.png ../../_images/97d991c6a67079fbc9262b4a23bcfb0bc5bafa0160fa05b6c1a6bfffe93e6708.png ../../_images/3cbf021278401d2c530674234fceec5b650d8dc074f35257f103a1ed7ffc88ce.png ../../_images/fcf1a4e238d0e748501b87878f4dc68fc18fa0f3522dc2903121aab2b540866f.png ../../_images/dfa7b998dba2f453e02af180448db45a32e58c26f763df9fa41c20e8532f3437.png ../../_images/47be9604a31021c85b3aa9fbcf00435dab375dc316c2727a8074072537a0b395.png ../../_images/fcf1a4e238d0e748501b87878f4dc68fc18fa0f3522dc2903121aab2b540866f.png ../../_images/dfa7b998dba2f453e02af180448db45a32e58c26f763df9fa41c20e8532f3437.png ../../_images/d81ee2ac76f7537b32c9b6ecbc920173f6f1091279e728415b043ffe05c299d0.png ../../_images/87e20dc4ea3398a309eeb7f5223dd9055668442a21600073bd5dd8772d941a40.png ../../_images/b148fb68e8b167682ccb2ace3dc8dde47359923bfaf9bd98aa2aed3f46983990.png
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference - Performing intersection of shapes                                                                                
Info    : [ 80%] Difference - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments - Performing intersection of shapes                                                                                
Info    : [ 80%] Fragments - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference                                                                                  
Info    : [ 20%] Difference                                                                                  
Info    : [ 30%] Difference                                                                                  
Info    : [ 40%] Difference                                                                                  
Info    : [ 50%] Difference                                                                                  
Info    : [ 60%] Difference                                                                                  
Info    : [ 70%] Difference                                                                                  
Info    : [ 80%] Difference - Making faces                                                                                
Info    : [ 90%] Difference - Adding holes                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments                                                                                  
Info    : [ 40%] Fragments                                                                                  
Info    : [ 70%] Fragments                                                                                  
Info    : [ 80%] Fragments - Splitting faces                                                                                
                                                                                
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 1 (Line)
Info    : [  0%] Meshing curve 2 (Line)
Info    : [  0%] Meshing curve 3 (Line)
Info    : [  0%] Meshing curve 4 (Line)
Info    : [  0%] Meshing curve 5 (Line)
Info    : [ 20%] Meshing curve 6 (Line)
Info    : [ 20%] Meshing curve 7 (Line)
Info    : [ 20%] Meshing curve 8 (Line)
Info    : [ 20%] Meshing curve 9 (Line)
Info    : [ 20%] Meshing curve 10 (Line)
Info    : [ 60%] Meshing curve 11 (Line)
Info    : [ 60%] Meshing curve 12 (Line)
Info    : Done meshing 1D (Wall 0.000794718s, CPU 0.001019s)
Info    : Meshing 2D...
Info    : [  0%] Meshing surface 2 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 1 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 3 (Plane, Frontal-Delaunay)
Info    : Done meshing 2D (Wall 0.0682911s, CPU 0.100008s)
Info    : 3006 nodes 6082 elements
Info    : Writing 'mesh.msh'...
Info    : Done writing 'mesh.msh'
Info    : Writing '/tmp/tmpes3ek3c7/mesh.msh'...
Info    : Done writing '/tmp/tmpes3ek3c7/mesh.msh'
Warning : Logger already started - ignoring
../../_images/5257dc19038b732c4b8072519486bd1b679fec721265fe9592823b24bf9deb94.png ../../_images/928ab7534f76decb427bd15448730296364bdc05438fed9151d4fd4baa47fbf9.png ../../_images/0ec91a4191b4ae8c5804b18de0a18278a194df3f2b5908dc675dc2404f561a4d.png ../../_images/d78e96cd896101436e532a34af376c44f5bc8589e286b9dd6a3aef26aad6d69b.png ../../_images/5257dc19038b732c4b8072519486bd1b679fec721265fe9592823b24bf9deb94.png ../../_images/928ab7534f76decb427bd15448730296364bdc05438fed9151d4fd4baa47fbf9.png ../../_images/02c6d1e81f121225b42ca9459080ef599a4a2c9482e1bd259feac02c4dd0e522.png ../../_images/5257dc19038b732c4b8072519486bd1b679fec721265fe9592823b24bf9deb94.png ../../_images/928ab7534f76decb427bd15448730296364bdc05438fed9151d4fd4baa47fbf9.png ../../_images/79560fae5fddca1cf0905c5ebc9d27c9ceb1cee2787cadbb1b5002bf8e3c9506.png ../../_images/ab9cdfca25212522dc360a0ec37df6e32d2eb43e89260f5aed081724eb6b0cb5.png ../../_images/852257ba55cd11a3a121904f0df126f17bdfb1e1bf0a3f71f86d80cab70920ea.png
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference - Performing intersection of shapes                                                                                
Info    : [ 80%] Difference - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments - Performing intersection of shapes                                                                                
Info    : [ 80%] Fragments - Building splits of containers                                                                                
                                                                                
Info    : [  0%] Difference                                                                                  
Info    : [ 10%] Difference                                                                                  
Info    : [ 20%] Difference                                                                                  
Info    : [ 30%] Difference                                                                                  
Info    : [ 40%] Difference                                                                                  
Info    : [ 50%] Difference                                                                                  
Info    : [ 60%] Difference                                                                                  
Info    : [ 70%] Difference                                                                                  
Info    : [ 80%] Difference - Making faces                                                                                
Info    : [ 90%] Difference - Adding holes                                                                                
Info    : [  0%] Fragments                                                                                  
Info    : [ 10%] Fragments                                                                                  
Info    : [ 40%] Fragments                                                                                  
Info    : [ 70%] Fragments                                                                                  
Info    : [ 80%] Fragments - Splitting faces                                                                                
                                                                                
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 2 (Line)
Info    : [  0%] Meshing curve 3 (Line)
Info    : [  0%] Meshing curve 4 (Line)
Info    : [ 10%] Meshing curve 6 (Line)
Info    : [  0%] Meshing curve 1 (Line)
Info    : [ 10%] Meshing curve 7 (Line)
Info    : [ 40%] Meshing curve 8 (Line)
Info    : [ 40%] Meshing curve 9 (Line)
Info    : [ 40%] Meshing curve 10 (Line)
Info    : [ 60%] Meshing curve 11 (Line)
Info    : [ 60%] Meshing curve 12 (Line)
Info    : [ 10%] Meshing curve 5 (Line)
Info    : Done meshing 1D (Wall 0.00379967s, CPU 0.010165s)
Info    : Meshing 2D...
Info    : [  0%] Meshing surface 1 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 3 (Plane, Frontal-Delaunay)
Info    : [  0%] Meshing surface 2 (Plane, Frontal-Delaunay)
Info    : Done meshing 2D (Wall 0.0790151s, CPU 0.105941s)
Info    : 3282 nodes 6634 elements
Info    : Writing 'mesh.msh'...
Info    : Done writing 'mesh.msh'
Info    : Writing '/tmp/tmpmijvv80b/mesh.msh'...
Info    : Done writing '/tmp/tmpmijvv80b/mesh.msh'
Warning : Logger already started - ignoring
../../_images/bade79c58ddab41c5718d7e3aec2adf71be45acefa86bc974909d1b14cda1947.png ../../_images/1c0accbdd0d51dddd6685e050b3b7ededa45b113b9ca1954fc525b75a433674e.png ../../_images/137c736ea609ae105b82afa2bad4a7757ada45f557ea4c8098f2b848870e3225.png ../../_images/569ce7e1c8feb5ec3f54b8449098a2cc04957b961d3b4050945c3f055f56c9a8.png ../../_images/bade79c58ddab41c5718d7e3aec2adf71be45acefa86bc974909d1b14cda1947.png ../../_images/1c0accbdd0d51dddd6685e050b3b7ededa45b113b9ca1954fc525b75a433674e.png ../../_images/37aaece2f33a7f40f308cc30bcaca8ad4d8afd7ad564e76f0068365792713815.png ../../_images/bade79c58ddab41c5718d7e3aec2adf71be45acefa86bc974909d1b14cda1947.png ../../_images/1c0accbdd0d51dddd6685e050b3b7ededa45b113b9ca1954fc525b75a433674e.png ../../_images/d60141f03db56e59f14f1df6104d7bd5bd5262d6b7efa20e7400bc237814f0cb.png ../../_images/89a4f38c3f615a9de19567a4ce7b4d4eab3a72fe960db131918bf8045ec4a752.png ../../_images/7aa3f47338f1e95ea11431cfc65007863d93a8bcf7bb3275012963ad965c52f5.png

Using the coupling coefficients and propagation constants, we plot the power in each waveguide as a function of propagation distance, and compare to reference data (light shade):

Chrostowski_4p19a = np.genfromtxt(
    "../reference_data/Chrostowski/Chrostowski_4p19a.csv", skip_header=2, delimiter=","
)
Chrostowski_4p19b = np.genfromtxt(
    "../reference_data/Chrostowski/Chrostowski_4p19b.csv", skip_header=2, delimiter=","
)
L = np.linspace(0, 70, 10000)  # um

cmap = mpl.colormaps["tab10"]
colors = cmap(np.linspace(0, 1, 11))

widths_B_list = [widths_B[0], widths_B[1], widths_B[1], widths_B[0]]
gaps_list = [gaps[0], gaps[0], gaps[0], gaps[0]]
colors_index = [3, 0, 1, 2]
functions_list = [PA, PA, PB, PB]

for width, gap, function, color_ind in zip(widths_B_list, gaps_list, functions_list, colors_index):
    plt.plot(
        L,
        dB(
            function(
                coeff1s[(width, gap)],
                coeff2s[(width, gap)],
                beta_full_1s[(width, gap)],
                beta_full_2s[(width, gap)],
                L,
            )
        ),
        color=colors[color_ind],
        label=f"{width_A*1E3:1.0f} nm, {width*1E3:1.0f} nm, {gap*1E3:1.0f} nm, {function.__name__}",
    )

plt.plot(Chrostowski_4p19a[:, 2], Chrostowski_4p19a[:, 3], color=colors[0], alpha=0.3, linewidth=5)
plt.plot(Chrostowski_4p19a[:, 4], Chrostowski_4p19a[:, 5], color=colors[1], alpha=0.3, linewidth=5)
plt.plot(Chrostowski_4p19a[:, 0], Chrostowski_4p19a[:, 1], color=colors[2], alpha=0.3, linewidth=5)

plt.legend(title="Width A, Width B, gap, guide", bbox_to_anchor=[1.0, 1.0])
plt.title("Power in waveguide A (PA, initially 100%) or waveguide B (PB, initially 0%)")

plt.ylim([-60, 5])

plt.ylabel("Normalized power in waveguide / dB")
plt.xlabel("Length / um")
/tmp/ipykernel_7561/421449922.py:17: RuntimeWarning: invalid value encountered in log10
  return 10 * np.log10(lin)
Text(0.5, 0, 'Length / um')
../../_images/30ad31828fc709a083ba547addb65e53cdba2a2208fdeb06c0ad041b710a1ca3.png
L = np.linspace(0, 70, 10000)  # um

cmap = mpl.colormaps["tab10"]
colors = cmap(np.linspace(0, 1, 11))

widths_B_list = [widths_B[0], widths_B[1], widths_B[1], widths_B[0]]
gaps_list = [gaps[1], gaps[1], gaps[1], gaps[1]]
colors_index = [3, 0, 1, 2]
functions_list = [PA, PA, PB, PB]

for width, gap, function, color_ind in zip(widths_B_list, gaps_list, functions_list, colors_index):
    plt.plot(
        L,
        dB(
            function(
                coeff1s[(width, gap)],
                coeff2s[(width, gap)],
                beta_full_1s[(width, gap)],
                beta_full_2s[(width, gap)],
                L,
            )
        ),
        color=colors[color_ind],
        label=f"{width_A*1E3:1.0f} nm, {width*1E3:1.0f} nm, {gap*1E3:1.0f} nm, {function.__name__}",
    )

plt.plot(Chrostowski_4p19b[:, 2], Chrostowski_4p19b[:, 3], color=colors[0], alpha=0.3, linewidth=5)
plt.plot(Chrostowski_4p19b[:, 4], Chrostowski_4p19b[:, 5], color=colors[1], alpha=0.3, linewidth=5)
plt.plot(Chrostowski_4p19b[:, 0], Chrostowski_4p19b[:, 1], color=colors[2], alpha=0.3, linewidth=5)

plt.legend(title="Width A, Width B, gap, guide", bbox_to_anchor=[1.0, 1.0])
plt.title("Power in waveguide A (PA, initially 100%) or waveguide B (PB, initially 0%)")

plt.ylim([-60, 5])

plt.ylabel("Normalized power in waveguide / dB")
plt.xlabel("Length / um")
/tmp/ipykernel_7561/421449922.py:17: RuntimeWarning: divide by zero encountered in log10
  return 10 * np.log10(lin)
Text(0.5, 0, 'Length / um')
../../_images/0ec9806219b40fc4a09ddd75f7af17090a6b59d75070a4ae1d286ae2fecc687a.png