User Tools

Site Tools


gds_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gds_example [2025/11/27 09:41] – created alehengds_example [2025/11/27 09:45] (current) alehen
Line 8: Line 8:
     UpperEllipse = gf.components.ellipse(radii = (d, y-w/2), layer = (1, 0))     UpperEllipse = gf.components.ellipse(radii = (d, y-w/2), layer = (1, 0))
     HalfPad = gf.boolean(LeftPad, UpperEllipse, operation = "A-B", layer = (1, 0))     HalfPad = gf.boolean(LeftPad, UpperEllipse, operation = "A-B", layer = (1, 0))
- 
     return HalfPad     return HalfPad
  
Line 15: Line 14:
     UpPad = CreateHalfPad(pad[0], pad[1], pad[2], pad[3])     UpPad = CreateHalfPad(pad[0], pad[1], pad[2], pad[3])
     DownPad = CreateHalfPad(pad[0], pad[1], pad[2], pad[3])     DownPad = CreateHalfPad(pad[0], pad[1], pad[2], pad[3])
- 
     AddedUpPad = pads.add_ref(UpPad)     AddedUpPad = pads.add_ref(UpPad)
     AddedDownPad = pads.add_ref(DownPad)     AddedDownPad = pads.add_ref(DownPad)
- 
     AddedDownPad.mirror()     AddedDownPad.mirror()
     AddedUpPad.rotate(180)     AddedUpPad.rotate(180)
     AddedUpPad.move([0, pad[0] -50])     AddedUpPad.move([0, pad[0] -50])
- 
     TotalPad = gf.boolean(AddedUpPad, AddedDownPad, operation = "xor", layer = (1, 0))     TotalPad = gf.boolean(AddedUpPad, AddedDownPad, operation = "xor", layer = (1, 0))
     return TotalPad     return TotalPad
Line 36: Line 32:
         layer=(1, 0),         layer=(1, 0),
     )     )
- 
     return snspd     return snspd
  
Line 43: Line 38:
     Comp_Pad1 = gf.Component() #Temporary building blocks     Comp_Pad1 = gf.Component() #Temporary building blocks
     Comp_Pad2 = gf.Component() #Temporary building blocks     Comp_Pad2 = gf.Component() #Temporary building blocks
- 
     SNSPDObj = CreateSNSPD(SNSPD[0], SNSPD[1], SNSPD[2], SNSPD[3], SNSPD[4], SNSPD[5])     SNSPDObj = CreateSNSPD(SNSPD[0], SNSPD[1], SNSPD[2], SNSPD[3], SNSPD[4], SNSPD[5])
- 
     SNSPDObjAdd = Comp_SNSPD.add_ref(SNSPDObj)     SNSPDObjAdd = Comp_SNSPD.add_ref(SNSPDObj)
     SNSPDObjAdd.move([SNSPD[2][0]/2 + (200-SNSPD[2][0])/4 , Pad[1]])     SNSPDObjAdd.move([SNSPD[2][0]/2 + (200-SNSPD[2][0])/4 , Pad[1]])
- 
     Pad1 = CreatePad(pad = Pad)     Pad1 = CreatePad(pad = Pad)
     Pad2 = CreatePad(pad = Pad)     Pad2 = CreatePad(pad = Pad)
- 
     Pad1.move([50, 0])     Pad1.move([50, 0])
- 
     #Pad 2 correction calculation     #Pad 2 correction calculation
     #if math.floor((SNSPD[2][0])/((SNSPD[1]*2))) % 2 == 0:     #if math.floor((SNSPD[2][0])/((SNSPD[1]*2))) % 2 == 0:
Line 60: Line 50:
     else:     else:
         correction = (round( (SNSPD[2][1])/(SNSPD[1]*2) )) * (SNSPD[1]*2)         correction = (round( (SNSPD[2][1])/(SNSPD[1]*2) )) * (SNSPD[1]*2)
- 
     if SNSPD[5] == False:     if SNSPD[5] == False:
         Pad2.rotate(180)         Pad2.rotate(180)
Line 67: Line 56:
         correction = (round( (SNSPD[2][1] - 1.3*SNSPD[1])/(SNSPD[1]*2 ))) * (SNSPD[1]*2) + SNSPD[1]         correction = (round( (SNSPD[2][1] - 1.3*SNSPD[1])/(SNSPD[1]*2 ))) * (SNSPD[1]*2) + SNSPD[1]
         Pad2.move([50, SNSPDObjAdd.ymin - SNSPDObjAdd.ymax + SNSPD[0]])         Pad2.move([50, SNSPDObjAdd.ymin - SNSPDObjAdd.ymax + SNSPD[0]])
- 
     Comp_SNSPD.add_ref(Pad1)     Comp_SNSPD.add_ref(Pad1)
     Comp_SNSPD.add_ref(Pad2)     Comp_SNSPD.add_ref(Pad2)
- 
     #Comp_Pad2.connect("o1", SNSPDObjAdd.ports["e2"], allow_layer_mismatch = True)     #Comp_Pad2.connect("o1", SNSPDObjAdd.ports["e2"], allow_layer_mismatch = True)
- 
     ConstructionTemp = gf.boolean(SNSPDObjAdd, Pad1, operation = "xor", layer = (1, 0))     ConstructionTemp = gf.boolean(SNSPDObjAdd, Pad1, operation = "xor", layer = (1, 0))
     Construction = gf.boolean(ConstructionTemp, Pad2, operation = "xor", layer = (1, 0))     Construction = gf.boolean(ConstructionTemp, Pad2, operation = "xor", layer = (1, 0))
- 
     Rect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))     Rect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))
     Rect1C = Comp_Pad1.add_ref(Rect1)     Rect1C = Comp_Pad1.add_ref(Rect1)
     Rect1C.move([-Pad[0] + 50, -10])     Rect1C.move([-Pad[0] + 50, -10])
- 
     Rect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))     Rect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))
     Rect2C = Comp_Pad1.add_ref(Rect2)     Rect2C = Comp_Pad1.add_ref(Rect2)
     Rect2C.move([-Pad[0] + 50, Pad[1] * 2 -10])     Rect2C.move([-Pad[0] + 50, Pad[1] * 2 -10])
- 
     Rect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0))     Rect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0))
     Rect3C = Comp_Pad1.add_ref(Rect3)     Rect3C = Comp_Pad1.add_ref(Rect3)
     Rect3C.move([-Pad[0] + 50, 0])     Rect3C.move([-Pad[0] + 50, 0])
- 
     Rect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0))     Rect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0))
     Rect4C = Comp_Pad1.add_ref(Rect4)     Rect4C = Comp_Pad1.add_ref(Rect4)
     Rect4C.move([-110, -10])     Rect4C.move([-110, -10])
- 
     Rect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0))     Rect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0))
     Rect5C = Comp_Pad1.add_ref(Rect5)     Rect5C = Comp_Pad1.add_ref(Rect5)
     Rect5C.move([-110, 360])     Rect5C.move([-110, 360])
- 
     correct = SNSPDObjAdd.ymin - SNSPDObjAdd.ymax + SNSPD[0]     correct = SNSPDObjAdd.ymin - SNSPDObjAdd.ymax + SNSPD[0]
- 
     SecondRect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))     SecondRect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))
     SecondRect1C = Comp_Pad1.add_ref(SecondRect1)     SecondRect1C = Comp_Pad1.add_ref(SecondRect1)
     SecondRect1C.move([-Pad[0] + 50, -10 + correct])     SecondRect1C.move([-Pad[0] + 50, -10 + correct])
- 
     SecondRect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))     SecondRect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0))
     SecondRect2C = Comp_Pad1.add_ref(SecondRect2)     SecondRect2C = Comp_Pad1.add_ref(SecondRect2)
     SecondRect2C.move([-Pad[0] + 50, Pad[1] * 2 -10 + correct])     SecondRect2C.move([-Pad[0] + 50, Pad[1] * 2 -10 + correct])
- 
     SecondRect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0))     SecondRect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0))
     SecondRect3C = Comp_Pad1.add_ref(SecondRect3)     SecondRect3C = Comp_Pad1.add_ref(SecondRect3)
     SecondRect3C.move([-Pad[0] + 50, correct])     SecondRect3C.move([-Pad[0] + 50, correct])
- 
     SecondRect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0))     SecondRect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0))
     SecondRect4C = Comp_Pad1.add_ref(SecondRect4)     SecondRect4C = Comp_Pad1.add_ref(SecondRect4)
     SecondRect4C.move([-110, -10 + correct])     SecondRect4C.move([-110, -10 + correct])
- 
     SecondRect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0))     SecondRect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0))
     SecondRect5C = Comp_Pad1.add_ref(SecondRect5)     SecondRect5C = Comp_Pad1.add_ref(SecondRect5)
     SecondRect5C.move([-110, 360 + correct])     SecondRect5C.move([-110, 360 + correct])
- 
     return Construction, Comp_Pad1     return Construction, Comp_Pad1
  
 def CreatePositiveStructure(Pad, SNSPD): def CreatePositiveStructure(Pad, SNSPD):
     c = gf.Component() #Temporary building blocks     c = gf.Component() #Temporary building blocks
- 
     SNSPDObj = CreateSNSPD(SNSPD[0], SNSPD[1], SNSPD[2], SNSPD[3], SNSPD[4], SNSPD[5])     SNSPDObj = CreateSNSPD(SNSPD[0], SNSPD[1], SNSPD[2], SNSPD[3], SNSPD[4], SNSPD[5])
- 
     SNSPDObjAdd = c.add_ref(SNSPDObj)     SNSPDObjAdd = c.add_ref(SNSPDObj)
     SNSPDObjAdd.move([SNSPD[2][0]/2 + (200-SNSPD[2][0])/4 , Pad[1]])     SNSPDObjAdd.move([SNSPD[2][0]/2 + (200-SNSPD[2][0])/4 , Pad[1]])
- 
     Pad1 = CreatePad(pad = Pad)     Pad1 = CreatePad(pad = Pad)
     Pad2 = CreatePad(pad = Pad)     Pad2 = CreatePad(pad = Pad)
- 
     Pad1.move([50, 0])     Pad1.move([50, 0])
- 
     #Pad 2 correction calculation     #Pad 2 correction calculation
     #if math.floor((SNSPD[2][0])/((SNSPD[1]*2))) % 2 == 0:     #if math.floor((SNSPD[2][0])/((SNSPD[1]*2))) % 2 == 0:
Line 139: Line 108:
     else:     else:
         correction = (round( (SNSPD[2][1])/(SNSPD[1]*2) )) * (SNSPD[1]*2)         correction = (round( (SNSPD[2][1])/(SNSPD[1]*2) )) * (SNSPD[1]*2)
- 
     Pad2.rotate(180)     Pad2.rotate(180)
     Pad2.move([50 + SNSPD[2][0], Pad[0] - 50 - correction])     Pad2.move([50 + SNSPD[2][0], Pad[0] - 50 - correction])
- 
     c.add_ref(Pad1)     c.add_ref(Pad1)
     c.add_ref(Pad2)     c.add_ref(Pad2)
- 
     ConstructionTemp = gf.boolean(SNSPDObjAdd, Pad1, operation = "xor", layer = (1, 0))     ConstructionTemp = gf.boolean(SNSPDObjAdd, Pad1, operation = "xor", layer = (1, 0))
     Construction = gf.boolean(ConstructionTemp, Pad2, operation = "xor", layer = (1, 0))     Construction = gf.boolean(ConstructionTemp, Pad2, operation = "xor", layer = (1, 0))
- 
     SNSPD_area = Construction.get_region(layer = (1, 0))     SNSPD_area = Construction.get_region(layer = (1, 0))
     SNSPD_outline = SNSPD_area.sized(200)     SNSPD_outline = SNSPD_area.sized(200)
- 
     Final_SNSPD = SNSPD_outline - SNSPD_area     Final_SNSPD = SNSPD_outline - SNSPD_area
- 
- 
- 
     return Final_SNSPD     return Final_SNSPD
  
Line 179: Line 140:
         SNSPD.name = (str(WireWidth[i]) + "nm width " + str(FillingFactor[j]) + " ff")         SNSPD.name = (str(WireWidth[i]) + "nm width " + str(FillingFactor[j]) + " ff")
         print(SNSPD.name)         print(SNSPD.name)
- 
         RectC = Temp.add_ref(Rect)         RectC = Temp.add_ref(Rect)
- 
         SNSPDNeg = c2.add_ref(SNSPD, name = (str(WireWidth[i]) + "nm width"))         SNSPDNeg = c2.add_ref(SNSPD, name = (str(WireWidth[i]) + "nm width"))
         SNSPDNeg.move([i* 1600, j*1600])         SNSPDNeg.move([i* 1600, j*1600])
gds_example.1764232876.txt.gz · Last modified: by alehen