1. Cython compile system build. 2. License system build. 3. Auto md file generation for Sphinx build.

This commit is contained in:
2026-05-07 13:51:42 +08:00
parent 15610b623c
commit dda69d5b84
129 changed files with 4458 additions and 516 deletions
+7
View File
@@ -0,0 +1,7 @@
# Python cache directories and files
__pycache__/
*.py[cod]
*$py.class
# Custom files to ignore
*.syc
+19 -9
View File
@@ -6,10 +6,19 @@ This is the fast-track guide to contributing to **mxPIC**. Adherence to these ru
### <span style="color: #ff57c7;">0. Installation dependencies</span>
- python 3.10.1
- nazca 0.6.1
- numpy 1.12.0
- pandas 0.12.0
-
- nazca 0.5.13
- gdstk 1.0.0
- numpy 1.22.3
- pandas 1.3.3
- matplotlib 3.4.3
- Cython 3.2.4
- Sphnix 7.4.7
- myst-parser 3.0.1
- 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>
The repository have an archtecture like this.
@@ -97,11 +106,11 @@ The basic routing algorthium is based the information between nodes, which is th
|Catagory| Prefix | name | index | expample | device instance
|---|---|---|---|---|---|
| Optical| opt_ | a | 1~x | opt_a1 | direction_coupler
| Optical (Sinlge IO to waveguide)| opt_ | a | 1~x | opt_a1 |grating_coupler
| Electrical| ele_ | a | 1~x | ele_a1 | heater/resistor
| PN diodes| ele_ | ka/an | 1~x | ele_an1 | modulator/p-i-n waveuigde
| Transistors (BJT)| ele_ | ba/em/cl | 1~x | ele_cl1 | BJT
| Optical| opt_ | a | 1~x | opt_a_1 | direction_coupler
| Optical (Sinlge IO to waveguide)| opt_ | a_ | 1~x | opt_a_1 |grating_coupler
| Electrical| ele_ | a | 1~x | ele_a_1 | heater/resistor
| PN diodes| ele_ | cathode/anode | 1~x | ele_anode_1 | modulator/p-i-n waveuigde
| Transistors (BJT)| ele_ | base/em/collector | 1~x | ele_colloctor_1 | BJT
| Transistors (MOS)| ele_ | gt/su/dr | 1~x | ele_gt1 | MOSFET
@@ -113,3 +122,4 @@ nazca.add_layer_to_xsection("WG_HM",growx=2,growy=2)
nazca.add_layer_to_xsection("WG_STRIP",growx=2,growy=2)
```
BIN
View File
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
# import mxpic as mx
import mxpic_release.mxpic as mx
EC = mx.EC_dual_layer_px3(name="xxx",w_in=0.5,L_in=10,Ltp1=10,Ltp2=10,Ltp3=10)
# import uuid
# mac = uuid.getnode()
# mc_addr = ':'.join(("%012X" % mac)[i:i+2] for i in range(0, 12, 2))
# print(mc_addr)
+56
View File
@@ -0,0 +1,56 @@
import os
import shutil
import subprocess
from pathlib import Path
def build_and_harvest():
src_dir = Path("mxpic")
release_dir = Path("mxpic_release/mxpic")
print("🧹 Cleaning old builds...")
if release_dir.parent.exists():
shutil.rmtree(release_dir.parent)
print("🔨 Compiling C-Extensions with Cython...")
# Run the setup.py build command in-place
subprocess.run(["python", "setup.py", "build_ext", "--inplace"], check=True)
print("📦 Harvesting compiled files into release package...")
release_dir.mkdir(parents=True, exist_ok=True)
# Walk through the original source directory
for root, dirs, files in os.walk(src_dir):
# Skip docs folder
if 'docs' in dirs:
dirs.remove('docs')
current_root = Path(root)
rel_path = current_root.relative_to(src_dir)
target_dir = release_dir / rel_path
# Ensure the mirrored directory exists
target_dir.mkdir(parents=True, exist_ok=True)
for file in files:
file_path = current_root / file
# Copy compiled binaries (.so for Linux/WSL, .pyd for Windows)
if file.endswith((".so", ".pyd")):
shutil.move(file_path, target_dir / file)
# Copy __init__.py files so Python recognizes the packages
elif file == "__init__.py":
shutil.copy2(file_path, target_dir / file)
# (Optional) Copy non-code assets like config files or templates
elif file.endswith((".json", ".yaml", ".yml")):
shutil.copy2(file_path, target_dir / file)
print("✨ Cleanup: Removing intermediate .c files from source...")
for c_file in src_dir.rglob("*.c"):
c_file.unlink()
print(f"\n🚀 Success! Your secure package is ready in: {release_dir.parent.resolve()}")
if __name__ == "__main__":
build_and_harvest()
Binary file not shown.
Binary file not shown.
-18
View File
@@ -1,18 +0,0 @@
.. mxpic_handbook documentation master file, created by
sphinx-quickstart on Sun May 3 16:05:57 2026.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
# mxpic_handbook documentation
============================
Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.
Welcome to the automated documentation for the mxPIC silicon photonics library.
```{toctree}
:maxdepth: 2
:caption: Components:
primitives/edge_couplers/edge_couplers
@@ -1,25 +0,0 @@
# Edge Coupler Reference
This section covers the dual-layer edge coupler designs used for fiber-to-chip interfacing.
## Dual Layer PX3
The `EC_dual_layer_px3` is our standard spot-size converter.
```{eval-rst}
.. autoclass:: mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3
:members:
:undoc-members:
:show-inheritance:
```
```{figure} ../../_static/images/ec_px3_layout.png
:width: 600px
:align: center
:alt: GDS layout of the dual-layer edge coupler
Figure 1: GDS layout of the EC_dual_layer_px3 showing the SiN-to-SOI taper transition.
```
## Design Notes
- Tapers: Ensure Ltp1, Ltp2, and Ltp3 provide enough length for adiabatic mode expansion.
- Alignment: The angle_tile parameter (default 8°) is critical for reducing back-reflections.
BIN
View File
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
Search.setIndex({"alltitles": {"Components:": [[0, null]], "Design Notes": [[1, "design-notes"]], "Dual Layer PX3": [[1, "dual-layer-px3"]], "Edge Coupler Reference": [[1, null]], "mxpic_handbook documentation": [[0, null]]}, "docnames": ["index", "primitives/edge_couplers/edge_couplers"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["index.md", "primitives/edge_couplers/edge_couplers.md"], "indexentries": {"ec_dual_layer_px3 (class in mxpic_forge.primitives.edge_couplers.ec_dual_layer_px3)": [[1, "mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3", false]], "generate_gds() (mxpic_forge.primitives.edge_couplers.ec_dual_layer_px3.ec_dual_layer_px3 method)": [[1, "mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds", false]]}, "objects": {"mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3": [[1, 0, 1, "", "EC_dual_layer_px3"]], "mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3": [[1, 1, 1, "", "generate_gds"]]}, "objnames": {"0": ["py", "class", "Python class"], "1": ["py", "method", "Python method"]}, "objtypes": {"0": "py:class", "1": "py:method"}, "terms": {"0": 1, "05": 0, "1": 1, "12": 1, "16": 0, "2": 1, "2026": 0, "3": 0, "45": 1, "50": 1, "57": 0, "6": 1, "8": 1, "The": 1, "_": 0, "adapt": 0, "add": 0, "adiabat": 1, "air": 1, "air_trench": 1, "align": 1, "angl": 1, "angle_til": 1, "associ": 1, "autom": 0, "back": 1, "base": 1, "bend": 1, "beol": 1, "between": 1, "box": 1, "can": 0, "cell": 1, "central": 1, "chip": 1, "clad": 1, "class": 1, "clear": 1, "complet": 0, "compon": 1, "contain": 0, "content": 0, "contrast": 1, "convert": 1, "core": 1, "coupl": 1, "coupler": 0, "cover": 1, "creat": 0, "critic": 1, "cross": 1, "curvatur": 1, "deep": 1, "default": 1, "degre": 1, "design": 0, "detail": 0, "devic": 1, "dimens": 1, "direct": 0, "doc": 0, "dual": 0, "dummi": 1, "e": 1, "ec_dual_layer_px3": 1, "edg": 0, "edge_coupl": 1, "en": 0, "enough": 1, "ensur": 1, "exclus": 1, "expans": 1, "extens": 1, "facet": 1, "fiber": 1, "figur": 1, "file": 0, "final": 1, "first": 1, "float": 1, "g": 1, "gd": 1, "generate_gd": 1, "high": 1, "html": 0, "http": 0, "i": 1, "identifi": 1, "index": [0, 1], "initi": 1, "input": 1, "interfac": 1, "l_box_end": 1, "l_end": 1, "l_in": 1, "layer": 0, "layer_dt": 1, "layer_dum_exl_b": 1, "layer_sin_slab": 1, "layer_top_cov": 1, "layout": 1, "least": 0, "length": 1, "librari": 0, "like": 0, "ltp1": 1, "ltp2": 1, "ltp3": 1, "mai": 0, "manag": 1, "master": 0, "micron": 1, "midpoint": 1, "mode": 1, "mxpic": 0, "mxpic_forg": 1, "name": 1, "nitrid": 1, "none": 1, "note": 0, "object": 1, "open": 1, "optic": 1, "option": 1, "org": 0, "our": 1, "oxid": 1, "oxide_facet": 1, "pad": 1, "pad_opt": 1, "paramet": 1, "photon": 0, "primit": 1, "provid": 1, "px3": 0, "quickstart": 0, "r_bend": 1, "radiu": 1, "reduc": 1, "refer": 0, "reflect": 1, "respect": 1, "restructuredtext": 0, "root": 0, "rout": 1, "second": 1, "secondari": 1, "section": 1, "see": 0, "should": 0, "show": 1, "silicon": 0, "sin": 1, "sin_rib_wg": 1, "size": 1, "slab": 1, "soi": 1, "sphinx": 0, "spot": 1, "standard": 1, "str": 1, "sun": 0, "syntax": 0, "taper": 1, "thi": [0, 1], "third": 1, "tilt": 1, "tip": 1, "toctre": 0, "top": 1, "transit": 1, "trench": 1, "uniqu": 1, "us": [0, 1], "usag": 0, "w1_slab": 1, "w_box": 1, "w_box_end": 1, "w_dt": 1, "w_in": 1, "w_mid_slab": 1, "w_tip_cor": 1, "w_tip_slab": 1, "waveguid": 1, "welcom": 0, "width": 1, "www": 0, "xs_sin": 1, "xs_trench": 1, "you": 0, "your": 0}, "titles": ["mxpic_handbook documentation", "Edge Coupler Reference"], "titleterms": {"compon": 0, "coupler": 1, "design": 1, "document": 0, "dual": 1, "edg": 1, "layer": 1, "mxpic_handbook": 0, "note": 1, "px3": 1, "refer": 1}})
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

-18
View File
@@ -1,18 +0,0 @@
.. mxpic_handbook documentation master file, created by
sphinx-quickstart on Sun May 3 16:05:57 2026.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
# mxpic_handbook documentation
============================
Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.
Welcome to the automated documentation for the mxPIC silicon photonics library.
```{toctree}
:maxdepth: 2
:caption: Components:
primitives/edge_couplers/edge_couplers
@@ -1,25 +0,0 @@
# Edge Coupler Reference
This section covers the dual-layer edge coupler designs used for fiber-to-chip interfacing.
## Dual Layer PX3
The `EC_dual_layer_px3` is our standard spot-size converter.
```{eval-rst}
.. autoclass:: mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3
:members:
:undoc-members:
:show-inheritance:
```
```{figure} ../../_static/images/ec_px3_layout.png
:width: 600px
:align: center
:alt: GDS layout of the dual-layer edge coupler
Figure 1: GDS layout of the EC_dual_layer_px3 showing the SiN-to-SOI taper transition.
```
## Design Notes
- Tapers: Ensure Ltp1, Ltp2, and Ltp3 provide enough length for adiabatic mode expansion.
- Alignment: The angle_tile parameter (default 8°) is critical for reducing back-reflections.
+80
View File
@@ -0,0 +1,80 @@
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\\")
+5
View File
@@ -0,0 +1,5 @@
{
"mac_address": "D4:54:8B:F1:46:49",
"expiration": "2027-05-07",
"signature": "844002ba44b83a6bc5ddb9889db72fc614b1232ed980cc7e13dd02c2f8de25f2"
}
+12
View File
@@ -0,0 +1,12 @@
# mxpic/__init__.py
from .core.license_check import verify_license
# Run the check immediately upon import
verify_license()
# If the check passes, the rest of the library loads
from .components import EC_dual_layer_px3
from .routing import Route
from .components.primitives import *
+45
View File
@@ -0,0 +1,45 @@
import nazca as nd
import numpy as np
def __cell_arg__(arg,arg_name,func_name):
if (isinstance(arg,nd.Cell)):
return arg
elif (hasattr(arg,'cell')):
return arg.cell
else :
raise Exception("ERROR: In <"+func_name+">, <"+arg_name+"> not a [cell] argument")
def __list_convert__(var,name,func_name):
if (isinstance(var,str)):
var = [var]
elif (isinstance(var,list)):
var = var
else : raise Exception("ERROR: in <"+func_name+">, <"+name+"> not defined properly, please input <"+type+"> or <list>")
return var
def __array_convert__(var,name,func_name,num=1):
if (isinstance(var,int) or isinstance(var,float)):
var = var*np.ones(num)
elif (isinstance(var,list) or isinstance(var,np.ndarray)):
var = np.array(var)
else : raise Exception("ERROR: in <"+func_name+">, <"+name+"> not defined properly, please input <"+type+"> or <list> or <np.ndarray>")
return var
## Small revision in 2023.1.31
def __xs_exist__(xs,para_name,func_name):
if (xs!=None):
try:
nd.get_xsection(xs)
except:
print("WARNING: In <"+func_name+">, <"+para_name+"> not defined in tapeout")
xs=None
return xs
else :
return None
+1
View File
@@ -0,0 +1 @@
from .primitives import *
+2
View File
@@ -0,0 +1,2 @@
from .directional_couplers.directional_couplers import *
from .edge_couplers.EC_dual_layer_px3 import *
@@ -0,0 +1 @@
from .directional_couplers import *
@@ -1,23 +1,68 @@
import nazca as nd
import numpy as np
from numpy import pi
from ..pic import taper
from ..structures import *
from ..routing import Route
# import nazca.interconnects as IC
# class Route(IC.Interconnect):
# pass
from ..structures import _my_polygon
from ..basic import __cell_arg__
from ....routing import Route
from ....structures import _my_polygon,circle,Clothoid
from ....basic import __cell_arg__
class ring_bus_wg:
## two types:
## DC, BDC
"""
Initialize ring-bus waveguide coupler settings.
Parameters
----------
xs : str, optional
Waveguide cross-section name (default is "strip").
R_cp : int, optional
Coupling waveguide bend radius in microns for BDC mode (default is 20).
w_bus : float, optional
Coupling waveguide width in microns (default is 0.5).
w_wg : float, optional
Port waveguide width in microns (default is 0.5).
bend_DC : bool, optional
Use bend directional coupler (True) or straight DC (False, default is True).
dLc : int, optional
Straight coupling length in microns for DC mode (default is 10).
dAc : int, optional
Coupling angle in degrees for BDC mode (default is 10).
euler_transistion : bool, optional
Enable Euler transition segments before/after the coupling arc (default is False).
dL_trans : int, optional
Straight transition length in microns when Euler transition is enabled (default is 10).
dA_trans : int, optional
Transition bend angle in degrees for the Euler segment (default is 30).
R_max_trans : int, optional
Maximum radius in microns for the transition segment (default is 100).
w_trans : float, optional
Waveguide width in microns inside the transition (default is 0.5).
euler_anti_bend : bool, optional
Enable Euler anti-bend routing after the coupling section (default is False).
R_max_anti : int, optional
Maximum radius in microns for the anti-bend segment (default is 100).
R_min_anti : int, optional
Minimum radius in microns for the anti-bend segment (default is 10).
A_anti : float, optional
Anti-bend angle in degrees (default is None, meaning auto-calculated).
res : float, optional
Geometry discretization step in microns (default is 0.1).
wg_Ltp : int, optional
Port taper length in microns (default is 5).
dL_p2p : float, optional
Target horizontal spacing in microns between input/output ports (default is None).
sharp_patch : bool, optional
Insert chamfer polygons to avoid sharp corners (default is True).
show_pins : bool, optional
Draw Nazca stub markers for debugging (default is False).
end_patch : bool, optional
Force small straight fillers at the end of Euler segments (default is False).
clothoid_order : int, optional
Order of the spiral section used inside :class:`Clothoid` transitions (default is 1).
"""
def __init__(self,
xs='strip',
R_cp = 20,
@@ -45,32 +90,6 @@ class ring_bus_wg :
end_patch = False,
clothoid_order = 1,
) -> None:
"""_summary_
Args:
xs (str, optional): waveguide xsection. Defaults to 'strip'.
R_cp (int, optional): coupling waveguide radius, for bend coupling . Defaults to 20.
w_bus (float, optional): coupling waveguide width. Defaults to 0.5.
w_wg (float, optional): waveugide port width. Defaults to 0.5.
bend_DC (bool, optional): BDC or DC. Defaults to True.
dLc (int, optional): for DC, the coupling length. Defaults to 10.
dAc (int, optional): for BDC, the coupling angle. Defaults to 10.
n_points (int, optional): _description_. Defaults to 512.
euler_transistion (bool, optional): _description_. Defaults to False.
dL_trans (int, optional): _description_. Defaults to 10.
dA_trans (int, optional): _description_. Defaults to 30.
R_max_trans (int, optional): _description_. Defaults to 100.
w_trans (float, optional): _description_. Defaults to 0.5.
euler_anti_bend (bool, optional): _description_. Defaults to False.
R_max_anti (int, optional): _description_. Defaults to 100.
R_min_anti (int, optional): _description_. Defaults to 10.
A_anti (_type_, optional): _description_. Defaults to None.
res (float, optional): _description_. Defaults to 0.1.
wg_Ltp (int, optional): _description_. Defaults to 5.
dL_p2p (_type_, optional): _description_. Defaults to None.
sharp_patch (bool, optional): _description_. Defaults to True.
show_pins (bool, optional): _description_. Defaults to False.
"""
self.xs = xs
self.R_cp = R_cp
@@ -182,6 +201,67 @@ class ring_bus_wg :
class ADC_STD_2x2:
"""
General-purpose 2×2 adiabatic directional coupler scaffold.
Parameters
----------
name : str, optional
Unique cell identifier (default is None, meaning no instantiation).
xs : str, optional
Registered Nazca cross-section name (default is "strip").
wu0 : float, optional
Upper waveguide width at the input plane in microns (default is 0.45).
wu1 : float, optional
Upper waveguide width at the output plane in microns (default is 0.61).
wu_in : float, optional
Upper input port width in microns (default is 0.45).
wu_out : float, optional
Upper output port width in microns (default is 0.8).
wd0 : float, optional
Lower waveguide width at the input plane in microns (default is 0.33).
wd1 : float, optional
Lower waveguide width at the output plane in microns (default is 0.2).
wd_in : float, optional
Lower input port width in microns (default is 0.45).
wd_out : float, optional
Lower output port width in microns (default is 0.8).
Lu : int, optional
Interaction length of the upper core in microns (default is 33).
Ld : int, optional
Interaction length of the lower core in microns (default is 33).
angle : int, optional
Sbend deflection angle in degrees (default is 20).
g0 : float, optional
Gap between the two cores at the input plane in microns (default is 0.2).
g1 : float, optional
Gap between the two cores at the output plane in microns (default is 0.2).
sbend_type : str, optional
Type of IO transition ("euler" or "circular", default is "euler").
Rmax : optional
Maximum Euler bend radius in microns (default is None, meaning auto).
Rmin : int, optional
Minimum Euler bend radius in microns (default is 5).
Ru0 : int, optional
Upper input bend radius in microns (default is 0).
Ru1 : int, optional
Upper output bend radius in microns (default is 20).
Rd0 : int, optional
Lower input bend radius in microns (default is 20).
Rd1 : int, optional
Lower output bend radius in microns (default is 0).
tp_angle : int, optional
Half-angle of straight tapers in degrees when Euler bends are disabled (default is 2).
sharp_patch : bool, optional
Insert chamfer polygons to reduce acute corners (default is True).
show_pins : bool, optional
Draw Nazca stub markers for debugging (default is False).
euler_points : int, optional
Number of sampling points for Euler/Clothoid evaluation (default is 64).
res : float, optional
Geometry discretization step in microns (default is 0.1).
"""
def __init__ (self,
name = None,
xs='strip',
@@ -210,34 +290,6 @@ class ADC_STD_2x2:
show_pins=False,
euler_points = 64,
res = 0.1):
"""_summary_
Args:
tapeout (_type_): _description_
xs (str, optional): _description_. Defaults to 'strip'.
wu0 (float, optional): _description_. Defaults to 0.45.
wu1 (float, optional): _description_. Defaults to 0.61.
wu_in (float, optional): _description_. Defaults to 0.45.
wu_out (float, optional): _description_. Defaults to 0.8.
wd0 (float, optional): _description_. Defaults to 0.33.
wd1 (float, optional): _description_. Defaults to 0.20.
wd_in (float, optional): _description_. Defaults to 0.45.
wd_out (float, optional): _description_. Defaults to 0.8.
Lu (int, optional): _description_. Defaults to 33.
Ld (int, optional): _description_. Defaults to 33.
angle (int, optional): _description_. Defaults to 20.
g0 (float, optional): _description_. Defaults to 0.2.
g1 (float, optional): _description_. Defaults to 0.2.
sbend_type (str, optional): _description_. Defaults to 'euler'.
Rmax (_type_, optional): _description_. Defaults to None.
Rmin (int, optional): _description_. Defaults to 5.
Ru0 (int, optional): _description_. Defaults to 0.
Ru1 (int, optional): _description_. Defaults to 20.
Rd0 (int, optional): _description_. Defaults to 20.
Rd1 (int, optional): _description_. Defaults to 0.
tp_angle (int, optional): _description_. Defaults to 2.
sharp_patch (bool, optional): _description_. Defaults to True.
"""
self.name = name
if (self.name==None):
@@ -364,7 +416,7 @@ class ADC_STD_2x2:
_dX_ = abs(pin_b2.x - self.Ld)
else :
Ltp = np.max([_dX_-5,np.abs(self.wd1+err-self.wd_out)/np.tan(self.tp_angle/180*pi)])
Ltp = np.abs(self.wd1+err-self.wd_out)/np.tan(self.tp_angle/180*pi)
Ltp = int(Ltp*20)*0.05 ## keep it in integer
temp = nd.strt(xs=self.xs,length=5,width=self.wd1+err).put(self.Ld,vtx_lower_y[1]/2+vtx_lower_y[-2]/2,0,flip=0)
@@ -503,6 +555,40 @@ class ADC_STD_2x2:
class DC(ADC_STD_2x2):
"""
Standard symmetric directional coupler wrapper built on ``ADC_STD_2x2``.
Parameters
----------
name : str, optional
Unique cell identifier (default is None, meaning no instantiation).
xs : str, optional
Nazca cross-section key for both guides (default is "strip").
w_cp : float, optional
Coupling-section core width in microns (default is 0.45).
w_wg : float, optional
IO port width in microns (default is 0.45).
L_cp : float, optional
Coupling-section length in microns (default is 30).
angle : float, optional
Port bend deflection angle in degrees (default is 20).
gap : float, optional
Gap between the two cores in microns (default is 0.2).
sbend_type : str, optional
Type of the IO bend ("euler" or "circular", default is "circular").
Rmax : float, optional
Maximum Euler radius in microns when "sbend_type" is "euler" (default is None).
Rmin : int, optional
Minimum Euler radius in microns (default is 5).
R0 : int, optional
Circular bend radius in microns applied to both ports (default is 10).
tp_angle : int, optional
Straight taper half-angle in degrees when Euler bends are disabled (default is 2).
sharp_patch : bool, optional
Insert chamfer polygons to avoid acute corners (default is True).
show_pins : bool, optional
Draw Nazca stub markers for debugging (default is False).
"""
def __init__(self,
name = None,
xs:str='strip',
@@ -518,23 +604,7 @@ class DC(ADC_STD_2x2):
tp_angle:float=2,
sharp_patch:bool=True,
show_pins:bool=False):
"""_summary_
Args:
tapeout (_type_): _description_
xs (str, 'strip' | 'rib' | ...): Nazca xsection of the waveguide. Defaults to 'strip'.
w_cp (float): Width of the coupling area. Defaults to 0.45.
w_wg (float): Width of the port waveguide. Defaults to 0.45.
L_cp (float): Length of the coupling area. Defaults to 30.
angle (float): Bned angle of the port. Defaults to 20.
gap (float): Gap width of the coupling area. Defaults to 0.2.
sbend_type (str, 'euler' | 'circular'): Bend type of the ouput port. Defaults to 'euler'.
Rmax (_type_, optional): Max bending radius of euler. Defaults to None.
Rmin (int, optional): Mini bending radius of euler. Defaults to 5.
R0 (int, optional): Bending radius. Defaults to 10.
tp_angle (int, optional): Taper angle of the w_cp to w_wg tapering. Defaults to 2.
sharp_patch (bool, optional): Add patch to avoid sharp angle. Defaults to True.
"""
super().__init__(name, xs, wu0=w_cp, wu1=w_cp,
wu_in=w_wg, wu_out=w_wg,
wd0=w_cp, wd1=w_cp,
@@ -579,6 +649,36 @@ class DC(ADC_STD_2x2):
return C
class BS_tdc(ADC_STD_2x2):
"""
Balanced splitter based on asymmetric taper-directional-coupler sections.
Parameters
----------
name : str, optional
Nazca cell name (default is None).
xs : str, optional
Nazca cross-section for both guides (default is "strip").
wa0 : float, optional
Upper input width in microns (default is 0.35).
wa1 : float, optional
Upper output width in microns (default is 0.45).
wb0 : float, optional
Lower input width in microns (default is 0.55).
wb1 : float, optional
Lower output width in microns (default is 0.45).
w_wg : float, optional
External IO width in microns (default is 0.45).
gap : float, optional
Coupling gap in microns (default is 0.2).
Lt : float, optional
Coupling/taper length in microns (default is 20).
R0 : float, optional
Port bend radius in microns (default is 30).
angle : float, optional
Port bend angle in degrees (default is 15).
sbend_type : str, optional
IO bend type ("circle" or "euler", default is "circle").
"""
def __init__(self,
name=None,
xs:str ='strip',
@@ -593,22 +693,7 @@ class BS_tdc(ADC_STD_2x2):
angle:float =15,
sbend_type:str ='circle',
):
"""_summary_
Args:
tapeout (class): foundry used in your design
xs (str, optional): nazca xsection used for the coupler. Defaults to 'strip'.
wa0 (float, optional): Upper waveguide input port width. Defaults to 0.35.
wa1 (float, optional): Upper waveguide ouput port width. Defaults to 0.45.
wb0 (float, optional): Lower waveguide input port width. Defaults to 0.55.
wb1 (float, optional): Lower waveguide ouput port width. Defaults to 0.45.
w_wg (float, optional): The width of the waveguide interface. Defaults to 0.45.
gap (float, optional): Gap width between two waveguides. Defaults to 0.2.
Lt (int, optional): Taper Length of the coupler. Defaults to 20.
R0 (int, optional): The bending radius of the output/input port. Defaults to 30.
angle (int, optional): The angle of the bending of the output/input port. Defaults to 15.
sbend_type (str, optional): The type of the output/input bending, Euler or Circular. Defaults to 'circle'.
"""
super().__init__(name = name,
xs=xs,
wu0=wa0,wu1=wa1,wu_in=w_wg,wu_out=w_wg,
@@ -621,6 +706,50 @@ class BS_tdc(ADC_STD_2x2):
class MDM(ADC_STD_2x2):
"""
Mode-division-multiplexing directional coupler derived from ``ADC_STD_2x2``.
Parameters
----------
name : str, optional
Nazca cell name (default is None).
xs : str, optional
Device cross-section key (default is "strip").
wb0 : float, optional
BUS waveguide width at the input plane in microns (default is 0.45).
wb1 : float, optional
BUS waveguide width at the output plane in microns (default is 0.61).
wb_in : float, optional
BUS input port width in microns (default is 0.45).
wb_out : float, optional
BUS output port width in microns (default is 0.88).
w_wg : float, optional
Coupler-waveguide IO width in microns (default is 0.45).
w0 : float, optional
Coupler waveguide width at the input plane in microns (default is 0.33).
w1 : float, optional
Coupler waveguide width at the output plane in microns (default is 0.2).
gap0 : float, optional
Initial BUScoupler gap in microns (default is 0.2).
Lt_bus : float, optional
BUS taper length from wb0 to wb1 in microns (default is 20).
R0 : float, optional
Lower-waveguide bend radius in microns (default is 40).
angle : float, optional
Bend deflection angle in degrees (default is 22.5).
Lt_cp : float, optional
Coupler taper length from w0 to w1 in microns (default is None, meaning ``Lt_bus``).
gap1 : float, optional
Final BUScoupler gap in microns (default is None, meaning ``gap0``).
Lb0 : float, optional
Reserved for future BUS offsets (default is None).
symmetric_BUS : bool, optional
Whether BUS geometry is mirrored (default is True).
single_end : bool, optional
Keep single-ended termination on the coupler arm (default is True).
Rmin : float, optional
Minimum Euler radius in microns for bends (default is 8).
"""
def __init__(self,
name = None,
xs:str='strip',
@@ -642,30 +771,6 @@ class MDM(ADC_STD_2x2):
single_end:bool =True,
Rmin:float =8
):
"""_summary_
Args:
tapeout (_type_): _description_
xs (str): Device waveguide xsection. Defaults to 'strip'.
wb0 (float): Coupling region, **BUS** waveguide starting width. Defaults to 0.45.
wb1 (float): Coupling region, **BUS** waveguide ending width. Defaults to 0.61.
wb_in (float): **BUS** waveguide input width. Defaults to 0.45.
wb_out (float): **BUS** waveguide output width. Defaults to 0.88.
w_wg (float): **coupler** waveguide input width. Defaults to 0.45.
w0 (float): Coupling region, **coupler** waveguide starting width. Defaults to 0.33.
w1 (float): Coupling region, **coupler** waveguide ending width. Defaults to 0.2.
gap0 (float): Gap width at starting. Defaults to 0.2.
Lt_bus (float): Taper length for **BUS** from stating to ending. Defaults to 20.
R0 (float): _description_. Defaults to 40.
angle (float): _description_. Defaults to 22.5.
Lt_cp (float | None): Taper length for **coupler** from stating to ending. Defaults to None.
gap1 (float | None): Gap width at ending, usually not used. Defaults to None.
name (_type_ | None): _description_. Defaults to None.
Lb0 (_type_ | None): _description_. Defaults to None.
symmetric_BUS (bool): **BUS** waveguide type selection, symmetric or not. Defaults to True.
single_end (bool): _description_. Defaults to True.
Rmin (int): For euler bend, the minimum radius. Defaults to 8.
"""
self.wb0=wb0 ## BUS waveguide width on the input
@@ -753,6 +858,36 @@ class DC_bend :
Written by HU GAOLEI at 2022.5.15.
'''
"""
Bend-based directional coupler for broadband, fabrication-tolerant splitting.
Parameters
----------
name : str, optional
Nazca cell name (default is None).
w_in : float, optional
Inner (tight) waveguide width in the coupling region, in microns (default is 0.45).
w_out : float, optional
Outer waveguide width in the coupling region, in microns (default is 0.45).
gap : float, optional
Separation between waveguides in microns (default is 0.2).
r_in : float, optional
Bend radius of the inner waveguide in microns (default is 40).
theta_arc : float, optional
Coupling-arc angle in degrees (default is 30).
w_wg : float, optional
IO waveguide width in microns (default is 0.45).
theta_ext : float, optional
Extra bend angle used to align IO planes in degrees (default is 15).
xs_wg : str, optional
Nazca cross-section for both waveguides (default is "strip").
sharp_patch : bool, optional
Insert chamfer polygons to smooth acute corners (default is True).
show_pins : bool, optional
Draw Nazca stub markers for debugging (default is False).
"""
def __init__(
self,
name = None,
@@ -768,17 +903,6 @@ class DC_bend :
sharp_patch=True,
show_pins=False
):
'''
Initilization bend directional coupler.
Args:
- w_in [um] Width of the inner waveguide in the coupling region
- w2 [um] Width of the outer waveguide in the coupling region
- gap [um] Gap between two waveguide in the coupling region
- r_in [um] Bend radius of the inner waveguide
- theta_arc [degree] Angle of the coupling region
- w_wg [um] Width of input and output waveguide
'''
self.name = name
if (self.name==None):
@@ -902,6 +1026,43 @@ class DC_bend :
class DC_pX_3sg:
"""
Three-segment phase-tunable directional coupler (pX) generator.
Parameters
----------
name : str, optional
Nazca cell name (default is None).
xs_wg : str, optional
Cross-section key for all segments (default is "strip").
Lc1 : float, optional
Length of the first coupling segment in microns (default is 10).
Lp1 : float, optional
Phase-shifter length in microns (default is 5).
Lc2 : float, optional
Length of the second coupling segment in microns (default is 10).
Lt : float, optional
Taper length between coupling and phase sections in microns (default is 1).
w_cp : float, optional
Nominal coupling width in microns (default is 0.5).
dw : float, optional
Width offset applied to the phase section in microns (default is 0.1).
gap : float, optional
Vertical spacing between the two cores in microns (default is 0.2).
R0 : float, optional
Bend radius in microns for port transitions (default is 10).
A : float, optional
Bend angle in degrees for port transitions (default is 15).
w_wg : float, optional
External IO width in microns (default is 0.45).
pX_type : str, optional
Phase-section topology ("symmetric" or "asymmetric", default is "symmetric").
port_symmetric : bool, optional
Use mirrored port routing for both arms (default is True).
sharp_patch : bool, optional
Insert chamfer polygons to mitigate sharp tips (default is True).
"""
def __init__(self,
name = None,
xs_wg:str='strip',
@@ -1,7 +1,8 @@
import nazca as nd
import numpy as np
from ...strurctures import _my_polygon
from mxpic.structures import _my_polygon
# from ....structures import _my_polygon
class EC_dual_layer_px3():
"""
@@ -1,37 +1,47 @@
import nazca as nd
import numpy as np
import math
from ..structures import *
from ..structures import _my_polygon
from ..basic import __cell_arg__
from ..routing import Route
import pandas as pd
from ....routing import Route
from ....structures import _my_polygon,circle,Clothoid,hole
from ....basic import __cell_arg__
''' Class for nanoantenna '''
class Nano_ant():
"""Class of nanoantenna for optical phased array.
"""
Configure a nano-antenna for optical phased-array grating couplers.
This is the class of nanoantenna for optical phased array. GDS cell can be generated using this class. Simulation structure generation and simulation results analysis is going to be added in the future.
Args:
- tapeout [class] (Default: CUMEC_CSiP130Cu)
- w_wg [um] (Default: 0.5um)
Width of input waveguide
- vector [um] (Default: [0.5,..,0.5]])
Vectors to define the length of each teeth
- taper_length [um] (Default: 1um)
Length of the linear taper region
- width [um] (Default: 3um)
Width of the nanoantenna
- max_theta [degree](Default: 110)
Open degree of linear taper
- define_type [str] (Default: non-periodic)
Way to define the antenna, including: "non-periodic", "periodic"
- etch_depth [str] (Default: "DETCH")
Define the etch depth, including: "FETCH", "METCH", "SETCH"
Parameters
----------
w_wg : float, optional
Input waveguide width in microns (default is 0.41).
xs_wg : str, optional
Nazca cross-section key for the feed waveguide (default is "strip").
define_type : str, optional
Antenna definition scheme, either "non-periodic" or "periodic" (default is "non-periodic").
vector : Sequence[float], optional
Alternating etched/filled segment lengths (µm) when ``define_type`` is "non-periodic"
(default is ``[0.5, 0.5, 0.5, 0.5, 0.5, 0.5]``).
taper_length : float, optional
Linear taper length preceding the teeth region in microns (default is 3).
width : float, optional
Maximum aperture width in microns (default is 6).
max_theta : float, optional
Fan-out opening angle in degrees (default is 110).
pitch : float or Sequence[float], optional
Tooth pitch (µm) when ``define_type`` is "periodic"; scalar applies to all periods (default is 0.6).
duty_cycle : float or Sequence[float], optional
Etched fraction per period for periodic antennas; scalar or dual-entry list for dual-etch (default is 0.3).
teeth_number : int, optional
Number of etched teeth when periodic mode is used (default is 6).
etch_depth : Sequence[str], optional
List of etch-depth identifiers ("FETCH", "METCH", "SETCH"); length determines single/dual etch (default is ["METCH"]).
show_pins : bool, optional
Draw Nazca stub markers on exported pins (default is True).
"""
def __init__(
@@ -40,15 +50,15 @@ class Nano_ant():
xs_wg: str = "strip",
define_type: str = "non-periodic",
vector: float = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5],
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 = 0.6,
duty_cycle: float = 0.3,
pitch: 'float|list' = 0.6,
duty_cycle: 'float|list' = 0.3,
teeth_number: float = 6,
etch_depth: str = ["METCH"],
etch_depth: 'str|list' = ["METCH"],
show_pins: bool = True
):
# Init and save the input parameters
@@ -191,7 +201,22 @@ class Nano_ant():
''' Class for 2D antenna array for FMF grating '''
class Taper() :
"""
Create a stand-alone planar taper cell for 2D antenna feeds.
Parameters
----------
width1 : float, optional
Input width in microns (default is 4).
width2 : float, optional
Output width in microns (default is 0.45).
length : float, optional
Physical taper length in microns (default is 30).
type : str, optional
Transition profile, "linear" or "parabolic" (default is "linear").
show_pins : bool, optional
Draw Nazca stub markers for debugging (default is False).
"""
def __init__(self, width1=4, width2=0.45, length=30, type="linear", show_pins=False) -> None:
self.width1 = width1
self.width2 = width2
@@ -251,9 +276,37 @@ class Taper() :
class Grating_2D_Hole() :
'''
"""
Define a single 2D hole-array grating (diffraction + reflector + taper).
This is a class for 2D Grating in IMEC.
'''
Parameters
----------
w_wg : float, optional
Feed waveguide width in microns (default is 0.5).
w_gt : float, optional
Square grating aperture width in microns (default is 5).
l_taper : float, optional
Taper length from grating to feed in microns (default is 30).
type_taper : str, optional
Taper profile ("linear" or "parabolic", default is "parabolic").
gt_vector : Sequence[float], optional
Pitch list (µm) for the main etched holes (default is ``[0.5, 0.5, 0.5, 0.5, 0.5]``).
gt_diameter : float, optional
Diameter of the main holes in microns (default is 0.4).
gt_layer : str, optional
Nazca layer name used for the main holes (default is "STRIP_COR").
polysi_vector : Sequence[float], optional
Pitch list (µm) for polysilicon holes (default is ``[0.5, 0.5, 0.5, 0.5, 0.5]``).
polysi_diameter : float, optional
Diameter of polysilicon holes in microns (default is 0.4).
polysi_layer : str, optional
Layer name for polysilicon etch (default is "FCW_TRE").
reflector_vector : Sequence[float], optional
Alternating reflector spacing/width values in microns (default is ``[0.3, 0.3, 0.3, 0.3, 0.3, 0.3]``).
l_field_center : float, optional
Offset from the grating edge to the mode-field center in microns (default is 1).
"""
def __init__(
self,
w_wg=0.5,
@@ -342,7 +395,20 @@ class Grating_2D_Hole() :
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
@@ -414,7 +480,20 @@ class Grating_2D_Hole_4Rec() :
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
@@ -483,6 +562,63 @@ class Grating_2D_Hole_3Rec() :
""" Renamed for simplification in 2023.04.02 """
class GC_STD_2D:
"""
General-purpose 2D grating coupler generator with rectangular or arc shapes.
Parameters
----------
name : str, optional
Nazca cell name (default is None, meaning uninstantiated cell).
etch_type : str, optional
Etch depth selector: "FETCH", "METCH", or "SETCH" (default is "FETCH").
xs_wg : str, optional
Cross-section for the grating slab and output waveguide (default is "grating").
Dx_hole : float or Sequence[float], optional
Hole size along x (µm). Scalar applies to all columns (default is 0.3).
Dy_hole : float or Sequence[float], optional
Hole size along y (µm). Scalar applies to all rows (default is 0.3).
hole_shape : str, optional
Individual hole shape, "circle" or "rectangle" (default is "circle").
shape : str, optional
Overall grating footprint, "circle", "arc", or "rectangle" (default is "circle").
xs_open : str or None, optional
Optional open-area cross-section for keep-out regions (default is None).
Px : float or Sequence[float], optional
Periods along x in microns; scalar broadcasts (default is 0.57).
Py : float or Sequence[float], optional
Periods along y in microns; scalar broadcasts (default is 0.57).
num_x : int, optional
Number of periods along x when ``Px`` is scalar (default is 25).
num_y : int, optional
Number of periods along y when ``Py`` is scalar (default is 25).
Lx_taper : float, optional
Horizontal taper length to the output port in microns (default is 50).
Ly_taper : float, optional
Vertical taper length in microns (default is 0).
Lx_end : float, optional
Extra straight length appended to the positive-x end (default is 1).
Ly_end : float, optional
Extra straight length appended to the +/-y ends (default is 1).
Lx_side : float, optional
Lateral margin on the +/x sides in microns (default is 0.5).
Ly_side : float, optional
Lateral margin on the +/y sides in microns (default is 0.5).
Lx_port : float, optional
Straight-section length after the x-port taper in microns (default is 5).
Ly_port : float, optional
Straight-section length after the y-port taper in microns (default is 5).
w_wg : float, optional
Output waveguide width in microns (default is 0.5).
show_pins : bool, optional
Draw Nazca stub markers (default is False).
P_AR : float, optional
Anti-reflection pitch in microns (default is 0.6).
L_AR : float, optional
Anti-reflection taper length in microns (default is 1).
Raises:
Exception: Period do not match D_hole
"""
def __init__(self,
name=None,
etch_type :str = 'FETCH',
@@ -509,33 +645,7 @@ class GC_STD_2D:
P_AR: float = 0.6,
L_AR: float = 1,
):
"""_summary_
Args:
etch_type (str, optional): Three etch depth for election , full-etch = "FETCH", middle etch = "METCH", shallow etch = "ETCH". Defaults to 'FETCH'.
xs_wg (str, optional): xsection of the grating and also the output waveguide. Defaults to 'grating'.
Dx_hole (float, optional): size X of the hole, when in 'circle' hole selection ,this is the Diameter of your hole . Defaults to 0.3.
Dy_hole (float, optional): size Y of the hole, when in 'circle' hole selection ,this is the Diameter of your hole . Defaults to 0.3.
hole_shape (str, 'circle' | 'rectangel'): shape of the hole. Defaults to 'circle'.
shape (str, 'circle' | 'rectangel'): shape of the grating. Defaults to 'circle'.
Px (float, optional): Period distance X. Defaults to 0.57.
Py (float, optional): Period distance Y. Defaults to 0.57.
num_x (int, optional): number of pitches. Defaults to 25.
num_y (int, optional): number of pitches. Defaults to 25.
Lx_taper (int, optional): taper connection to the port. Defaults to 50.
Ly_taper (int, optional): taper connection to the port. Defaults to 0.
Lx_end (int, optional): length arratched to the end. Defaults to 5.
Ly_end (int, optional): length arratched to the end. Defaults to 3.
Lx_side (float, optional): side expansion. Defaults to 0.5.
Ly_side (float, optional): side expansion. Defaults to 0.5.
Lx_port (int, optional): output port length expansion. Defaults to 5.
Ly_port (int, optional): output port length expansion. Defaults to 5.
w_wg (float, optional): output port width. Defaults to 0.5.
show_pins (bool, optional): _description_. Defaults to False.
Raises:
Exception: Period do not match D_hole
"""
self.name = name
if (self.name==None):
self.instantiate = False
@@ -772,6 +882,44 @@ class GC_STD_2D:
return C
class GC_STD_1D:
"""
Versatile 1D grating coupler supporting sector and rectangular layouts.
Parameters
----------
name : str, optional
Nazca cell name (default is None).
xs_wg : str, optional
Cross-section key for the slab/taper region (default is "strip").
w_wg : float, optional
Input waveguide width in microns (default is 0.5).
etch_type : str, optional
Etch depth selector: "FETCH", "METCH", or "SETCH" (default is "FETCH").
xs_open : str or None, optional
Optional cross-section for keep-out/open regions (default is None).
L_taper : float, optional
Length of the entrance taper in microns (default is 10).
L_end : float, optional
Terminal slab length after the grating in microns (default is 2).
A_taper : float, optional
Fan-out angle in degrees (default is 30).
Period : float or Sequence[float], optional
Grating periods in microns; scalar broadcasts (default is 0.5).
eta_etch : float or Sequence[float], optional
Etch duty (between 0 and 1) per period (default is 0.5).
num : int, optional
Number of periods when ``Period`` and ``eta_etch`` are scalars (default is 20).
sector_gc : bool, optional
Use sector (True) or rectangular (False) geometry (default is True).
show_pins : bool, optional
Draw Nazca stub markers (default is False).
L_tail : float, optional
Extra straight length added before the taper in microns (default is 2).
P_AR : float, optional
Anti-reflection pitch in microns (default is 1).
L_AR : float, optional
Anti-reflection taper length in microns (default is 2).
"""
def __init__ (self,
name=None,
xs_wg : str = 'strip',
@@ -1073,6 +1221,20 @@ class GC_STD_1D:
return C
class FA:
"""
Instantiate a fiber-array fanout from repeated grating/fiber couplers.
Parameters
----------
fiber_coupler : nd.Cell or object
Reference coupler cell or instance exposing ``cell`` and pin ``g1``/``a0``.
pitch : float, optional
Center-to-center spacing between adjacent couplers in microns.
number : int
Total number of channels in the array.
show_pins : bool, optional
Draw Nazca stub markers on exported pins (default is False).
"""
def __init__(self,fiber_coupler,pitch,number,show_pins=False):
# if (isinstance(fiber_coupler,nd.Cell)):
+39
View File
@@ -0,0 +1,39 @@
import hmac
import hashlib
import json
from datetime import datetime, timedelta
# This is your master key. NEVER share this or put it in public code.
SECRET_KEY = b"mxPIC_Super_Secret_Master_Key_2026!"
def generate_license(mac_address: str, days_valid: int, output_file: str = "mxpic.lic"):
"""Generates a cryptographically signed license file."""
# Calculate the expiration date
expiration = (datetime.now() + timedelta(days=days_valid)).strftime("%Y-%m-%d")
# Create the payload message we want to sign
message = f"{mac_address}|{expiration}".encode('utf-8')
# Generate the unforgeable signature using HMAC + SHA256
signature = hmac.new(SECRET_KEY, message, hashlib.sha256).hexdigest()
# Create the license dictionary
license_data = {
"mac_address": mac_address,
"expiration": expiration,
"signature": signature
}
# Save to file
with open(output_file, "w") as f:
json.dump(license_data, f, indent=4)
#
print(f"✅ License generated for MAC {mac_address}")
print(f"✅ Expires on {expiration}")
print(f"✅ Saved to {output_file}")
if __name__ == "__main__":
# Example: Customer sends MAC "A1:B2:C3:D4:E5:F6", they bought a 1-year license
generate_license("D4:54:8B:F1:46:49", days_valid=365,output_file="mxpic.lic")
+81
View File
@@ -0,0 +1,81 @@
import uuid
import hmac
import hashlib
import json
import sys
import os
from datetime import datetime
from pathlib import Path
# This MUST match the key in your generator exactly.
# Because this file is compiled via Cython to a .so/.pyd file,
# This MUST match the key in your generator exactly.
_SECRET_KEY = b"mxPIC_Super_Secret_Master_Key_2026!"
_ENV_VAR_NAME = "LIC_MXPIC_OPTIHK_DIR"
def _get_local_mac() -> str:
"""Retrieves the physical MAC address of the current machine."""
mac = uuid.getnode()
return ':'.join(("%012X" % mac)[i:i+2] for i in range(0, 12, 2))
def _locate_license_file() -> Path:
"""Intelligently resolves the path to the license file."""
env_path_str = os.getenv(_ENV_VAR_NAME)
if env_path_str:
path_obj = Path(env_path_str)
# If the user pointed to a directory, append the default filename
if path_obj.is_dir():
return path_obj / "mxpic.lic"
# Otherwise, assume they pointed directly to the file itself
return path_obj
else:
# Fallback: Look in the current working directory where the script is run
return Path("mxpic.lic")
def verify_license() -> None:
"""Verifies the license file. Halts execution if invalid."""
lic_file = _locate_license_file()
if not lic_file.exists():
print(f"\n❌ mxPIC FATAL ERROR: License file not found.")
print(f"Searched at: {lic_file.resolve()}")
print(f"Please set the '{_ENV_VAR_NAME}' environment variable to point to your license file.")
sys.exit(1)
try:
with open(lic_file, "r", encoding="utf-8") as f:
lic = json.load(f)
local_mac = _get_local_mac()
# 1. Check MAC match
if lic["mac_address"] != local_mac:
print(f"\n❌ mxPIC FATAL ERROR: License registered to different machine.")
print(f"Registered: {lic['mac_address']} | Local: {local_mac}")
sys.exit(1)
# 2. Check Expiration
exp_date = datetime.strptime(lic["expiration"], "%Y-%m-%d")
if datetime.now() > exp_date:
print(f"\n❌ mxPIC FATAL ERROR: License expired on {lic['expiration']}.")
sys.exit(1)
# 3. Verify Signature
message = f"{lic['mac_address']}|{lic['expiration']}".encode('utf-8')
expected_sig = hmac.new(_SECRET_KEY, message, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected_sig, lic["signature"]):
print("\n❌ mxPIC FATAL ERROR: License signature is corrupted or forged.")
sys.exit(1)
except json.JSONDecodeError:
print(f"\n❌ mxPIC FATAL ERROR: License file is corrupted (invalid JSON).")
sys.exit(1)
except KeyError as e:
print(f"\n❌ mxPIC FATAL ERROR: License file is missing required data: {e}")
sys.exit(1)
except Exception as e:
print(f"\n❌ mxPIC FATAL ERROR: Failed to read license. {e}")
sys.exit(1)
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: be816ea2c3cdf6e3cdbe94c30599652d
config: ec3e07af3f4b33dda3e0c115a231056a
tags: 645f666f9bcd5a90fca523b33c5a78b7
+13
View File
@@ -0,0 +1,13 @@
.. mxpic_handbook documentation master file, created by
sphinx-quickstart on Sun May 3 16:05:57 2026.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
# Welcome to the automated documentation for the mxPIC silicon photonics library.
```{toctree}
:maxdepth: 2
:caption: Components:
mxpic/components/primitives/directional_couplers/directional_couplers
mxpic/components/primitives/edge_couplers/EC_dual_layer_px3
mxpic/components/primitives/grating_couplers/grating_couplers
@@ -0,0 +1,7 @@
# mxpic\components\primitives\directional_couplers\directional_couplers
```{eval-rst}
.. automodule:: mxpic.components.primitives.directional_couplers.directional_couplers
:members:
:undoc-members:
:show-inheritance:
```
@@ -0,0 +1,7 @@
# mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
```{eval-rst}
.. automodule:: mxpic.components.primitives.edge_couplers.EC_dual_layer_px3
:members:
:undoc-members:
:show-inheritance:
```
@@ -0,0 +1,7 @@
# mxpic\components\primitives\grating_couplers\grating_couplers
```{eval-rst}
.. automodule:: mxpic.components.primitives.grating_couplers.grating_couplers
:members:
:undoc-members:
:show-inheritance:
```

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

+560
View File
@@ -0,0 +1,560 @@
<!DOCTYPE html>
<html lang="en" data-content_root="./" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &#8212; mxpic_handbook mxpic documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!--
this give us a css class that will be invisible only if js is disabled
-->
<noscript>
<style>
.pst-js-only { display: none !important; }
</style>
</noscript>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=8f2a1f02" />
<!-- So that users can add custom icons -->
<script src="_static/scripts/fontawesome.js?digest=8878045cc6db502f8baf"></script>
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />
<script src="_static/documentation_options.js?v=91346475"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'genindex';</script>
<link rel="index" title="Index" href="#" />
<link rel="search" title="Search" href="search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<dialog id="pst-search-dialog">
<form class="bd-search d-flex align-items-center"
action="search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
placeholder="Search the docs ..."
aria-label="Search the docs ..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form>
</dialog>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
<div class="bd-header__inner bd-page-width">
<button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="Site navigation">
<span class="fa-solid fa-bars"></span>
</button>
<div class="col-lg-3 navbar-header-items__start">
<div class="navbar-item">
<a class="navbar-brand logo" href="index.html">
<p class="title logo__title">mxpic_handbook mxpic documentation</p>
</a></div>
</div>
<div class="col-lg-9 navbar-header-items">
<div class="me-auto navbar-header-items__center">
<div class="navbar-item">
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html">
mxpic\components\primitives\directional_couplers\directional_couplers
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html">
mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html">
mxpic\components\primitives\grating_couplers\grating_couplers
</a>
</li>
</ul>
</nav></div>
</div>
<div class="navbar-header-items__end">
<div class="navbar-item navbar-persistent--container">
<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
</div>
<div class="navbar-item">
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" aria-label="Color mode" data-bs-title="Color mode" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings"></i>
</button></div>
</div>
</div>
<div class="navbar-persistent--mobile">
<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
</div>
</div>
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<dialog id="pst-primary-sidebar-modal"></dialog>
<div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar hide-on-wide">
<div class="sidebar-header-items sidebar-primary__section">
<div class="sidebar-header-items__center">
<div class="navbar-item">
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html">
mxpic\components\primitives\directional_couplers\directional_couplers
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html">
mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html">
mxpic\components\primitives\grating_couplers\grating_couplers
</a>
</li>
</ul>
</nav></div>
</div>
<div class="sidebar-header-items__end">
<div class="navbar-item">
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" aria-label="Color mode" data-bs-title="Color mode" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings"></i>
</button></div>
</div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
<div class="sidebar-primary-item">
<div id="ethical-ad-placement"
class="flat"
data-ea-publisher="readthedocs"
data-ea-type="readthedocs-sidebar"
data-ea-manual="true">
</div></div>
</div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none"></div>
<div id="searchbox"></div>
<article class="bd-article">
<h1 id="index">Index</h1>
<div class="genindex-jumpbox">
<a href="#A"><strong>A</strong></a>
| <a href="#B"><strong>B</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#F"><strong>F</strong></a>
| <a href="#G"><strong>G</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#N"><strong>N</strong></a>
| <a href="#R"><strong>R</strong></a>
| <a href="#T"><strong>T</strong></a>
</div>
<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2">ADC_STD_2x2 (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="B">B</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.BS_tdc">BS_tdc (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="D">D</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC">DC (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_bend">DC_bend (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_pX_3sg">DC_pX_3sg (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3">EC_dual_layer_px3 (class in mxpic.components.primitives.edge_couplers.EC_dual_layer_px3)</a>
</li>
</ul></td>
</tr></table>
<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.FA">FA (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D">GC_STD_1D (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D">GC_STD_2D (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2.generate_err">generate_err() (mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2 method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2.generate_gds">generate_gds() (mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2 method)</a>
<ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_bend.generate_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.DC_bend method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_pX_3sg.generate_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.DC_pX_3sg method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ring_bus_wg.generate_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.ring_bus_wg method)</a>
</li>
<li><a href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds">(mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3 method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole.generate_gds">(mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_3Rec.generate_gds">(mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_3Rec method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_4Rec.generate_gds">(mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_4Rec method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant.generate_gds">(mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Taper.generate_gds">(mxpic.components.primitives.grating_couplers.grating_couplers.Taper method)</a>
</li>
</ul></li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant.generate_gds_error">generate_gds_error() (mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant.generate_gds_positive">generate_gds_positive() (mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D.generate_negative">generate_negative() (mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D method)</a>
<ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D.generate_negative">(mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D method)</a>
</li>
</ul></li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D.generate_positive">generate_positive() (mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D method)</a>
<ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D.generate_positive">(mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D method)</a>
</li>
</ul></li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D.generate_test_dev">generate_test_dev() (mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2.generate_test_gds">generate_test_gds() (mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2 method)</a>
<ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC.generate_test_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.DC method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_bend.generate_test_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.DC_bend method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_pX_3sg.generate_test_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.DC_pX_3sg method)</a>
</li>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.MDM.generate_test_gds">(mxpic.components.primitives.directional_couplers.directional_couplers.MDM method)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D.generate_test_gds">(mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D method)</a>
</li>
</ul></li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole">Grating_2D_Hole (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_3Rec">Grating_2D_Hole_3Rec (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_4Rec">Grating_2D_Hole_4Rec (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.MDM">MDM (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
<li>
module
<ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#module-mxpic.components.primitives.directional_couplers.directional_couplers">mxpic.components.primitives.directional_couplers.directional_couplers</a>
</li>
<li><a href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html#module-mxpic.components.primitives.edge_couplers.EC_dual_layer_px3">mxpic.components.primitives.edge_couplers.EC_dual_layer_px3</a>
</li>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#module-mxpic.components.primitives.grating_couplers.grating_couplers">mxpic.components.primitives.grating_couplers.grating_couplers</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
mxpic.components.primitives.directional_couplers.directional_couplers
<ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#module-mxpic.components.primitives.directional_couplers.directional_couplers">module</a>
</li>
</ul></li>
<li>
mxpic.components.primitives.edge_couplers.EC_dual_layer_px3
<ul>
<li><a href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html#module-mxpic.components.primitives.edge_couplers.EC_dual_layer_px3">module</a>
</li>
</ul></li>
<li>
mxpic.components.primitives.grating_couplers.grating_couplers
<ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#module-mxpic.components.primitives.grating_couplers.grating_couplers">module</a>
</li>
</ul></li>
</ul></td>
</tr></table>
<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant">Nano_ant (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ring_bus_wg">ring_bus_wg (class in mxpic.components.primitives.directional_couplers.directional_couplers)</a>
</li>
</ul></td>
</tr></table>
<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Taper">Taper (class in mxpic.components.primitives.grating_couplers.grating_couplers)</a>
</li>
</ul></td>
</tr></table>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
</div>
</footer>
</div>
</div>
<footer class="bd-footer-content">
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script defer src="_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf"></script>
<script defer src="_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf"></script>
<footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
<div class="footer-items__start">
<div class="footer-item">
<p class="copyright">
© Copyright 2026, Qin Yue (PotatoMaxwell).
<br/>
</p>
</div>
<div class="footer-item">
<p class="sphinx-version">
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.7.
<br/>
</p>
</div>
</div>
<div class="footer-items__end">
<div class="footer-item">
<p class="theme-version">
<!-- # L10n: Setting the PST URL as an argument as this does not need to be localized -->
Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.16.1.
</p></div>
</div>
</div>
</footer>
</body>
</html>
@@ -8,7 +8,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>mxpic_handbook documentation &#8212; mxpic_handbook mxpic documentation</title>
<title>Welcome to the automated documentation for the mxPIC silicon photonics library. &#8212; mxpic_handbook mxpic documentation</title>
@@ -44,7 +44,7 @@
<script>DOCUMENTATION_OPTIONS.pagename = 'index';</script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Edge Coupler Reference" href="primitives/edge_couplers/edge_couplers.html" />
<link rel="next" title="mxpic\components\primitives\directional_couplers\directional_couplers" href="mxpic/components/primitives/directional_couplers/directional_couplers.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
@@ -109,7 +109,7 @@
<p class="title logo__title">mxPIC Handbook</p>
<p class="title logo__title">mxpic_handbook mxpic documentation</p>
</a></div>
@@ -124,8 +124,22 @@
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-internal" href="primitives/edge_couplers/edge_couplers.html">
Edge Coupler Reference
<a class="nav-link nav-internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html">
mxpic\components\primitives\directional_couplers\directional_couplers
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html">
mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html">
mxpic\components\primitives\grating_couplers\grating_couplers
</a>
</li>
@@ -205,8 +219,22 @@
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-internal" href="primitives/edge_couplers/edge_couplers.html">
Edge Coupler Reference
<a class="nav-link nav-internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html">
mxpic\components\primitives\directional_couplers\directional_couplers
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html">
mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html">
mxpic\components\primitives\grating_couplers\grating_couplers
</a>
</li>
@@ -264,19 +292,34 @@
sphinx-quickstart on Sun May 3 16:05:57 2026.
You can adapt this file completely to your liking, but it should at least
contain the root <code class="docutils literal notranslate"><span class="pre">toctree</span></code> directive.</p>
<section id="mxpic-handbook-documentation">
<h1>mxpic_handbook documentation<a class="headerlink" href="#mxpic-handbook-documentation" title="Link to this heading">#</a></h1>
<p>============================</p>
<p>Add your content using <code class="docutils literal notranslate"><span class="pre">reStructuredText</span></code> syntax. See the
<code class="docutils literal notranslate"><span class="pre">reStructuredText</span> <span class="pre">&lt;https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html&gt;</span></code>_
documentation for details.</p>
<p>Welcome to the automated documentation for the mxPIC silicon photonics library.</p>
<section id="welcome-to-the-automated-documentation-for-the-mxpic-silicon-photonics-library">
<h1>Welcome to the automated documentation for the mxPIC silicon photonics library.<a class="headerlink" href="#welcome-to-the-automated-documentation-for-the-mxpic-silicon-photonics-library" title="Link to this heading">#</a></h1>
<div class="toctree-wrapper compound">
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Components:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="primitives/edge_couplers/edge_couplers.html">Edge Coupler Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="primitives/edge_couplers/edge_couplers.html#dual-layer-px3">Dual Layer PX3</a></li>
<li class="toctree-l2"><a class="reference internal" href="primitives/edge_couplers/edge_couplers.html#design-notes">Design Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html">mxpic\components\primitives\directional_couplers\directional_couplers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ADC_STD_2x2"><code class="docutils literal notranslate"><span class="pre">ADC_STD_2x2</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.BS_tdc"><code class="docutils literal notranslate"><span class="pre">BS_tdc</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC"><code class="docutils literal notranslate"><span class="pre">DC</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_bend"><code class="docutils literal notranslate"><span class="pre">DC_bend</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.DC_pX_3sg"><code class="docutils literal notranslate"><span class="pre">DC_pX_3sg</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.MDM"><code class="docutils literal notranslate"><span class="pre">MDM</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/directional_couplers/directional_couplers.html#mxpic.components.primitives.directional_couplers.directional_couplers.ring_bus_wg"><code class="docutils literal notranslate"><span class="pre">ring_bus_wg</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html">mxpic\components\primitives\edge_couplers\EC_dual_layer_px3</a><ul>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.html#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3"><code class="docutils literal notranslate"><span class="pre">EC_dual_layer_px3</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html">mxpic\components\primitives\grating_couplers\grating_couplers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.FA"><code class="docutils literal notranslate"><span class="pre">FA</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_1D"><code class="docutils literal notranslate"><span class="pre">GC_STD_1D</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.GC_STD_2D"><code class="docutils literal notranslate"><span class="pre">GC_STD_2D</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole"><code class="docutils literal notranslate"><span class="pre">Grating_2D_Hole</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_3Rec"><code class="docutils literal notranslate"><span class="pre">Grating_2D_Hole_3Rec</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Grating_2D_Hole_4Rec"><code class="docutils literal notranslate"><span class="pre">Grating_2D_Hole_4Rec</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Nano_ant"><code class="docutils literal notranslate"><span class="pre">Nano_ant</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="mxpic/components/primitives/grating_couplers/grating_couplers.html#mxpic.components.primitives.grating_couplers.grating_couplers.Taper"><code class="docutils literal notranslate"><span class="pre">Taper</span></code></a></li>
</ul>
</li>
</ul>
@@ -294,11 +337,11 @@ documentation for details.</p>
<div class="prev-next-area">
<a class="right-next"
href="primitives/edge_couplers/edge_couplers.html"
href="mxpic/components/primitives/directional_couplers/directional_couplers.html"
title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">Edge Coupler Reference</p>
<p class="prev-next-title">mxpic\components\primitives\directional_couplers\directional_couplers</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>
File diff suppressed because one or more lines are too long
@@ -2,13 +2,13 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../../" >
<html lang="en" data-content_root="../../../../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Edge Coupler Reference &#8212; mxpic_handbook mxpic documentation</title>
<title>mxpic\components\primitives\edge_couplers\EC_dual_layer_px3 &#8212; mxpic_handbook mxpic documentation</title>
@@ -27,24 +27,25 @@
</noscript>
<!-- Loaded before other Sphinx assets -->
<link href="../../_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="../../../../_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="../../../../_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=8f2a1f02" />
<!-- So that users can add custom icons -->
<script src="../../_static/scripts/fontawesome.js?digest=8878045cc6db502f8baf"></script>
<script src="../../../../_static/scripts/fontawesome.js?digest=8878045cc6db502f8baf"></script>
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />
<link rel="preload" as="script" href="../../../../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
<link rel="preload" as="script" href="../../../../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />
<script src="../../_static/documentation_options.js?v=91346475"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'primitives/edge_couplers/edge_couplers';</script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="prev" title="mxpic_handbook documentation" href="../../index.html" />
<script src="../../../../_static/documentation_options.js?v=91346475"></script>
<script src="../../../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'mxpic/components/primitives/edge_couplers/EC_dual_layer_px3';</script>
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
<link rel="next" title="mxpic\components\primitives\grating_couplers\grating_couplers" href="../grating_couplers/grating_couplers.html" />
<link rel="prev" title="mxpic\components\primitives\directional_couplers\directional_couplers" href="../directional_couplers/directional_couplers.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
@@ -66,7 +67,7 @@
<dialog id="pst-search-dialog">
<form class="bd-search d-flex align-items-center"
action="../../search.html"
action="../../../../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
@@ -102,14 +103,14 @@
<a class="navbar-brand logo" href="../../index.html">
<a class="navbar-brand logo" href="../../../../index.html">
<p class="title logo__title">mxPIC Handbook</p>
<p class="title logo__title">mxpic_handbook mxpic documentation</p>
</a></div>
@@ -123,9 +124,23 @@
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-internal" href="../directional_couplers/directional_couplers.html">
mxpic\components\primitives\directional_couplers\directional_couplers
</a>
</li>
<li class="nav-item current active">
<a class="nav-link nav-internal" href="#">
Edge Coupler Reference
mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../grating_couplers/grating_couplers.html">
mxpic\components\primitives\grating_couplers\grating_couplers
</a>
</li>
@@ -202,9 +217,23 @@
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-internal" href="../directional_couplers/directional_couplers.html">
mxpic\components\primitives\directional_couplers\directional_couplers
</a>
</li>
<li class="nav-item current active">
<a class="nav-link nav-internal" href="#">
Edge Coupler Reference
mxpic\components\primitives\edge_couplers\EC_dual_layer_px3
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../grating_couplers/grating_couplers.html">
mxpic\components\primitives\grating_couplers\grating_couplers
</a>
</li>
@@ -270,11 +299,11 @@
<ul class="bd-breadcrumbs">
<li class="breadcrumb-item breadcrumb-home">
<a href="../../index.html" class="nav-link" aria-label="Home">
<a href="../../../../index.html" class="nav-link" aria-label="Home">
<i class="fa-solid fa-home"></i>
</a>
</li>
<li class="breadcrumb-item active" aria-current="page"><span class="ellipsis">Edge Coupler Reference</span></li>
<li class="breadcrumb-item active" aria-current="page"><span class="ellipsis">mxpic\components\primitives\edge_couplers\EC_dual_layer_px3</span></li>
</ul>
</nav>
</div>
@@ -291,15 +320,11 @@
<div id="searchbox"></div>
<article class="bd-article">
<section id="edge-coupler-reference">
<h1>Edge Coupler Reference<a class="headerlink" href="#edge-coupler-reference" title="Link to this heading">#</a></h1>
<p>This section covers the dual-layer edge coupler designs used for fiber-to-chip interfacing.</p>
<section id="dual-layer-px3">
<h2>Dual Layer PX3<a class="headerlink" href="#dual-layer-px3" title="Link to this heading">#</a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">EC_dual_layer_px3</span></code> is our standard spot-size converter.</p>
<section id="module-mxpic.components.primitives.edge_couplers.EC_dual_layer_px3">
<span id="mxpic-components-primitives-edge-couplers-ec-dual-layer-px3"></span><h1>mxpic\components\primitives\edge_couplers\EC_dual_layer_px3<a class="headerlink" href="#module-mxpic.components.primitives.edge_couplers.EC_dual_layer_px3" title="Link to this heading">#</a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.</span></span><span class="sig-name descname"><span class="pre">EC_dual_layer_px3</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_in</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">L_in</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Ltp1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Ltp2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Ltp3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">L_end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_tip_core</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w1_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.6</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_tip_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_mid_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.45</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_box</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">8</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_box_end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">12</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">L_box_end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_DT</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">12</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xs_SiN</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'sin'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_SiN_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'SiN_Rib_WG'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_DT</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'OXIDE_FACET'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xs_Trench</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'air_trench'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_top_cover</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'PAD_OPTICAL'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_dum_exl_be</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angle_tile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">8</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">R_bend</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">50</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3" title="Link to this definition">#</a></dt>
<dt class="sig sig-object py" id="mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.</span></span><span class="sig-name descname"><span class="pre">EC_dual_layer_px3</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_in</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">L_in</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Ltp1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Ltp2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Ltp3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">L_end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_tip_core</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w1_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.6</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_tip_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_mid_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.45</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_box</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">8</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_box_end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">12</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">L_box_end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w_DT</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">12</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xs_SiN</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'sin'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_SiN_slab</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'SiN_Rib_WG'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_DT</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'OXIDE_FACET'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xs_Trench</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'air_trench'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_top_cover</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'PAD_OPTICAL'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer_dum_exl_be</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angle_tile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">8</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">R_bend</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">50</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3" title="Link to this definition">#</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Dual-layer Edge Coupler (Spot Size Converter) for fiber-to-chip coupling.</p>
<p>This component manages the adiabatic transition between a high-index
@@ -334,28 +359,13 @@ contrast core and a secondary slab/cladding layer (e.g., SiN to SOI).</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds">
<span class="sig-name descname"><span class="pre">generate_gds</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds" title="Link to this definition">#</a></dt>
<dt class="sig sig-object py" id="mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds">
<span class="sig-name descname"><span class="pre">generate_gds</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds" title="Link to this definition">#</a></dt>
<dd><p>central core</p>
</dd></dl>
</dd></dl>
<figure class="align-center" id="id1">
<a class="reference internal image-reference" href="../../_images/ec_px3_layout.png"><img alt="GDS layout of the dual-layer edge coupler" src="../../_images/ec_px3_layout.png" style="width: 600px;" />
</a>
<figcaption>
<p><span class="caption-text">Figure 1: GDS layout of the EC_dual_layer_px3 showing the SiN-to-SOI taper transition.</span><a class="headerlink" href="#id1" title="Link to this image">#</a></p>
</figcaption>
</figure>
</section>
<section id="design-notes">
<h2>Design Notes<a class="headerlink" href="#design-notes" title="Link to this heading">#</a></h2>
<ul class="simple">
<li><p>Tapers: Ensure Ltp1, Ltp2, and Ltp3 provide enough length for adiabatic mode expansion.</p></li>
<li><p>Alignment: The angle_tile parameter (default 8°) is critical for reducing back-reflections.</p></li>
</ul>
</section>
</section>
@@ -369,14 +379,23 @@ contrast core and a secondary slab/cladding layer (e.g., SiN to SOI).</p>
<div class="prev-next-area">
<a class="left-prev"
href="../../index.html"
href="../directional_couplers/directional_couplers.html"
title="previous page">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">mxpic_handbook documentation</p>
<p class="prev-next-title">mxpic\components\primitives\directional_couplers\directional_couplers</p>
</div>
</a>
<a class="right-next"
href="../grating_couplers/grating_couplers.html"
title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">mxpic\components\primitives\grating_couplers\grating_couplers</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>
</div>
</footer>
@@ -396,14 +415,10 @@ contrast core and a secondary slab/cladding layer (e.g., SiN to SOI).</p>
</div>
<nav class="bd-toc-nav page-toc" aria-labelledby="pst-page-navigation-heading-2">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#dual-layer-px3">Dual Layer PX3</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3"><code class="docutils literal notranslate"><span class="pre">EC_dual_layer_px3</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#mxpic_forge.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds"><code class="docutils literal notranslate"><span class="pre">EC_dual_layer_px3.generate_gds()</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3"><code class="docutils literal notranslate"><span class="pre">EC_dual_layer_px3</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#mxpic.components.primitives.edge_couplers.EC_dual_layer_px3.EC_dual_layer_px3.generate_gds"><code class="docutils literal notranslate"><span class="pre">EC_dual_layer_px3.generate_gds()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#design-notes">Design Notes</a></li>
</ul>
</nav></div>
@@ -411,7 +426,7 @@ contrast core and a secondary slab/cladding layer (e.g., SiN to SOI).</p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/primitives/edge_couplers/edge_couplers.md.txt"
<li><a href="../../../../_sources/mxpic/components/primitives/edge_couplers/EC_dual_layer_px3.md.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div></div>
@@ -429,8 +444,8 @@ contrast core and a secondary slab/cladding layer (e.g., SiN to SOI).</p>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script defer src="../../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf"></script>
<script defer src="../../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf"></script>
<script defer src="../../../../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf"></script>
<script defer src="../../../../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf"></script>
<footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">

Some files were not shown because too many files have changed in this diff Show More