72 lines
2.5 KiB
Python
72 lines
2.5 KiB
Python
"""Loop mirror composite layouts."""
|
|
|
|
from typing import Any
|
|
import nazca as nd
|
|
import numpy as np
|
|
import nazca.interconnects as IC
|
|
|
|
from ..geometry import *
|
|
from ..routing import *
|
|
|
|
from ..primitives.pic import *
|
|
from ..electronics import Vias
|
|
|
|
from ..primitives.passive import waveguide
|
|
|
|
|
|
class LoopMirror():
|
|
"""Loop mirror reflector built from a beam splitter and return bend.
|
|
|
|
Parameters
|
|
----------
|
|
xs_wg : str, optional
|
|
Waveguide cross-section name.
|
|
w_wg : float, optional
|
|
Optical waveguide width in microns.
|
|
Radius : float, optional
|
|
Bend radius used for the loop mirror routing.
|
|
angle : float, optional
|
|
Bend angle in degrees for the side bends.
|
|
sharp_patch : bool, optional
|
|
Add cladding patch geometry around sharp loop features.
|
|
BS : Any, optional
|
|
Beam splitter object or cell. If not provided, a default directional
|
|
coupler is generated.
|
|
|
|
Attributes
|
|
----------
|
|
cell : nazca.Cell
|
|
Generated loop mirror layout cell.
|
|
"""
|
|
|
|
def __init__(self,
|
|
xs_wg: str='strip',
|
|
w_wg: float=0.45,
|
|
Radius: float = 20,
|
|
angle: float = 45,
|
|
sharp_patch: bool=True,
|
|
BS: Any=None) -> None:
|
|
with nd.Cell(instantiate=False) as C:
|
|
if (BS==None):
|
|
BS = DC(w_cp=0.45,gap=0.2,w_wg=w_wg,L_cp=10,R0=10,angle=20,xs=xs_wg,sharp_patch=True)
|
|
BS_Inst = BS.cell.put(0,0,0) ## middle
|
|
D_port = np.abs(BS_Inst.pin['b1'].y - BS_Inst.pin['b2'].y)
|
|
pic = Route(radius=Radius,width=w_wg,xs=xs_wg)
|
|
BU = nd.bend(radius=Radius,width=w_wg,xs=xs_wg,angle=angle).put('a0',BS_Inst.pin['b1'],flip=0)
|
|
BD = nd.bend(radius=Radius,width=w_wg,xs=xs_wg,angle=angle).put('a0',BS_Inst.pin['b2'],flip=1)
|
|
|
|
|
|
R_loop = (Radius+D_port/2)/np.cos(angle/180*np.pi) - Radius
|
|
BC = nd.bend(radius=R_loop,width=w_wg,xs=xs_wg,angle=180+angle*2).put('a0',BU.pin['b0'],flip=1)
|
|
|
|
if (sharp_patch==True):
|
|
for layers,growx,growy,acc in nd.layeriter(xs=xs_wg):
|
|
(a1,b1), (a2,b2),c1,c2 = growx
|
|
if (layers.find('CLD')!=-1):
|
|
### middle patch
|
|
nd.strt(length=(R_loop+w_wg*a1+b1)*(1+np.sin((180-angle)/180*np.pi))+(Radius)*np.sin(angle/180*np.pi),width=2*(R_loop+w_wg*a1+b1),layer=layers).put(BS_Inst.pin['b1'].x,0,0)
|
|
|
|
nd.Pin(name='a1',pin=BS_Inst.pin['a1']).put()
|
|
|
|
self.cell = C
|