Technolgy file archetecture revised with dictionary input method
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"""Mach-Zehnder interferometer composite layouts."""
|
||||
|
||||
from typing import Any, Optional
|
||||
import nazca as nd
|
||||
import numpy as np
|
||||
@@ -16,8 +18,25 @@ from ..primitives.passive import waveguide, PS_2st, PS_2st_Straight
|
||||
|
||||
from ..basic import __cell_arg__
|
||||
|
||||
""" Default 50:50 beam splitter generation using standard DC """
|
||||
def __BS_generate__(BS,xs,func_name):
|
||||
"""Resolve a beam splitter object into a Nazca cell.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
BS : Any
|
||||
Beam splitter cell, object with a ``cell`` attribute, or ``None``.
|
||||
xs : str
|
||||
Waveguide cross-section name used when a default directional coupler
|
||||
must be generated.
|
||||
func_name : str
|
||||
Name of the calling composite, used in warning messages.
|
||||
|
||||
Returns
|
||||
-------
|
||||
nazca.Cell
|
||||
Beam splitter cell used by the composite layout.
|
||||
"""
|
||||
|
||||
if (BS==None):
|
||||
BS_cell = DC(xs=xs,w_cp=0.45,w_wg=0.45,L_cp=9.27,angle=10,R0=15,Rmax=15,Rmin=15).cell
|
||||
|
||||
@@ -36,6 +55,63 @@ def __BS_generate__(BS,xs,func_name):
|
||||
|
||||
|
||||
class MZI:
|
||||
"""Mach-Zehnder interferometer with optional heaters and isolation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str, optional
|
||||
Nazca cell name. If omitted, the generated cell is not instantiated.
|
||||
xs_wg : str, optional
|
||||
Optical waveguide cross-section name.
|
||||
w_wg : float, optional
|
||||
Input and output waveguide width in microns.
|
||||
dL_Amzi : float, optional
|
||||
Differential arm length for asymmetric MZI operation.
|
||||
L_arm : int, optional
|
||||
Nominal straight arm length.
|
||||
R_bend : int, optional
|
||||
Bend radius used by internal routing.
|
||||
D_arm : int, optional
|
||||
Vertical distance between interferometer arms.
|
||||
D_port : Any, optional
|
||||
Output port pitch. If omitted, the beam splitter port pitch is used.
|
||||
w_arm : float, optional
|
||||
Internal arm waveguide width.
|
||||
xs_heater : str, optional
|
||||
Heater cross-section name.
|
||||
w_heater : float, optional
|
||||
Heater width. Use 0 to disable heater drawing.
|
||||
Ltp : int, optional
|
||||
Taper length between bus and arm widths.
|
||||
xs_metal : str, optional
|
||||
Metal routing cross-section name.
|
||||
w_metal : float, optional
|
||||
Metal routing width.
|
||||
via_h2m : Any, optional
|
||||
Heater-to-metal via object or cell.
|
||||
isl : Any, optional
|
||||
Isolation trench object or cell.
|
||||
outer_isl : bool, optional
|
||||
Add outer isolation structures.
|
||||
dual_ht : bool, optional
|
||||
Add heaters on both arms.
|
||||
L_patch : float, optional
|
||||
Straight patch length at routing interfaces.
|
||||
BS : Any, optional
|
||||
First beam splitter cell or object. If omitted, a default DC is used.
|
||||
BS2 : Any, optional
|
||||
Second beam splitter cell or object. If omitted, ``BS`` is reused.
|
||||
sharp_patch : bool, optional
|
||||
Add cladding patches around sharp geometry features.
|
||||
show_pins : bool, optional
|
||||
Show Nazca pin stubs in the generated layout.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: Optional[str]=None,
|
||||
xs_wg: str='strip',
|
||||
@@ -64,35 +140,9 @@ class MZI:
|
||||
BS2: Any=None,
|
||||
sharp_patch: bool=True,
|
||||
show_pins: bool=False) -> None:
|
||||
"""_summary_
|
||||
"""Initialize the MZI composite.
|
||||
|
||||
Args:
|
||||
name (_type_, optional): Name of the device, None means no instance cell will be created. Defaults to None.
|
||||
xs_wg (str, optional): The xsection of the waveguide. Defaults to 'strip'.
|
||||
w_wg (float, optional): The width of the ouput waveguide. Defaults to 0.45.
|
||||
dL_Amzi (int, optional): The asysmmetric length of AMZI. Defaults to 0.
|
||||
L_arm (int, optional): Length of the arms. Defaults to 150.
|
||||
R_bend (int, optional): Bneding radius of internal attachment. Defaults to 10.
|
||||
D_arm (int, optional): Distance of arms. Defaults to 75.
|
||||
D_port (_type_, optional): Distance of ports. If None, distance of BS ports will be used. Defaults to None.
|
||||
w_arm (float, optional): Width of arms, if you need wide arm to decrease phase errors. Defaults to 1.0.
|
||||
xs_heater (str, optional): xsection of heaters. Defaults to 'heater'.
|
||||
w_heater (int, optional): Width of heaters. Defaults to 0.
|
||||
Ltp (int, optional): Taper length of the wider arm to the thinner waveguide. Defaults to 15.
|
||||
xs_metal (str, optional): Xsection of metal. Defaults to 'metal'.
|
||||
w_metal (int, optional): Width of the attached metal. Defaults to 10.
|
||||
via_h2m (_type_, optional): The class of the vias. Defaults to None.
|
||||
isl (_type_, optional): The class of the isolation trench. Defaults to None.
|
||||
outer_isl (bool, optional): Flag of whether to place outside isolation. Defaults to True.
|
||||
dual_ht (bool, optional): Flag of whether to have two heaters. Defaults to True.
|
||||
BS (_type_, optional): The cell class for the first beamsplitter. Defaults to None.
|
||||
BS2 (_type_, optional): The cell class for the first beamsplitter. Defaults to None.
|
||||
sharp_patch (bool, optional): Flag of whether to add sharp_patch to the device. Defaults to True.
|
||||
show_pins (bool, optional): Flag of whether to show pins in the waveguide. Defaults to False.
|
||||
|
||||
Raises:
|
||||
Exception: _description_
|
||||
Exception: _description_
|
||||
See the class docstring for parameter descriptions.
|
||||
"""
|
||||
self.name = name
|
||||
if (self.name==None):
|
||||
@@ -249,6 +299,61 @@ class MZI:
|
||||
self.L = np.abs(self.cell.pin['a1'].x-self.cell.pin['b1'].x)
|
||||
|
||||
class MZI_NS:
|
||||
"""Nested-straight MZI composite with taperable arm widths.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
Nazca cell name.
|
||||
BS : Any
|
||||
Beam splitter cell or object used at both splitter positions.
|
||||
xs_wg : str
|
||||
Optical waveguide cross-section name.
|
||||
w1 : float
|
||||
Input/output waveguide width.
|
||||
w2 : float
|
||||
Internal arm waveguide width.
|
||||
L0 : Any
|
||||
Input/output straight section length.
|
||||
Ln : Any
|
||||
Length of the nominal arm section.
|
||||
Ls : Any
|
||||
Length of the shifted arm section.
|
||||
Ltp : Any
|
||||
Taper length between ``w1`` and ``w2``.
|
||||
R_bend : Any
|
||||
Bend radius used by the arm routing.
|
||||
w_wg : float
|
||||
Optical waveguide width used for ports and routing.
|
||||
L_patch : Any
|
||||
Straight patch length at routing interfaces.
|
||||
D_arm : int, optional
|
||||
Vertical distance between interferometer arms.
|
||||
L12 : Any, optional
|
||||
Optional length between the first and second beam splitter regions.
|
||||
w_heater : float, optional
|
||||
Heater width. Use 0 to disable heater drawing.
|
||||
L_ht : Any, optional
|
||||
Heater length override.
|
||||
via_h2m : Any, optional
|
||||
Heater-to-metal via object or cell.
|
||||
isl : Any, optional
|
||||
Isolation trench object or cell.
|
||||
show_pins : bool, optional
|
||||
Show Nazca pin stubs in the generated layout.
|
||||
D_port : Any, optional
|
||||
Output port pitch override.
|
||||
sharp_patch : bool, optional
|
||||
Add cladding patches around sharp geometry features.
|
||||
dual_ht : bool, optional
|
||||
Add heaters on both arms.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated nested-straight MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: str,
|
||||
BS: Any,
|
||||
@@ -372,6 +477,59 @@ class MZI_NS:
|
||||
self.cell = C
|
||||
|
||||
class MZI_NS_ubend:
|
||||
"""Nested-straight MZI composite using U-bend arm routing.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
Nazca cell name.
|
||||
BS : Any
|
||||
Beam splitter cell or object used at both splitter positions.
|
||||
xs_wg : str
|
||||
Optical waveguide cross-section name.
|
||||
w1 : float
|
||||
Input/output waveguide width.
|
||||
w2 : float
|
||||
Internal arm waveguide width.
|
||||
L0 : Any
|
||||
Input/output straight section length.
|
||||
Ln : Any
|
||||
Length of the nominal arm section.
|
||||
Ls : Any
|
||||
Length of the shifted arm section.
|
||||
Ltp : Any
|
||||
Taper length between ``w1`` and ``w2``.
|
||||
R_bend : Any
|
||||
Bend radius used by the U-bends.
|
||||
w_wg : float
|
||||
Optical waveguide width used for ports and routing.
|
||||
L_patch : Any
|
||||
Straight patch length at routing interfaces.
|
||||
L12 : Any, optional
|
||||
Optional length between splitter regions.
|
||||
w_ht : float, optional
|
||||
Heater width. Use 0 to disable heater drawing.
|
||||
L_ht : int, optional
|
||||
Heater length override.
|
||||
via_h2m : Any, optional
|
||||
Heater-to-metal via object or cell.
|
||||
isl : Any, optional
|
||||
Isolation trench object or cell.
|
||||
show_pins : bool, optional
|
||||
Show Nazca pin stubs in the generated layout.
|
||||
D_port : Any, optional
|
||||
Output port pitch override.
|
||||
sharp_patch : bool, optional
|
||||
Add cladding patches around sharp geometry features.
|
||||
dual_ht : bool, optional
|
||||
Add heaters on both arms.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated U-bend MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: str,
|
||||
BS: Any,
|
||||
@@ -490,8 +648,49 @@ class MZI_NS_ubend:
|
||||
nd.put_stub()
|
||||
|
||||
self.cell = C
|
||||
|
||||
|
||||
class MZI_2st_ubend:
|
||||
"""Two-stage U-bend MZI composite with three beam splitters.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
Nazca cell name.
|
||||
BS1, BS2, BS3 : Any
|
||||
Beam splitter cells or objects for the three splitter stages.
|
||||
xs_wg : str
|
||||
Optical waveguide cross-section name.
|
||||
w1 : float
|
||||
Input/output waveguide width.
|
||||
w2 : float
|
||||
Internal arm waveguide width.
|
||||
L0 : Any
|
||||
Input/output straight section length.
|
||||
Ln1, Ls1 : Any
|
||||
Nominal and shifted arm lengths for the first stage.
|
||||
Ln2, Ls2 : Any
|
||||
Nominal and shifted arm lengths for the second stage.
|
||||
Ltp : Any
|
||||
Taper length between ``w1`` and ``w2``.
|
||||
R_bend : Any
|
||||
Bend radius used by U-bend routing.
|
||||
w_wg : float
|
||||
Optical waveguide width used for ports and routing.
|
||||
L_patch : Any
|
||||
Straight patch length at routing interfaces.
|
||||
via_h2m : Any, optional
|
||||
Heater-to-metal via object or cell.
|
||||
isl : Any, optional
|
||||
Isolation trench object or cell.
|
||||
L12 : Any, optional
|
||||
Optional length between beam splitter regions.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated two-stage MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: str,
|
||||
BS1: Any,
|
||||
@@ -569,6 +768,45 @@ class MZI_2st_ubend:
|
||||
self.cell = C
|
||||
|
||||
class MZI_Eubend:
|
||||
"""Euler U-bend MZI composite for compact asymmetric routing.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
Nazca cell name.
|
||||
BS : Any
|
||||
Beam splitter cell or object.
|
||||
w_arm : float
|
||||
Internal arm waveguide width.
|
||||
w_wg : float
|
||||
Input/output waveguide width.
|
||||
L_arm : Any
|
||||
Nominal straight arm length.
|
||||
dL_Amzi : float
|
||||
Differential length for asymmetric MZI operation.
|
||||
L_patch : Any
|
||||
Straight patch length at routing interfaces.
|
||||
xs_wg : str
|
||||
Optical waveguide cross-section name.
|
||||
Rmax : int, optional
|
||||
Maximum Euler bend radius.
|
||||
Rmin : int, optional
|
||||
Minimum Euler bend radius.
|
||||
dL : float, optional
|
||||
Length-search resolution for the Euler compensation.
|
||||
w_arm_min : float, optional
|
||||
Minimum arm width used during tapering.
|
||||
show_pins : bool, optional
|
||||
Show Nazca pin stubs in the generated layout.
|
||||
sharp_patch : bool, optional
|
||||
Add cladding patches around sharp geometry features.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated Euler U-bend MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: str,
|
||||
BS: Any,
|
||||
@@ -640,6 +878,51 @@ class MZI_Eubend:
|
||||
self.cell = C
|
||||
|
||||
class MZI_Ubend(MZI_NS_ubend):
|
||||
"""Convenience U-bend MZI wrapper with default width handling.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
Nazca cell name.
|
||||
BS : Any
|
||||
Beam splitter cell or object.
|
||||
L_arm : Any
|
||||
Nominal arm length.
|
||||
xs_wg : str, optional
|
||||
Optical waveguide cross-section name.
|
||||
w_arm : float, optional
|
||||
Internal arm waveguide width.
|
||||
L_tp : int, optional
|
||||
Taper length between bus and arm widths.
|
||||
R_bend : int, optional
|
||||
Bend radius used by U-bend routing.
|
||||
w_wg : float, optional
|
||||
Input/output waveguide width.
|
||||
L_patch : float, optional
|
||||
Straight patch length at routing interfaces.
|
||||
w_ht : float, optional
|
||||
Heater width. Use 0 to disable heater drawing.
|
||||
L_ht : int, optional
|
||||
Heater length override.
|
||||
via_h2m : Any, optional
|
||||
Heater-to-metal via object or cell.
|
||||
isl : Any, optional
|
||||
Isolation trench object or cell.
|
||||
show_pins : bool, optional
|
||||
Show Nazca pin stubs in the generated layout.
|
||||
D_port : Any, optional
|
||||
Output port pitch override.
|
||||
sharp_patch : bool, optional
|
||||
Add cladding patches around sharp geometry features.
|
||||
dual_ht : bool, optional
|
||||
Add heaters on both arms.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated U-bend MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: str,
|
||||
BS: Any,
|
||||
@@ -669,6 +952,63 @@ class MZI_Ubend(MZI_NS_ubend):
|
||||
L_ht=L_ht, via_h2m=via_h2m, isl=isl, show_pins=show_pins, D_port=D_port, sharp_patch=sharp_patch,dual_ht=dual_ht)
|
||||
|
||||
class MZI_Butterfly:
|
||||
"""Butterfly-style MZI composite with compact folded arms.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str, optional
|
||||
Nazca cell name. If omitted, the generated cell is not instantiated.
|
||||
xs_wg : str, optional
|
||||
Optical waveguide cross-section name.
|
||||
w_wg : float, optional
|
||||
Input and output waveguide width in microns.
|
||||
dL_AMZI : float, optional
|
||||
Differential arm length for asymmetric MZI operation.
|
||||
L_arm : int, optional
|
||||
Nominal straight arm length.
|
||||
L_inner : int, optional
|
||||
Inner straight section length used by the butterfly fold.
|
||||
R_bend : int, optional
|
||||
Bend radius used by internal routing.
|
||||
D_port : Any, optional
|
||||
Output port pitch. If omitted, beam splitter pitch is used.
|
||||
w_arm : float, optional
|
||||
Internal arm waveguide width.
|
||||
xs_ht : str, optional
|
||||
Heater cross-section name.
|
||||
w_ht : float, optional
|
||||
Heater width. Use 0 to disable heater drawing.
|
||||
Ltp : int, optional
|
||||
Taper length between bus and arm widths.
|
||||
xs_metal : str, optional
|
||||
Metal routing cross-section name.
|
||||
w_metal : float, optional
|
||||
Metal routing width.
|
||||
via_h2m : Any, optional
|
||||
Heater-to-metal via object or cell.
|
||||
isl : Any, optional
|
||||
Isolation trench object or cell.
|
||||
outer_isl : bool, optional
|
||||
Add outer isolation structures.
|
||||
dual_ht : bool, optional
|
||||
Add heaters on both arms.
|
||||
L_patch : float, optional
|
||||
Straight patch length at routing interfaces.
|
||||
BS : Any, optional
|
||||
First beam splitter cell or object. If omitted, a default DC is used.
|
||||
BS2 : Any, optional
|
||||
Second beam splitter cell or object. If omitted, ``BS`` is reused.
|
||||
sharp_patch : bool, optional
|
||||
Add cladding patches around sharp geometry features.
|
||||
show_pins : bool, optional
|
||||
Show Nazca pin stubs in the generated layout.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
cell : nazca.Cell
|
||||
Generated butterfly MZI layout cell.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: Optional[str]=None,
|
||||
xs_wg: str='strip',
|
||||
|
||||
Reference in New Issue
Block a user