Grating coupler FDTD simulations

Contents

Grating coupler FDTD simulations#

You can also expand the planar component simulations to simulate an out-of-plane grating coupler.

You can run grating coupler simulations in 2D to save time, and for accuracy you can also run them in 3D

tidy3d#

import gplugins.tidy3d as gt
import matplotlib.pyplot as plt
import numpy as np

import ubcpdk.components as pdk
from ubcpdk.config import PATH

c = pdk.gc_te1550()
c.plot()
../_images/ba9ca09e2b866acb6e18722bc36f3ee2b730876515024f0679139a5f3b3665fb.png
fiber_angle_deg = -31
s = gt.get_simulation_grating_coupler(
    c, is_3d=False, fiber_angle_deg=fiber_angle_deg, fiber_xoffset=0
)
f = gt.plot_simulation(s)
Adding layer=WG, layer_tuple=(1, 0) zmin=0.0, zmax=0.22 material_name='si'
17:37:00 UTC WARNING: The medium associated with structures[1] has a frequency  
             range: (1.692592e+14, 1.208995e+15) (Hz) that does not fully cover 
             the frequencies contained in monitors[0]. This can cause           
             inaccuracies in the recorded results.                              
             WARNING: Suppressed 1 WARNING message.                             
../_images/1d4afcb25a400de77bb9c615dd5f06e375e54f3f749e44892bbd9af1be06c621.png
def log(x):
    return 20 * np.log10(x)
sp = gt.write_sparameters_grating_coupler(
    c,
    is_3d=False,
    fiber_angle_deg=fiber_angle_deg,
    fiber_xoffset=0,
    filepath=PATH.sparameters / "gc_te1550.npz",
)
offsets = np.arange(-5, 5 + 1, 5)
offsets
array([-5,  0,  5])
jobs = [
    dict(
        component=c,
        is_3d=False,
        fiber_angle_deg=fiber_angle_deg,
        fiber_xoffset=fiber_xoffset,
        dirpath=PATH.sparameters,
        filepath=PATH.sparameters
        / f"gc_{fiber_angle_deg:.1f}deg_{fiber_xoffset:.1f}um.npz",
    )
    for fiber_xoffset in offsets
]
sps = gt.write_sparameters_grating_coupler_batch(jobs)
sps[0].result()
{'wavelengths': array([1.2       , 1.20235294, 1.20470588, 1.20705882, 1.20941176,
        1.21176471, 1.21411765, 1.21647059, 1.21882353, 1.22117647,
        1.22352941, 1.22588235, 1.22823529, 1.23058824, 1.23294118,
        1.23529412, 1.23764706, 1.24      , 1.24235294, 1.24470588,
        1.24705882, 1.24941176, 1.25176471, 1.25411765, 1.25647059,
        1.25882353, 1.26117647, 1.26352941, 1.26588235, 1.26823529,
        1.27058824, 1.27294118, 1.27529412, 1.27764706, 1.28      ,
        1.28235294, 1.28470588, 1.28705882, 1.28941176, 1.29176471,
        1.29411765, 1.29647059, 1.29882353, 1.30117647, 1.30352941,
        1.30588235, 1.30823529, 1.31058824, 1.31294118, 1.31529412,
        1.31764706, 1.32      , 1.32235294, 1.32470588, 1.32705882,
        1.32941176, 1.33176471, 1.33411765, 1.33647059, 1.33882353,
        1.34117647, 1.34352941, 1.34588235, 1.34823529, 1.35058824,
        1.35294118, 1.35529412, 1.35764706, 1.36      , 1.36235294,
        1.36470588, 1.36705882, 1.36941176, 1.37176471, 1.37411765,
        1.37647059, 1.37882353, 1.38117647, 1.38352941, 1.38588235,
        1.38823529, 1.39058824, 1.39294118, 1.39529412, 1.39764706,
        1.4       , 1.40235294, 1.40470588, 1.40705882, 1.40941176,
        1.41176471, 1.41411765, 1.41647059, 1.41882353, 1.42117647,
        1.42352941, 1.42588235, 1.42823529, 1.43058824, 1.43294118,
        1.43529412, 1.43764706, 1.44      , 1.44235294, 1.44470588,
        1.44705882, 1.44941176, 1.45176471, 1.45411765, 1.45647059,
        1.45882353, 1.46117647, 1.46352941, 1.46588235, 1.46823529,
        1.47058824, 1.47294118, 1.47529412, 1.47764706, 1.48      ,
        1.48235294, 1.48470588, 1.48705882, 1.48941176, 1.49176471,
        1.49411765, 1.49647059, 1.49882353, 1.50117647, 1.50352941,
        1.50588235, 1.50823529, 1.51058824, 1.51294118, 1.51529412,
        1.51764706, 1.52      , 1.52235294, 1.52470588, 1.52705882,
        1.52941176, 1.53176471, 1.53411765, 1.53647059, 1.53882353,
        1.54117647, 1.54352941, 1.54588235, 1.54823529, 1.55058824,
        1.55294118, 1.55529412, 1.55764706, 1.56      , 1.56235294,
        1.56470588, 1.56705882, 1.56941176, 1.57176471, 1.57411765,
        1.57647059, 1.57882353, 1.58117647, 1.58352941, 1.58588235,
        1.58823529, 1.59058824, 1.59294118, 1.59529412, 1.59764706,
        1.6       , 1.60235294, 1.60470588, 1.60705882, 1.60941176,
        1.61176471, 1.61411765, 1.61647059, 1.61882353, 1.62117647,
        1.62352941, 1.62588235, 1.62823529, 1.63058824, 1.63294118,
        1.63529412, 1.63764706, 1.64      , 1.64235294, 1.64470588,
        1.64705882, 1.64941176, 1.65176471, 1.65411765, 1.65647059,
        1.65882353, 1.66117647, 1.66352941, 1.66588235, 1.66823529,
        1.67058824, 1.67294118, 1.67529412, 1.67764706, 1.68      ,
        1.68235294, 1.68470588, 1.68705882, 1.68941176, 1.69176471,
        1.69411765, 1.69647059, 1.69882353, 1.70117647, 1.70352941,
        1.70588235, 1.70823529, 1.71058824, 1.71294118, 1.71529412,
        1.71764706, 1.72      , 1.72235294, 1.72470588, 1.72705882,
        1.72941176, 1.73176471, 1.73411765, 1.73647059, 1.73882353,
        1.74117647, 1.74352941, 1.74588235, 1.74823529, 1.75058824,
        1.75294118, 1.75529412, 1.75764706, 1.76      , 1.76235294,
        1.76470588, 1.76705882, 1.76941176, 1.77176471, 1.77411765,
        1.77647059, 1.77882353, 1.78117647, 1.78352941, 1.78588235,
        1.78823529, 1.79058824, 1.79294118, 1.79529412, 1.79764706,
        1.8       ]),
 'o1@0,o1@0': array([-1.09915493e-03-3.72710113e-03j,  4.30354283e-04-2.71505269e-03j,
         1.25515940e-03-1.06543230e-03j,  2.44296862e-03+1.16749244e-03j,
         3.71181301e-03+3.12208783e-03j,  3.18408399e-03+2.53478944e-03j,
         1.22133617e-03+2.21319815e-03j,  4.93022825e-04+2.86296988e-03j,
         3.73705379e-05+1.83333069e-03j, -3.37237878e-04+1.41150528e-03j,
        -1.09410877e-03+6.95844792e-04j, -2.41848535e-03+3.41357532e-04j,
        -3.43312875e-03+1.58227698e-03j, -2.40671548e-03+1.56192436e-03j,
        -1.97243812e-03-3.76178321e-05j, -2.01005863e-03-1.73775186e-03j,
        -1.77713979e-03-2.84182197e-03j, -9.81855180e-04-3.70778930e-03j,
         1.90074598e-04-4.76653432e-03j,  3.61633977e-04-4.81188933e-03j,
         1.04933546e-03-4.14493117e-03j,  2.38430272e-03-2.20766157e-03j,
         3.74844644e-03-2.95031415e-04j,  5.50536199e-03+5.56100226e-04j,
         4.41880462e-03-6.00352613e-04j,  2.26813614e-03+2.07600886e-04j,
         1.57362740e-03+1.66180987e-03j,  1.18128778e-03+1.58102016e-03j,
         1.14722973e-03+8.05844805e-04j,  8.17239073e-04+2.12931274e-04j,
         8.39198749e-04+9.50164733e-04j,  5.53551940e-04+2.76527471e-03j,
         5.73136570e-04+5.22951748e-03j,  6.16085733e-04+4.77281483e-03j,
        -6.50852388e-04+2.98289401e-03j, -2.07693209e-03+1.51350041e-03j,
        -2.69422684e-03+5.70827134e-05j, -1.99011313e-03-8.00009787e-04j,
        -1.08810710e-03-1.21039037e-03j, -9.48165234e-05-1.78788914e-03j,
         7.05267606e-04-1.68548345e-03j,  1.00031752e-03-1.07708667e-03j,
         1.49012167e-03-2.93624173e-04j,  1.66588804e-03+3.47433800e-04j,
         1.58181497e-03+7.25552279e-04j,  1.19835840e-03+9.81816410e-04j,
         7.10623580e-04+1.21555634e-03j,  2.15817733e-04+1.32419746e-03j,
        -6.17493991e-05+1.22929061e-03j, -2.82939088e-04+8.73704197e-04j,
        -4.41642069e-04+4.54775355e-04j, -5.29800755e-04+1.40069165e-04j,
        -4.41942404e-04-7.36145458e-05j, -1.93076188e-04-2.57459136e-04j,
         1.20646428e-04-4.38809841e-04j,  3.37441805e-04-5.03080149e-04j,
         4.66384820e-04-4.26957879e-04j,  6.16922776e-04-2.29906518e-04j,
         7.21238094e-04-5.96399892e-05j,  7.67307196e-04+1.11361351e-04j,
         6.80915260e-04+2.87307088e-04j,  5.31020823e-04+3.31115250e-04j,
         3.77563722e-04+4.23668217e-04j,  2.19926471e-04+4.66457947e-04j,
         1.05238361e-04+3.92731444e-04j, -1.99341990e-05+2.75291745e-04j,
        -1.16087042e-04+1.44139963e-04j, -1.61347171e-04+1.65584048e-05j,
        -1.37771347e-04-4.77148777e-05j, -5.50967393e-05-1.44760741e-04j,
         4.34256600e-05-2.25405677e-04j,  1.18945678e-04-2.63378030e-04j,
         1.47439867e-04-2.16412258e-04j,  2.14739468e-04-1.61758393e-04j,
         2.64452705e-04-7.76945783e-05j,  2.66893247e-04+2.63756325e-06j,
         2.34583133e-04+6.77402803e-05j,  1.25003715e-04+1.30873931e-04j,
         1.09825677e-05+1.91929880e-04j, -8.57803485e-05+2.23141016e-04j,
        -1.67778451e-04+1.95768067e-04j, -2.66605318e-04+1.54639687e-04j,
        -3.39396641e-04+2.60926580e-05j, -4.08178281e-04-5.39271327e-05j,
        -4.13648711e-04-1.30934907e-04j, -3.72032617e-04-2.21565137e-04j,
        -3.05245078e-04-3.26262145e-04j, -2.15359694e-04-3.82982792e-04j,
        -1.52855732e-04-4.04275225e-04j, -7.18200490e-05-3.59869624e-04j,
         3.60880653e-05-2.96452836e-04j,  1.37436622e-04-2.31805576e-04j,
         1.84618414e-04-1.46663066e-04j,  1.93571687e-04-3.18240978e-05j,
         1.90930742e-04+5.58310958e-05j,  1.21191670e-04+1.92749979e-04j,
         6.74035482e-05+2.99090711e-04j, -8.66386992e-06+3.60055816e-04j,
        -1.18490157e-04+3.75485870e-04j, -2.56736315e-04+3.77159743e-04j,
        -3.76738449e-04+3.67455841e-04j, -4.69798052e-04+3.38623352e-04j,
        -5.17881301e-04+2.34852754e-04j, -5.46184485e-04+1.65687916e-04j,
        -5.74175036e-04+4.26156075e-05j, -5.86960091e-04-6.27997159e-05j,
        -5.50610555e-04-1.36123833e-04j, -4.66733067e-04-1.81800598e-04j,
        -3.62128193e-04-2.30361086e-04j, -2.54503370e-04-2.80571003e-04j,
        -1.62655885e-04-2.98466665e-04j, -8.14276645e-05-2.72575156e-04j,
         1.52984826e-05-1.93676579e-04j,  1.03894078e-04-9.57533084e-05j,
         1.82702335e-04-3.87203936e-05j,  2.15833679e-04+6.79027175e-05j,
         2.00361722e-04+1.32183102e-04j,  1.74828339e-04+2.42582551e-04j,
         1.40661093e-04+3.49467909e-04j,  1.27373868e-04+4.47602622e-04j,
         5.42168727e-05+4.59903513e-04j, -2.34270247e-05+4.68919624e-04j,
        -1.16901236e-04+4.76151569e-04j, -2.06511981e-04+4.77332731e-04j,
        -2.68689276e-04+4.72317685e-04j, -2.90007024e-04+4.35427742e-04j,
        -3.23423593e-04+3.68344408e-04j, -3.54752681e-04+2.90473217e-04j,
        -3.66032732e-04+2.23586040e-04j, -3.65918683e-04+1.79287670e-04j,
        -3.36471592e-04+1.38615011e-04j, -2.76861037e-04+1.00926230e-04j,
        -2.16785716e-04+5.95687893e-05j, -1.71918464e-04+2.29010184e-05j,
        -1.24364842e-04+1.07452512e-05j, -8.37268473e-05+3.07138066e-05j,
        -3.96500250e-05+5.06266994e-05j,  4.69951118e-06+8.75720983e-05j,
         4.34887233e-05+1.16967802e-04j,  7.42446560e-05+1.45545455e-04j,
         6.64187577e-05+1.78317561e-04j,  5.38700864e-05+2.21064821e-04j,
         3.98632789e-05+2.59675783e-04j,  1.50783044e-05+2.93375730e-04j,
        -1.07904297e-05+3.12397506e-04j, -3.49145523e-05+3.15942120e-04j,
        -6.94797554e-05+3.04583574e-04j, -1.08708572e-04+2.93733844e-04j,
        -1.45449631e-04+2.79040297e-04j, -1.70788593e-04+2.61017779e-04j,
        -1.83369587e-04+2.48674067e-04j, -1.92841117e-04+2.02965785e-04j,
        -1.97347957e-04+1.63186960e-04j, -1.92434085e-04+1.14833544e-04j,
        -1.92789202e-04+8.11435229e-05j, -1.85686321e-04+5.68223888e-05j,
        -1.60231636e-04+3.94266673e-05j, -1.30184083e-04+2.65116567e-05j,
        -1.00273499e-04+8.16535140e-06j, -7.96455009e-05-2.78793191e-06j,
        -5.46148414e-05-1.32836468e-05j, -3.92604896e-05-1.33845852e-05j,
        -2.79747959e-05+4.19954800e-06j, -7.87156804e-06+3.36258221e-05j,
        -3.71290311e-06+4.76732481e-05j,  1.54396203e-05+5.26939835e-05j,
         9.68616504e-06+5.85793994e-05j, -9.03903931e-06+6.71093626e-05j,
        -2.46236688e-05+8.62197007e-05j, -4.50625620e-05+9.27732560e-05j,
        -6.12544640e-05+1.10526370e-04j, -7.20973630e-05+1.10017552e-04j,
        -8.44365540e-05+1.04457562e-04j, -1.06677577e-04+8.96395285e-05j,
        -1.30846968e-04+7.47768714e-05j, -1.62553480e-04+6.07071928e-05j,
        -1.79447992e-04+6.05944318e-05j, -1.89632026e-04+4.65463958e-05j,
        -1.86147593e-04+2.36101129e-05j, -1.89958985e-04+3.33168085e-06j,
        -1.93881681e-04-2.15851548e-05j, -2.01415755e-04-4.72694522e-05j,
        -2.10402652e-04-5.92920443e-05j, -2.05546902e-04-5.64053074e-05j,
        -2.01956986e-04-6.56817860e-05j, -1.87020875e-04-7.00132892e-05j,
        -1.79197206e-04-8.06917313e-05j, -1.79879039e-04-8.76468695e-05j,
        -1.83111083e-04-8.61656913e-05j, -1.82994431e-04-8.40487505e-05j,
        -1.84165385e-04-7.21291153e-05j, -1.85036075e-04-6.77056235e-05j,
        -1.86119948e-04-6.14808647e-05j, -1.90767855e-04-5.73408619e-05j,
        -1.98865094e-04-5.64217607e-05j, -2.10121494e-04-5.42408013e-05j,
        -2.24241535e-04-5.28411660e-05j, -2.37232690e-04-5.16736765e-05j,
        -2.53053260e-04-4.79900012e-05j, -2.64940757e-04-4.58860817e-05j,
        -2.76234456e-04-4.84751558e-05j, -2.85170589e-04-5.50808213e-05j,
        -2.97526131e-04-6.02536396e-05j, -3.10461609e-04-6.88568789e-05j,
        -3.20197219e-04-7.78371607e-05j, -3.30541147e-04-8.26606119e-05j,
        -3.39039170e-04-8.90944209e-05j, -3.43802798e-04-9.40507771e-05j,
        -3.46893062e-04-9.88641725e-05j, -3.47383772e-04-1.03219133e-04j,
        -3.48123051e-04-1.07732218e-04j, -3.50710848e-04-1.14157340e-04j,
        -3.53052370e-04-1.17048250e-04j, -3.55459848e-04-1.15062932e-04j,
        -3.58218183e-04-1.13387121e-04j, -3.59943970e-04-1.08139806e-04j,
        -3.61466142e-04-1.03129166e-04j, -3.61321688e-04-9.58880989e-05j,
        -3.63555664e-04-9.24754909e-05j, -3.65549042e-04-8.76124407e-05j,
        -3.73592648e-04-8.29745085e-05j, -3.82991816e-04-7.81567010e-05j,
        -3.92458016e-04-7.23095385e-05j, -4.03186008e-04-6.42192236e-05j,
        -4.12639984e-04-5.69575474e-05j, -4.20928393e-04-4.89642476e-05j,
        -4.27869066e-04-4.56913287e-05j, -4.35874522e-04-4.31760600e-05j,
        -4.45214917e-04-4.34729348e-05j, -4.59001099e-04-4.59880418e-05j,
        -4.69576353e-04-4.66533029e-05j, -4.83852197e-04-4.89593101e-05j,
        -4.93702521e-04-4.61514008e-05j, -5.05196028e-04-4.27469000e-05j,
        -5.06598219e-04-4.08996920e-05j, -5.07059989e-04-4.29546014e-05j,
        -5.09085591e-04-4.72623600e-05j, -5.11822142e-04-5.56265336e-05j,
        -5.17755293e-04-5.96552111e-05j, -5.27412233e-04-6.71351228e-05j,
        -5.34498433e-04-6.36725945e-05j, -5.40331318e-04-5.25787921e-05j,
        -5.35929421e-04-4.70158334e-05j, -5.30395490e-04-3.72025564e-05j,
        -5.17426359e-04-3.70254667e-05j, -5.22933777e-04-4.15842447e-05j,
        -5.18746427e-04-5.00760178e-05j, -5.34068059e-04-5.18743881e-05j,
        -5.39395521e-04-4.57013071e-05j, -5.43664915e-04-3.54336632e-05j,
        -5.54439281e-04-2.23093630e-05j, -5.50011090e-04-5.28638168e-06j,
        -5.33773454e-04+4.85518202e-06j, -5.28294148e-04-5.65955739e-07j,
        -5.19358722e-04-8.10014414e-06j, -5.29190182e-04-2.22858201e-05j]),
 'o2@0,o2@0': array([-1.09915493e-03-3.72710113e-03j,  4.30354283e-04-2.71505269e-03j,
         1.25515940e-03-1.06543230e-03j,  2.44296862e-03+1.16749244e-03j,
         3.71181301e-03+3.12208783e-03j,  3.18408399e-03+2.53478944e-03j,
         1.22133617e-03+2.21319815e-03j,  4.93022825e-04+2.86296988e-03j,
         3.73705379e-05+1.83333069e-03j, -3.37237878e-04+1.41150528e-03j,
        -1.09410877e-03+6.95844792e-04j, -2.41848535e-03+3.41357532e-04j,
        -3.43312875e-03+1.58227698e-03j, -2.40671548e-03+1.56192436e-03j,
        -1.97243812e-03-3.76178321e-05j, -2.01005863e-03-1.73775186e-03j,
        -1.77713979e-03-2.84182197e-03j, -9.81855180e-04-3.70778930e-03j,
         1.90074598e-04-4.76653432e-03j,  3.61633977e-04-4.81188933e-03j,
         1.04933546e-03-4.14493117e-03j,  2.38430272e-03-2.20766157e-03j,
         3.74844644e-03-2.95031415e-04j,  5.50536199e-03+5.56100226e-04j,
         4.41880462e-03-6.00352613e-04j,  2.26813614e-03+2.07600886e-04j,
         1.57362740e-03+1.66180987e-03j,  1.18128778e-03+1.58102016e-03j,
         1.14722973e-03+8.05844805e-04j,  8.17239073e-04+2.12931274e-04j,
         8.39198749e-04+9.50164733e-04j,  5.53551940e-04+2.76527471e-03j,
         5.73136570e-04+5.22951748e-03j,  6.16085733e-04+4.77281483e-03j,
        -6.50852388e-04+2.98289401e-03j, -2.07693209e-03+1.51350041e-03j,
        -2.69422684e-03+5.70827134e-05j, -1.99011313e-03-8.00009787e-04j,
        -1.08810710e-03-1.21039037e-03j, -9.48165234e-05-1.78788914e-03j,
         7.05267606e-04-1.68548345e-03j,  1.00031752e-03-1.07708667e-03j,
         1.49012167e-03-2.93624173e-04j,  1.66588804e-03+3.47433800e-04j,
         1.58181497e-03+7.25552279e-04j,  1.19835840e-03+9.81816410e-04j,
         7.10623580e-04+1.21555634e-03j,  2.15817733e-04+1.32419746e-03j,
        -6.17493991e-05+1.22929061e-03j, -2.82939088e-04+8.73704197e-04j,
        -4.41642069e-04+4.54775355e-04j, -5.29800755e-04+1.40069165e-04j,
        -4.41942404e-04-7.36145458e-05j, -1.93076188e-04-2.57459136e-04j,
         1.20646428e-04-4.38809841e-04j,  3.37441805e-04-5.03080149e-04j,
         4.66384820e-04-4.26957879e-04j,  6.16922776e-04-2.29906518e-04j,
         7.21238094e-04-5.96399892e-05j,  7.67307196e-04+1.11361351e-04j,
         6.80915260e-04+2.87307088e-04j,  5.31020823e-04+3.31115250e-04j,
         3.77563722e-04+4.23668217e-04j,  2.19926471e-04+4.66457947e-04j,
         1.05238361e-04+3.92731444e-04j, -1.99341990e-05+2.75291745e-04j,
        -1.16087042e-04+1.44139963e-04j, -1.61347171e-04+1.65584048e-05j,
        -1.37771347e-04-4.77148777e-05j, -5.50967393e-05-1.44760741e-04j,
         4.34256600e-05-2.25405677e-04j,  1.18945678e-04-2.63378030e-04j,
         1.47439867e-04-2.16412258e-04j,  2.14739468e-04-1.61758393e-04j,
         2.64452705e-04-7.76945783e-05j,  2.66893247e-04+2.63756325e-06j,
         2.34583133e-04+6.77402803e-05j,  1.25003715e-04+1.30873931e-04j,
         1.09825677e-05+1.91929880e-04j, -8.57803485e-05+2.23141016e-04j,
        -1.67778451e-04+1.95768067e-04j, -2.66605318e-04+1.54639687e-04j,
        -3.39396641e-04+2.60926580e-05j, -4.08178281e-04-5.39271327e-05j,
        -4.13648711e-04-1.30934907e-04j, -3.72032617e-04-2.21565137e-04j,
        -3.05245078e-04-3.26262145e-04j, -2.15359694e-04-3.82982792e-04j,
        -1.52855732e-04-4.04275225e-04j, -7.18200490e-05-3.59869624e-04j,
         3.60880653e-05-2.96452836e-04j,  1.37436622e-04-2.31805576e-04j,
         1.84618414e-04-1.46663066e-04j,  1.93571687e-04-3.18240978e-05j,
         1.90930742e-04+5.58310958e-05j,  1.21191670e-04+1.92749979e-04j,
         6.74035482e-05+2.99090711e-04j, -8.66386992e-06+3.60055816e-04j,
        -1.18490157e-04+3.75485870e-04j, -2.56736315e-04+3.77159743e-04j,
        -3.76738449e-04+3.67455841e-04j, -4.69798052e-04+3.38623352e-04j,
        -5.17881301e-04+2.34852754e-04j, -5.46184485e-04+1.65687916e-04j,
        -5.74175036e-04+4.26156075e-05j, -5.86960091e-04-6.27997159e-05j,
        -5.50610555e-04-1.36123833e-04j, -4.66733067e-04-1.81800598e-04j,
        -3.62128193e-04-2.30361086e-04j, -2.54503370e-04-2.80571003e-04j,
        -1.62655885e-04-2.98466665e-04j, -8.14276645e-05-2.72575156e-04j,
         1.52984826e-05-1.93676579e-04j,  1.03894078e-04-9.57533084e-05j,
         1.82702335e-04-3.87203936e-05j,  2.15833679e-04+6.79027175e-05j,
         2.00361722e-04+1.32183102e-04j,  1.74828339e-04+2.42582551e-04j,
         1.40661093e-04+3.49467909e-04j,  1.27373868e-04+4.47602622e-04j,
         5.42168727e-05+4.59903513e-04j, -2.34270247e-05+4.68919624e-04j,
        -1.16901236e-04+4.76151569e-04j, -2.06511981e-04+4.77332731e-04j,
        -2.68689276e-04+4.72317685e-04j, -2.90007024e-04+4.35427742e-04j,
        -3.23423593e-04+3.68344408e-04j, -3.54752681e-04+2.90473217e-04j,
        -3.66032732e-04+2.23586040e-04j, -3.65918683e-04+1.79287670e-04j,
        -3.36471592e-04+1.38615011e-04j, -2.76861037e-04+1.00926230e-04j,
        -2.16785716e-04+5.95687893e-05j, -1.71918464e-04+2.29010184e-05j,
        -1.24364842e-04+1.07452512e-05j, -8.37268473e-05+3.07138066e-05j,
        -3.96500250e-05+5.06266994e-05j,  4.69951118e-06+8.75720983e-05j,
         4.34887233e-05+1.16967802e-04j,  7.42446560e-05+1.45545455e-04j,
         6.64187577e-05+1.78317561e-04j,  5.38700864e-05+2.21064821e-04j,
         3.98632789e-05+2.59675783e-04j,  1.50783044e-05+2.93375730e-04j,
        -1.07904297e-05+3.12397506e-04j, -3.49145523e-05+3.15942120e-04j,
        -6.94797554e-05+3.04583574e-04j, -1.08708572e-04+2.93733844e-04j,
        -1.45449631e-04+2.79040297e-04j, -1.70788593e-04+2.61017779e-04j,
        -1.83369587e-04+2.48674067e-04j, -1.92841117e-04+2.02965785e-04j,
        -1.97347957e-04+1.63186960e-04j, -1.92434085e-04+1.14833544e-04j,
        -1.92789202e-04+8.11435229e-05j, -1.85686321e-04+5.68223888e-05j,
        -1.60231636e-04+3.94266673e-05j, -1.30184083e-04+2.65116567e-05j,
        -1.00273499e-04+8.16535140e-06j, -7.96455009e-05-2.78793191e-06j,
        -5.46148414e-05-1.32836468e-05j, -3.92604896e-05-1.33845852e-05j,
        -2.79747959e-05+4.19954800e-06j, -7.87156804e-06+3.36258221e-05j,
        -3.71290311e-06+4.76732481e-05j,  1.54396203e-05+5.26939835e-05j,
         9.68616504e-06+5.85793994e-05j, -9.03903931e-06+6.71093626e-05j,
        -2.46236688e-05+8.62197007e-05j, -4.50625620e-05+9.27732560e-05j,
        -6.12544640e-05+1.10526370e-04j, -7.20973630e-05+1.10017552e-04j,
        -8.44365540e-05+1.04457562e-04j, -1.06677577e-04+8.96395285e-05j,
        -1.30846968e-04+7.47768714e-05j, -1.62553480e-04+6.07071928e-05j,
        -1.79447992e-04+6.05944318e-05j, -1.89632026e-04+4.65463958e-05j,
        -1.86147593e-04+2.36101129e-05j, -1.89958985e-04+3.33168085e-06j,
        -1.93881681e-04-2.15851548e-05j, -2.01415755e-04-4.72694522e-05j,
        -2.10402652e-04-5.92920443e-05j, -2.05546902e-04-5.64053074e-05j,
        -2.01956986e-04-6.56817860e-05j, -1.87020875e-04-7.00132892e-05j,
        -1.79197206e-04-8.06917313e-05j, -1.79879039e-04-8.76468695e-05j,
        -1.83111083e-04-8.61656913e-05j, -1.82994431e-04-8.40487505e-05j,
        -1.84165385e-04-7.21291153e-05j, -1.85036075e-04-6.77056235e-05j,
        -1.86119948e-04-6.14808647e-05j, -1.90767855e-04-5.73408619e-05j,
        -1.98865094e-04-5.64217607e-05j, -2.10121494e-04-5.42408013e-05j,
        -2.24241535e-04-5.28411660e-05j, -2.37232690e-04-5.16736765e-05j,
        -2.53053260e-04-4.79900012e-05j, -2.64940757e-04-4.58860817e-05j,
        -2.76234456e-04-4.84751558e-05j, -2.85170589e-04-5.50808213e-05j,
        -2.97526131e-04-6.02536396e-05j, -3.10461609e-04-6.88568789e-05j,
        -3.20197219e-04-7.78371607e-05j, -3.30541147e-04-8.26606119e-05j,
        -3.39039170e-04-8.90944209e-05j, -3.43802798e-04-9.40507771e-05j,
        -3.46893062e-04-9.88641725e-05j, -3.47383772e-04-1.03219133e-04j,
        -3.48123051e-04-1.07732218e-04j, -3.50710848e-04-1.14157340e-04j,
        -3.53052370e-04-1.17048250e-04j, -3.55459848e-04-1.15062932e-04j,
        -3.58218183e-04-1.13387121e-04j, -3.59943970e-04-1.08139806e-04j,
        -3.61466142e-04-1.03129166e-04j, -3.61321688e-04-9.58880989e-05j,
        -3.63555664e-04-9.24754909e-05j, -3.65549042e-04-8.76124407e-05j,
        -3.73592648e-04-8.29745085e-05j, -3.82991816e-04-7.81567010e-05j,
        -3.92458016e-04-7.23095385e-05j, -4.03186008e-04-6.42192236e-05j,
        -4.12639984e-04-5.69575474e-05j, -4.20928393e-04-4.89642476e-05j,
        -4.27869066e-04-4.56913287e-05j, -4.35874522e-04-4.31760600e-05j,
        -4.45214917e-04-4.34729348e-05j, -4.59001099e-04-4.59880418e-05j,
        -4.69576353e-04-4.66533029e-05j, -4.83852197e-04-4.89593101e-05j,
        -4.93702521e-04-4.61514008e-05j, -5.05196028e-04-4.27469000e-05j,
        -5.06598219e-04-4.08996920e-05j, -5.07059989e-04-4.29546014e-05j,
        -5.09085591e-04-4.72623600e-05j, -5.11822142e-04-5.56265336e-05j,
        -5.17755293e-04-5.96552111e-05j, -5.27412233e-04-6.71351228e-05j,
        -5.34498433e-04-6.36725945e-05j, -5.40331318e-04-5.25787921e-05j,
        -5.35929421e-04-4.70158334e-05j, -5.30395490e-04-3.72025564e-05j,
        -5.17426359e-04-3.70254667e-05j, -5.22933777e-04-4.15842447e-05j,
        -5.18746427e-04-5.00760178e-05j, -5.34068059e-04-5.18743881e-05j,
        -5.39395521e-04-4.57013071e-05j, -5.43664915e-04-3.54336632e-05j,
        -5.54439281e-04-2.23093630e-05j, -5.50011090e-04-5.28638168e-06j,
        -5.33773454e-04+4.85518202e-06j, -5.28294148e-04-5.65955739e-07j,
        -5.19358722e-04-8.10014414e-06j, -5.29190182e-04-2.22858201e-05j]),
 'o1@0,o2@0': array([-1.52302677e-02-9.94713170e-03j, -1.79776621e-02+1.54904698e-02j,
         1.09705642e-02+2.25592503e-02j,  2.21942409e-02-3.41964801e-03j,
         4.60868896e-03-1.64942614e-02j, -6.42110015e-03-1.04147587e-02j,
        -1.19369043e-02-5.70931918e-03j, -1.66651766e-02+8.39767718e-03j,
         7.98631524e-04+2.30997509e-02j,  2.27072233e-02+8.15686350e-03j,
         1.48356906e-02-1.53668408e-02j, -3.60275833e-03-1.61251349e-02j,
        -1.10129661e-02-8.15122699e-03j, -1.53924327e-02+1.33898781e-03j,
        -8.80000341e-03+1.56194150e-02j,  9.55603504e-03+1.49580740e-02j,
         1.45003321e-02-7.96380511e-04j,  6.02093099e-03-7.97038606e-03j,
         1.13942891e-03-7.62459370e-03j, -3.75331947e-03-8.20171119e-03j,
        -9.94071464e-03-2.76603876e-03j, -7.78977230e-03+6.17650679e-03j,
        -1.99094431e-04+8.33049541e-03j,  4.28562387e-03+5.11812661e-03j,
         5.77687618e-03+1.72752684e-03j,  6.22238030e-03-2.18655982e-03j,
         3.26837761e-03-7.00673071e-03j, -4.27451723e-03-7.60268631e-03j,
        -9.02495957e-03-3.63437197e-05j, -3.73696047e-03+7.53947190e-03j,
         4.30861663e-03+5.59965078e-03j,  5.48173600e-03-5.42363662e-04j,
         3.01786835e-03-3.64064627e-03j, -2.04544249e-04-5.75705462e-03j,
        -6.64937197e-03-4.63277231e-03j, -9.72376336e-03+4.34223130e-03j,
        -1.58666921e-03+1.25472530e-02j,  1.02587096e-02+9.23639038e-03j,
         1.42652133e-02-2.02720939e-03j,  8.99996586e-03-1.21920854e-02j,
        -2.04784928e-03-1.63461160e-02j, -1.40697079e-02-1.14075322e-02j,
        -1.95200710e-02+1.66493891e-03j, -1.39625944e-02+1.54073285e-02j,
        -2.06950191e-04+2.19945072e-02j,  1.52236003e-02+1.78350757e-02j,
         2.47950232e-02+3.66644005e-03j,  2.23779145e-02-1.43944890e-02j,
         7.93365283e-03-2.68528769e-02j, -1.18462470e-02-2.69034797e-02j,
        -2.77217054e-02-1.37261286e-02j, -3.16684883e-02+7.60900757e-03j,
        -2.04009931e-02+2.73866612e-02j,  1.77856441e-03+3.55738198e-02j,
         2.48064086e-02+2.75210730e-02j,  3.80542792e-02+6.07439419e-03j,
         3.47832841e-02-1.98426643e-02j,  1.52905536e-02-3.85550274e-02j,
        -1.23779437e-02-4.09580006e-02j, -3.60556261e-02-2.52610805e-02j,
        -4.51984607e-02+2.30108878e-03j, -3.52384635e-02+3.03078149e-02j,
        -9.60969861e-03+4.66559738e-02j,  2.12264698e-02+4.38215725e-02j,
         4.43019846e-02+2.24791727e-02j,  4.98657140e-02-8.90434934e-03j,
         3.52196413e-02-3.77570058e-02j,  5.74866841e-03-5.22675854e-02j,
        -2.69716483e-02-4.61648471e-02j, -4.98575155e-02-2.15040512e-02j,
        -5.37348579e-02+1.22560868e-02j, -3.67811649e-02+4.21421085e-02j,
        -5.12452513e-03+5.64978321e-02j,  2.92885875e-02+4.94330854e-02j,
         5.32219092e-02+2.33037778e-02j,  5.74081174e-02-1.21411176e-02j,
         4.00261718e-02-4.36103363e-02j,  7.32321421e-03-5.91481101e-02j,
        -2.84559490e-02-5.25998639e-02j, -5.35894450e-02-2.63569032e-02j,
        -5.85785971e-02+9.32001375e-03j, -4.21554400e-02+4.07273979e-02j,
        -1.13436586e-02+5.65520682e-02j,  2.20443501e-02+5.21051491e-02j,
         4.63418098e-02+3.03175319e-02j,  5.41521846e-02-2.55949880e-04j,
         4.42517088e-02-2.91140722e-02j,  2.10499664e-02-4.74189191e-02j,
        -7.52473882e-03-5.03358150e-02j, -3.26007807e-02-3.78951602e-02j,
        -4.69022223e-02-1.46204500e-02j, -4.67743336e-02+1.20369373e-02j,
        -3.30546097e-02+3.41286322e-02j, -1.04105216e-02+4.56295684e-02j,
         1.43996090e-02+4.38968968e-02j,  3.45051872e-02+2.99772025e-02j,
         4.45949432e-02+8.03866335e-03j,  4.21252536e-02-1.57598975e-02j,
         2.79481916e-02-3.48040831e-02j,  6.20162970e-03-4.37898291e-02j,
        -1.67654362e-02-4.03449524e-02j, -3.43457237e-02-2.58686073e-02j,
        -4.18681719e-02-5.01573190e-03j, -3.79941341e-02+1.60752573e-02j,
        -2.46975385e-02+3.18940867e-02j, -6.11156130e-03+3.90243210e-02j,
         1.29689436e-02+3.65723308e-02j,  2.82791925e-02+2.58288581e-02j,
         3.67848351e-02+9.58704909e-03j,  3.69705941e-02-8.56440756e-03j,
         2.88864645e-02-2.48011842e-02j,  1.41825008e-02-3.55961422e-02j,
        -3.98188403e-03-3.84040862e-02j, -2.14719188e-02-3.24354364e-02j,
        -3.42431936e-02-1.90309030e-02j, -3.94540320e-02-1.28206811e-03j,
        -3.60987143e-02+1.68940687e-02j, -2.49930858e-02+3.17207503e-02j,
        -8.38149546e-03+4.02646075e-02j,  1.06274062e-02+4.07977296e-02j,
         2.85528593e-02+3.28565319e-02j,  4.18130029e-02+1.72364879e-02j,
         4.69911717e-02-3.73793391e-03j,  4.17068607e-02-2.58947559e-02j,
         2.59967341e-02-4.37837614e-02j,  3.02667994e-03-5.24972448e-02j,
        -2.19121015e-02-4.95869394e-02j, -4.33823112e-02-3.54998318e-02j,
        -5.69503407e-02-1.26265299e-02j, -5.91276654e-02+1.53050082e-02j,
        -4.76594411e-02+4.28395089e-02j, -2.31370870e-02+6.29032418e-02j,
         9.54241242e-03+6.89639553e-02j,  4.21066179e-02+5.81412671e-02j,
         6.60231240e-02+3.26118012e-02j,  7.53825234e-02-1.62208818e-03j,
         6.78548018e-02-3.69259967e-02j,  4.45193526e-02-6.55302726e-02j,
         9.80706855e-03-8.06171439e-02j, -2.88179759e-02-7.79488214e-02j,
        -6.24950382e-02-5.74532076e-02j, -8.34779946e-02-2.33392020e-02j,
        -8.68961545e-02+1.73122519e-02j, -7.12586794e-02+5.60890638e-02j,
        -3.87368257e-02+8.42647224e-02j,  4.27920434e-03+9.43491466e-02j,
         4.76304757e-02+8.27524836e-02j,  8.03226994e-02+5.20340677e-02j,
         9.46710348e-02+1.03395993e-02j,  8.88088312e-02-3.20745725e-02j,
         6.59274673e-02-6.66214473e-02j,  3.16670384e-02-8.80149885e-02j,
        -7.87302393e-03-9.37386331e-02j, -4.66309811e-02-8.31584516e-02j,
        -7.84939481e-02-5.74242209e-02j, -9.76769297e-02-1.98945951e-02j,
        -9.96880488e-02+2.36935202e-02j, -8.25095596e-02+6.56155561e-02j,
        -4.77366015e-02+9.72295357e-02j, -1.18851386e-03+1.10909047e-01j,
         4.77560571e-02+1.02449747e-01j,  8.84847461e-02+7.28240115e-02j,
         1.12198953e-01+2.80926344e-02j,  1.14164675e-01-2.24475151e-02j,
         9.43877779e-02-6.87691499e-02j,  5.70662569e-02-1.02166703e-01j,
         9.51704607e-03-1.16691138e-01j, -3.92717922e-02-1.10151781e-01j,
        -8.04951793e-02-8.44504522e-02j, -1.07368526e-01-4.48632972e-02j,
        -1.16154498e-01+1.45932026e-03j, -1.06217168e-01+4.69800789e-02j,
        -7.96167922e-02+8.47563956e-02j, -4.07775126e-02+1.09143691e-01j,
         4.03925529e-03+1.16696262e-01j,  4.78492575e-02+1.06868722e-01j,
         8.44372500e-02+8.19291545e-02j,  1.09395546e-01+4.59769190e-02j,
         1.20259430e-01+3.84363107e-03j,  1.16243479e-01-3.95342909e-02j,
         9.80636002e-02-7.95520843e-02j,  6.76152471e-02-1.12460686e-01j,
         2.70720538e-02-1.35620443e-01j, -2.19787538e-02-1.46578576e-01j,
        -7.78475494e-02-1.41407987e-01j, -1.36083728e-01-1.14385468e-01j,
        -1.86956328e-01-6.07941659e-02j, -2.16198783e-01+1.82472880e-02j,
        -2.09851492e-01+1.12581524e-01j, -1.60369812e-01+2.04463555e-01j,
        -6.98875756e-02+2.73656983e-01j,  5.07104962e-02+3.02493526e-01j,
         1.84104030e-01+2.78167395e-01j,  3.07558176e-01+1.93823631e-01j,
         3.93025148e-01+5.16779783e-02j,  4.10692642e-01-1.31489326e-01j,
         3.38495190e-01-3.21044038e-01j,  1.74588226e-01-4.69289803e-01j,
        -5.49906444e-02-5.29596723e-01j, -3.00030443e-01-4.73920197e-01j,
        -5.00584833e-01-3.04469211e-01j, -6.05364388e-01-5.40280857e-02j,
        -5.85787938e-01+2.24000840e-01j, -4.41504877e-01+4.69870567e-01j,
        -1.98726545e-01+6.30456935e-01j,  9.57299312e-02+6.69314924e-01j,
         3.82978110e-01+5.73713520e-01j,  6.03134861e-01+3.58448453e-01j,
         7.08168329e-01+6.46267681e-02j,  6.73714484e-01-2.48216557e-01j,
         5.05597361e-01-5.15628514e-01j,  2.38392251e-01-6.83359936e-01j,
        -7.33871525e-02-7.19332632e-01j, -3.68077594e-01-6.19320293e-01j,
        -5.89998555e-01-4.05970382e-01j, -6.99847342e-01-1.22552067e-01j,
        -6.81081633e-01+1.76435695e-01j, -5.41712467e-01+4.36220625e-01j,
        -3.11302523e-01+6.11848086e-01j, -3.42279793e-02+6.75772367e-01j,
         2.39310759e-01+6.21632600e-01j,  4.62422669e-01+4.63850216e-01j,
         5.99269997e-01+2.33739242e-01j,  6.30245914e-01-2.65393577e-02j,
         5.54629011e-01-2.71465143e-01j,  3.90101092e-01-4.59999642e-01j,
         1.69187985e-01-5.62693964e-01j, -6.72337599e-02-5.66754861e-01j,
        -2.77803566e-01-4.77660467e-01j, -4.28567803e-01-3.17085577e-01j,
        -4.98661881e-01-1.17780706e-01j, -4.83231529e-01+8.33155960e-02j,
        -3.93130559e-01+2.52179584e-01j, -2.51652782e-01+3.64039582e-01j,
        -8.89095016e-02+4.07482245e-01j,  6.52983922e-02+3.85583080e-01j,
         1.88082602e-01+3.13172453e-01j,  2.67485699e-01+2.11144364e-01j,
         3.02556872e-01+9.98130183e-02j,  2.99702677e-01-5.92389600e-03j,
         2.67593739e-01-9.77473567e-02j,  2.13424285e-01-1.71775884e-01j,
         1.42205884e-01-2.25167271e-01j,  5.87584281e-02-2.54079234e-01j,
        -2.98303991e-02-2.54328249e-01j, -1.13278482e-01-2.24027075e-01j,
        -1.79871252e-01-1.66195185e-01j, -2.19759136e-01-8.94955671e-02j,
        -2.28111752e-01-6.41306649e-03j, -2.06357340e-01+7.00596186e-02j,
        -1.61220618e-01+1.29655528e-01j, -1.02283542e-01+1.66687961e-01j,
        -3.93673435e-02+1.80166091e-01j,  1.94253933e-02+1.72705269e-01j,
         6.85303836e-02+1.48971361e-01j,  1.04949576e-01+1.14266364e-01j]),
 'o2@0,o1@0': array([-1.52302677e-02-9.94713170e-03j, -1.79776621e-02+1.54904698e-02j,
         1.09705642e-02+2.25592503e-02j,  2.21942409e-02-3.41964801e-03j,
         4.60868896e-03-1.64942614e-02j, -6.42110015e-03-1.04147587e-02j,
        -1.19369043e-02-5.70931918e-03j, -1.66651766e-02+8.39767718e-03j,
         7.98631524e-04+2.30997509e-02j,  2.27072233e-02+8.15686350e-03j,
         1.48356906e-02-1.53668408e-02j, -3.60275833e-03-1.61251349e-02j,
        -1.10129661e-02-8.15122699e-03j, -1.53924327e-02+1.33898781e-03j,
        -8.80000341e-03+1.56194150e-02j,  9.55603504e-03+1.49580740e-02j,
         1.45003321e-02-7.96380511e-04j,  6.02093099e-03-7.97038606e-03j,
         1.13942891e-03-7.62459370e-03j, -3.75331947e-03-8.20171119e-03j,
        -9.94071464e-03-2.76603876e-03j, -7.78977230e-03+6.17650679e-03j,
        -1.99094431e-04+8.33049541e-03j,  4.28562387e-03+5.11812661e-03j,
         5.77687618e-03+1.72752684e-03j,  6.22238030e-03-2.18655982e-03j,
         3.26837761e-03-7.00673071e-03j, -4.27451723e-03-7.60268631e-03j,
        -9.02495957e-03-3.63437197e-05j, -3.73696047e-03+7.53947190e-03j,
         4.30861663e-03+5.59965078e-03j,  5.48173600e-03-5.42363662e-04j,
         3.01786835e-03-3.64064627e-03j, -2.04544249e-04-5.75705462e-03j,
        -6.64937197e-03-4.63277231e-03j, -9.72376336e-03+4.34223130e-03j,
        -1.58666921e-03+1.25472530e-02j,  1.02587096e-02+9.23639038e-03j,
         1.42652133e-02-2.02720939e-03j,  8.99996586e-03-1.21920854e-02j,
        -2.04784928e-03-1.63461160e-02j, -1.40697079e-02-1.14075322e-02j,
        -1.95200710e-02+1.66493891e-03j, -1.39625944e-02+1.54073285e-02j,
        -2.06950191e-04+2.19945072e-02j,  1.52236003e-02+1.78350757e-02j,
         2.47950232e-02+3.66644005e-03j,  2.23779145e-02-1.43944890e-02j,
         7.93365283e-03-2.68528769e-02j, -1.18462470e-02-2.69034797e-02j,
        -2.77217054e-02-1.37261286e-02j, -3.16684883e-02+7.60900757e-03j,
        -2.04009931e-02+2.73866612e-02j,  1.77856441e-03+3.55738198e-02j,
         2.48064086e-02+2.75210730e-02j,  3.80542792e-02+6.07439419e-03j,
         3.47832841e-02-1.98426643e-02j,  1.52905536e-02-3.85550274e-02j,
        -1.23779437e-02-4.09580006e-02j, -3.60556261e-02-2.52610805e-02j,
        -4.51984607e-02+2.30108878e-03j, -3.52384635e-02+3.03078149e-02j,
        -9.60969861e-03+4.66559738e-02j,  2.12264698e-02+4.38215725e-02j,
         4.43019846e-02+2.24791727e-02j,  4.98657140e-02-8.90434934e-03j,
         3.52196413e-02-3.77570058e-02j,  5.74866841e-03-5.22675854e-02j,
        -2.69716483e-02-4.61648471e-02j, -4.98575155e-02-2.15040512e-02j,
        -5.37348579e-02+1.22560868e-02j, -3.67811649e-02+4.21421085e-02j,
        -5.12452513e-03+5.64978321e-02j,  2.92885875e-02+4.94330854e-02j,
         5.32219092e-02+2.33037778e-02j,  5.74081174e-02-1.21411176e-02j,
         4.00261718e-02-4.36103363e-02j,  7.32321421e-03-5.91481101e-02j,
        -2.84559490e-02-5.25998639e-02j, -5.35894450e-02-2.63569032e-02j,
        -5.85785971e-02+9.32001375e-03j, -4.21554400e-02+4.07273979e-02j,
        -1.13436586e-02+5.65520682e-02j,  2.20443501e-02+5.21051491e-02j,
         4.63418098e-02+3.03175319e-02j,  5.41521846e-02-2.55949880e-04j,
         4.42517088e-02-2.91140722e-02j,  2.10499664e-02-4.74189191e-02j,
        -7.52473882e-03-5.03358150e-02j, -3.26007807e-02-3.78951602e-02j,
        -4.69022223e-02-1.46204500e-02j, -4.67743336e-02+1.20369373e-02j,
        -3.30546097e-02+3.41286322e-02j, -1.04105216e-02+4.56295684e-02j,
         1.43996090e-02+4.38968968e-02j,  3.45051872e-02+2.99772025e-02j,
         4.45949432e-02+8.03866335e-03j,  4.21252536e-02-1.57598975e-02j,
         2.79481916e-02-3.48040831e-02j,  6.20162970e-03-4.37898291e-02j,
        -1.67654362e-02-4.03449524e-02j, -3.43457237e-02-2.58686073e-02j,
        -4.18681719e-02-5.01573190e-03j, -3.79941341e-02+1.60752573e-02j,
        -2.46975385e-02+3.18940867e-02j, -6.11156130e-03+3.90243210e-02j,
         1.29689436e-02+3.65723308e-02j,  2.82791925e-02+2.58288581e-02j,
         3.67848351e-02+9.58704909e-03j,  3.69705941e-02-8.56440756e-03j,
         2.88864645e-02-2.48011842e-02j,  1.41825008e-02-3.55961422e-02j,
        -3.98188403e-03-3.84040862e-02j, -2.14719188e-02-3.24354364e-02j,
        -3.42431936e-02-1.90309030e-02j, -3.94540320e-02-1.28206811e-03j,
        -3.60987143e-02+1.68940687e-02j, -2.49930858e-02+3.17207503e-02j,
        -8.38149546e-03+4.02646075e-02j,  1.06274062e-02+4.07977296e-02j,
         2.85528593e-02+3.28565319e-02j,  4.18130029e-02+1.72364879e-02j,
         4.69911717e-02-3.73793391e-03j,  4.17068607e-02-2.58947559e-02j,
         2.59967341e-02-4.37837614e-02j,  3.02667994e-03-5.24972448e-02j,
        -2.19121015e-02-4.95869394e-02j, -4.33823112e-02-3.54998318e-02j,
        -5.69503407e-02-1.26265299e-02j, -5.91276654e-02+1.53050082e-02j,
        -4.76594411e-02+4.28395089e-02j, -2.31370870e-02+6.29032418e-02j,
         9.54241242e-03+6.89639553e-02j,  4.21066179e-02+5.81412671e-02j,
         6.60231240e-02+3.26118012e-02j,  7.53825234e-02-1.62208818e-03j,
         6.78548018e-02-3.69259967e-02j,  4.45193526e-02-6.55302726e-02j,
         9.80706855e-03-8.06171439e-02j, -2.88179759e-02-7.79488214e-02j,
        -6.24950382e-02-5.74532076e-02j, -8.34779946e-02-2.33392020e-02j,
        -8.68961545e-02+1.73122519e-02j, -7.12586794e-02+5.60890638e-02j,
        -3.87368257e-02+8.42647224e-02j,  4.27920434e-03+9.43491466e-02j,
         4.76304757e-02+8.27524836e-02j,  8.03226994e-02+5.20340677e-02j,
         9.46710348e-02+1.03395993e-02j,  8.88088312e-02-3.20745725e-02j,
         6.59274673e-02-6.66214473e-02j,  3.16670384e-02-8.80149885e-02j,
        -7.87302393e-03-9.37386331e-02j, -4.66309811e-02-8.31584516e-02j,
        -7.84939481e-02-5.74242209e-02j, -9.76769297e-02-1.98945951e-02j,
        -9.96880488e-02+2.36935202e-02j, -8.25095596e-02+6.56155561e-02j,
        -4.77366015e-02+9.72295357e-02j, -1.18851386e-03+1.10909047e-01j,
         4.77560571e-02+1.02449747e-01j,  8.84847461e-02+7.28240115e-02j,
         1.12198953e-01+2.80926344e-02j,  1.14164675e-01-2.24475151e-02j,
         9.43877779e-02-6.87691499e-02j,  5.70662569e-02-1.02166703e-01j,
         9.51704607e-03-1.16691138e-01j, -3.92717922e-02-1.10151781e-01j,
        -8.04951793e-02-8.44504522e-02j, -1.07368526e-01-4.48632972e-02j,
        -1.16154498e-01+1.45932026e-03j, -1.06217168e-01+4.69800789e-02j,
        -7.96167922e-02+8.47563956e-02j, -4.07775126e-02+1.09143691e-01j,
         4.03925529e-03+1.16696262e-01j,  4.78492575e-02+1.06868722e-01j,
         8.44372500e-02+8.19291545e-02j,  1.09395546e-01+4.59769190e-02j,
         1.20259430e-01+3.84363107e-03j,  1.16243479e-01-3.95342909e-02j,
         9.80636002e-02-7.95520843e-02j,  6.76152471e-02-1.12460686e-01j,
         2.70720538e-02-1.35620443e-01j, -2.19787538e-02-1.46578576e-01j,
        -7.78475494e-02-1.41407987e-01j, -1.36083728e-01-1.14385468e-01j,
        -1.86956328e-01-6.07941659e-02j, -2.16198783e-01+1.82472880e-02j,
        -2.09851492e-01+1.12581524e-01j, -1.60369812e-01+2.04463555e-01j,
        -6.98875756e-02+2.73656983e-01j,  5.07104962e-02+3.02493526e-01j,
         1.84104030e-01+2.78167395e-01j,  3.07558176e-01+1.93823631e-01j,
         3.93025148e-01+5.16779783e-02j,  4.10692642e-01-1.31489326e-01j,
         3.38495190e-01-3.21044038e-01j,  1.74588226e-01-4.69289803e-01j,
        -5.49906444e-02-5.29596723e-01j, -3.00030443e-01-4.73920197e-01j,
        -5.00584833e-01-3.04469211e-01j, -6.05364388e-01-5.40280857e-02j,
        -5.85787938e-01+2.24000840e-01j, -4.41504877e-01+4.69870567e-01j,
        -1.98726545e-01+6.30456935e-01j,  9.57299312e-02+6.69314924e-01j,
         3.82978110e-01+5.73713520e-01j,  6.03134861e-01+3.58448453e-01j,
         7.08168329e-01+6.46267681e-02j,  6.73714484e-01-2.48216557e-01j,
         5.05597361e-01-5.15628514e-01j,  2.38392251e-01-6.83359936e-01j,
        -7.33871525e-02-7.19332632e-01j, -3.68077594e-01-6.19320293e-01j,
        -5.89998555e-01-4.05970382e-01j, -6.99847342e-01-1.22552067e-01j,
        -6.81081633e-01+1.76435695e-01j, -5.41712467e-01+4.36220625e-01j,
        -3.11302523e-01+6.11848086e-01j, -3.42279793e-02+6.75772367e-01j,
         2.39310759e-01+6.21632600e-01j,  4.62422669e-01+4.63850216e-01j,
         5.99269997e-01+2.33739242e-01j,  6.30245914e-01-2.65393577e-02j,
         5.54629011e-01-2.71465143e-01j,  3.90101092e-01-4.59999642e-01j,
         1.69187985e-01-5.62693964e-01j, -6.72337599e-02-5.66754861e-01j,
        -2.77803566e-01-4.77660467e-01j, -4.28567803e-01-3.17085577e-01j,
        -4.98661881e-01-1.17780706e-01j, -4.83231529e-01+8.33155960e-02j,
        -3.93130559e-01+2.52179584e-01j, -2.51652782e-01+3.64039582e-01j,
        -8.89095016e-02+4.07482245e-01j,  6.52983922e-02+3.85583080e-01j,
         1.88082602e-01+3.13172453e-01j,  2.67485699e-01+2.11144364e-01j,
         3.02556872e-01+9.98130183e-02j,  2.99702677e-01-5.92389600e-03j,
         2.67593739e-01-9.77473567e-02j,  2.13424285e-01-1.71775884e-01j,
         1.42205884e-01-2.25167271e-01j,  5.87584281e-02-2.54079234e-01j,
        -2.98303991e-02-2.54328249e-01j, -1.13278482e-01-2.24027075e-01j,
        -1.79871252e-01-1.66195185e-01j, -2.19759136e-01-8.94955671e-02j,
        -2.28111752e-01-6.41306649e-03j, -2.06357340e-01+7.00596186e-02j,
        -1.61220618e-01+1.29655528e-01j, -1.02283542e-01+1.66687961e-01j,
        -3.93673435e-02+1.80166091e-01j,  1.94253933e-02+1.72705269e-01j,
         6.85303836e-02+1.48971361e-01j,  1.04949576e-01+1.14266364e-01j])}
for fiber_xoffset in offsets:
    sp = gt.write_sparameters_grating_coupler(
        c,
        is_3d=False,
        fiber_angle_deg=fiber_angle_deg,
        fiber_xoffset=fiber_xoffset,
        filepath=PATH.sparameters
        / f"gc_{fiber_angle_deg:.1f}deg_{fiber_xoffset:.1f}um.npz",
    )
    plt.plot(
        sp["wavelengths"],
        20 * np.log10(np.abs(sp["o2@0,o1@0"])),
        label=str(fiber_xoffset),
    )

plt.xlabel("wavelength (um")
plt.ylabel("Transmission (dB)")
plt.title("transmission vs fiber xoffset (um)")
plt.legend()
<matplotlib.legend.Legend at 0x7ff7c8304450>
../_images/759f1f2b71a30e7f4975d6b7400514b4916d252273799537f73b078b055376b4.png
help(gt.write_sparameters_grating_coupler)
Help on function write_sparameters_grating_coupler in module gplugins.tidy3d.write_sparameters_grating_coupler:

write_sparameters_grating_coupler(component: 'ComponentSpec', dirpath: 'PathType | None' = None, filepath: 'PathType | None' = None, overwrite: 'bool' = False, port_waveguide_name: 'str' = 'o1', fiber_port_prefix: 'str' = 'o2', verbose: 'bool' = False, run: 'bool' = True, **kwargs) -> 'Sparameters'
    Get sparameter matrix from a gdsfactory grating coupler.
    
    Assumes grating coupler waveguide port is facing to the left (west).
    
    TODO: add a fiber model (more realistic than a gaussian_beam).
    
    Args:
        component: grating coupler gdsfactory Component to simulate.
        dirpath: directory to store sparameters in npz.
            Defaults to active Pdk.sparameters_path.
        filepath: optional sparameters file.
        overwrite: overwrites stored Sparameter npz results.
        verbose: prints info messages and progressbars.
        run: runs simulation, if False, only plots simulation.
    
    Keyword Args:
        port_extension: extend ports beyond the PML.
        layer_stack: contains layer to thickness, zmin and material.
            Defaults to active pdk.layer_stack.
        thickness_pml: PML thickness (um).
        xmargin: left/right distance from component to PML.
        xmargin_left: left distance from component to PML.
        xmargin_right: right distance from component to PML.
        ymargin: left/right distance from component to PML.
        ymargin_top: top distance from component to PML.
        ymargin_bot: bottom distance from component to PML.
        zmargin: thickness for cladding above and below core.
        clad_material: material for cladding.
        box_material: for bottom cladding.
        substrate_material: for substrate.
        box_thickness: bottom cladding thickness in (um).
        substrate_thickness: (um).
        port_waveguide_name: input port name.
        port_margin: margin on each side of the port.
        distance_source_to_monitors: in (um) source goes before monitors.
        port_waveguide_offset: mode solver workaround.
            positive moves source forward, negative moves source backward.
        wavelength: source center wavelength (um).
            if None takes mean between wavelength_start, wavelength_stop.
        wavelength_start: in (um).
        wavelength_stop: in (um).
        wavelength_points: number of wavelengths.
        plot_modes: plot source modes.
        num_modes: number of modes to plot.
        run_time_ps: make sure it's sufficient for the fields to decay.
            defaults to 10ps and counts on the automatic shutoff
            to stop earlier if needed.
        fiber_port_prefix: port prefix to place fiber source.
        fiber_xoffset: fiber center xoffset to fiber_port_name.
        fiber_z: fiber zoffset from grating zmax.
        fiber_mfd: fiber mode field diameter (um).
        fiber_angle_deg: fiber_angle in degrees with respect to normal.
        material_name_to_tidy3d: dispersive materials have a wavelength dependent index.
            Maps layer_stack names with tidy3d material database names.
        is_3d: True by default runs in 3D.
        with_all_monitors: stores all monitor fields.