Update to github version

This commit is contained in:
2026-05-17 11:58:41 +08:00
parent 9f2e3f3f78
commit 52be015967
100 changed files with 870 additions and 675 deletions
+11 -8
View File
@@ -7,6 +7,7 @@ This is the fast-track guide to contributing to **mxPIC**. Adherence to these ru
### <span style="color: #ff57c7;">0. Installation dependencies</span> ### <span style="color: #ff57c7;">0. Installation dependencies</span>
- python 3.10.1 - python 3.10.1
- nazca 0.5.13 - nazca 0.5.13
- build 1.4.4
- gdstk 1.0.0 - gdstk 1.0.0
- numpy 1.22.3 - numpy 1.22.3
- pandas 1.3.3 - pandas 1.3.3
@@ -16,15 +17,12 @@ This is the fast-track guide to contributing to **mxPIC**. Adherence to these ru
- myst-parser 3.0.1 - myst-parser 3.0.1
- sphinx-rtd-theme 3.1.0 - sphinx-rtd-theme 3.1.0
```
pip install sphinx myst-parser sphinx-rtd-theme gdstk==1.0.0
```
## <span style="color: #ff57c7;">1. File & architecture</span> ## <span style="color: #ff57c7;">1. File & architecture</span>
The repository have an archtecture like this. The repository have an archtecture like this.
``` ```
mxpic_forge/ mxpic/
├── primitives/ ├── primitives/
│ ├── edge_couplers/ │ ├── edge_couplers/
│ │ └── EC_dual_layer_px3.py │ │ └── EC_dual_layer_px3.py
@@ -42,10 +40,8 @@ mxpic_forge/
├── others/ ├── others/
├── structures/ ├── structures/
├── routing/ ├── routing/
── foundries/ ── foundries/
└── docs/
└── source/
└── conf.py
``` ```
## <span style="color: #ff57c7;">2. Annotation & Documentation</span> ## <span style="color: #ff57c7;">2. Annotation & Documentation</span>
@@ -84,6 +80,7 @@ The devices are divided into four major types, which is <span style="color: #d2a
In the definitial of classes, compulsary keys are required, including **name** , **show_pins** , all defaults are None. In the definitial of classes, compulsary keys are required, including **name** , **show_pins** , all defaults are None.
All classes are cored at the **cell** class of **nazca**, which is generated through an internal method named "generate_gds" All classes are cored at the **cell** class of **nazca**, which is generated through an internal method named "generate_gds"
``` python ``` python
class GratingCoupler(): class GratingCoupler():
def __init__(self,name:"str"=None,....,show_pins:bool=None) def __init__(self,name:"str"=None,....,show_pins:bool=None)
@@ -98,6 +95,12 @@ class GratingCoupler():
return C return C
``` ```
Please not that each class can be directly generated without any argument input which requires all the arguements to have default values, example below :
``` python
grating = GratingCoupler()
```
--- ---
## <span style="color: #ff57c7;">4. Port information formatting</span> ## <span style="color: #ff57c7;">4. Port information formatting</span>
The basic routing algorthium is based the information between nodes, which is the **pin** attribute inside each file. The formatting of **pin** name will be important. The basic routing algorthium is based the information between nodes, which is the **pin** attribute inside each file. The formatting of **pin** name will be important.
+16 -12
View File
@@ -1,16 +1,20 @@
# import mxpic as mx
import mxpic as mx import mxpic as mx
import nazca as nd import nazca as nd
import matplotlib import numpy as np
matplotlib.use('Agg')
import matplotlib.pyplot as plt # <-- Add this import
EC = mx.EC_dual_layer_px3(name="xxx",w_in=0.5,L_in=10,Ltp1=100,Ltp2=200,Ltp3=300) w_teeth_SiN = 0.5*np.ones(30)
gap_teeth_SiN = 0.5*np.ones(30)
nd.export_plt(topcells=EC.cell,path="",title="test",filename="file.plt") w_teeth_Si = 0.45*np.ones(30)
plt.savefig("test", bbox_inches='tight', dpi=300) gap_teeth_Si = 0.45*np.ones(30)
plt.close()
# import uuid
# mac = uuid.getnode() tapeout = mx.foundries.Silterra.EOM1_2ML_CU()
# mc_addr = ':'.join(("%012X" % mac)[i:i+2] for i in range(0, 12, 2))
# print(mc_addr) GC = mx.grating_couplers.GC_SiN_Si_Dual_Layer(name="test",
w_teeth_SiN=w_teeth_SiN,gap_teeth_SiN=gap_teeth_SiN,
w_teeth_Si=w_teeth_Si,gap_teeth_Si=gap_teeth_Si,
layer_Si_teeth="WG_HM",layer_Si_slab="WG_HIGHRIB",
layer_SiN_etch="SiN_Rib_WG",layer_SiN_slab="WG_N")
nd.export_gds(topcells=GC.cell,filename="..\\test.gds")
+8
View File
@@ -4,6 +4,7 @@ import importlib
import inspect import inspect
from pathlib import Path from pathlib import Path
import matplotlib import matplotlib
import shutil
matplotlib.use('Agg') matplotlib.use('Agg')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@@ -43,6 +44,13 @@ def generate_component_images(img_root="images/components"):
src_root = Path("mxpic/components") src_root = Path("mxpic/components")
img_root = Path(img_root) img_root = Path(img_root)
# 1. Delete the directory and all its contents
if img_root.exists() and img_root.is_dir():
shutil.rmtree(img_root)
# 2. Recreate the directory
img_root.mkdir(parents=True, exist_ok=True)
if not src_root.exists(): if not src_root.exists():
print(f"❌ Error: Source directory '{src_root}' not found.") print(f"❌ Error: Source directory '{src_root}' not found.")
sys.exit(1) sys.exit(1)
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@@ -1,20 +0,0 @@
# mxpic.components.primitives.EC_dual_layer_px3
```{eval-rst}
.. automodule:: mxpic.components.primitives.EC_dual_layer_px3
:no-members:
```
## EC_dual_layer_px3
```{eval-rst}
.. image:: EC_dual_layer_px3.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.EC_dual_layer_px3.EC_dual_layer_px3
:members:
:undoc-members:
:show-inheritance:
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

@@ -1,33 +0,0 @@
# mxpic.components.primitives.beam_splitters
```{eval-rst}
.. automodule:: mxpic.components.primitives.beam_splitters
:no-members:
```
## YBranch
```{eval-rst}
.. image:: YBranch.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.beam_splitters.YBranch
:members:
:undoc-members:
:show-inheritance:
```
## Ybranch_3wg
```{eval-rst}
.. image:: Ybranch_3wg.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.beam_splitters.Ybranch_3wg
:members:
:undoc-members:
:show-inheritance:
```
@@ -1,98 +0,0 @@
# mxpic.components.primitives.directional_couplers
```{eval-rst}
.. automodule:: mxpic.components.primitives.directional_couplers
:no-members:
```
## ADC_STD_2x2
```{eval-rst}
.. image:: ADC_STD_2x2.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.ADC_STD_2x2
:members:
:undoc-members:
:show-inheritance:
```
## BS_tdc
```{eval-rst}
.. image:: BS_tdc.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.BS_tdc
:members:
:undoc-members:
:show-inheritance:
```
## DC
```{eval-rst}
.. image:: DC.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.DC
:members:
:undoc-members:
:show-inheritance:
```
## DC_bend
```{eval-rst}
.. image:: DC_bend.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.DC_bend
:members:
:undoc-members:
:show-inheritance:
```
## DC_pX_3sg
```{eval-rst}
.. image:: DC_pX_3sg.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.DC_pX_3sg
:members:
:undoc-members:
:show-inheritance:
```
## MDM
```{eval-rst}
.. image:: MDM.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.MDM
:members:
:undoc-members:
:show-inheritance:
```
## ring_bus_wg
```{eval-rst}
.. image:: ring_bus_wg.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.directional_couplers.ring_bus_wg
:members:
:undoc-members:
:show-inheritance:
```
@@ -1,111 +0,0 @@
# mxpic.components.primitives.grating_couplers
```{eval-rst}
.. automodule:: mxpic.components.primitives.grating_couplers
:no-members:
```
## FA
```{eval-rst}
.. image:: FA.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.FA
:members:
:undoc-members:
:show-inheritance:
```
## GC_STD_1D
```{eval-rst}
.. image:: GC_STD_1D.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.GC_STD_1D
:members:
:undoc-members:
:show-inheritance:
```
## GC_STD_2D
```{eval-rst}
.. image:: GC_STD_2D.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.GC_STD_2D
:members:
:undoc-members:
:show-inheritance:
```
## Grating_2D_Hole
```{eval-rst}
.. image:: Grating_2D_Hole.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.Grating_2D_Hole
:members:
:undoc-members:
:show-inheritance:
```
## Grating_2D_Hole_3Rec
```{eval-rst}
.. image:: Grating_2D_Hole_3Rec.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.Grating_2D_Hole_3Rec
:members:
:undoc-members:
:show-inheritance:
```
## Grating_2D_Hole_4Rec
```{eval-rst}
.. image:: Grating_2D_Hole_4Rec.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.Grating_2D_Hole_4Rec
:members:
:undoc-members:
:show-inheritance:
```
## Nano_ant
```{eval-rst}
.. image:: Nano_ant.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.Nano_ant
:members:
:undoc-members:
:show-inheritance:
```
## Taper
```{eval-rst}
.. image:: Taper.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.grating_couplers.Taper
:members:
:undoc-members:
:show-inheritance:
```
@@ -1,33 +0,0 @@
# mxpic.components.primitives.multimode_interferometers
```{eval-rst}
.. automodule:: mxpic.components.primitives.multimode_interferometers
:no-members:
```
## MMI_ML
```{eval-rst}
.. image:: MMI_ML.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.multimode_interferometers.MMI_ML
:members:
:undoc-members:
:show-inheritance:
```
## MMI_STD
```{eval-rst}
.. image:: MMI_STD.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.multimode_interferometers.MMI_STD
:members:
:undoc-members:
:show-inheritance:
```
@@ -1,85 +0,0 @@
# mxpic.components.primitives.spiral
```{eval-rst}
.. automodule:: mxpic.components.primitives.spiral
:no-members:
```
## Spiral_Cicle_MM
```{eval-rst}
.. image:: Spiral_Cicle_MM.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.spiral.Spiral_Cicle_MM
:members:
:undoc-members:
:show-inheritance:
```
## Spiral_Cicle_STD
```{eval-rst}
.. image:: Spiral_Cicle_STD.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.spiral.Spiral_Cicle_STD
:members:
:undoc-members:
:show-inheritance:
```
## Spiral_Rect_STD
```{eval-rst}
.. image:: Spiral_Rect_STD.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.spiral.Spiral_Rect_STD
:members:
:undoc-members:
:show-inheritance:
```
## spiral
```{eval-rst}
.. image:: spiral.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.spiral.spiral
:members:
:undoc-members:
:show-inheritance:
```
## spiral_circle
```{eval-rst}
.. image:: spiral_circle.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.spiral.spiral_circle
:members:
:undoc-members:
:show-inheritance:
```
## spiral_rectangle
```{eval-rst}
.. image:: spiral_rectangle.png
:align: center
:width: 600px
.. autoclass:: mxpic.components.primitives.spiral.spiral_rectangle
:members:
:undoc-members:
:show-inheritance:
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

@@ -1,88 +1,9 @@
# import os
# import shutil
# from pathlib import Path
# basic_md_info = "\
# .. mxpic_handbook documentation master file, created by\n\
# sphinx-quickstart on Sun May 3 16:05:57 2026.\n\
# You can adapt this file completely to your liking, but it should at least\n\
# contain the root `toctree` directive.\n\n\
# # Welcome to the automated documentation for the mxPIC silicon photonics library.\n\
# ```{toctree}\n\
# :maxdepth: 2\n\
# :caption: Components:\n\n\
# "
# def generate_myst_docs(src_dir: str, docs_api_dir: str) -> None:
# """
# Scans a Python package and generates MyST Markdown files for Sphinx autodoc.
# """
# src_path = Path(src_dir).resolve()
# api_path = Path(docs_api_dir).resolve()
# # Clean the old api directory to prevent dead links from deleted files
# if api_path.exists():
# # shutil.rmtree(api_path)
# pass
# else :
# api_path.mkdir(parents=True, exist_ok=True)
# package_name = src_path.name
# generated_files = []
# print(f"Scanning {package_name} for Python modules...")
# index_info = basic_md_info
# # Recursively find all .py files
# for py_file in src_path.rglob("*.py"):
# # Skip init files and private/internal scripts if desired
# if py_file.name == "__init__.py" or py_file.name.startswith("_"):
# continue
# # Convert file path to Python module format (e.g., mxpic.primitives.mzm)
# rel_path = py_file.relative_to(src_path.parent.parent)
# class_name = str(rel_path.with_suffix("")).replace(os.sep, ".")
# module_name = str(rel_path.with_suffix("")).replace(os.sep, "\\")
# index_md_name = str(rel_path.with_suffix("")).replace(os.sep, "/")
# # Create the markdown file
# md_filename = api_path / f"{module_name}.md"
# # MyST Markdown format using Sphinx autodoc directives
# content = f"# {module_name}\n \
# ```{{eval-rst}}\n \
# .. automodule:: {class_name}\n\
# :members:\n\
# :undoc-members:\n\
# :show-inheritance:\n\
# ```\n\
# "
# ## Building .md file for each .py file
# try :
# try : os.makedirs(name=str(md_filename.parent.resolve()))
# except : pass
# with open(file=str(md_filename.resolve()),mode="w") as md_file:
# md_file.write(content)
# print(f"Generated: {docs_api_dir}{module_name}.md")
# except Exception as e:
# print(e)
# ## Writing information into the index.md file
# index_info = index_info + f"{index_md_name}\n"
# with open(file=docs_api_dir+"index.md",mode="w") as md_file:
# md_file.write(index_info)
# if __name__ == "__main__":
# generate_myst_docs(src_dir="mxpic\\components\\",docs_api_dir="mxpic\\docs\\source\\")
import os import os
import sys import sys
import importlib import importlib
import inspect import inspect
from pathlib import Path from pathlib import Path
import shutil
def generate_markdown_handbook(): def generate_markdown_handbook():
print("📝 Starting mxPIC Markdown Generation...") print("📝 Starting mxPIC Markdown Generation...")
@@ -92,8 +13,12 @@ def generate_markdown_handbook():
# This should point to where your Sphinx .md files are stored # This should point to where your Sphinx .md files are stored
docs_root = Path("docs/source/mxpic/components") docs_root = Path("docs/source/mxpic/components")
# We use absolute Sphinx paths for images (starts with / meaning docs/source root) # 1. Delete the directory and all its contents
sphinx_image_root = "source/images/components" if docs_root.exists() and docs_root.is_dir():
shutil.rmtree(docs_root)
# 2. Recreate the directory
docs_root.mkdir(parents=True, exist_ok=True)
success_count = 0 success_count = 0
+1 -1
View File
@@ -6,7 +6,7 @@ from .core.license_check import verify_license
verify_license() verify_license()
# If the check passes, the rest of the library loads # If the check passes, the rest of the library loads
from .components import EC_dual_layer_px3,DC,DC_bend,DC_pX_3sg from .components import grating_couplers,EC_dual_layer_px3
from .routing import Route from .routing import Route
from .foundries import * from .foundries import *
@@ -76,20 +76,10 @@ class EC_dual_layer_px3():
layer_dum_exl_be:str=None, layer_dum_exl_be:str=None,
angle_tile: float = 8, angle_tile: float = 8,
R_bend: float = 50, R_bend: float = 50,
sample_build = False,
): ):
"""""" """"""
""" This is the instruction for building a sample """ """ This is the instruction for building a sample """
if (sample_build):
name = "EC_dual_layer_px3"
w_in = 0.8
L_in = 15
Ltp1 = 50
Ltp2 = 150
Ltp3 = 450
self.name = name self.name = name
if (self.name is None): self.instantiate = False if (self.name is None): self.instantiate = False
else: self.instantiate = True else: self.instantiate = True
+1
View File
@@ -4,3 +4,4 @@ from .directional_couplers import *
from .beam_splitters import * from .beam_splitters import *
from .multimode_interferometers import * from .multimode_interferometers import *
from .spiral import * from .spiral import *
from .grating_couplers import *
@@ -452,7 +452,7 @@ class ADC_STD_2x2:
_dX_ = abs(pin_a1.x) _dX_ = abs(pin_a1.x)
else : else :
Ltp = np.max([_dX_-5,np.abs(self.wu0+err-self.wu_in)/np.tan(self.tp_angle/180*pi)]) Ltp = np.max([-5,np.abs(self.wu0+err-self.wu_in)/np.tan(self.tp_angle/180*pi)])
Ltp = int(Ltp*20)*0.05 ## keep it in integer Ltp = int(Ltp*20)*0.05 ## keep it in integer
temp = nd.strt(xs=self.xs,length=5,width=self.wu0+err).put(0,vtx_upper_y[0]/2+vtx_upper_y[-1]/2,180,flip=0) temp = nd.strt(xs=self.xs,length=5,width=self.wu0+err).put(0,vtx_upper_y[0]/2+vtx_upper_y[-1]/2,180,flip=0)
pin_a1 = nd.taper(xs=self.xs,length=Ltp,width1=self.wu0+err,width2=self.wu_in).put().pin['b0'] pin_a1 = nd.taper(xs=self.xs,length=Ltp,width1=self.wu0+err,width2=self.wu_in).put().pin['b0']
+142 -178
View File
@@ -394,172 +394,6 @@ class Grating_2D_Hole() :
) )
return ic return ic
class Grating_2D_Hole_4Rec() :
"""
Assemble four identical 2D hole gratings into a rectangular array.
Parameters
----------
grating_unit : Grating_2D_Hole
Pre-built grating instance supplying the unit cell.
mode_radius : float, optional
Radius of the target circular fiber mode in microns (default is 8).
cell_name : str or None, optional
Nazca cell name suffix; ``None`` uses "TwoD_Grating" (default is None).
show_pins : bool, optional
Draw Nazca stub markers on exported IO pins (default is False).
"""
def __init__(self, grating_unit, mode_radius=8, cell_name=None, show_pins=False) -> None:
self.gt_2D_class = grating_unit
self.cell_unit = grating_unit.cell
self.mode_radius = mode_radius
# Calculate the field center location
# radius = np.sqrt(2)/2 * (
# self.mode_radius + np.sqrt(2)/2*(grating_unit.w_gt/2-grating_unit.l_field_center) -
# np.sqrt(np.power(self.mode_radius, 2) - 1/2*np.power(grating_unit.w_gt/2-grating_unit.l_field_center, 2))
# )
# print("---------------------"+str(radius)+"------------------------------")
l_field_center = grating_unit.l_field_center
w_gt = grating_unit.w_gt
x0 = (
2*(w_gt/2-l_field_center)-np.sqrt(
8*mode_radius**2 - 4 * (w_gt/2 - l_field_center)**2
)
) / 4
self.field_center = (
x0 + mode_radius*np.cos(np.pi/4),
x0 + mode_radius*np.cos(np.pi/4),
180
)
self.cell_unit._put_pin(name='g0', connect=self.field_center)
self.show_pins = show_pins
self.cell_name = cell_name
self.cell = self.generate_gds()
def generate_gds(self) :
if self.cell_name is not None : self.cell_name = "TwoD_Grating_" + self.cell_name
else : self.cell_name = "TwoD_Grating"
with nd.Cell(name=self.cell_name, instantiate=False) as ic :
gt_1 = self.cell_unit.put(
'g0', self.mode_radius*np.cos(np.pi/4), self.mode_radius*np.sin(np.pi/4)
)
gt_2 = self.cell_unit.put(
'g0', self.mode_radius*np.cos(np.pi/4), -self.mode_radius*np.sin(np.pi/4), flip=True
)
gt_3 = self.cell_unit.put(
'g0', -self.mode_radius*np.cos(np.pi/4), -self.mode_radius*np.sin(np.pi/4), flip=True, flop=True
)
gt_4 = self.cell_unit.put(
'g0', -self.mode_radius*np.cos(np.pi/4), self.mode_radius*np.sin(np.pi/4), flip=False, flop=True
)
'''Put OPEN and PATH region if necessary.'''
if nd.get_layer(layer="GC_OPEN") == "GC_OPEN" :
nd.Polygon(
points=nd.geom.circle(radius=self.mode_radius+20, N=int(np.floor((self.mode_radius+20)/0.1))),
layer="GC_OPEN"
).put(0,0)
if nd.get_layer(layer="STRIP_CLD") == "STRIP_CLD" :
nd.Polygon(
points=nd.geom.circle(radius=self.mode_radius+10, N=int(np.floor((self.mode_radius+20)/0.1))),
layer="STRIP_CLD"
).put(0,0)
''' Put Pins '''
nd.Pin(name='g1').put(gt_1.pin['g1'])
nd.Pin(name='g2').put(gt_1.pin['g2'])
nd.Pin(name='g3').put(gt_2.pin['g1'])
nd.Pin(name='g4').put(gt_2.pin['g2'])
nd.Pin(name='g5').put(gt_3.pin['g1'])
nd.Pin(name='g6').put(gt_3.pin['g2'])
nd.Pin(name='g7').put(gt_4.pin['g1'])
nd.Pin(name='g8').put(gt_4.pin['g2'])
nd.Pin(name='a0').put(gt_1.pin['g1'].x, 0, 0)
if self.show_pins :
nd.put_stub()
return ic
class Grating_2D_Hole_3Rec() :
"""
Assemble three identical 2D hole gratings in triangular symmetry.
Parameters
----------
grating_unit : Grating_2D_Hole
Source grating instance providing the layout cell.
mode_radius : float, optional
Radius of the circumscribed fiber mode in microns (default is 6.5).
cell_name : str or None, optional
Custom Nazca cell name suffix (default is None).
show_pins : bool, optional
Draw Nazca stub markers on exported IO pins (default is False).
"""
def __init__(self, grating_unit, mode_radius=6.5, cell_name=None, show_pins=False) -> None:
self.gt_2D_class = grating_unit
self.cell_unit = grating_unit.cell
self.mode_radius = mode_radius
self.cell_name = cell_name
# Calculate the field center location
radius = np.sqrt(2)/2 * (
self.mode_radius + np.sqrt(2)/2*(grating_unit.w_gt/2-grating_unit.l_field_center) -
np.sqrt(np.power(self.mode_radius, 2) - 1/2*np.power(grating_unit.w_gt/2-grating_unit.l_field_center, 2))
)
self.field_center = (
radius*np.cos(np.pi/4),
radius*np.cos(np.pi/4),
45
)
self.cell_unit._put_pin(name='g0', connect=self.field_center)
self.show_pins = show_pins
self.cell = self.generate_gds()
def generate_gds(self) :
if self.cell_name is not None : self.cell_name = "TwoD_Grating_" + self.cell_name
else : self.cell_name = "TwoD_Grating"
with nd.Cell(name=self.cell_name, instantiate=False) as ic :
rotation_angle = 2*np.pi/3*0
gt_1 = self.cell_unit.put(
'g0',
self.mode_radius*np.cos(rotation_angle), self.mode_radius*np.sin(rotation_angle),
180 + rotation_angle*180/np.pi
)
rotation_angle = 2*np.pi/3*1
gt_2 = self.cell_unit.put(
'g0',
self.mode_radius*np.cos(rotation_angle), self.mode_radius*np.sin(rotation_angle),
180 + rotation_angle*180/np.pi
)
rotation_angle = 2*np.pi/3*2
gt_3 = self.cell_unit.put(
'g0',
self.mode_radius*np.cos(rotation_angle), self.mode_radius*np.sin(rotation_angle),
180 + rotation_angle*180/np.pi
)
'''Put OPEN and PATH region if necessary.'''
if nd.get_layer(layer="GC_OPEN") == "GC_OPEN" :
nd.Polygon(
points=nd.geom.circle(radius=self.mode_radius+20, N=int(np.floor((self.mode_radius+20)/0.1))),
layer="GC_OPEN"
).put(0,0)
if nd.get_layer(layer="STRIP_CLD") == "STRIP_CLD" :
nd.Polygon(
points=nd.geom.circle(radius=self.mode_radius+10, N=int(np.floor((self.mode_radius+20)/0.1))),
layer="STRIP_CLD"
).put(0,0)
'''Put pins'''
nd.Pin(name='g1').put(gt_1.pin['g1'])
nd.Pin(name='g2').put(gt_1.pin['g2'])
nd.Pin(name='g3').put(gt_2.pin['g1'])
nd.Pin(name='g4').put(gt_2.pin['g2'])
nd.Pin(name='g5').put(gt_3.pin['g1'])
nd.Pin(name='g6').put(gt_3.pin['g2'])
if self.show_pins :
nd.put_stub()
return ic
""" Renamed for simplification in 2023.04.02 """ """ Renamed for simplification in 2023.04.02 """
class GC_STD_2D: class GC_STD_2D:
""" """
@@ -632,14 +466,14 @@ class GC_STD_2D:
Py:float=0.57, Py:float=0.57,
num_x:float=25, num_x:float=25,
num_y:float=25, num_y:float=25,
Lx_taper:float = 50, Lx_taper:float = 50.0,
Ly_taper:float = 0, Ly_taper:float = 0.0,
Lx_end:float = 1, Lx_end:float = 1.0,
Ly_end:float = 1, Ly_end:float = 1.0,
Lx_side:float = 0.5, Lx_side:float = 0.5,
Ly_side:float = 0.5, Ly_side:float = 0.5,
Lx_port:float=5, Lx_port:float=5.0,
Ly_port:float=5, Ly_port:float=5.0,
w_wg:float=0.5, w_wg:float=0.5,
show_pins:bool=False, show_pins:bool=False,
P_AR: float = 0.6, P_AR: float = 0.6,
@@ -926,18 +760,18 @@ class GC_STD_1D:
w_wg : float = 0.5, w_wg : float = 0.5,
etch_type :str = 'FETCH', etch_type :str = 'FETCH',
xs_open :str=None, xs_open :str=None,
L_taper :float = 10, L_taper :float = 10.0,
L_end :float = 2, L_end :float = 2.0,
A_taper :float = 30, A_taper :float = 30.0,
Period :float = 0.5, Period :float = 0.5,
eta_etch :float = 0.5, eta_etch :float = 0.5,
num :float = 20, ### note, when Period and eta is defined as list, this is not usefull num :int = 20, ### note, when Period and eta is defined as list, this is not usefull
sector_gc :bool =True, sector_gc :bool =True,
show_pins=False, show_pins=False,
L_tail = 2, L_tail = 2,
# n_points = 64, # n_points = 64,
P_AR: float = 1, ### adding anti reflection pitches P_AR: float = 1.0, ### adding anti reflection pitches
L_AR: float = 2, L_AR: float = 2.0,
): ):
self.name = name self.name = name
@@ -1276,3 +1110,133 @@ class FA:
nd.put_stub(pinsize=3) nd.put_stub(pinsize=3)
self.cell = C self.cell = C
class GC_SiN_Si_Dual_Layer:
def __init__(self,
name:str=None,
w_teeth_SiN:'list|float' = 0.5,
gap_teeth_SiN:'list|float' = 0.5,
w_teeth_Si:'list|float' = 0.5,
gap_teeth_Si:'list|float' = 0.5,
ori_teeth_offset:float = 5.0,
n_teeth_Si:float=30,
n_teeth_SiN:float=30,
A_gc_taper:float=25.0,
R_teeth_ori_SiN:float=40.0,
R_teeth_ori_Si:float=40.0,
L_end_Si:float=0.2,
L_end_SiN:float=5.0,
w_port : float = 0.9,
A_anti_rfl:float = 4.0,
layer_SiN_slab:str=None,
layer_Si_slab:str=None,
layer_Si_teeth:str=None,
layer_SiN_teeth:str=None,
layer_SiN_etch:str=None,
layer_Si_etch:str=None,
layer_ox_open:str=None,
):
self.name = name
self.w_teeth_SiN = w_teeth_SiN
self.gap_teeth_SiN = gap_teeth_SiN
self.w_teeth_Si = w_teeth_Si
self.gap_teeth_Si = gap_teeth_Si
self.ori_teeth_offset = ori_teeth_offset
self.n_teeth_SiN = n_teeth_SiN
self.n_teeth_Si = n_teeth_Si
self.A_gc_taper = A_gc_taper
self.w_port = w_port
self.L_end_Si = L_end_Si
self.L_end_SiN = L_end_SiN
self.A_anti_rfl = A_anti_rfl
self.R_teeth_ori_SiN = R_teeth_ori_SiN
self.R_teeth_ori_Si = R_teeth_ori_Si
self.layer_SiN_slab = layer_SiN_slab
self.layer_Si_slab = layer_Si_slab
self.layer_Si_teeth = layer_Si_teeth
self.layer_SiN_teeth = layer_SiN_teeth
self.layer_SiN_etch = layer_SiN_etch
self.layer_Si_etch = layer_Si_etch
self.layer_ox_open = layer_ox_open
self.cell = self.generate_gds()
def generate_gds(self):
""" creating instance cell or not """
if (self.name is None) : self.instantiate = False
else : self.instantiate = True
""" """
if (isinstance(self.w_teeth_SiN,list) or isinstance(self.w_teeth_SiN,np.ndarray)):
n_teeth_SiN = len(self.w_teeth_SiN)
elif (isinstance(self.w_teeth_SiN,float)):
n_teeth_SiN = self.n_teeth_SiN
w_teeth_SiN = [w_teeth_SiN]*n_teeth_SiN
""" """
if (isinstance(self.w_teeth_Si,list) or isinstance(self.w_teeth_Si,np.ndarray)):
n_teeth_Si = len(self.w_teeth_Si)
elif (isinstance(self.w_teeth_Si,float)):
n_teeth_Si = self.n_teeth_Si
w_teeth_Si = [w_teeth_Si]*n_teeth_Si
with nd.Cell(instantiate=self.instantiate, name=self.name) as C:
""" Creating SiN layer grating """
## whole area where the grating area covered
L_gc = self.R_teeth_ori_SiN + self.L_end_SiN + sum(self.w_teeth_SiN) + sum(self.gap_teeth_SiN)
w_box_gc = L_gc*np.sin(self.A_gc_taper/2*np.pi/180)*2
L_box_gc = L_gc*np.cos(self.A_gc_taper/2*np.pi/180)
x_slab = [0,L_box_gc,L_gc+w_box_gc*np.sin(self.A_anti_rfl*np.pi/180),L_gc,L_box_gc,0]
y_slab = [self.w_port/2,w_box_gc/2,w_box_gc/2,-w_box_gc/2,-w_box_gc/2,-self.w_port/2]
_my_polygon(layer_wg=self.layer_SiN_slab,vtx=np.c_[x_slab,y_slab]).put(0,0,0)
# circle(radius=self.R_teeth_ori_SiN/2,angle=self.A_gc_taper,layer=self.layer_SiN_slab,
# width=self.R_teeth_ori_SiN).cell.put(0,0,-self.A_gc_taper/2)
A_etch_ext = 4
## Placing teeth
r_in = self.R_teeth_ori_SiN
for idxT in range(0,n_teeth_SiN):
r_out = r_in + self.gap_teeth_SiN[idxT]
circle(radius=(r_out+r_in)/2,angle=self.A_gc_taper+A_etch_ext,layer=self.layer_SiN_etch,
width=self.gap_teeth_Si[idxT]).cell.put(0,0,-self.A_gc_taper/2-A_etch_ext/2)
r_in = r_out + self.w_teeth_SiN[idxT]
""" Creating Si layer grating """
w_Si_slab = sum(self.w_teeth_Si)+sum(self.gap_teeth_Si)
R_Si_slab = self.R_teeth_ori_Si+w_Si_slab/2
circle(radius=R_Si_slab,angle=self.A_gc_taper,layer=self.layer_Si_slab,
width=w_Si_slab).cell.put(0,0,-self.A_gc_taper/2)
## Placing teeth
r_in = self.R_teeth_ori_Si
for idxT in range(0,n_teeth_Si):
r_out = r_in + self.gap_teeth_Si[idxT]
if (self.layer_Si_etch is not None):
circle(radius=(r_out+r_in)/2,angle=self.A_gc_taper+A_etch_ext,layer=self.layer_Si_etch,
width=self.gap_teeth_Si[idxT]).cell.put(0,0,-self.A_gc_taper/2-A_etch_ext/2)
elif (self.layer_Si_teeth is not None):
circle(radius=r_out+(self.w_teeth_Si[idxT])/2,angle=self.A_gc_taper,layer=self.layer_Si_teeth,
width=self.w_teeth_Si[idxT]).cell.put(0,0,-self.A_gc_taper/2)
r_in = r_out + self.w_teeth_Si[idxT]
return C
+5 -1
View File
@@ -565,7 +565,11 @@ class spiral_rectangle:
print("WARNING: In <mxpic::passive::spiral>, Dmin too small") print("WARNING: In <mxpic::passive::spiral>, Dmin too small")
D_port = self.Dmin - bend_sz[1]*2 D_port = self.Dmin - bend_sz[1]*2
with nd.Cell(instantiate=True,name="wg_mid_cell"+self.name) as wg_mid_cell: if (self.name is None):
wg_mid_name = None
else:
wg_mid_name = "wg_mid_cell"+self.name
with nd.Cell(instantiate=self.instantiate,name=wg_mid_name) as wg_mid_cell:
wg = self.__strt_with_taper__(length=self.Lmin-bend_sz[0]*2-bend_sz[0],width2=self.width,width1=bend_cell.pin['a0']. wg = self.__strt_with_taper__(length=self.Lmin-bend_sz[0]*2-bend_sz[0],width2=self.width,width1=bend_cell.pin['a0'].
width,xs=self.xs,Ltp=self.Ltp).put(-self.Lmin/2+bend_sz[0]*2+bend_sz[0],0,0,flip=1) width,xs=self.xs,Ltp=self.Ltp).put(-self.Lmin/2+bend_sz[0]*2+bend_sz[0],0,0,flip=1)
+1
View File
@@ -15,6 +15,7 @@ _ENV_VAR_NAME = "LIC_MXPIC_OPTIHK_DIR"
# Add your team's MAC addresses here. Use uppercase. # Add your team's MAC addresses here. Use uppercase.
_DEVELOPER_MACS = { _DEVELOPER_MACS = {
"D4:54:8B:F1:46:49", # Qin Yue's Workstation "D4:54:8B:F1:46:49", # Qin Yue's Workstation
"28:92:00:C9:13:E5", # Qin Yue's in HKSTP
} }
def _get_local_mac() -> str: def _get_local_mac() -> str:
+3
View File
@@ -0,0 +1,3 @@
from .foundries import *
from .components import DC as DC, DC_bend as DC_bend, DC_pX_3sg as DC_pX_3sg, EC_dual_layer_px3 as EC_dual_layer_px3
from .routing import Route as Route
+4
View File
@@ -0,0 +1,4 @@
def __cell_arg__(arg, arg_name, func_name): ...
def __list_convert__(var, name, func_name): ...
def __array_convert__(var, name, func_name, num: int = 1): ...
def __xs_exist__(xs, para_name, func_name): ...
@@ -0,0 +1 @@
from .primitives import *
@@ -0,0 +1,30 @@
from _typeshed import Incomplete
class EC_dual_layer_px3:
name: Incomplete
instantiate: bool
w_in: Incomplete
L_in: Incomplete
Ltp1: Incomplete
Ltp2: Incomplete
Ltp3: Incomplete
L_end: Incomplete
w_tip_core: Incomplete
w1_slab: Incomplete
w_tip_slab: Incomplete
w_mid_slab: Incomplete
w_box: Incomplete
w_box_end: Incomplete
L_box_end: Incomplete
w_DT: Incomplete
xs_SiN: Incomplete
layer_SiN_slab: Incomplete
layer_top_cover: Incomplete
layer_dum_exl_be: Incomplete
layer_DT: Incomplete
xs_Trench: Incomplete
angle_tile: Incomplete
R_bend: Incomplete
cell: Incomplete
def __init__(self, name: str = None, w_in: float = 1.0, L_in: float = 15, Ltp1: float = 100, Ltp2: float = 200, Ltp3: float = 400, L_end: float = 0, w_tip_core: float = 0.2, w1_slab: float = 0.6, w_tip_slab: float = 0.2, w_mid_slab: float = 0.45, w_box: float = 8, w_box_end: float = 12, L_box_end: float = 2, w_DT: float = 12, xs_SiN: str = 'sin', layer_SiN_slab: str = 'SiN_Rib_WG', layer_DT: str = 'OXIDE_FACET', xs_Trench: str = 'air_trench', layer_top_cover: str = 'PAD_OPTICAL', layer_dum_exl_be: str = None, angle_tile: float = 8, R_bend: float = 50) -> None: ...
def generate_gds(self): ...
@@ -0,0 +1,5 @@
from .directional_couplers import *
from .EC_dual_layer_px3 import *
from .beam_splitters import *
from .multimode_interferometers import *
from .spiral import *
@@ -0,0 +1,39 @@
from ...structures import *
from ...foundries import *
import numpy as np
from ...basic import __cell_arg__ as __cell_arg__
from ...routing import Route as Route
from _typeshed import Incomplete
class YBranch:
name: Incomplete
instantiate: bool
w: Incomplete
L: Incomplete
res: Incomplete
R_att: Incomplete
A_att: Incomplete
w_port: Incomplete
xs: Incomplete
cell: Incomplete
def __init__(self, name: str = None, xs: str = 'strip', w: list | np.ndarray = [1.2, 1.0, 1.8, 1.2, 1.0, 1.2, 1.2], L: float = 6, R_att: float = 10, A_att: float = 10, w_port: float = 0.45, show_pins: bool = False, sharp_patch: bool = True, res: float = 0.1) -> None: ...
def generate_gds(self, show_pins: bool = False, sharp_patch: bool = True): ...
class Ybranch_3wg:
name: Incomplete
instantiate: bool
w0: Incomplete
w1: Incomplete
gap: Incomplete
Lcp: Incomplete
xs: Incomplete
w_wg: Incomplete
R0: Incomplete
angle: Incomplete
L_attach: Incomplete
L_in_tp: Incomplete
cell: Incomplete
L: Incomplete
def __init__(self, name=None, w0: float = 0.4, w1: float = 0.2, gap: float = 0.18, Lcp: float = 20, xs: str = 'strip', w_wg: float = 0.45, R0: float = 10, angle: float = 20, L_attach: float = 3, L_in_tp: float = 3, sharp_patch: bool = True) -> None: ...
def generate_gds(self, sharp_patch, err_asy: int = 0): ...
def generate_test_gds(self, gc, dX_gc2gc: int = 400, dY_gc2gc: int = 80, sharp_patch: bool = True, Rbend: int = 15): ...
@@ -0,0 +1,141 @@
from ...basic import __cell_arg__ as __cell_arg__
from ...routing import Route as Route
from ...structures import Clothoid as Clothoid, circle as circle
from _typeshed import Incomplete
class ring_bus_wg:
xs: Incomplete
R_cp: Incomplete
w_bus: Incomplete
dLc: Incomplete
dAc: Incomplete
w_wg: Incomplete
bend_DC: Incomplete
euler_transistion: Incomplete
dL_trans: Incomplete
dA_trans: Incomplete
R_max_trans: Incomplete
w_trans: Incomplete
R_max_anti: Incomplete
R_min_anti: Incomplete
A_anti: Incomplete
wg_Ltp: Incomplete
dL_p2p: Incomplete
res: Incomplete
end_patch: Incomplete
L: int
clothoid_order: Incomplete
cell: Incomplete
def __init__(self, xs: str = 'strip', R_cp: int = 20, w_bus: float = 0.5, bend_DC: bool = True, w_wg: float = 0.5, dLc: int = 10, dAc: int = 10, euler_transistion: bool = False, dL_trans: int = 10, dA_trans: int = 30, R_max_trans: int = 100, w_trans: float = 0.5, euler_anti_bend: bool = False, R_max_anti: int = 100, R_min_anti: int = 10, A_anti=None, res: float = 0.1, wg_Ltp: int = 5, dL_p2p=None, sharp_patch: bool = True, show_pins: bool = False, end_patch: bool = False, clothoid_order: int = 1) -> None: ...
w: Incomplete
sz: Incomplete
def generate_gds(self, sharp_patch, show_pins: bool = False): ...
class ADC_STD_2x2:
name: Incomplete
instantiate: bool
wu0: Incomplete
xs: Incomplete
wu1: Incomplete
wu_in: Incomplete
wu_out: Incomplete
wd0: Incomplete
wd1: Incomplete
wd_in: Incomplete
wd_out: Incomplete
Lu: Incomplete
Ld: Incomplete
angle: Incomplete
g0: Incomplete
g1: Incomplete
sbend_type: Incomplete
Rmax: Incomplete
Rmin: Incomplete
sharp_patch: Incomplete
euler_points: Incomplete
res: Incomplete
Ru0: Incomplete
Ru1: Incomplete
Rd0: Incomplete
Rd1: Incomplete
tp_angle: Incomplete
cell: Incomplete
L: Incomplete
def __init__(self, name=None, xs: str = 'strip', wu0: float = 0.45, wu1: float = 0.61, wu_in: float = 0.45, wu_out: float = 0.8, wd0: float = 0.33, wd1: float = 0.2, wd_in: float = 0.45, wd_out: float = 0.8, Lu: int = 33, Ld: int = 33, angle: int = 20, g0: float = 0.2, g1: float = 0.2, sbend_type: str = 'euler', Rmax=None, Rmin: int = 5, Ru0: int = 0, Ru1: int = 20, Rd0: int = 20, Rd1: int = 0, tp_angle: int = 2, sharp_patch: bool = True, show_pins: bool = False, euler_points: int = 64, res: float = 0.1) -> None: ...
def generate_gds(self, err: int = 0, show_pins: bool = False): ...
err: Incomplete
def generate_err(self, err: float = 0.02): ...
def generate_test_gds(self, gc, dX_gc2gc: int = 400, dY_gc2gc: int = 80, sharp_patch: bool = True): ...
class DC(ADC_STD_2x2):
def __init__(self, name=None, xs: str = 'strip', w_cp: float = 0.45, w_wg: float = 0.45, L_cp: float = 30, angle: float = 20, gap: float = 0.2, sbend_type: str = 'circular', Rmax: float = None, Rmin: float = 5, R0: float = 10, tp_angle: float = 2, sharp_patch: bool = True, show_pins: bool = False) -> None: ...
def generate_test_gds(self, gc, dX_gc2gc: int = 300, dY_gc2gc: int = 40, sharp_patch: bool = True): ...
class BS_tdc(ADC_STD_2x2):
def __init__(self, name=None, xs: str = 'strip', wa0: float = 0.35, wa1: float = 0.45, wb0: float = 0.55, wb1: float = 0.45, w_wg: float = 0.45, gap: float = 0.2, Lt: float = 20, R0: float = 30, angle: float = 15, sbend_type: str = 'circle') -> None: ...
class MDM(ADC_STD_2x2):
wb0: Incomplete
wb1: Incomplete
w0: Incomplete
w1: Incomplete
w_wg: Incomplete
gap0: Incomplete
gap1: Incomplete
Lt_bus: Incomplete
Lt_cp: Incomplete
xs: Incomplete
R0: Incomplete
angle: Incomplete
symmetric_BUS: Incomplete
Rmin: Incomplete
L: Incomplete
def __init__(self, name=None, xs: str = 'strip', wb0: float = 0.45, wb1: float = 0.61, wb_in: float = 0.45, wb_out: float = 0.88, w_wg: float = 0.45, w0: float = 0.33, w1: float = 0.2, gap0: float = 0.2, Lt_bus: float = 20, R0: float = 40, angle: float = 22.5, Lt_cp: float = None, gap1: float = None, Lb0: float = None, symmetric_BUS: bool = True, single_end: bool = True, Rmin: float = 8) -> None: ...
def generate_test_gds(self, gc, dX_gc2gc: int = 300, dY_gc2gc: int = 40, sharp_patch: bool = True): ...
class DC_bend:
name: Incomplete
instantiate: bool
w_in: Incomplete
w_out: Incomplete
gap: Incomplete
r_in: Incomplete
r_out: Incomplete
theta_arc: Incomplete
theta_ext: Incomplete
w_wg: Incomplete
xs_wg: Incomplete
sharp_patch: Incomplete
show_pins: Incomplete
cell: Incomplete
def __init__(self, name=None, w_in: float = 0.45, w_out: float = 0.45, gap: float = 0.2, r_in: int = 40, theta_arc: int = 30, w_wg: float = 0.45, theta_ext: int = 15, xs_wg: str = 'strip', sharp_patch: bool = True, show_pins: bool = False) -> None: ...
width: Incomplete
length: Incomplete
def generate_gds(self, cellname: str = ''): ...
def generate_test_gds(self, gc, dX_gc2gc: int = 300, dY_gc2gc: int = 40, sharp_patch: bool = True): ...
class DC_pX_3sg:
name: Incomplete
instantiate: bool
xs_wg: Incomplete
Lc1: Incomplete
Lp1: Incomplete
Lc2: Incomplete
Lt: Incomplete
w_cp: Incomplete
dw: Incomplete
gap: Incomplete
R0: Incomplete
A: Incomplete
w_wg: Incomplete
sharp_patch: Incomplete
pX_type: Incomplete
port_symmetric: Incomplete
cell: Incomplete
cellU: Incomplete
cellD: Incomplete
L: Incomplete
length: Incomplete
def __init__(self, name=None, xs_wg: str = 'strip', Lc1: float = 10, Lp1: float = 5, Lc2: float = 10, Lt: float = 1, w_cp: float = 0.5, dw: float = 0.1, gap: float = 0.2, R0: float = 10, A: float = 15, w_wg: float = 0.45, pX_type: str = 'symmetric', port_symmetric: bool = True, sharp_patch: bool = True) -> None: ...
def generate_gds(self, err: int = 0): ...
def generate_test_gds(self, gc, dX_gc2gc: int = 300, dY_gc2gc: int = 40, sharp_patch: bool = True): ...
@@ -0,0 +1,121 @@
from ...basic import __cell_arg__ as __cell_arg__
from ...routing import Route as Route
from ...structures import Clothoid as Clothoid, circle as circle, hole as hole
from _typeshed import Incomplete
class Nano_ant:
w_wg: Incomplete
xs_wg: Incomplete
etch_type: str
vector: Incomplete
teeth_number: Incomplete
pitch: Incomplete
duty_cycle: Incomplete
taper_length: Incomplete
ant_length: Incomplete
width: Incomplete
max_theta: Incomplete
define_type: Incomplete
etch_depth: Incomplete
show_pins: Incomplete
cell: Incomplete
def __init__(self, w_wg: float = 0.41, xs_wg: str = 'strip', define_type: str = 'non-periodic', vector: float | list = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5], taper_length: float = 3, width: float = 6, max_theta: float = 110, pitch: float | list = 0.6, duty_cycle: float | list = 0.3, teeth_number: float = 6, etch_depth: str | list = ['METCH'], show_pins: bool = True) -> None: ...
def generate_gds(self, sample_step: float = 0.1, cell_name: str = 'Nanoantenna'): ...
def generate_gds_positive(self, sample_step: float = 0.1): ...
def generate_gds_error(self) -> None: ...
class Taper:
width1: Incomplete
width2: Incomplete
length: Incomplete
type: Incomplete
order: int
show_pins: Incomplete
cell: Incomplete
def __init__(self, width1: int = 4, width2: float = 0.45, length: int = 30, type: str = 'linear', show_pins: bool = False) -> None: ...
def generate_gds(self): ...
class Grating_2D_Hole:
w_wg: Incomplete
w_gt: Incomplete
l_taper: Incomplete
type_taper: Incomplete
gt_vector: Incomplete
gt_num: Incomplete
gt_diameter: Incomplete
gt_layer: Incomplete
polysi_vector: Incomplete
polysi_num: Incomplete
polysi_diameter: Incomplete
polysi_layer: Incomplete
reflector_vector: Incomplete
l_field_center: Incomplete
cell: Incomplete
def __init__(self, w_wg: float = 0.5, w_gt: int = 5, l_taper: int = 30, type_taper: str = 'parabolic', gt_vector=[0.5, 0.5, 0.5, 0.5, 0.5], gt_diameter: float = 0.4, gt_layer: str = 'STRIP_COR', polysi_vector=[0.5, 0.5, 0.5, 0.5, 0.5], polysi_diameter: float = 0.4, polysi_layer: str = 'FCW_TRE', reflector_vector=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3], l_field_center: int = 1) -> None: ...
reflector_num: Incomplete
def generate_gds(self): ...
class GC_STD_2D:
name: Incomplete
instantiate: bool
num_x: Incomplete
num_y: Incomplete
Lx_taper: Incomplete
Ly_taper: Incomplete
Lx_end: Incomplete
Ly_end: Incomplete
Lx_side: Incomplete
Ly_side: Incomplete
Lx_port: Incomplete
Ly_port: Incomplete
xs_open: Incomplete
w_wg: Incomplete
xs_wg: Incomplete
etch_type: Incomplete
shape: Incomplete
hole_shape: Incomplete
Dx_hole: Incomplete
Dy_hole: Incomplete
Px: Incomplete
Py: Incomplete
P_AR: Incomplete
L_AR: Incomplete
show_pins: Incomplete
positive: bool
layer_etch: Incomplete
cell: Incomplete
def __init__(self, name=None, etch_type: str = 'FETCH', xs_wg: str = 'grating', Dx_hole: float = 0.3, Dy_hole: float = 0.3, hole_shape: str = 'circle', shape: str = 'circle', xs_open: str = None, Px: float = 0.57, Py: float = 0.57, num_x: float = 25, num_y: float = 25, Lx_taper: float = 50.0, Ly_taper: float = 0.0, Lx_end: float = 1.0, Ly_end: float = 1.0, Lx_side: float = 0.5, Ly_side: float = 0.5, Lx_port: float = 5.0, Ly_port: float = 5.0, w_wg: float = 0.5, show_pins: bool = False, P_AR: float = 0.6, L_AR: float = 1) -> None: ...
def generate_negative(self): ...
def generate_positive(self): ...
def generate_test_gds(self, dX_gc2gc: int = 300): ...
class GC_STD_1D:
name: Incomplete
instantiate: bool
xs_open: Incomplete
xs_wg: Incomplete
w_wg: Incomplete
L_taper: Incomplete
L_end: Incomplete
A_taper: Incomplete
show_pins: Incomplete
L_tail: Incomplete
positive: bool
Period: Incomplete
eta_etch: Incomplete
num: Incomplete
sector_gc: Incomplete
L_AR: Incomplete
P_AR: Incomplete
layer_etch: Incomplete
cell: Incomplete
def __init__(self, name=None, xs_wg: str = 'strip', w_wg: float = 0.5, etch_type: str = 'FETCH', xs_open: str = None, L_taper: float = 10.0, L_end: float = 2.0, A_taper: float = 30.0, Period: float = 0.5, eta_etch: float = 0.5, num: int = 20, sector_gc: bool = True, show_pins: bool = False, L_tail: int = 2, P_AR: float = 1.0, L_AR: float = 2.0) -> None: ...
def generate_negative(self): ...
def generate_positive(self): ...
def generate_test_dev(self, dX_gc2gc): ...
class FA:
pitch: Incomplete
number: Incomplete
cell: Incomplete
def __init__(self, fiber_coupler, pitch, number, show_pins: bool = False) -> None: ...
@@ -0,0 +1,29 @@
from ...structures import *
from ...routing import Route as Route
from ...structures import Conchoid as Conchoid
from _typeshed import Incomplete
from turtle import shape as shape
class MMI_ML:
name: Incomplete
instantiate: bool
L_arm: Incomplete
xs: Incomplete
w_arm: Incomplete
arm_sine_width: Incomplete
L_mmi: Incomplete
w_mmi: Incomplete
res: Incomplete
N_out: Incomplete
N_in: Incomplete
Dp_out: Incomplete
Dp_in: Incomplete
mmi_sine_width: Incomplete
cell: Incomplete
L: Incomplete
def __init__(self, name=None, L_arm=[10], w_arm=[0.45, 1.35], xs: str = 'strip', arm_sine_width: bool = False, L_mmi=[10], w_mmi=[5, 5], mmi_sine_width: bool = False, sharp_patch: bool = True, show_pins: bool = False, res: float = 0.01, N_out: int = 3, N_in: int = 1, Dp_out: float = 1.5, Dp_in: float = 1.5) -> None: ...
def generate_gds(self, sharp_patch, show_pins): ...
def generate_test_gds(self, gc, dX_gc2gc, dY_gc2gc, R_bend: int = 10, Xout_offset: int = 50): ...
class MMI_STD(MMI_ML):
def __init__(self, name=None, N_out: int = 3, N_in: int = 1, L_arm: int = 10, w_wg: float = 0.45, w_port: float = 1.2, xs: str = 'strip', L_mmi: int = 10, w_mmi: int = 5, sharp_patch: bool = True, show_pins: bool = False, Dp_out: float = 1.5, Dp_in: float = 1.5) -> None: ...
@@ -0,0 +1,108 @@
from ...structures import *
from ...foundries import *
import nazca as nd
from ...routing import Route as Route
from ...structures import Conchoid as Conchoid
from _typeshed import Incomplete
from scipy import optimize as optimize
class spiral:
Dmin: Incomplete
Lmin: Incomplete
R_bend: Incomplete
shape: Incomplete
cycles: Incomplete
width: Incomplete
w_port: Incomplete
gap: Incomplete
xs: Incomplete
layer: Incomplete
name: Incomplete
instantiate: bool
port_angle: Incomplete
w_bend_center: Incomplete
Rmin_bend_center: Incomplete
Euler_bend: Incomplete
Rmin_euler: Incomplete
sharp_patch: Incomplete
w_bend_port: Incomplete
Ltp_port: Incomplete
cell_transition: Incomplete
res: Incomplete
cell: Incomplete
def __init__(self, name: str = None, shape: str = 'circle', Dmin: float = 50, R_bend: float = 10, Rmin_euler: float = 10, Lmin: float = 50, width: float = 2, w_port: float = 0.45, w_bend_center: float = 1, Rmin_bend_center: float = 10, gap: float = 1, cycles: float = 20, xs: str = 'strip', layer: str = None, w_bend_port=None, Ltp_port: int = 10, res: float = 0.5, cell_transition: nd.Cell = None, port_angle: float = 180, Euler_bend: bool = False, show_pins: bool = False, sharp_patch: bool = True, sample_build: bool = False) -> None: ...
def __strt_with_taper__(self, width1, width2, xs, length, Ltp: int = 15, Lstart: int = 2): ...
Atilt: Incomplete
L: Incomplete
Ru: Incomplete
Rd: Incomplete
bend_cell: Incomplete
def generate_gds(self, show_pins): ...
class spiral_rectangle:
Dmin: Incomplete
Lmin: Incomplete
Rmax_bend: Incomplete
Rmin_bend: Incomplete
wmin_bend: Incomplete
cycles: Incomplete
width: Incomplete
w_port: Incomplete
gap: Incomplete
xs: Incomplete
layer: Incomplete
Ltp: Incomplete
Lpatch: Incomplete
name: Incomplete
instantiate: bool
port_angle: Incomplete
sharp_patch: Incomplete
w_bend_port: Incomplete
Lport: Incomplete
cell_xs_transition: Incomplete
res: Incomplete
in_out_align: Incomplete
cell: Incomplete
def __init__(self, name: str = None, Dmin: float = 50, Rmax_bend: float = 10, Rmin_bend: float = 10, wmin_bend: float = 10, Lmin: float = 50, width: float = 2, w_port: float = 0.45, gap: float = 1, cycles: float = 20, xs: str = 'strip', layer: str = None, w_bend_port=None, Lport: int = 10, Ltp: int = 10, res: float = 0.5, cell_xs_transition=None, port_angle: float = 180, show_pins: bool = False, sharp_patch: bool = True, in_out_align: bool = True, Lpatch: float = 0.05, sample_build: bool = False) -> None: ...
def __strt_with_taper__(self, width1, width2, xs, length, Ltp: int = 15, Lstart: int = 2): ...
bend_cell: Incomplete
L: Incomplete
def generate_gds(self, show_pins): ...
class Spiral_Rect_STD(spiral_rectangle):
def __init__(self, name: str = None, Dmin: float = 50, R_bend: float = 10, Lmin: float = 50, width: float = 2, w_port: float = 0.45, gap: float = 1, cycles: float = 20, xs: str = 'strip', layer: str = None, Lport: int = 10, in_out_align: bool = True, res: float = 0.5, cell_xs_transition=None, port_angle: float = 180, show_pins: bool = False, sharp_patch: bool = True) -> None: ...
class spiral_circle:
Dmin: Incomplete
cycles: Incomplete
width: Incomplete
w_port: Incomplete
gap: Incomplete
xs: Incomplete
layer: Incomplete
name: Incomplete
instantiate: bool
port_angle: Incomplete
w_bend_center: Incomplete
Euler_Sbend: Incomplete
sharp_patch: Incomplete
Lport: Incomplete
rib2strip: Incomplete
res: Incomplete
strict_condition: Incomplete
R_ratio_mamnual: Incomplete
cell: Incomplete
def __init__(self, name: str = None, Dmin: float = 50, width: float = 2, w_port: float = 0.45, w_bend_center: float = 1, gap: float = 1, cycles: float = 20, xs: str = 'strip', layer: str = None, Lport: int = 10, res: float = 0.5, rib2strip: bool = True, port_angle: float = 180, Euler_Sbend: bool = False, show_pins: bool = False, sharp_patch: bool = True, strict_condition: bool = False, R_ratio_mamnual=None) -> None: ...
def opt_euler(self, R, R0): ...
Atilt: Incomplete
Rmax: Incomplete
L: Incomplete
Ru: Incomplete
Rd: Incomplete
def generate_gds(self, show_pins): ...
class Spiral_Cicle_MM(spiral_circle):
def __init__(self, name: str = None, Dmin: float = 50, width: float = 2, w_port: float = 0.45, w_bend_center: float = 1, gap: float = 1, cycles: float = 20, xs: str = 'strip', layer: str = None, Lport: int = 10, res: float = 0.5, rib2strip: bool = True, port_angle: float = 180, show_pins: bool = False, sharp_patch: bool = True, strict_condition: bool = False) -> None: ...
class Spiral_Cicle_STD(spiral_circle):
def __init__(self, name: str = None, Dmin: float = 50, width: float = 2, w_port: float = 0.45, gap: float = 1, cycles: float = 20, xs: str = 'strip', layer: str = None, Lport: int = 10, res: float = 0.5, rib2strip: bool = True, port_angle: float = 180, show_pins: bool = False, sharp_patch: bool = True, strict_condition: bool = False) -> None: ...
@@ -0,0 +1,3 @@
SECRET_KEY: bytes
def generate_license(mac_address: str, days_valid: int, output_file: str = 'mxpic.lic'): ...
@@ -0,0 +1 @@
def verify_license() -> None: ...
+11
View File
@@ -0,0 +1,11 @@
from .Foundry import Foundry as Foundry
class AMF_Si220_Active(Foundry):
STD_SMWG_WIDTH: float
SLAB_GROWTH: int
W_METAL_MIN: int
SPACING_HEATER_MIN: int
SPACING_METAL_MIN: int
W_HEATER_MIN: int
lib_path: str
def __init__(self, layermap=...) -> None: ...
+16
View File
@@ -0,0 +1,16 @@
from _typeshed import Incomplete
class Foundry:
STD_SMWG_WIDTH: float
SLAB_GROWTH: int
W_METAL_MIN: int
SPACING_HEATER_MIN: int
SPACING_METAL_MIN: float
W_HEATER_MIN: int
W_VIA_H2M: float
SPACING_VIA_H2M: float
ISL_W_MIN: int
ISL_SP_MIN: int
show_pins: bool
layermap: Incomplete
def __init__(self, layermap=None) -> None: ...
@@ -0,0 +1,11 @@
from .Foundry import Foundry as Foundry
class EOM1_2ML_CU(Foundry):
STD_SMWG_WIDTH: float
SLAB_GROWTH: int
W_METAL_MIN: int
SPACING_HEATER_MIN: int
SPACING_METAL_MIN: int
W_HEATER_MIN: int
lib_path: str
def __init__(self, layermap=...) -> None: ...
@@ -0,0 +1,2 @@
from .AMF import AMF_Si220_Active as AMF_Si220_Active
from .Silterra import EOM1_2ML_CU as EOM1_2ML_CU
+1
View File
@@ -0,0 +1 @@
from .routing import *
+36
View File
@@ -0,0 +1,36 @@
from ..structures import *
import nazca as nd
from _typeshed import Incomplete
def ic_exception(msg: str = '') -> None: ...
class Route(nd.interconnects.Interconnect):
PCB: Incomplete
sharp_patch: Incomplete
Ltp_mm: Incomplete
width2_mm: Incomplete
MM_route: Incomplete
def __init__(self, radius=None, width=None, angle: int = 90, Ltp_mm: int = 10, width2_mm: float = 1.0, MM_route: bool = False, xs=None, layer=None, adapt_width: bool = False, adapt_xs: bool = False, instantiate: bool = False, pinstyle=None, offset=None, varname=None, doc: str = '', PCB: bool = False, modes=None, sharp_patch: bool = True) -> None: ...
def connPatch(self) -> None: ...
def rt_bend(self, width: int = 3, xs: str = 'strip', angle: int = 90, layer=None, pin=None): ...
def strt_mm(self, pin=None, width2=None, Ltp=None, width1=None, Lstart: float = 0.5, length=None, xs=None, arrow: bool = False): ...
def line_mm(self, length=None, width=None, xs=None, width_mm=None, Ltp=None): ...
def strt_mm_p2p(self, pin1=None, pin2=None, width2=None, Ltp=None, width1=None, Lstart: float = 0.5, length=None, xs=None, arrow: bool = False, name=None): ...
def bend_p2p(self, pin1=None, pin2=None, radius=None, width=None, xs=None, name=None, arrow: bool = False, width_mm=None, Ltp=None, sharp_path: bool = True): ...
def ubend_route(self, pin=None, offset: float = 20.0, radius=None, width=None, xs=None, length: int = 0, name=None, arrow: bool = False, balance: int = 0, end_angle: bool = False, width_mm=None, Ltp=None): ...
def sbend_route(self, radius=None, width=None, pin=None, xs=None, offset: int = 20, Ltot=None, length1: int = 0, length2: int = 0, name=None, arrow: bool = False, Amax: float = 90.0, original_function: bool = False): ...
def bend_strt_bend_p2p_mine(self, pin1=None, pin2=None, radius=None, radius1=None, radius2=None, width=None, xs=None, length1: int = 0, length2: int = 0, ictype: str = 'shortest', name=None, arrow: bool = False): ...
def bend_route(self, radius=None, angle=None, width=None, pin=None, xs=None, length1: float = 0.1, length2: float = 0.1, name=None, arrow: bool = False, offset=None, sharp_patch: bool = True, original_function: bool = False): ...
def bend_route_p2p(self, pin1=None, pin2=None, radius=None, width=None, xs=None, name=None, arrow: bool = False, original_function: bool = False): ...
def bend_mine(self, radius=None, angle=None, width=None, pin=None, xs=None, length1: int = 0, length2: int = 0, name=None, arrow: bool = False, offset=None, sharp_patch: bool = True): ...
def tube_mine(self, geo, showpins: bool = False, name=None, xs=None, arrow: bool = False, Ltp=None, width_mm=None, sharp_patch=None): ...
def strt_bend_strt_p2p_mine(self, pin1=None, pin2=None, radius=None, radius1=None, radius2=None, width=None, xs=None, length1: int = 0, length2: int = 0, ictype: str = 'shortest', name=None, arrow: bool = False, width_mm=None, Ltp=None): ...
def sbend_p2p_mine(self, pin1=None, pin2=None, width=None, radius=None, Lstart: int = 0, doFirst: int = 1, arrow: bool = False, width_mm=None, Ltp=None, sharp_patch: bool = False): ...
def sbend_p2p(self, pin1=None, pin2=None, width=None, radius=None, Amax: int = 90, xs=None, doStrFirst: int = 1, Lstart: int = 0, BendEndFlag: int = 1, ref=None, name=None, arrow: bool = False, bsb: bool = True, sharp_patch=None, width_mm=None, Ltp=None): ...
def bend_strt_bend_p2p(self, pin1=None, pin2=None, radius=None, radius1=None, radius2=None, width=None, xs=None, length1: int = 0, length2: int = 0, ictype: str = 'shortest', name=None, arrow: bool = True, width_mm=None, Ltp=None): ...
def ubend_p2p(self, pin1=None, pin2=None, radius=None, width=None, xs=None, length: float = 0.1, name=None, arrow: bool = False, balance: int = 0, end_angle: bool = False, original_function: bool = False, Ltp=None, width_mm=None): ...
def strt(self, length=None, width=None, pin=None, xs=None, edge1=None, edge2=None, edgepoints: int = 50, name=None, arrow: bool = False, gridpatch=None): ...
def taper(self, length=None, width1=None, width2=None, shift: int = 0, xs=None, pin=None, name=None, patch: bool = False, arrow: bool = False): ...
adapt_width: bool
def taper_p2p(self, pin1=None, pin2=None, width1=None, width2=None, xs=None, name=None, arrow: bool = False): ...
def strt_p2p(self, pin1=None, pin2=None, width=None, xs=None, name=None, arrow: bool = False): ...
+113
View File
@@ -0,0 +1,113 @@
import numpy as np
from _typeshed import Incomplete
class hole:
cell: Incomplete
def __init__(self, r_hole: float = 0.3, Dx_hole: float = 0.3, Dy_hole: float = 0.3, Lx_sq: int = 6, Ly_sq: int = 6, offset: int = 0, res: float = 0.05, xs: str = 'strip', layer=None, sharp_patch: bool = True, hole_shape: str = 'circle') -> None: ...
class strt_round_courner:
cell: Incomplete
def __init__(self, width: int = 5, length: int = 10, layer=None, radius: int = 1, n_points: int = 64) -> None: ...
class circle:
vtx: Incomplete
sz: Incomplete
w: Incomplete
cell: Incomplete
def __init__(self, radius: int = 10, width: float = 0.45, theta_start: int = 0, theta_stop: int = 360, res: float = 0.05, angle=None, xs: str = 'strip', layer=None, sharp_patch: bool = True, y_cut=None) -> None: ...
class mx_bend:
sz: Incomplete
w: Incomplete
cell: Incomplete
def __init__(self, radius: int = 10, width: float = 0.45, theta_start: int = 0, theta_stop: int = 360, res: float = 0.05, angle=None, xs: str = 'strip', layer=None, sharp_patch: bool = True) -> None: ...
class Elipse_dual:
ORx: Incomplete
ORy: Incomplete
IRx: Incomplete
IRy: Incomplete
offset_X: Incomplete
offset_Y: Incomplete
xs: Incomplete
layer: Incomplete
res: Incomplete
theta_start: Incomplete
theta_stop: Incomplete
y_cut: Incomplete
cell: Incomplete
wa: Incomplete
wb: Incomplete
def __init__(self, ORx: float, ORy: float, IRx: float, IRy: float, offset_X: float = 0, offset_Y: float = 0, xs: str = None, layer: str = None, theta_start: float = 0, theta_stop: float = 360, sharp_patch: bool = True, res: float = 0.001, y_cut=None) -> None: ...
sz: Incomplete
def generate_gds(self, sharp_patch): ...
class Elipse:
La: Incomplete
Lb: Incomplete
wa: Incomplete
wb: Incomplete
offset_a: Incomplete
offset_b: Incomplete
type: Incomplete
layer: Incomplete
xs: Incomplete
theta_start: Incomplete
theta_stop: Incomplete
res: Incomplete
cell: Incomplete
def __init__(self, La=None, Lb=None, wa=None, wb=None, offset_a: int = 0, offset_b: int = 0, type: str = 'center', width_type: str = 'sine', layer=None, xs=None, theta_start: int = 0, theta_stop: int = 360, res: float = 0.001, sharp_patch: bool = False, show_pins: bool = False) -> None: ...
sz: Incomplete
def generate_gds(self, sharp_patch, show_pins): ...
class Conchoid:
Atilt: Incomplete
L: Incomplete
cell: Incomplete
vtx_center: Incomplete
vtx: Incomplete
K_end: Incomplete
R_end: Incomplete
def __init__(self, R0, kR, T, w, layer, w_end=None, res: float = 0.1, final_flat=None, begin_flat=None, xs=None) -> None: ...
class Clothoid:
name: Incomplete
R: Incomplete
A: Incomplete
width_type: Incomplete
spiral_order: Incomplete
dL_cal: Incomplete
xs: Incomplete
layer: Incomplete
dL_wg: Incomplete
x: Incomplete
y: Incomplete
L: Incomplete
L0: Incomplete
theta: Incomplete
vtx_center: Incomplete
end_patch: Incomplete
sz: Incomplete
n_points: Incomplete
w: Incomplete
cell: Incomplete
def __init__(self, name: str = None, R: list | np.ndarray = [10, 20], w: list | np.ndarray | float = [0.4, 0.5], A: list | np.ndarray = [0, 45], width_type: str = 'sine', spiral_order: float | list = 1, Rmax: float = 10000, dL_cal: float = 0.001, dL_wg: float = 0.1, xs: str = 'strip', layer: str = None, sharp_patch: bool = True, end_patch: bool = True, show_pins: bool = False) -> None: ...
instantiate: bool
vtx: Incomplete
sz_p2p: Incomplete
def generate_gds(self, sharp_patch, show_pins): ...
class Racetrack:
dLx: Incomplete
R_bend: Incomplete
dLy: Incomplete
xs: Incomplete
layer: Incomplete
bend_cell: Incomplete
A_bend: Incomplete
w: Incomplete
w_crack: float
cell: Incomplete
def __init__(self, bend_cell=None, xs: str = 'strip', layer=None, R_bend: int = 10, w: float = 0.5, dLx: int = 100, dLy: int = 100, res: float = 0.001) -> None: ...
sz: Incomplete
def generate_gds(self): ...