optical pins name revised. Pin type added
This commit is contained in:
@@ -123,7 +123,9 @@ def DEVICE_2X2_FDTD_INIT(fdtd,run=False,instrcutPATH=None,LibPATH=None):
|
||||
def tuple_to_complex(t):
|
||||
return complex(t[0], t[1])
|
||||
|
||||
def SimuDataFigurePlot(simuPath,devName,saveFlag=True,ports=["a1","b1"]):
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: def SimuDataFigurePlot(simuPath,devName,saveFlag=True,ports=["a1","b1"]):
|
||||
def SimuDataFigurePlot(simuPath,devName,saveFlag=True,ports=["opt_a1","opt_b1"]):
|
||||
|
||||
if (simuPath.endswith("\\")):
|
||||
pass
|
||||
@@ -173,20 +175,30 @@ def SimuDataFigurePlot(simuPath,devName,saveFlag=True,ports=["a1","b1"]):
|
||||
ax[0,idx].pcolor(np.real(E_mag))
|
||||
|
||||
""" Plotting the port transmission """
|
||||
if ("b1" in ports and "a1" in ports):
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: if ("b1" in ports and "a1" in ports):
|
||||
if ("opt_b1" in ports and "opt_a1" in ports):
|
||||
dataDict["Ephase_11"] = np.squeeze(data["Ephase_11"][()])
|
||||
Trans_11 = dataDict["b1"]["trans"]
|
||||
Tmodes = dataDict["b1"]["modes"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: Trans_11 = dataDict["b1"]["trans"]
|
||||
Trans_11 = dataDict["opt_b1"]["trans"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: Tmodes = dataDict["b1"]["modes"]
|
||||
Tmodes = dataDict["opt_b1"]["modes"]
|
||||
|
||||
ax1 = ax[1,0]
|
||||
ax2 = ax[2,0]
|
||||
|
||||
ax1.set_title("a_1 to b_1 trans [Through]")
|
||||
ax1.plot(dataDict["a1"]["wl"]*1e+6,Trans_11,linewidth=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ax1.plot(dataDict["a1"]["wl"]*1e+6,Trans_11,linewidth=3)
|
||||
ax1.plot(dataDict["opt_a1"]["wl"]*1e+6,Trans_11,linewidth=3)
|
||||
|
||||
""" plotting the eigen mode decomposition """
|
||||
dataSZ = np.shape(Tmodes)
|
||||
plt_wl = dataDict["a1"]["wl"]*1e+6
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: plt_wl = dataDict["a1"]["wl"]*1e+6
|
||||
plt_wl = dataDict["opt_a1"]["wl"]*1e+6
|
||||
|
||||
dataPlt = []
|
||||
|
||||
@@ -206,20 +218,30 @@ def SimuDataFigurePlot(simuPath,devName,saveFlag=True,ports=["a1","b1"]):
|
||||
ax2.plot(plt_wl,Trans_dB,label=f"mode_{pltIdx}",linewidth=3)
|
||||
|
||||
|
||||
if ("b2" in ports and "a1" in ports):
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: if ("b2" in ports and "a1" in ports):
|
||||
if ("opt_b2" in ports and "opt_a1" in ports):
|
||||
dataDict["Ephase_21"] = np.squeeze(data["Ephase_11"][()])
|
||||
Trans_21 = dataDict["b2"]["trans"]
|
||||
Tmodes = dataDict["b2"]["modes"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: Trans_21 = dataDict["b2"]["trans"]
|
||||
Trans_21 = dataDict["opt_b2"]["trans"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: Tmodes = dataDict["b2"]["modes"]
|
||||
Tmodes = dataDict["opt_b2"]["modes"]
|
||||
|
||||
ax1 = ax[1,1]
|
||||
ax2 = ax[2,1]
|
||||
|
||||
ax1.set_title("a_1 to b_1 trans [Through]")
|
||||
ax1.plot(dataDict["a1"]["wl"]*1e+6,Trans_21)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ax1.plot(dataDict["a1"]["wl"]*1e+6,Trans_21)
|
||||
ax1.plot(dataDict["opt_a1"]["wl"]*1e+6,Trans_21)
|
||||
|
||||
""" plotting the eigen mode decomposition """
|
||||
dataSZ = np.shape(Tmodes)
|
||||
plt_wl = dataDict["a1"]["wl"]*1e+6
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: plt_wl = dataDict["a1"]["wl"]*1e+6
|
||||
plt_wl = dataDict["opt_a1"]["wl"]*1e+6
|
||||
|
||||
dataPlt = []
|
||||
|
||||
@@ -238,15 +260,23 @@ def SimuDataFigurePlot(simuPath,devName,saveFlag=True,ports=["a1","b1"]):
|
||||
Trans_dB = 10*np.log10(_data_)
|
||||
ax2.plot(plt_wl,Trans_dB,label=f"mode_{pltIdx}",linewidth=3)
|
||||
|
||||
if ("a2" in ports and "a1" in ports):
|
||||
Refl_21 = dataDict["a2"]["trans"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: if ("a2" in ports and "a1" in ports):
|
||||
if ("opt_a2" in ports and "opt_a1" in ports):
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: Refl_21 = dataDict["a2"]["trans"]
|
||||
Refl_21 = dataDict["opt_a2"]["trans"]
|
||||
# fig,ax = plt.subplots(3,2,6)
|
||||
ax[1,2].set_title("a_1 to a_2 trans [Replection]")
|
||||
ax[1,2].plot(dataDict["a1"]["wl"]*1e+6,Refl_21,linewidth=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ax[1,2].plot(dataDict["a1"]["wl"]*1e+6,Refl_21,linewidth=3)
|
||||
ax[1,2].plot(dataDict["opt_a1"]["wl"]*1e+6,Refl_21,linewidth=3)
|
||||
|
||||
ax2 = ax[2,2]
|
||||
Trans_dB = 10*np.log10(Refl_21)
|
||||
ax2.plot(dataDict["a1"]["wl"]*1e+6,Trans_dB,linewidth=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ax2.plot(dataDict["a1"]["wl"]*1e+6,Trans_dB,linewidth=3)
|
||||
ax2.plot(dataDict["opt_a1"]["wl"]*1e+6,Trans_dB,linewidth=3)
|
||||
|
||||
if (saveFlag):
|
||||
""" in CPU mode, there will be no folder """
|
||||
@@ -268,10 +298,14 @@ class DEVICE_PORTS:
|
||||
CladMaterial: str = "SiO2 (Glass) - Palik",
|
||||
modeIdx: list=[1,2,3,4],
|
||||
sourceMode: int = 1,
|
||||
ports_extend: list=["a1"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ports_extend: list=["a1"],
|
||||
ports_extend: list=["opt_a1"],
|
||||
SimuBox: Any = None,
|
||||
|
||||
port_radius: dict={"a1":0},
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_radius: dict={"a1":0},
|
||||
port_radius: dict={"opt_a1":0},
|
||||
sample_points: int = 101,
|
||||
Field_sample: int = 3,
|
||||
|
||||
@@ -279,7 +313,9 @@ class DEVICE_PORTS:
|
||||
LumericalPATH: Any = None,
|
||||
runFDTD: bool = False,
|
||||
GPUOn: bool = True,
|
||||
port_names: list = ["a1","b1","a2","b2"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_names: list = ["a1","b1","a2","b2"],
|
||||
port_names: list = ["opt_a1","opt_b1","opt_a2","opt_b2"],
|
||||
) -> None:
|
||||
|
||||
|
||||
@@ -344,18 +380,32 @@ class DEVICE_PORTS:
|
||||
|
||||
""" port Z for propagation recording """
|
||||
ports = jsonFile["ports"]
|
||||
dx = abs(ports["a1"]["x"] - ports["b1"]["x"])
|
||||
cX = (ports["a1"]["x"] + ports["b1"]["x"])/2
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dx = abs(ports["a1"]["x"] - ports["b1"]["x"])
|
||||
dx = abs(ports["opt_a1"]["x"] - ports["opt_b1"]["x"])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cX = (ports["a1"]["x"] + ports["b1"]["x"])/2
|
||||
cX = (ports["opt_a1"]["x"] + ports["opt_b1"]["x"])/2
|
||||
|
||||
if ("b2" in jsonFile["ports"]["names"]):
|
||||
dy = abs(ports["b1"]["y"] - ports["b2"]["y"])
|
||||
cY = (ports["b1"]["y"] + ports["b2"]["y"])/2
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: if ("b2" in jsonFile["ports"]["names"]):
|
||||
if ("opt_b2" in jsonFile["ports"]["names"]):
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dy = abs(ports["b1"]["y"] - ports["b2"]["y"])
|
||||
dy = abs(ports["opt_b1"]["y"] - ports["opt_b2"]["y"])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cY = (ports["b1"]["y"] + ports["b2"]["y"])/2
|
||||
cY = (ports["opt_b1"]["y"] + ports["opt_b2"]["y"])/2
|
||||
elif (SimuBox is not None):
|
||||
dy = SimuBox["dy"]
|
||||
cY = ports["b1"]["y"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cY = ports["b1"]["y"]
|
||||
cY = ports["opt_b1"]["y"]
|
||||
else:
|
||||
dy = 0
|
||||
cY = ports["b1"]["y"]
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cY = ports["b1"]["y"]
|
||||
cY = ports["opt_b1"]["y"]
|
||||
|
||||
|
||||
FDTD = {}
|
||||
@@ -526,36 +576,64 @@ class DEVICE_RING_BUS(DEVICE_PORTS):
|
||||
raise Exception("ERROR :: <device> not recongized")
|
||||
|
||||
|
||||
dx = abs(cell_dev.pin["a1"].x - cell_dev.pin["b1"].x)+port_width
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dx = abs(cell_dev.pin["a1"].x - cell_dev.pin["b1"].x)+port_width
|
||||
dx = abs(cell_dev.pin["opt_a1"].x - cell_dev.pin["opt_b1"].x)+port_width
|
||||
|
||||
if (Aport is None):
|
||||
|
||||
if (cell_dev.pin['b1'].x > r_ring):
|
||||
cell_dev.pin['b2'] = nd.Pin(name="b2").put(r_ring,0, 90)
|
||||
cell_dev.pin['a2'] = nd.Pin(name="a2").put(-r_ring,0, 90)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: if (cell_dev.pin['b1'].x > r_ring):
|
||||
if (cell_dev.pin['opt_b1'].x > r_ring):
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['b2'] = nd.Pin(name="b2").put(r_ring,0, 90)
|
||||
cell_dev.pin['opt_b2'] = nd.Pin(name="opt_b2",type="optical:").put(r_ring,0, 90)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['a2'] = nd.Pin(name="a2").put(-r_ring,0, 90)
|
||||
cell_dev.pin['opt_a2'] = nd.Pin(name="opt_a2",type="optical:").put(-r_ring,0, 90)
|
||||
else:
|
||||
x = cell_dev.pin['b1'].x
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: x = cell_dev.pin['b1'].x
|
||||
x = cell_dev.pin['opt_b1'].x
|
||||
y = -np.sqrt(r_ring**2 - x**2)
|
||||
a = np.arcsin(x/r_ring)/np.pi*180
|
||||
dy_ports = abs(y-cell_dev.pin['b1'].y)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dy_ports = abs(y-cell_dev.pin['b1'].y)
|
||||
dy_ports = abs(y-cell_dev.pin['opt_b1'].y)
|
||||
|
||||
if (dy_ports > port_distance):
|
||||
|
||||
y = cell_dev.pin['b1'].y + port_distance
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: y = cell_dev.pin['b1'].y + port_distance
|
||||
y = cell_dev.pin['opt_b1'].y + port_distance
|
||||
x = np.sqrt(r_ring**2 - (abs(y))**2)
|
||||
a = np.arcsin(x/r_ring)/np.pi*180
|
||||
cell_dev.pin['b2'] = nd.Pin(name="b2").put( x,y, a)
|
||||
cell_dev.pin['a2'] = nd.Pin(name="a2").put(-x,y,180-a)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['b2'] = nd.Pin(name="b2").put( x,y, a)
|
||||
cell_dev.pin['opt_b2'] = nd.Pin(name="opt_b2",type="optical:").put( x,y, a)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['a2'] = nd.Pin(name="a2").put(-x,y,180-a)
|
||||
cell_dev.pin['opt_a2'] = nd.Pin(name="opt_a2",type="optical:").put(-x,y,180-a)
|
||||
|
||||
else :
|
||||
cell_dev.pin['b2'] = nd.Pin(name="b2").put( x,y, a)
|
||||
cell_dev.pin['a2'] = nd.Pin(name="a2").put(-x,y,180-a)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['b2'] = nd.Pin(name="b2").put( x,y, a)
|
||||
cell_dev.pin['opt_b2'] = nd.Pin(name="opt_b2",type="optical:").put( x,y, a)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['a2'] = nd.Pin(name="a2").put(-x,y,180-a)
|
||||
cell_dev.pin['opt_a2'] = nd.Pin(name="opt_a2",type="optical:").put(-x,y,180-a)
|
||||
|
||||
else :
|
||||
cell_dev.pin['b2'] = nd.Pin(name="b2").put( r_ring*np.sin(Aport/180*np.pi),-r_ring*np.cos(Aport/180*np.pi), Aport)
|
||||
cell_dev.pin['a2'] = nd.Pin(name="a2").put(-r_ring*np.sin(Aport/180*np.pi),-r_ring*np.cos(Aport/180*np.pi), Aport)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['b2'] = nd.Pin(name="b2").put( r_ring*np.sin(Aport/180*np.pi),-r_ring*np.cos(Aport/180*np.pi), Aport)
|
||||
cell_dev.pin['opt_b2'] = nd.Pin(name="opt_b2",type="optical:").put( r_ring*np.sin(Aport/180*np.pi),-r_ring*np.cos(Aport/180*np.pi), Aport)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cell_dev.pin['a2'] = nd.Pin(name="a2").put(-r_ring*np.sin(Aport/180*np.pi),-r_ring*np.cos(Aport/180*np.pi), Aport)
|
||||
cell_dev.pin['opt_a2'] = nd.Pin(name="opt_a2",type="optical:").put(-r_ring*np.sin(Aport/180*np.pi),-r_ring*np.cos(Aport/180*np.pi), Aport)
|
||||
|
||||
yMax = cell_dev.pin['b2'].y
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: yMax = cell_dev.pin['b2'].y
|
||||
yMax = cell_dev.pin['opt_b2'].y
|
||||
yMin = -r_ring - port_width
|
||||
|
||||
dy = abs(yMax - yMin)
|
||||
@@ -570,10 +648,14 @@ class DEVICE_RING_BUS(DEVICE_PORTS):
|
||||
super().__init__(dev_name=dev_name, device=device, simu_xs=simu_xs, port_width=port_width, path=path, wl=wl,
|
||||
mesh_order=mesh_order, layer_heights=layer_heights,
|
||||
FDTD_height=FDTD_height, material=material, CladMaterial=CladMaterial,
|
||||
modeIdx=modeIdx, ports_extend=["a1","b1"], SimuBox = {"dx":dx,"dy":dy,"y":cy}, port_radius={"a2":r_ring,"b2":r_ring},
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: modeIdx=modeIdx, ports_extend=["a1","b1"], SimuBox = {"dx":dx,"dy":dy,"y":cy}, port_radius={"a2":r_ring,"b2":r_ring},
|
||||
modeIdx=modeIdx, ports_extend=["opt_a1","opt_b1"], SimuBox = {"dx":dx,"dy":dy,"y":cy}, port_radius={"opt_a2":r_ring,"opt_b2":r_ring},
|
||||
sample_points=sample_points,FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,
|
||||
GPUOn=GPUOn,
|
||||
port_names = ["a1","b1","a2","b2"],)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_names = ["a1","b1","a2","b2"],)
|
||||
port_names = ["opt_a1","opt_b1","opt_a2","opt_b2"],)
|
||||
|
||||
class DEVICE_COUPLER(DEVICE_PORTS):
|
||||
|
||||
@@ -590,9 +672,13 @@ class DEVICE_COUPLER(DEVICE_PORTS):
|
||||
) -> None:
|
||||
|
||||
super().__init__(dev_name, device, simu_xs, port_width, path, wl, mesh_order,
|
||||
layer_heights, FDTD_height, material, CladMaterial, modeIdx, ports_extend=["a1","a2","b1","b2"],SimuBox=None,port_radius={},
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: layer_heights, FDTD_height, material, CladMaterial, modeIdx, ports_extend=["a1","a2","b1","b2"],SimuBox=None,port_radius={},
|
||||
layer_heights, FDTD_height, material, CladMaterial, modeIdx, ports_extend=["opt_a1","opt_a2","opt_b1","opt_b2"],SimuBox=None,port_radius={},
|
||||
sample_points=sample_points,FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,GPUOn=GPUOn,
|
||||
port_names = ["a1","b1","a2","b2"],sourceMode=sourceMode)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_names = ["a1","b1","a2","b2"],sourceMode=sourceMode)
|
||||
port_names = ["opt_a1","opt_b1","opt_a2","opt_b2"],sourceMode=sourceMode)
|
||||
|
||||
class EULER_CROW_INTER_CP(DEVICE_PORTS):
|
||||
def __init__(self, dev_name: str, device: Any, simu_xs: str="strip",
|
||||
@@ -612,17 +698,29 @@ class EULER_CROW_INTER_CP(DEVICE_PORTS):
|
||||
""" The pins reconized in here is ra1,ra2,ra3,ra4 and rb1,rb2,rb3,rb4 """
|
||||
|
||||
newDev = device
|
||||
newDev.cell.pin['a1'] = device.cell.pin['ra2']
|
||||
newDev.cell.pin['a2'] = device.cell.pin['rb2']
|
||||
newDev.cell.pin['b1'] = device.cell.pin['ra4']
|
||||
newDev.cell.pin['b2'] = device.cell.pin['rb4']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: newDev.cell.pin['a1'] = device.cell.pin['ra2']
|
||||
newDev.cell.pin['opt_a1'] = device.cell.pin['ra2']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: newDev.cell.pin['a2'] = device.cell.pin['rb2']
|
||||
newDev.cell.pin['opt_a2'] = device.cell.pin['rb2']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: newDev.cell.pin['b1'] = device.cell.pin['ra4']
|
||||
newDev.cell.pin['opt_b1'] = device.cell.pin['ra4']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: newDev.cell.pin['b2'] = device.cell.pin['rb4']
|
||||
newDev.cell.pin['opt_b2'] = device.cell.pin['rb4']
|
||||
|
||||
port_radius = {"a1":device.R1, "a2": device.R1, "b1":-device.R1, "b2":-device.R1}
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_radius = {"a1":device.R1, "a2": device.R1, "b1":-device.R1, "b2":-device.R1}
|
||||
port_radius = {"opt_a1":device.R1, "opt_a2": device.R1, "opt_b1":-device.R1, "opt_b2":-device.R1}
|
||||
|
||||
super().__init__(dev_name, newDev, simu_xs, port_width, path, wl, mesh_order, layer_heights, FDTD_height, material, CladMaterial, modeIdx,
|
||||
ports_extend=[],
|
||||
SimuBox=SimuBox, port_radius=port_radius, sample_points=sample_points,
|
||||
FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["a1","b1","a2","b2"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["a1","b1","a2","b2"],
|
||||
FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["opt_a1","opt_b1","opt_a2","opt_b2"],
|
||||
GPUOn=GPUOn)
|
||||
|
||||
class EULER_CROW_BUS(DEVICE_PORTS):
|
||||
@@ -644,24 +742,38 @@ class EULER_CROW_BUS(DEVICE_PORTS):
|
||||
|
||||
newDev = device
|
||||
# newDev.cell.pin['a1'] = device.cell.pin['ra2']
|
||||
newDev.cell.pin['a2'] = device.cell.pin['ra2']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: newDev.cell.pin['a2'] = device.cell.pin['ra2']
|
||||
newDev.cell.pin['opt_a2'] = device.cell.pin['ra2']
|
||||
# newDev.cell.pin['b1'] = device.cell.pin['ra4']
|
||||
newDev.cell.pin['b2'] = device.cell.pin['ra4']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: newDev.cell.pin['b2'] = device.cell.pin['ra4']
|
||||
newDev.cell.pin['opt_b2'] = device.cell.pin['ra4']
|
||||
|
||||
port_radius = {"a2": device.R1, "b2":-device.R1}
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_radius = {"a2": device.R1, "b2":-device.R1}
|
||||
port_radius = {"opt_a2": device.R1, "opt_b2":-device.R1}
|
||||
|
||||
if (SimuBox is None):
|
||||
yMax = newDev.cell.pin['b2'].y
|
||||
yMin = newDev.cell.pin['b1'].y - newDev.ring_cell[0].sz[1]/2 - port_width/2
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: yMax = newDev.cell.pin['b2'].y
|
||||
yMax = newDev.cell.pin['opt_b2'].y
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: yMin = newDev.cell.pin['b1'].y - newDev.ring_cell[0].sz[1]/2 - port_width/2
|
||||
yMin = newDev.cell.pin['opt_b1'].y - newDev.ring_cell[0].sz[1]/2 - port_width/2
|
||||
|
||||
SimuBox = {}
|
||||
SimuBox["dy"] = yMax - yMin
|
||||
SimuBox["y"] = (yMax+yMin)/2
|
||||
|
||||
super().__init__(dev_name, newDev, simu_xs, port_width, path, wl, mesh_order, layer_heights, FDTD_height, material, CladMaterial, modeIdx,
|
||||
ports_extend=["a1","b1"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ports_extend=["a1","b1"],
|
||||
ports_extend=["opt_a1","opt_b1"],
|
||||
SimuBox=SimuBox, port_radius=port_radius, sample_points=sample_points,
|
||||
FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["a1","b1","a2","b2"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["a1","b1","a2","b2"],
|
||||
FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["opt_a1","opt_b1","opt_a2","opt_b2"],
|
||||
GPUOn=GPUOn)
|
||||
|
||||
|
||||
@@ -672,15 +784,21 @@ class RESONATOR(DEVICE_PORTS):
|
||||
mesh_order: int=5, layer_heights: list=[0.22],
|
||||
FDTD_height: int=2, material: str="Si (Silicon) - Palik", CladMaterial: str="SiO2 (Glass) - Palik",
|
||||
modeIdx: list=[1, 2, 3, 4],
|
||||
ports_extend: list=["a1"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ports_extend: list=["a1"],
|
||||
ports_extend: list=["opt_a1"],
|
||||
sample_points: int=10001,
|
||||
SimuBox: Any=None,
|
||||
FDTDBuild: bool = False,
|
||||
LumericalPATH: Any = None,
|
||||
runFDTD: bool = False) -> None:
|
||||
super().__init__(dev_name, device, simu_xs, port_width, path, wl, mesh_order, layer_heights, FDTD_height, material, CladMaterial,
|
||||
modeIdx, ports_extend=["a1","a2","b1","b2"], SimuBox=SimuBox, port_radius=[], sample_points=sample_points,
|
||||
FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["a1","b1","a2","b2"],)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: modeIdx, ports_extend=["a1","a2","b1","b2"], SimuBox=SimuBox, port_radius=[], sample_points=sample_points,
|
||||
modeIdx, ports_extend=["opt_a1","opt_a2","opt_b1","opt_b2"], SimuBox=SimuBox, port_radius=[], sample_points=sample_points,
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["a1","b1","a2","b2"],)
|
||||
FDTDBuild=FDTDBuild,LumericalPATH=LumericalPATH,runFDTD=runFDTD,port_names = ["opt_a1","opt_b1","opt_a2","opt_b2"],)
|
||||
|
||||
class RING_PHASE(DEVICE_PORTS):
|
||||
def __init__(self, dev_name: str, device: Any, simu_xs: str="strip",
|
||||
@@ -691,7 +809,9 @@ class RING_PHASE(DEVICE_PORTS):
|
||||
CladMaterial: str="SiO2 (Glass) - Palik",
|
||||
modeIdx: list=[1, 2, 3, 4],
|
||||
SimuBox: Any=None,
|
||||
port_radius: dict={ "a1": 0 },
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: port_radius: dict={ "a1": 0 },
|
||||
port_radius: dict={ "opt_a1": 0 },
|
||||
sample_points: int=101,
|
||||
FDTDBuild: bool=False,
|
||||
LumericalPATH: Any=None,
|
||||
@@ -707,13 +827,21 @@ class RING_PHASE(DEVICE_PORTS):
|
||||
elif (isinstance(device,nd.Cell)):
|
||||
dev_cell = device
|
||||
|
||||
dev_cell.pin['a1'] = dev_cell.pin['r1']
|
||||
dev_cell.pin['b1'] = dev_cell.pin['r3']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dev_cell.pin['a1'] = dev_cell.pin['r1']
|
||||
dev_cell.pin['opt_a1'] = dev_cell.pin['r1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dev_cell.pin['b1'] = dev_cell.pin['r3']
|
||||
dev_cell.pin['opt_b1'] = dev_cell.pin['r3']
|
||||
|
||||
|
||||
dy = abs(dev_cell.pin['a1'].y - dev_cell.pin['b1'].y )
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dy = abs(dev_cell.pin['a1'].y - dev_cell.pin['b1'].y )
|
||||
dy = abs(dev_cell.pin['opt_a1'].y - dev_cell.pin['opt_b1'].y )
|
||||
|
||||
cy = (dev_cell.pin['a1'].y + dev_cell.pin['b1'].y)/2
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: cy = (dev_cell.pin['a1'].y + dev_cell.pin['b1'].y)/2
|
||||
cy = (dev_cell.pin['opt_a1'].y + dev_cell.pin['opt_b1'].y)/2
|
||||
if (SimuBox is None):
|
||||
SimuBox = {}
|
||||
SimuBox["dy"] = dy
|
||||
@@ -728,7 +856,9 @@ class RING_PHASE(DEVICE_PORTS):
|
||||
super().__init__(dev_name, dev_cell, simu_xs, port_width, path, wl, mesh_order, layer_heights,
|
||||
FDTD_height, material, CladMaterial, modeIdx, ports_extend=[],
|
||||
SimuBox=SimuBox, port_radius=port_radius, sample_points=sample_points,
|
||||
FDTDBuild=FDTDBuild, LumericalPATH=LumericalPATH, runFDTD=runFDTD, port_names=["a1","b1"],
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: FDTDBuild=FDTDBuild, LumericalPATH=LumericalPATH, runFDTD=runFDTD, port_names=["a1","b1"],
|
||||
FDTDBuild=FDTDBuild, LumericalPATH=LumericalPATH, runFDTD=runFDTD, port_names=["opt_a1","opt_b1"],
|
||||
GPUOn = GPUOn)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user