Noise floor of overlap integrals

Noise floor of overlap integrals#

The overlap integral between neighboring waveguides is one way to determine the coupling between neighboring waveguides. As the modes decay exponentially outside the core after a certain distance, the overlap integral also decays in good approximation exponentially. In order to see how good the estimation of the overlap integral is and to see at which distance the coupling is too weak to be estimated precisely using this methodology, we calculate the coupling as a function of the distance in the following.

For this example we chose two silicon nitride waveguides with a width of 1μm and a thickness of 0.3μm. Those waveguides are ontop of a silicon dioxide layer and air-clad.

Hide code cell source
using PyCall

all_distances = 1:1.0:30
distances = Float64[]
overlaps = Float64[]

mode_1 = nothing
mode_2 = nothing
Ω = nothing

for distance in all_distances
    println(distance)

    py"""
    import numpy as np
    import shapely
    import shapely.geometry
    import shapely.affinity
    from shapely.ops import clip_by_rect, unary_union
    from collections import OrderedDict
    from femwell.mesh import mesh_from_OrderedDict

    distance = $distance
    wg_width = 1
    wg_thickness = 0.3
    core = shapely.geometry.box(-wg_width / 2, 0, +wg_width / 2, wg_thickness)
    core1 = shapely.affinity.translate(core, xoff=distance/2)
    core2 = shapely.affinity.translate(core, xoff=-distance/2)
    env = unary_union([core1, core2]).buffer(max(5,distance), quad_segs = 2)

    polygons = OrderedDict(
        core1=core1,
        core2=core2,
        box = clip_by_rect(env, -np.inf, -np.inf, np.inf, 0),
        clad = clip_by_rect(env, -np.inf, 0, np.inf, np.inf),
    )

    resolutions = {f"core{i}": {"resolution": 0.05, "distance": 1} for i in [1,2]}
    mesh = mesh_from_OrderedDict(
        polygons,
        resolutions,
        default_resolution_max = 1,
        filename = "mesh.msh"
    )
    """
    using Gridap
    using Gridap.Geometry
    using Gridap.Visualization
    using Gridap.ReferenceFEs
    using GridapGmsh
    using GridapMakie, CairoMakie

    using Femwell.Maxwell.Waveguide

    order = 1

    CairoMakie.inline!(true)

    model = GmshDiscreteModel("mesh.msh")
    Ω = Triangulation(model)
    labels = get_face_labeling(model)
    τ = CellField(get_face_tag(labels, num_cell_dims(model)), Ω)

    fig = plot(Ω)
    fig.axis.aspect = DataAspect()
    wireframe!(Ω, color = :black, linewidth = 1)
    display(fig)

    epsilons = ["core1" => 1.9963^2, "core2" => 1.444^2, "box" => 1.444^2, "clad" => 1.0^2]
    ε(tag) = Dict(get_tag_from_name(labels, u) => v for (u, v) in epsilons)[tag]
    @time modes_1 = calculate_modes(model, ε  τ, λ = 1.55, num = 1, order = order)
    println(n_eff(modes_1[1]))

    if length(distances) == 0
        push!(distances, 0)
        push!(overlaps, overlap(modes_1[1], modes_1[1]))
    end

    epsilons = ["core1" => 1.444^2, "core2" => 1.9963^2, "box" => 1.444^2, "clad" => 1.0^2]
    ε(tag) = Dict(get_tag_from_name(labels, u) => v for (u, v) in epsilons)[tag]
    modes_2 = calculate_modes(model, ε  τ, λ = 1.55, num = 1, order = order)
    println(n_eff(modes_2[1]))

    overlap_integral = overlap(modes_1[1], modes_2[1])
    println(overlap_integral)
    push!(distances, distance)
    push!(overlaps, abs(overlap_integral))

    if distance == last(all_distances)
        plot_mode(modes_1[1])
        plot_mode(modes_2[1])
    end
end
Hide code cell output
1.0
WARNING: Method definition (::Main.var"#ε#3"{labels})(Any) in module Main at In[1]:70 overwritten at In[1]:80.
Info    : Reading 'mesh.msh'...
Info    : 43 entities
Info    : 1104 nodes
Info    : 2288 elements
Info    : Done reading 'mesh.msh'
../_images/5b45cc23b9b03e881bb3747679af4e4651e94f5325f1eb599608fae1aeb0495b.png
 64.335426 seconds (93.34 M allocations: 6.092 GiB, 5.06% gc time, 99.07% compilation time: 1% of which was recompilation)
1.5082524342791668 + 0.0im
1.5082529968556588 + 0.0im
0.4010136455306138
 + 0.0im
2.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1498 nodes
Info    : 3087 elements
Info    : Done reading 'mesh.msh'
../_images/b0fa900537cab54d2bca5517b359eb0f64c9e85f4c573b7bc56c592fcdece3d2.png
  0.674811 seconds (975.28 k allocations: 242.239 MiB, 3.45% gc time, 1.11% compilation time)
1.4922643739390187 + 0.0im
1.4922623594825648 + 0.0im
-0.03794356916880129 + 0.0im
3.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1703 nodes
Info    : 3497 elements
Info    : Done reading 'mesh.msh'
../_images/5a415366115933e240f9a5f9100cd977fa5d01eee3fabcdbc82ae5574d2b4385.png
  0.749875 seconds (960.47 k allocations: 259.227 MiB, 3.88% gc time, 0.19% compilation time)
1.4922546008603403 + 0.0im
1.49226037656255 + 0.0im
0.006086512274636152 + 0.0im
4.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1412 nodes
Info    : 2917 elements
Info    : Done reading 'mesh.msh'
../_images/7f5d0b776e92f9268f5b8259a1da1de5a3314618ca10521391ecade6438a6230.png
  0.861531 seconds (882.28 k allocations: 226.535 MiB, 33.87% gc time)
1.4922618217043488 + 0.0im
1.492258769989978 + 0.0im
0.0011031043139779434 + 0.0im
5.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1458 nodes
Info    : 3006 elements
Info    : Done reading 'mesh.msh'
../_images/fde55ae313a30aad9e5ccd4a136bb9bcb3132b241e94fb52de004eb79aba3e96.png
  0.565358 seconds (892.72 k allocations: 230.740 MiB, 1.79% gc time)
1.4922601498176549 + 0.0im
1.4922601773775053 + 0.0im
-0.00021073259687788562 + 0.0im
6.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1634 nodes
Info    : 3353 elements
Info    : Done reading 'mesh.msh'
../_images/1fd9d1cc4ab4cb61dfc2b4d8fd2b0015153878e2078e19bd9ebcb2cb172a1bd8.png
  0.667258 seconds (933.25 k allocations: 250.962 MiB, 1.48% gc time)
1.4922577842283804 + 0.0im
1.4922569790276667 + 0.0im
4.1265745309426276e-5 + 0.0im
7.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1835 nodes
Info    : 3746 elements
Info    : Done reading 'mesh.msh'
../_images/a8ce2c9d632aa59d08d4e33b641483e25fe32f1f4ff3f92f621cef2e8a4a7639.png
  0.722618 seconds (979.21 k allocations: 272.935 MiB, 1.55% gc time)
1.4922575724871603 + 0.0im
1.4922578463437488 + 0.0im
-8.250277615455974e-6 + 0.0im
8.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 1977 nodes
Info    : 4025 elements
Info    : Done reading 'mesh.msh'
../_images/dba94757a3d570b4f8de55b7bfa4ac74d4ccae566571d25460cb69ad5eeb2535.png
  0.802077 seconds (1.01 M allocations: 288.894 MiB, 0.79% gc time)
1.492257769396203 + 0.0im
1.4922554494481366 + 0.0im
-1.6735852417557881e-6 + 0.0im
9.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 2057 nodes
Info    : 4184 elements
Info    : Done reading 'mesh.msh'
../_images/9e697b49dd3b82f245775f8f0ab03829b7c6bfe531ceb4b3214e9f3634616704.png
  1.473152 seconds (1.03 M allocations: 298.680 MiB, 42.60% gc time)
1.4922575647770118 + 0.0im
1.4922570428735267 + 0.0im
3.4236528569740273e-7 + 0.0im
10.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 2177 nodes
Info    : 4419 elements
Info    : Done reading 'mesh.msh'
../_images/1d978657c04f71d971d5a0e2d7bb11a45920280f94d3a134a76cf32d629d1ee0.png
  0.870574 seconds (1.06 M allocations: 311.802 MiB, 1.21% gc time)
1.4922571257167974 + 0.0im
1.4922564014656476 + 0.0im
-7.067558227307033e-8 + 0.0im
11.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 2635 nodes
Info    : 5326 elements
Info    : Done reading 'mesh.msh'
../_images/d58a45238128993ecca03246709675afc4b3e818bc784b98e85031433878285b.png
  1.095456 seconds (1.16 M allocations: 362.455 MiB, 0.57% gc time)
1.492261565657229 + 0.0im
1.4922607385240747 + 0.0im
1.4777837424702255e-8 + 0.0im
12.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 2745 nodes
Info    : 5541 elements
Info    : Done reading 'mesh.msh'
../_images/cc628b2874e8a812fd9655c792adf086ca25fd27205d4e87c2d5ccb6d3a8d009.png
  1.347273 seconds (1.19 M allocations: 387.915 MiB, 1.24% gc time)
1.4922571378095248 + 0.0im
1.4922566287958188 + 0.0im
-3.0611442503860635e-9 + 0.0im
13.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 3011 nodes
Info    : 6072 elements
Info    : Done reading 'mesh.msh'
../_images/57377625a57b14f0d54d6a508deeaf70a695bf66dd6fc7b247a2c8486e17106b.png
  1.245583 seconds (1.25 M allocations: 406.613 MiB, 0.75% gc time)
1.4922584642675885 + 0.0im
1.492257642215362 + 0.0im
-6.437725433572387e-10 + 0.0im
14.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 3294 nodes
Info    : 6629 elements
Info    : Done reading 'mesh.msh'
../_images/d9c24e12fda1c905d4e11d10e9899948900a7ccd552492f7c891b2da74e5d889.png
  1.736455 seconds (1.32 M allocations: 465.928 MiB, 2.25% gc time)
1.492259938640999 + 0.0im
1.4922594489581051 + 0.0im
1.3463619182939613e-10 + 0.0im
15.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 3652 nodes
Info    : 7340 elements
Info    : Done reading 'mesh.msh'
../_images/f02f4f0d4b9f14e11912d5862cf6483b77049e011fd013f4ec8fbbd324d79420.png
  1.624626 seconds (1.40 M allocations: 491.089 MiB, 0.50% gc time)
1.492265559134 + 0.0im
1.492264755781298 + 0.0im
-2.826666513240828e-11 + 0.0im
16.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 4123 nodes
Info    : 8273 elements
Info    : Done reading 'mesh.msh'
../_images/c7d0ef5f4055c4caccbf7f76b98df42bbc0efc87ba6bdb3b3b33e80d722e9f76.png
  1.729288 seconds (1.51 M allocations: 534.177 MiB, 0.57% gc time)
1.4922613400670683 + 0.0im
1.492261070957205 + 0.0im
-5.920001686961227e-12 + 0.0im
17.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 4339 nodes
Info    : 8700 elements
Info    : Done reading 'mesh.msh'
../_images/19b20cca5c8e320d452c9da7433b4a1b11a7f540b6a203d2bb0de6b040b56f51.png
  2.498138 seconds (1.56 M allocations: 561.278 MiB, 24.97% gc time)
1.4922553156101404 + 0.0im
1.4922553385803814 + 0.0im
1.2601745110562304e-12 + 0.0im
18.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 4562 nodes
Info    : 9145 elements
Info    : Done reading 'mesh.msh'
../_images/3e501fd5b48a9c7d19a86fe134f6b4976d6f5c3a24a6d8b5af2f010d3659608d.png
  1.955708 seconds (1.61 M allocations: 588.413 MiB, 0.73% gc time)
1.4922548737214314 + 0.0im
1.4922548566955325 + 0.0im
-2.7093873501720773e-13 + 0.0im
19.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 4844 nodes
Info    : 9704 elements
Info    : Done reading 'mesh.msh'
../_images/06aee5ae79499fedeb33ac46be40da17e4f9e00ce0b1839dc8974c1d8327b2ee.png
  2.143298 seconds (1.68 M allocations: 620.670 MiB, 2.06% gc time)
1.492254954310435 + 0.0im
1.4922549885971395 + 0.0im
5.659331368525275e-14 + 0.0im
20.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 5411 nodes
Info    : 10829 elements
Info    : Done reading 'mesh.msh'
../_images/0cc0b5d9f927886600a6bfca7bc317dc2c55c8060866b4dfcc79cf45616f7c41.png
  2.381252 seconds (1.81 M allocations: 686.891 MiB, 1.00% gc time)
1.492258391299866 + 0.0im
1.4922583858007183 + 0.0im
1.1783484783829462e-14 + 0.0im
21.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 5789 nodes
Info    : 11580 elements
Info    : Done reading 'mesh.msh'
../_images/ead36f55bd5ceb943a72aaa1dc22c4fad9462bf3288fe05516160f4334eaaecc.png
  2.721197 seconds (1.90 M allocations: 749.823 MiB, 0.70% gc time)
1.492258936968267 + 0.0im
1.4922589925593719 + 0.0im
2.6055026221668606e-15 + 0.0im
22.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 6055 nodes
Info    : 12111 elements
Info    : Done reading 'mesh.msh'
../_images/b8659f513d7fac4ec1a11d16831c622b16926be0e4d10c56255aaca7bd847baa.png
  3.206117 seconds (1.96 M allocations: 782.535 MiB, 10.76% gc time)
1.4922605888629283 + 0.0im
1.4922606238122351 + 0.0im
-4.991168348546156e-16 + 0.0im
23.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 6517 nodes
Info    : 13030 elements
Info    : Done reading 'mesh.msh'
../_images/974c15d269941661e74d73ec5695b0a865946e73f39610f29cc798afb70cb415.png
  2.893284 seconds (2.07 M allocations: 818.037 MiB, 1.49% gc time)
1.492254062862467 + 0.0im
1.4922540514928269 + 0.0im
3.711530290428669e-16 + 0.0im
24.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 7041 nodes
Info    : 14069 elements
Info    : Done reading 'mesh.msh'
../_images/8708d2ef1d1f11974d00d0a4a48f064605b260e52fe43c7266523044d2ea051b.png
  3.605267 seconds (2.19 M allocations: 877.102 MiB, 17.50% gc time)
1.4922573606685587 + 0.0im
1.4922572163276935 + 0.0im
-4.652532725804133e-16 + 0.0im
25.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 7571 nodes
Info    : 15124 elements
Info    : Done reading 'mesh.msh'
../_images/1335cf87becd1c835e7cfc65e0591ad5bd4f79efa671c6c421cfdcf7c521b9b4.png
  3.597267 seconds (2.32 M allocations: 964.901 MiB, 2.23% gc time)
1.4922576054731482 + 0.0im
1.492257317818005 + 0.0im
-5.188300924289708e-16 + 0.0im
26.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 7905 nodes
Info    : 15791 elements
Info    : Done reading 'mesh.msh'
../_images/bf1b3de29d50fb0a96e2ed5ccd66aff83167586e7968879ca65f296872d5f160.png
  3.876267 seconds (2.39 M allocations: 1004.323 MiB, 1.09% gc time)
1.4922620186114297 + 0.0im
1.4922620042258237 + 0.0im
3.7731591435145505e-16 + 0.0im
27.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 8662 nodes
Info    : 17296 elements
Info    : Done reading 'mesh.msh'
../_images/89fdd521d47be88dfd58255c0099a21b01331693ecbe0725b0f0e2c33bb067f5.png
  4.353417 seconds (2.57 M allocations: 1.067 GiB, 1.09% gc time)
1.492258699825146 + 0.0im
1.4922586786205327 + 0.0im
-2.0162284614949975e-16 + 0.0im
28.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 9178 nodes
Info    : 18323 elements
Info    : Done reading 'mesh.msh'
../_images/993ce1a0cd1a6c0604008e27937f0b8c3830568a152ace188c27b20d8620ca71.png
  4.874584 seconds (2.69 M allocations: 1.131 GiB, 7.37% gc time)
1.4922620953476209 + 0.0im
1.4922621087289998 + 0.0im
-4.833387421298411e-16 + 0.0im
29.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 9890 nodes
Info    : 19738 elements
Info    : Done reading 'mesh.msh'
../_images/6e166df58018b09a72c9ab604daeb3c2a31b5411ce978345630f914faaced3a6.png
  5.152529 seconds (2.86 M allocations: 1.227 GiB, 7.11% gc time)
1.4922562471800893 + 0.0im
1.4922562246275326 + 0.0im
-1.651741566247712e-16 + 0.0im
30.0
Info    : Reading 'mesh.msh'...
Info    : 59 entities
Info    : 10173 nodes
Info    : 20307 elements
Info    : Done reading 'mesh.msh'
../_images/61fa684d7ace02a769953d9b0c8a81eb7053fd85f72ad355ba4953b79218d5ed.png
  5.182831 seconds (2.93 M allocations: 1.244 GiB, 1.06% gc time)
1.492258332710649 + 0.0im
1.4922583476331839 + 0.0im
-1.8028372190813981e-16 + 0.0im
../_images/e74bf4f6b602369d242b4b24bd091f3114e7cb2671104c862fe0c85480d5b845.png ../_images/3453eaef8b69754b0dfd197744ce9262a60e5679411f12f593baabb98100cf59.png
Hide code cell source
f = Figure()
ax = Axis(
    f[1, 1],
    title = "Overlap integral between neighboring waveguides",
    xlabel = "Distance / μm",
    ylabel = "Overlap integral / dB",
)
lines!(ax, distances, 10 * log10.(overlaps))
plot!(ax, distances, 10 * log10.(overlaps))
display(f)
../_images/316c24a291353a081930a9f3ca5050704cc96ea0793479832f1cee63be9d4c20.png