Technolgy file archetecture revised with dictionary input method

This commit is contained in:
=
2026-06-07 17:07:20 +08:00
parent 8a17f1dde0
commit 54d20eb154
163 changed files with 5948 additions and 1297 deletions
+26
View File
@@ -1,3 +1,5 @@
"""Loop mirror composite layouts."""
from typing import Any
import nazca as nd
import numpy as np
@@ -13,6 +15,30 @@ 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,
+370 -30
View File
@@ -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',
+340 -144
View File
@@ -1,3 +1,5 @@
"""Mach-Zehnder interferometer mesh composite layouts."""
from typing import Any, Optional
import nazca as nd
import numpy as np
@@ -18,6 +20,51 @@ from .MZI import __BS_generate__
class W_waveguide:
"""W-shaped waveguide phase shifter section.
Parameters
----------
xs_wg : str, optional
Waveguide cross-section name.
w_wg : float, optional
Optical waveguide width in microns.
R_bend : int, optional
Bend radius used by W-shaped routing.
dL : float, optional
Vertical excursion of the W routing.
L_wg : int, optional
Total phase shifter waveguide length.
xs_heater : str, optional
Heater cross-section name.
w_ht : float, optional
Heater width. Use 0 to disable heater geometry.
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
Optional isolation helper.
n_bends : int, optional
Number of W bend periods.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
ISL_UPPER : bool, optional
Enable upper isolation placement when used.
ISL_LOWER : bool, optional
Enable lower isolation placement when used.
L_patch : float, optional
Straight patch length at bend interfaces.
reverse : bool, optional
Swap optical input/output pin naming.
Attributes
----------
cell : nazca.Cell
Generated W-waveguide layout cell.
"""
def __init__(self,
xs_wg: str='strip',
w_wg: float = 0.45,
@@ -36,26 +83,9 @@ class W_waveguide:
ISL_LOWER: bool = True,
L_patch: float = 0.25,
reverse: bool=False) -> None:
"""Generate a W-shaped waveguide phase shifter section.
"""Initialize the W waveguide composite.
Args:
xs_wg (str, optional): Waveguide xsection name. Defaults to 'strip'.
w_wg (float, optional): Waveguide width. Defaults to 0.45.
R_bend (int, optional): Bend radius used by the W routing. Defaults to 10.
dL (float, optional): Vertical excursion of each W bend. Defaults to 20.
L_wg (int, optional): Total phase shifter waveguide length. Defaults to 80.
xs_heater (str, optional): Heater xsection name. Defaults to 'heater'.
w_ht (float, optional): Heater width; use 0 to disable heater geometry. Defaults to 2.5.
xs_metal (str, optional): Metal xsection name. Defaults to 'metal'.
w_metal (float, optional): Metal routing width. Defaults to 6.
via_h2m (Any, optional): Heater-to-metal via object or cell. Defaults to None.
isl (Any, optional): Optional isolation helper reserved for isolation layout. Defaults to None.
n_bends (int, optional): Number of W bend periods. Defaults to 3.
show_pins (bool, optional): Show Nazca pin stubs. Defaults to False.
ISL_UPPER (bool, optional): Enable upper isolation placement when used. Defaults to True.
ISL_LOWER (bool, optional): Enable lower isolation placement when used. Defaults to True.
L_patch (float, optional): Short straight patch length at bend interfaces. Defaults to 0.25.
reverse (bool, optional): Swap optical input/output pin naming. Defaults to False.
See the class docstring for parameter descriptions.
"""
self.xs_wg = xs_wg
self.w_wg = w_wg
@@ -155,6 +185,61 @@ class W_waveguide:
## Standard unit of a mesh with one MZI and a PS
class UMat_2x2_S:
"""Standard 2x2 MZI mesh unit with phase shifter routing.
Parameters
----------
name : str, optional
Nazca cell name.
BS : Any, optional
Beam splitter cell or object. If omitted, a default DC is generated.
xs_wg : str, optional
Optical waveguide cross-section name.
L_arm : int, optional
Straight arm length between beam splitters.
D_arm : int, optional
Vertical spacing between MZI arms.
w_wg : float, optional
Input/output waveguide width.
R_bend : int, optional
Routing bend radius.
w_arm : float, optional
Internal arm width. If omitted, ``w_wg`` is used.
Ltp : int, optional
Taper length between bus and arm widths.
xs_heater : str, optional
Heater cross-section name.
bend_heaters : bool, optional
Route heaters along bent arms.
dL_ht : float, optional
Heater routing vertical offset.
dL_AMZI : float, optional
Differential length added for AMZI behavior.
L_heater : Any, optional
Optional explicit heater length.
xs_metal : str, optional
Metal routing cross-section name.
w_ht : float, optional
Heater width.
w_metal : float, optional
Metal routing width.
via_h2m : Any, optional
Heater-to-metal via object or cell.
isl : Any, optional
Isolation helper object or cell.
ht_same_side : bool, optional
Place both heater contacts on the same side.
port_align : bool, optional
Align optical ports to a common grid.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
Attributes
----------
cell : nazca.Cell
Generated 2x2 unit mesh layout cell.
"""
def __init__(self,
name: str="unit_mesh_2x2",
BS: Any=None,
@@ -182,31 +267,9 @@ class UMat_2x2_S:
ht_same_side: bool= False,
port_align: bool = True,
show_pins: bool=False) -> None:
"""Generate a standard 2x2 MZI mesh unit with phase shifter routing.
"""Initialize the UMat 2x2 S composite.
Args:
name (str, optional): Nazca cell name. Defaults to "unit_mesh_2x2".
BS (Any, optional): Beam splitter cell/object; None generates the default DC. Defaults to None.
xs_wg (str, optional): Waveguide xsection name. Defaults to 'strip'.
L_arm (int, optional): Straight arm length between beam splitters. Defaults to 80.
D_arm (int, optional): Vertical spacing between MZI arms. Defaults to 50.
w_wg (float, optional): Input/output waveguide width. Defaults to 0.45.
R_bend (int, optional): Routing bend radius. Defaults to 6.
w_arm (Optional[float], optional): Internal arm width; None uses w_wg. Defaults to None.
Ltp (int, optional): Taper length between w_wg and w_arm. Defaults to 15.
xs_heater (str, optional): Heater xsection name. Defaults to 'heater'.
bend_heaters (bool, optional): Route heaters along bent arms. Defaults to False.
dL_ht (float, optional): Heater routing vertical offset. Defaults to 30.
dL_AMZI (float, optional): Differential length added for AMZI behavior. Defaults to 0.
L_heater (Any, optional): Optional explicit heater length. Defaults to None.
xs_metal (str, optional): Metal xsection name. Defaults to 'metal'.
w_ht (float, optional): Heater width. Defaults to 2.5.
w_metal (float, optional): Metal width. Defaults to 8.
via_h2m (Any, optional): Heater-to-metal via object or cell. Defaults to None.
isl (Any, optional): Isolation helper object or cell. Defaults to None.
ht_same_side (bool, optional): Place both heater contacts on the same side. Defaults to False.
port_align (bool, optional): Align optical ports to a common grid. Defaults to True.
show_pins (bool, optional): Show Nazca pin stubs. Defaults to False.
See the class docstring for parameter descriptions.
"""
self.BS = __BS_generate__(BS=BS,xs=xs_wg,func_name="mxpic::functioanl::Umat_2x2_S")
@@ -344,8 +407,65 @@ class UMat_2x2_S:
return MZI_Unit
class MZI_mesh_U:
"""Universal MZI mesh built from repeated 2x2 MZI units.
Parameters
----------
BS : Any, optional
Beam splitter cell or object used by unit cells.
xs_wg : str, optional
Optical waveguide cross-section name.
L_arm : int, optional
Straight arm length in each unit MZI.
D_arm : int, optional
Vertical spacing between MZI arms.
w_wg : float, optional
Input/output waveguide width.
n_ports : int, optional
Number of mesh ports.
R_bend : int, optional
Routing bend radius.
L_compensate : int, optional
Length used for compensation routing.
R_compensate : int, optional
Bend radius used by compensation routing.
mesh_type : str, optional
Mesh topology name, such as ``"triangle"`` or ``"parallelogram"``.
xs_heater : str, optional
Heater cross-section name.
bend_heaters : bool, optional
Route heaters along bent arms.
dL_ht : float, optional
Heater routing vertical offset.
xs_metal : str, optional
Metal routing cross-section name.
w_ht : float, optional
Heater width.
w_metal : float, optional
Metal routing width.
w_arm : float, optional
Internal arm width. If omitted, ``w_wg`` is used.
Ltp : int, optional
Taper length between bus and arm widths.
via_h2m : Any, optional
Heater-to-metal via object or cell.
isl : Any, optional
Isolation helper object or cell.
port_align : bool, optional
Align optical ports to a common grid.
L_heater : Any, optional
Optional explicit heater length.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
Attributes
----------
cell : nazca.Cell
Generated universal MZI mesh layout cell.
"""
def __init__(self,
BS: Any=None,
BS: Any=None,
xs_wg: str='strip',
L_arm: int = 80,
D_arm: int = 50,
@@ -371,32 +491,9 @@ class MZI_mesh_U:
port_align: bool = True,
L_heater: Any = None,
show_pins: bool=False) -> None:
"""Generate a universal MZI mesh using repeated 2x2 MZI units.
"""Initialize the MZI mesh U composite.
Args:
BS (Any, optional): Beam splitter cell/object; None generates the default DC. Defaults to None.
xs_wg (str, optional): Waveguide xsection name. Defaults to 'strip'.
L_arm (int, optional): MZI unit arm length. Defaults to 80.
D_arm (int, optional): MZI unit arm spacing. Defaults to 50.
w_wg (float, optional): Mesh waveguide width. Defaults to 0.45.
n_ports (int, optional): Number of optical input/output ports. Defaults to 8.
R_bend (int, optional): Mesh routing bend radius. Defaults to 6.
L_compensate (int, optional): Straight length inside compensation bends. Defaults to 10.
R_compensate (int, optional): Bend radius inside compensation cells. Defaults to 10.
mesh_type (str, optional): Mesh topology, such as 'triangle' or 'parallelogram'. Defaults to 'triangle'.
xs_heater (str, optional): Heater xsection name. Defaults to 'heater'.
bend_heaters (bool, optional): Route heaters along bent arms. Defaults to True.
dL_ht (float, optional): Heater routing vertical offset. Defaults to 30.
xs_metal (str, optional): Metal xsection name. Defaults to 'metal'.
w_ht (float, optional): Heater width. Defaults to 2.5.
w_metal (float, optional): Metal width. Defaults to 8.
w_arm (Optional[float], optional): Internal arm width; None uses w_wg. Defaults to None.
Ltp (int, optional): Taper length between w_wg and w_arm. Defaults to 10.
via_h2m (Any, optional): Heater-to-metal via object or cell. Defaults to None.
isl (Any, optional): Isolation helper object or cell. Defaults to None.
port_align (bool, optional): Align external optical ports. Defaults to True.
L_heater (Any, optional): Optional explicit heater length for unit cells. Defaults to None.
show_pins (bool, optional): Show Nazca pin stubs. Defaults to False.
See the class docstring for parameter descriptions.
"""
self.BS = __BS_generate__(BS=BS,xs=xs_wg,func_name="mxpic::functioanl::MZI_mesh_U")
@@ -682,8 +779,63 @@ class MZI_mesh_U:
return mesh
class AMZI_W:
"""Asymmetric MZI with W-shaped phase shifter arms.
Parameters
----------
name : str, optional
Nazca cell name.
BS : Any, optional
Beam splitter cell or object. If omitted, a default DC is generated.
xs_wg : str, optional
Optical waveguide cross-section name.
D_arm : int, optional
Vertical spacing between MZI arms.
w_wg : float, optional
Input/output waveguide width.
R_bend : int, optional
Routing bend radius.
n_bend : int, optional
Number of W-shaped bend periods.
w_arm : float, optional
Internal arm width. If omitted, ``w_wg`` is used.
Ltp : int, optional
Taper length between bus and arm widths.
xs_heater : str, optional
Heater cross-section name.
dL_ht : float, optional
Heater routing vertical offset.
dL_AMZI : float, optional
Differential length added for AMZI behavior.
L_heater : Any, optional
Optional explicit heater length.
xs_metal : str, optional
Metal routing cross-section name.
w_ht : float, optional
Heater width.
w_metal : float, optional
Metal routing width.
D_port : Any, optional
Output port pitch override.
via_h2m : Any, optional
Heater-to-metal via object or cell.
isl : Any, optional
Isolation helper object or cell.
port_align : bool, optional
Align optical ports to a common grid.
L_patch : float, optional
Straight patch length at routing interfaces.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
Attributes
----------
cell : nazca.Cell
Generated asymmetric W-MZI layout cell.
"""
def __init__(self,
name: str="AMZI_W",
name: str="AMZI_W",
BS: Any=None,
xs_wg: str='strip',
D_arm: int = 50,
@@ -710,31 +862,9 @@ class AMZI_W:
port_align: bool = True,
L_patch: float = 0.25,
show_pins: bool=False) -> None:
"""Generate an asymmetric MZI with W-shaped phase shifter arms.
"""Initialize the AMZI W composite.
Args:
name (str, optional): Nazca cell name. Defaults to "AMZI_W".
BS (Any, optional): Beam splitter cell/object; None generates the default DC. Defaults to None.
xs_wg (str, optional): Waveguide xsection name. Defaults to 'strip'.
D_arm (int, optional): Vertical spacing between MZI arms. Defaults to 50.
w_wg (float, optional): Input/output waveguide width. Defaults to 0.45.
R_bend (int, optional): Routing bend radius. Defaults to 6.
n_bend (int, optional): Number of W bends in the phase shifter. Defaults to 3.
w_arm (Optional[float], optional): Internal arm width; None uses w_wg. Defaults to None.
Ltp (int, optional): Taper length between w_wg and w_arm. Defaults to 15.
xs_heater (str, optional): Heater xsection name. Defaults to 'heater'.
dL_ht (float, optional): Heater routing vertical offset. Defaults to 30.
dL_AMZI (float, optional): Differential length between AMZI arms. Defaults to 0.
L_heater (Any, optional): Optional explicit heater length. Defaults to None.
xs_metal (str, optional): Metal xsection name. Defaults to 'metal'.
w_ht (float, optional): Heater width. Defaults to 2.5.
w_metal (float, optional): Metal width. Defaults to 8.
D_port (Any, optional): Optional external port spacing override. Defaults to None.
via_h2m (Any, optional): Heater-to-metal via object or cell. Defaults to None.
isl (Any, optional): Isolation helper object or cell. Defaults to None.
port_align (bool, optional): Align optical ports to a common grid. Defaults to True.
L_patch (float, optional): Short straight patch length at bend interfaces. Defaults to 0.25.
show_pins (bool, optional): Show Nazca pin stubs. Defaults to False.
See the class docstring for parameter descriptions.
"""
self.BS = __BS_generate__(BS=BS,xs=xs_wg,func_name="mxpic::functioanl::Umat_2x2_S")
@@ -898,8 +1028,63 @@ class AMZI_W:
## Parlogon mesh
class MZI_mesh_Parl(MZI_mesh_U):
"""Parallelogram MZI mesh topology wrapper.
Parameters
----------
BS : Any, optional
Beam splitter cell or object used by unit cells.
xs_wg : str, optional
Optical waveguide cross-section name.
L_arm : int, optional
Straight arm length in each unit MZI.
D_arm : int, optional
Vertical spacing between MZI arms.
w_wg : float, optional
Input/output waveguide width.
n_ports : int, optional
Number of mesh ports.
R_bend : int, optional
Routing bend radius.
L_compensate : int, optional
Length used for compensation routing.
R_compensate : int, optional
Bend radius used by compensation routing.
xs_heater : str, optional
Heater cross-section name.
bend_heaters : bool, optional
Route heaters along bent arms.
dL_ht : float, optional
Heater routing vertical offset.
xs_metal : str, optional
Metal routing cross-section name.
w_ht : float, optional
Heater width.
w_metal : float, optional
Metal routing width.
w_ram : float, optional
Internal arm width passed to the unit mesh generator.
Ltp : int, optional
Taper length between bus and arm widths.
via_h2m : Any, optional
Heater-to-metal via object or cell.
isl : Any, optional
Isolation helper object or cell.
L_heater : Any, optional
Optional explicit heater length.
port_align : bool, optional
Align optical ports to a common grid.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
Attributes
----------
cell : nazca.Cell
Generated parallelogram MZI mesh layout cell.
"""
def __init__(self,
BS: Any=None, xs_wg: str='strip',
BS: Any=None, xs_wg: str='strip',
L_arm: int=80, D_arm: int=50,
w_wg: float=0.45, n_ports: int=8, R_bend: int=6, L_compensate: int=10, R_compensate: int=10,
xs_heater: str='heater', bend_heaters: bool=True, dL_ht: float=0, xs_metal: str='metal', w_ht: float=2.5, w_metal: float=8,
@@ -908,31 +1093,9 @@ class MZI_mesh_Parl(MZI_mesh_U):
isl: Any = None,
L_heater: Any = None,
port_align: bool=True, show_pins: bool=False) -> None:
"""Generate a parallelogram MZI mesh.
"""Initialize the MZI mesh Parl composite.
Args:
BS (Any, optional): Beam splitter cell/object; None generates the default DC. Defaults to None.
xs_wg (str, optional): Waveguide xsection name. Defaults to 'strip'.
L_arm (int, optional): MZI unit arm length. Defaults to 80.
D_arm (int, optional): MZI unit arm spacing. Defaults to 50.
w_wg (float, optional): Mesh waveguide width. Defaults to 0.45.
n_ports (int, optional): Number of optical input/output ports. Defaults to 8.
R_bend (int, optional): Mesh routing bend radius. Defaults to 6.
L_compensate (int, optional): Straight length inside compensation bends. Defaults to 10.
R_compensate (int, optional): Bend radius inside compensation cells. Defaults to 10.
xs_heater (str, optional): Heater xsection name. Defaults to 'heater'.
bend_heaters (bool, optional): Route heaters along bent arms. Defaults to True.
dL_ht (float, optional): Heater routing vertical offset. Defaults to 0.
xs_metal (str, optional): Metal xsection name. Defaults to 'metal'.
w_ht (float, optional): Heater width. Defaults to 2.5.
w_metal (float, optional): Metal width. Defaults to 8.
w_ram (float, optional): Internal arm width passed to the unit cell. Defaults to 0.45.
Ltp (int, optional): Taper length between waveguide widths. Defaults to 15.
via_h2m (Any, optional): Heater-to-metal via object or cell. Defaults to None.
isl (Any, optional): Isolation helper object or cell. Defaults to None.
L_heater (Any, optional): Optional explicit heater length. Defaults to None.
port_align (bool, optional): Align external optical ports. Defaults to True.
show_pins (bool, optional): Show Nazca pin stubs. Defaults to False.
See the class docstring for parameter descriptions.
"""
super().__init__(BS, xs_wg, L_arm, D_arm, w_wg, n_ports, R_bend, L_compensate, R_compensate, 'parallelogram', xs_heater, bend_heaters, dL_ht, xs_metal, w_ht, w_metal,
w_ram,Ltp,
@@ -940,8 +1103,63 @@ class MZI_mesh_Parl(MZI_mesh_U):
## Triangle mesh
class MZI_mesh_Tri(MZI_mesh_U):
"""Triangular MZI mesh topology wrapper.
Parameters
----------
BS : Any, optional
Beam splitter cell or object used by unit cells.
xs_wg : str, optional
Optical waveguide cross-section name.
L_arm : int, optional
Straight arm length in each unit MZI.
D_arm : int, optional
Vertical spacing between MZI arms.
w_wg : float, optional
Input/output waveguide width.
n_ports : int, optional
Number of mesh ports.
R_bend : int, optional
Routing bend radius.
L_compensate : int, optional
Length used for compensation routing.
R_compensate : int, optional
Bend radius used by compensation routing.
xs_heater : str, optional
Heater cross-section name.
bend_heaters : bool, optional
Route heaters along bent arms.
dL_ht : float, optional
Heater routing vertical offset.
xs_metal : str, optional
Metal routing cross-section name.
w_ht : float, optional
Heater width.
w_metal : float, optional
Metal routing width.
w_ram : float, optional
Internal arm width passed to the unit mesh generator.
Ltp : int, optional
Taper length between bus and arm widths.
via_h2m : Any, optional
Heater-to-metal via object or cell.
isl : Any, optional
Isolation helper object or cell.
L_heater : Any, optional
Optional explicit heater length.
port_align : bool, optional
Align optical ports to a common grid.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
Attributes
----------
cell : nazca.Cell
Generated triangular MZI mesh layout cell.
"""
def __init__(self,
BS: Any=None, xs_wg: str='strip',
BS: Any=None, xs_wg: str='strip',
L_arm: int=80, D_arm: int=50, w_wg: float=0.45,
n_ports: int=8, R_bend: int=6, L_compensate: int=10, R_compensate: int=10,
xs_heater: str='heater', bend_heaters: bool=True, dL_ht: float=0, xs_metal: str='metal', w_ht: float=2.5, w_metal: float=8,
@@ -950,31 +1168,9 @@ class MZI_mesh_Tri(MZI_mesh_U):
isl: Any = None,
L_heater: Any = None,
port_align: bool=True, show_pins: bool=False) -> None:
"""Generate a triangular MZI mesh.
"""Initialize the MZI mesh Tri composite.
Args:
BS (Any, optional): Beam splitter cell/object; None generates the default DC. Defaults to None.
xs_wg (str, optional): Waveguide xsection name. Defaults to 'strip'.
L_arm (int, optional): MZI unit arm length. Defaults to 80.
D_arm (int, optional): MZI unit arm spacing. Defaults to 50.
w_wg (float, optional): Mesh waveguide width. Defaults to 0.45.
n_ports (int, optional): Number of optical input/output ports. Defaults to 8.
R_bend (int, optional): Mesh routing bend radius. Defaults to 6.
L_compensate (int, optional): Straight length inside compensation bends. Defaults to 10.
R_compensate (int, optional): Bend radius inside compensation cells. Defaults to 10.
xs_heater (str, optional): Heater xsection name. Defaults to 'heater'.
bend_heaters (bool, optional): Route heaters along bent arms. Defaults to True.
dL_ht (float, optional): Heater routing vertical offset. Defaults to 0.
xs_metal (str, optional): Metal xsection name. Defaults to 'metal'.
w_ht (float, optional): Heater width. Defaults to 2.5.
w_metal (float, optional): Metal width. Defaults to 8.
w_ram (float, optional): Internal arm width passed to the unit cell. Defaults to 0.45.
Ltp (int, optional): Taper length between waveguide widths. Defaults to 15.
via_h2m (Any, optional): Heater-to-metal via object or cell. Defaults to None.
isl (Any, optional): Isolation helper object or cell. Defaults to None.
L_heater (Any, optional): Optional explicit heater length. Defaults to None.
port_align (bool, optional): Align external optical ports. Defaults to True.
show_pins (bool, optional): Show Nazca pin stubs. Defaults to False.
See the class docstring for parameter descriptions.
"""
super().__init__(BS, xs_wg, L_arm, D_arm, w_wg, n_ports, R_bend, L_compensate, R_compensate, 'triangle', xs_heater, bend_heaters, dL_ht, xs_metal, w_ht, w_metal,
w_ram,Ltp,
+24 -18
View File
@@ -1,3 +1,5 @@
"""Optical splitting tree composite layouts."""
from typing import Any
import nazca as nd
import numpy as np
@@ -10,25 +12,29 @@ from ..primitives.pic import *
## Class for splitting tree
class SplittingTree():
'''
Class for generating splitting tree.
"""Binary splitter tree built from repeated Y-branch cells.
Paras:
1. ybranch [class] (Default None)
- length (Default: 28) Length of the ybranch
- width (Default: 2) Pitch between two output waveguides
- w_wg (Default: 0.45) Width of output waveguide
- cell (Default: box)
- a1 [Pin] Input waveguide
- b1 [Pin] Output waveguide1
- b2 [Pin] Output waveguide2
2. output_number [-] (Default: 16)
Number of output channels(Need to be 2^N)
3. bend_radius [um] (Default: 10)
Bend radius used to connect the different layer of Y branch
4. output_pitch [um] (Default: None)
Can define the pitch of output channel(If ==None, then pitch=self.width, which is the minimum pitch)
'''
Parameters
----------
ybranch : Any, optional
Y-branch object with a ``cell`` attribute and ``a1``, ``b1``, and
``b2`` pins. If omitted, a simple box-based Y-branch is generated.
output_number : int, optional
Number of output channels. Values are coerced to the nearest lower
power of two when needed.
bend_radius : int, optional
Bend radius used to route between splitter levels.
output_pitch : Any, optional
Output channel pitch in microns. If omitted, the Y-branch output
pitch is used.
show_pins : bool, optional
Show Nazca pin stubs in the generated layout.
Attributes
----------
cell : nazca.Cell
Generated splitting tree layout cell.
"""
def __init__(self, ybranch: Any=None, output_number: int=16, bend_radius: int=10, output_pitch: Any=None, show_pins: bool=False) -> None:
if ybranch == None:
+2
View File
@@ -1,3 +1,5 @@
"""Composite component exports."""
from .advance import *
from .MZI import MZI,MZI_NS_ubend,MZI_2st_ubend,MZI_Eubend,MZI_NS,MZI_Ubend,MZI_Butterfly
+2
View File
@@ -1,4 +1,6 @@
"""Convenience exports for advanced ring and CROW composite building blocks."""
from ..primitives.passive.rings import AED_ring,MRR_AED,STD_PIC_Rings,MRR_STD_Ring
from ..primitives.passive.crows import CROW_Circular_ring