quantcore-circuits 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. quantcore_circuits/__init__.py +57 -0
  2. quantcore_circuits/analysis/__init__.py +12 -0
  3. quantcore_circuits/analysis/_metal.py +70 -0
  4. quantcore_circuits/analysis/amplifiers.py +263 -0
  5. quantcore_circuits/analysis/circuits.py +117 -0
  6. quantcore_circuits/analysis/epr.py +231 -0
  7. quantcore_circuits/analysis/epr_lumped.py +372 -0
  8. quantcore_circuits/analysis/extract.py +119 -0
  9. quantcore_circuits/analysis/lom.py +80 -0
  10. quantcore_circuits/analysis/results.py +549 -0
  11. quantcore_circuits/analysis/store.py +81 -0
  12. quantcore_circuits/analysis/synthesis.py +118 -0
  13. quantcore_circuits/analysis/transmon.py +126 -0
  14. quantcore_circuits/assembly/__init__.py +17 -0
  15. quantcore_circuits/assembly/builder.py +127 -0
  16. quantcore_circuits/assembly/drc.py +683 -0
  17. quantcore_circuits/assembly/last_good.py +137 -0
  18. quantcore_circuits/assembly/netlist.py +174 -0
  19. quantcore_circuits/assembly/plan.py +605 -0
  20. quantcore_circuits/assembly/sidecar.py +270 -0
  21. quantcore_circuits/autotrack.py +605 -0
  22. quantcore_circuits/cards.py +878 -0
  23. quantcore_circuits/circuit/__init__.py +14 -0
  24. quantcore_circuits/circuit/adapters.py +305 -0
  25. quantcore_circuits/circuit/bridges.py +353 -0
  26. quantcore_circuits/circuit/consensus.py +158 -0
  27. quantcore_circuits/circuit/derive.py +28 -0
  28. quantcore_circuits/circuit/draw.py +198 -0
  29. quantcore_circuits/circuit/fill.py +828 -0
  30. quantcore_circuits/circuit/hamiltonian.py +193 -0
  31. quantcore_circuits/circuit/kinetic.py +102 -0
  32. quantcore_circuits/circuit/schema.py +139 -0
  33. quantcore_circuits/cli.py +1085 -0
  34. quantcore_circuits/codesign.py +1038 -0
  35. quantcore_circuits/data/selftest_q1_r1.json +44 -0
  36. quantcore_circuits/design/__init__.py +44 -0
  37. quantcore_circuits/design/io.py +98 -0
  38. quantcore_circuits/design/pyscript.py +395 -0
  39. quantcore_circuits/design/schema.py +398 -0
  40. quantcore_circuits/designer.py +625 -0
  41. quantcore_circuits/guiflow.py +991 -0
  42. quantcore_circuits/kqc_files.py +208 -0
  43. quantcore_circuits/layouts/__init__.py +118 -0
  44. quantcore_circuits/layouts/catalog.py +520 -0
  45. quantcore_circuits/layouts/chips/__init__.py +0 -0
  46. quantcore_circuits/layouts/chips/design_chip.py +325 -0
  47. quantcore_circuits/layouts/chips/frame.py +235 -0
  48. quantcore_circuits/layouts/junctions/__init__.py +0 -0
  49. quantcore_circuits/layouts/junctions/jj_fingers.py +99 -0
  50. quantcore_circuits/layouts/junctions/legacy_junctions.py +237 -0
  51. quantcore_circuits/layouts/junctions/sim_gap.py +48 -0
  52. quantcore_circuits/layouts/junctions/trilayer.py +541 -0
  53. quantcore_circuits/layouts/metal/__init__.py +105 -0
  54. quantcore_circuits/layouts/metal/component.py +332 -0
  55. quantcore_circuits/layouts/metal/geometry.py +462 -0
  56. quantcore_circuits/layouts/others/__init__.py +0 -0
  57. quantcore_circuits/layouts/others/amplifiers.py +1139 -0
  58. quantcore_circuits/layouts/others/bond_pad.py +119 -0
  59. quantcore_circuits/layouts/others/connector_pads.py +190 -0
  60. quantcore_circuits/layouts/others/couplers.py +21 -0
  61. quantcore_circuits/layouts/others/cpw_segment.py +131 -0
  62. quantcore_circuits/layouts/others/cpwe.py +661 -0
  63. quantcore_circuits/layouts/others/keepout.py +66 -0
  64. quantcore_circuits/layouts/others/legacy_resonators.py +645 -0
  65. quantcore_circuits/layouts/others/markers.py +201 -0
  66. quantcore_circuits/layouts/others/qpdk_cells.py +263 -0
  67. quantcore_circuits/layouts/others/shapes.py +114 -0
  68. quantcore_circuits/layouts/others/spirals.py +140 -0
  69. quantcore_circuits/layouts/others/sqdmetal_cells.py +90 -0
  70. quantcore_circuits/layouts/others/test_pads.py +461 -0
  71. quantcore_circuits/layouts/ports.py +119 -0
  72. quantcore_circuits/layouts/qubits/__init__.py +0 -0
  73. quantcore_circuits/layouts/qubits/legacy_transmon.py +124 -0
  74. quantcore_circuits/layouts/qubits/qpdk_cells.py +374 -0
  75. quantcore_circuits/layouts/qubits/sqdmetal_cells.py +376 -0
  76. quantcore_circuits/layouts/qubits/trilayer_concentric.py +65 -0
  77. quantcore_circuits/layouts/qubits/xmon.py +375 -0
  78. quantcore_circuits/layouts/registry.py +418 -0
  79. quantcore_circuits/layouts/wafers/__init__.py +0 -0
  80. quantcore_circuits/layouts/wafers/fab_export.py +454 -0
  81. quantcore_circuits/layouts/wafers/legacy_wafer.py +111 -0
  82. quantcore_circuits/layouts/wafers/wafer.py +469 -0
  83. quantcore_circuits/live/__init__.py +6 -0
  84. quantcore_circuits/live/klayout.py +225 -0
  85. quantcore_circuits/live/klive.py +61 -0
  86. quantcore_circuits/live/snapshot.py +185 -0
  87. quantcore_circuits/live/watch.py +93 -0
  88. quantcore_circuits/lom/__init__.py +15 -0
  89. quantcore_circuits/lom/builder.py +932 -0
  90. quantcore_circuits/lom/calibration.py +82 -0
  91. quantcore_circuits/lom/estimates.py +235 -0
  92. quantcore_circuits/lom/fragment.py +421 -0
  93. quantcore_circuits/lom/kqc_models.py +734 -0
  94. quantcore_circuits/lom/metal_models.py +917 -0
  95. quantcore_circuits/lom/quantcore_models.py +784 -0
  96. quantcore_circuits/lom/simulate.py +636 -0
  97. quantcore_circuits/lom/synthesize.py +189 -0
  98. quantcore_circuits/loop.py +610 -0
  99. quantcore_circuits/optimise.py +423 -0
  100. quantcore_circuits/pdk/__init__.py +451 -0
  101. quantcore_circuits/plots.py +876 -0
  102. quantcore_circuits/plugins.py +69 -0
  103. quantcore_circuits/review/__init__.py +57 -0
  104. quantcore_circuits/review/server.py +251 -0
  105. quantcore_circuits/review/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  106. quantcore_circuits/review/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  107. quantcore_circuits/review/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  108. quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  109. quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  110. quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  111. quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  112. quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  113. quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  114. quantcore_circuits/review/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  115. quantcore_circuits/review/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  116. quantcore_circuits/review/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  117. quantcore_circuits/review/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  118. quantcore_circuits/review/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  119. quantcore_circuits/review/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  120. quantcore_circuits/review/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  121. quantcore_circuits/review/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  122. quantcore_circuits/review/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  123. quantcore_circuits/review/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  124. quantcore_circuits/review/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  125. quantcore_circuits/review/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  126. quantcore_circuits/review/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  127. quantcore_circuits/review/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  128. quantcore_circuits/review/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  129. quantcore_circuits/review/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  130. quantcore_circuits/review/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  131. quantcore_circuits/review/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  132. quantcore_circuits/review/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  133. quantcore_circuits/review/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  134. quantcore_circuits/review/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  135. quantcore_circuits/review/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  136. quantcore_circuits/review/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  137. quantcore_circuits/review/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  138. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  139. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  140. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  141. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  142. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  143. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  144. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  145. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  146. quantcore_circuits/review/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  147. quantcore_circuits/review/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  148. quantcore_circuits/review/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  149. quantcore_circuits/review/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  150. quantcore_circuits/review/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  151. quantcore_circuits/review/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  152. quantcore_circuits/review/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  153. quantcore_circuits/review/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  154. quantcore_circuits/review/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  155. quantcore_circuits/review/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  156. quantcore_circuits/review/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  157. quantcore_circuits/review/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  158. quantcore_circuits/review/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  159. quantcore_circuits/review/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  160. quantcore_circuits/review/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  161. quantcore_circuits/review/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  162. quantcore_circuits/review/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  163. quantcore_circuits/review/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  164. quantcore_circuits/review/static/assets/index-CDHdrFyA.css +1 -0
  165. quantcore_circuits/review/static/assets/index-CSx05Og4.js +409 -0
  166. quantcore_circuits/review/static/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
  167. quantcore_circuits/review/static/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
  168. quantcore_circuits/review/static/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
  169. quantcore_circuits/review/static/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
  170. quantcore_circuits/review/static/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
  171. quantcore_circuits/review/static/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
  172. quantcore_circuits/review/static/assets/inter-cyrillic-700-normal-CjBOestx.woff2 +0 -0
  173. quantcore_circuits/review/static/assets/inter-cyrillic-700-normal-DrXBdSj3.woff +0 -0
  174. quantcore_circuits/review/static/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
  175. quantcore_circuits/review/static/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
  176. quantcore_circuits/review/static/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
  177. quantcore_circuits/review/static/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
  178. quantcore_circuits/review/static/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
  179. quantcore_circuits/review/static/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
  180. quantcore_circuits/review/static/assets/inter-cyrillic-ext-700-normal-BjwYoWNd.woff2 +0 -0
  181. quantcore_circuits/review/static/assets/inter-cyrillic-ext-700-normal-LO58E6JB.woff +0 -0
  182. quantcore_circuits/review/static/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
  183. quantcore_circuits/review/static/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
  184. quantcore_circuits/review/static/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
  185. quantcore_circuits/review/static/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
  186. quantcore_circuits/review/static/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
  187. quantcore_circuits/review/static/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
  188. quantcore_circuits/review/static/assets/inter-greek-700-normal-BUv2fZ6O.woff +0 -0
  189. quantcore_circuits/review/static/assets/inter-greek-700-normal-C3JjAnD8.woff2 +0 -0
  190. quantcore_circuits/review/static/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
  191. quantcore_circuits/review/static/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
  192. quantcore_circuits/review/static/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
  193. quantcore_circuits/review/static/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
  194. quantcore_circuits/review/static/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
  195. quantcore_circuits/review/static/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
  196. quantcore_circuits/review/static/assets/inter-greek-ext-700-normal-BoQ6DsYi.woff +0 -0
  197. quantcore_circuits/review/static/assets/inter-greek-ext-700-normal-qfdV9bQt.woff2 +0 -0
  198. quantcore_circuits/review/static/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  199. quantcore_circuits/review/static/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  200. quantcore_circuits/review/static/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  201. quantcore_circuits/review/static/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  202. quantcore_circuits/review/static/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
  203. quantcore_circuits/review/static/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  204. quantcore_circuits/review/static/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
  205. quantcore_circuits/review/static/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  206. quantcore_circuits/review/static/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
  207. quantcore_circuits/review/static/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
  208. quantcore_circuits/review/static/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
  209. quantcore_circuits/review/static/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
  210. quantcore_circuits/review/static/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
  211. quantcore_circuits/review/static/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
  212. quantcore_circuits/review/static/assets/inter-latin-ext-700-normal-Ca8adRJv.woff2 +0 -0
  213. quantcore_circuits/review/static/assets/inter-latin-ext-700-normal-TidjK2hL.woff +0 -0
  214. quantcore_circuits/review/static/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
  215. quantcore_circuits/review/static/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  216. quantcore_circuits/review/static/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
  217. quantcore_circuits/review/static/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
  218. quantcore_circuits/review/static/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
  219. quantcore_circuits/review/static/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
  220. quantcore_circuits/review/static/assets/inter-vietnamese-700-normal-BZaoP0fm.woff +0 -0
  221. quantcore_circuits/review/static/assets/inter-vietnamese-700-normal-DlLaEgI2.woff2 +0 -0
  222. quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  223. quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  224. quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
  225. quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
  226. quantcore_circuits/review/static/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  227. quantcore_circuits/review/static/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  228. quantcore_circuits/review/static/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
  229. quantcore_circuits/review/static/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
  230. quantcore_circuits/review/static/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  231. quantcore_circuits/review/static/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  232. quantcore_circuits/review/static/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  233. quantcore_circuits/review/static/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  234. quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  235. quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  236. quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  237. quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
  238. quantcore_circuits/review/static/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  239. quantcore_circuits/review/static/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
  240. quantcore_circuits/review/static/index.html +14 -0
  241. quantcore_circuits/review/static/logo-quantcore-black.png +0 -0
  242. quantcore_circuits/review/static/logo-quantcore-white.png +0 -0
  243. quantcore_circuits/review/static/sample/chip.png +0 -0
  244. quantcore_circuits/review/static/sample/chip_rev1.png +0 -0
  245. quantcore_circuits/review/static/sample/q1.png +0 -0
  246. quantcore_circuits/review/static/sample/q2.png +0 -0
  247. quantcore_circuits/review/static/sample-state.json +3747 -0
  248. quantcore_circuits/route/__init__.py +5 -0
  249. quantcore_circuits/route/router.py +694 -0
  250. quantcore_circuits/route/waveguide.py +187 -0
  251. quantcore_circuits/selftest.py +224 -0
  252. quantcore_circuits/sim_tools/__init__.py +6 -0
  253. quantcore_circuits/sim_tools/aedt_attach.py +66 -0
  254. quantcore_circuits/sim_tools/aedt_progress.py +224 -0
  255. quantcore_circuits/sim_tools/aedt_project.py +302 -0
  256. quantcore_circuits/sim_tools/aedt_scripts.py +397 -0
  257. quantcore_circuits/sim_tools/aedt_session.py +275 -0
  258. quantcore_circuits/sim_tools/ansys.py +90 -0
  259. quantcore_circuits/sim_tools/builder.py +1690 -0
  260. quantcore_circuits/sim_tools/export.py +470 -0
  261. quantcore_circuits/sim_tools/geometry_check.py +342 -0
  262. quantcore_circuits/sim_tools/hfss.py +583 -0
  263. quantcore_circuits/sim_tools/palace.py +197 -0
  264. quantcore_circuits/sim_tools/runner.py +179 -0
  265. quantcore_circuits/sim_tools/subset.py +364 -0
  266. quantcore_circuits/track.py +671 -0
  267. quantcore_circuits-0.0.1.dist-info/METADATA +204 -0
  268. quantcore_circuits-0.0.1.dist-info/RECORD +272 -0
  269. quantcore_circuits-0.0.1.dist-info/WHEEL +5 -0
  270. quantcore_circuits-0.0.1.dist-info/entry_points.txt +2 -0
  271. quantcore_circuits-0.0.1.dist-info/licenses/LICENSE +674 -0
  272. quantcore_circuits-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,461 @@
1
+ """Junction test structures (ported from the QWri ``testPad*.py`` / ``xtp_testpads_TL_small.py`` scripts).
2
+
3
+ * :class:`JunctionTestPads`: two probe pads facing each other across a 20 µm junction window, with a trilayer
4
+ junction (straight + bent finger) between the triangular pad tips. One class covers the four legacy scripts;
5
+ :func:`legacy_test_pad_params` gives each script's parameters (``testPad_AVAQUS`` chips 01–02, ``testPad_Nb_TL``
6
+ chip 04, ``testPad_Nb_TL_HSQ`` chips 05/06/08, ``xtp_testpads_TL_small`` chip 10a).
7
+ * :class:`JunctionGroundPad`: one rounded 400 µm pad in a 500 µm etch window, joined to ground by a 50 µm bridge
8
+ carrying the junction (legacy ``testPad.py``, chips 01–02).
9
+
10
+ Frame: pad structure centred at the origin (legacy frame); the junction sits at the origin (``JunctionGroundPad``:
11
+ at ``junction_y`` on the bridge). Layers (fab mode): legacy 1/0 → ``base_metal_gap_wo_grid``, 2/0 (straight
12
+ finger) → ``SIS_junction``, 4/0 (bent finger) → ``SIS_junction_2``, 500/0 → qcc ``hsq`` (+ the 51–53/0 spacer
13
+ gradient, on by default: :func:`~quantcore_circuits.layouts.junctions.trilayer.spacer_gradient_levels`). The legacy
14
+ scripts also draw a separate 3/0 pattern (the other pad kept in the second metal); the Quantcore stack derives 3/0
15
+ from 1/0 at export, so it is not drawn — :func:`junction_test_pad_regions` / :func:`junction_ground_pad_regions`
16
+ still return it (``"m3"``). No ports: these are probe structures; refpoints mark the pads and the junction.
17
+ """
18
+
19
+ from kqcircuits.elements.element import Element
20
+ from kqcircuits.pya_resolver import pya
21
+ from kqcircuits.util.parameters import Param, pdt
22
+
23
+ from quantcore_circuits.layouts.junctions.legacy_junctions import coerced_bent_finger, coerced_straight_finger
24
+ from quantcore_circuits.layouts.junctions.trilayer import _PROCESS, insert_spacer
25
+
26
+
27
+ def junction_test_pad_regions(
28
+ dbu,
29
+ upper_pad_width=500,
30
+ upper_pad_height=400,
31
+ lower_pad_width=500,
32
+ lower_pad_height=400,
33
+ middle_height=300,
34
+ box_extra=100,
35
+ box_height=0,
36
+ upper_pad_trim=50,
37
+ lower_pad_trim=50,
38
+ junction_width=20,
39
+ junction_height=20,
40
+ finger_origin=5,
41
+ finger_width=0.5,
42
+ second_finger_width=0.6,
43
+ straight_finger_y=-2.4,
44
+ straight_pad_width=1.2,
45
+ straight_finger_length=3,
46
+ bent_finger_x=0.2,
47
+ bent_finger_y=-3.4,
48
+ bent_pad_width=1.6,
49
+ bent_finger_length=3,
50
+ bent_conn_height=0.5,
51
+ with_hsq=True,
52
+ hsq_width=0.2,
53
+ hsq_overlap=0.045,
54
+ hsq_y_offset=-0.85,
55
+ hsq_extra_low=0.1,
56
+ hsq_extra_high=0.2,
57
+ label="",
58
+ label_size=100,
59
+ label_pos=(-140, 400),
60
+ ) -> dict:
61
+ """Legacy ``create_testPad`` geometry in dbu: ``{"m1", "m3", "straight", "bent", "hsq"}`` Regions."""
62
+ gw, gh, tw, th, mh = upper_pad_width, upper_pad_height, lower_pad_width, lower_pad_height, middle_height
63
+ total = box_height or (gh + mh + th)
64
+ pad_box = pya.Polygon(
65
+ pya.Box((-gw - box_extra) / dbu / 2, -total / 2 / dbu, (gw + box_extra) / dbu / 2, total / dbu / 2)
66
+ )
67
+ pad1 = pya.Polygon(pya.Box(-gw / dbu / 2, mh / dbu / 2, gw / dbu / 2, (gh + (mh / 2) - upper_pad_trim) / dbu))
68
+ pad2 = pya.Polygon(pya.Box(-tw / dbu / 2, -mh / dbu / 2, tw / dbu / 2, (-mh / 2 - th + lower_pad_trim) / dbu))
69
+ p1 = pya.Point(-gw / dbu / 2, mh / 2 / dbu)
70
+ p2 = pya.Point(gw / dbu / 2, mh / 2 / dbu)
71
+ p3 = pya.Point(0 / dbu, finger_origin / dbu)
72
+ t1 = pya.Polygon([p1, p2, p3])
73
+ t2 = pya.Polygon([pya.Point(p1.x, -p1.y), pya.Point(p2.x, -p2.y), pya.Point(p3.x, -p3.y)])
74
+ cutout = pya.Polygon(
75
+ pya.Box(
76
+ -junction_width / 2 / dbu, -junction_height / dbu / 2, junction_width / 2 / dbu, junction_height / dbu / 2
77
+ )
78
+ )
79
+ m1 = pya.Region(pad_box) - pya.Region(pad1) - pya.Region(t1) - pya.Region(cutout)
80
+ m3 = pya.Region(pad_box) - pya.Region(pad2) - pya.Region(t2) - pya.Region(cutout)
81
+ jw, jh = junction_width + 1, junction_height + 1
82
+ straight = coerced_straight_finger(
83
+ dbu, straight_pad_width, 3, finger_width, straight_finger_length, jw, jh, 0, straight_finger_y
84
+ ).transformed(pya.Trans(0, True, 0, 0))
85
+ bent = coerced_bent_finger(
86
+ dbu,
87
+ bent_pad_width,
88
+ second_finger_width,
89
+ bent_finger_length,
90
+ bent_conn_height,
91
+ jw,
92
+ jh,
93
+ bent_finger_x,
94
+ bent_finger_y,
95
+ False,
96
+ )
97
+ straight -= pya.Region(t1)
98
+ bent -= pya.Region(t2)
99
+ hsq = pya.Region()
100
+ if with_hsq:
101
+ lx = -finger_width / 2 - hsq_width + hsq_overlap
102
+ rx = finger_width / 2 - hsq_overlap
103
+ y0 = (-second_finger_width + hsq_y_offset - hsq_extra_low) / dbu / 2
104
+ y1 = (second_finger_width + hsq_y_offset + hsq_extra_high) / dbu / 2
105
+ hsq.insert(pya.Box(lx / dbu, y0, (lx + hsq_width) / dbu, y1))
106
+ hsq.insert(pya.Box(rx / dbu, y0, (rx + hsq_width) / dbu, y1))
107
+ if label:
108
+ text = pya.TextGenerator.default_generator().text(label, dbu, label_size, False)
109
+ m1 += text.transformed(pya.Trans(0, False, label_pos[0] / dbu, label_pos[1] / dbu))
110
+ return {"m1": m1, "m3": m3, "straight": straight, "bent": bent, "hsq": hsq}
111
+
112
+
113
+ def legacy_test_pad_params(variant: str, size: float = 1.0, second_finger: float = 0.0) -> dict:
114
+ """:class:`JunctionTestPads` parameters reproducing legacy ``<variant>.create_testPad(size, second_finger)``.
115
+
116
+ ``size`` is the legacy junction size (straight finger ``0.2·size`` µm); ``second_finger`` the bent-finger width in
117
+ µm (0 → same as the straight finger; the legacy scripts fail in that case).
118
+ """
119
+ second = second_finger or round(0.2 * size, 6)
120
+ common = {"finger_width": 0.2 * size, "second_finger_width": second}
121
+ presets = {
122
+ "testPad_AVAQUS": {
123
+ "upper_pad_width": 200,
124
+ "upper_pad_height": 300,
125
+ "lower_pad_width": 200,
126
+ "lower_pad_height": 300,
127
+ "middle_height": 100,
128
+ "upper_pad_trim": 0,
129
+ "finger_width": (0.2 * size) + 0.06,
130
+ "second_finger_width": 0.2 * size,
131
+ "with_hsq": False,
132
+ "label": str(int(0.2 * size * 1000)) + "NM",
133
+ },
134
+ "testPad_Nb_TL": {
135
+ "upper_pad_height": 300,
136
+ "lower_pad_height": 300,
137
+ "upper_pad_trim": 0,
138
+ "finger_width": (0.2 * size) + 0.06,
139
+ "with_hsq": False,
140
+ },
141
+ "testPad_Nb_TL_HSQ": {},
142
+ "xtp_testpads_TL_small": {
143
+ "upper_pad_width": 150,
144
+ "upper_pad_height": 175,
145
+ "lower_pad_width": 150,
146
+ "lower_pad_height": 175,
147
+ "middle_height": 75,
148
+ "box_extra": 25,
149
+ "box_height": 175 + 75 / 4 + 175,
150
+ "hsq_extra_low": 0.3,
151
+ "hsq_extra_high": 0.3,
152
+ },
153
+ }
154
+ if variant not in presets:
155
+ raise ValueError(f"unknown legacy test pad {variant!r}; variants: {sorted(presets)}")
156
+ return {**common, **presets[variant]}
157
+
158
+
159
+ class JunctionTestPads(Element):
160
+ """Two probe pads with a trilayer junction between their tips (legacy ``testPad_*`` / ``xtp_testpads``)."""
161
+
162
+ qcc_category = "test_structure"
163
+
164
+ upper_pad_width = Param(pdt.TypeDouble, "Upper pad width", 500, unit="μm")
165
+ upper_pad_height = Param(pdt.TypeDouble, "Upper pad height", 400, unit="μm")
166
+ lower_pad_width = Param(pdt.TypeDouble, "Lower pad width", 500, unit="μm")
167
+ lower_pad_height = Param(pdt.TypeDouble, "Lower pad height", 400, unit="μm")
168
+ middle_height = Param(pdt.TypeDouble, "Distance between the pads (junction region)", 300, unit="μm")
169
+ box_extra = Param(pdt.TypeDouble, "Etch window wider than the upper pad by", 100, unit="μm")
170
+ box_height = Param(pdt.TypeDouble, "Etch window height (0 = pads + middle)", 0, unit="μm")
171
+ upper_pad_trim = Param(pdt.TypeDouble, "Upper pad shortened by (towards the window edge)", 50, unit="μm")
172
+ lower_pad_trim = Param(pdt.TypeDouble, "Lower pad shortened by (towards the window edge)", 50, unit="μm")
173
+ junction_width = Param(pdt.TypeDouble, "Junction window width", 20, unit="μm")
174
+ junction_height = Param(pdt.TypeDouble, "Junction window height", 20, unit="μm")
175
+ finger_origin = Param(pdt.TypeDouble, "Pad tip distance from the junction", 5, unit="μm")
176
+ finger_width = Param(pdt.TypeDouble, "Straight finger width", 0.5, unit="μm")
177
+ second_finger_width = Param(pdt.TypeDouble, "Bent finger width", 0.6, unit="μm")
178
+ straight_finger_y = Param(pdt.TypeDouble, "Straight finger offset (legacy y)", -2.4, unit="μm")
179
+ straight_pad_width = Param(pdt.TypeDouble, "Straight finger lead width", 1.2, unit="μm")
180
+ straight_finger_length = Param(pdt.TypeDouble, "Straight finger length", 3, unit="μm")
181
+ bent_finger_x = Param(pdt.TypeDouble, "Bent finger offset (legacy x)", 0.2, unit="μm")
182
+ bent_finger_y = Param(pdt.TypeDouble, "Bent finger offset (legacy y)", -3.4, unit="μm")
183
+ bent_pad_width = Param(pdt.TypeDouble, "Bent finger lead width", 1.6, unit="μm")
184
+ bent_finger_length = Param(pdt.TypeDouble, "Bent finger length", 3, unit="μm")
185
+ bent_conn_height = Param(pdt.TypeDouble, "Bent finger connection height", 0.5, unit="μm")
186
+ with_hsq = Param(pdt.TypeBoolean, "Draw HSQ sidewall boxes", True)
187
+ hsq_width = Param(pdt.TypeDouble, "HSQ box width", 0.2, unit="μm")
188
+ hsq_overlap = Param(pdt.TypeDouble, "HSQ overlap onto the finger", 0.045, unit="μm")
189
+ hsq_y_offset = Param(pdt.TypeDouble, "HSQ box centre offset (legacy y_off)", -0.85, unit="μm")
190
+ hsq_extra_low = Param(pdt.TypeDouble, "HSQ box extra length below", 0.1, unit="μm")
191
+ hsq_extra_high = Param(pdt.TypeDouble, "HSQ box extra length above", 0.2, unit="μm")
192
+ spacer_gradient = Param(
193
+ pdt.TypeBoolean,
194
+ "Spacer gradient: 51–53/0 dose levels inside the HSQ (width / 3 strips)",
195
+ _PROCESS.spacer_gradient,
196
+ )
197
+ label = Param(pdt.TypeString, "Text etched above the pads (empty = none)", "")
198
+ label_size = Param(pdt.TypeDouble, "Label height", 100, unit="μm")
199
+ label_pos = Param(pdt.TypeList, "Label position [x, y]", [-140, 400], unit="μm")
200
+
201
+ _NAMES = (
202
+ "upper_pad_width upper_pad_height lower_pad_width lower_pad_height middle_height box_extra box_height "
203
+ "upper_pad_trim lower_pad_trim junction_width junction_height finger_origin finger_width "
204
+ "second_finger_width straight_finger_y straight_pad_width straight_finger_length bent_finger_x "
205
+ "bent_finger_y bent_pad_width bent_finger_length bent_conn_height with_hsq hsq_width hsq_overlap "
206
+ "hsq_y_offset hsq_extra_low hsq_extra_high label label_size"
207
+ ).split()
208
+
209
+ def _regions(self) -> dict:
210
+ params = {n: getattr(self, n) for n in self._NAMES}
211
+ pos = (float(self.label_pos[0]), float(self.label_pos[1]))
212
+ return junction_test_pad_regions(self.layout.dbu, **params, label_pos=pos)
213
+
214
+ @classmethod
215
+ def qcc_keepout(cls, params: dict) -> list:
216
+ """3/0 keep-out (local µm): the legacy scripts' own 3/0 pattern (``m3``: the pad structure, the other pad
217
+ kept in the second metal)."""
218
+ from quantcore_circuits.layouts.others.keepout import as_cell, dpolygons # pylint: disable=C0415
219
+
220
+ return dpolygons(cls._regions(as_cell(cls, params))["m3"])
221
+
222
+ def build(self):
223
+ dbu = self.layout.dbu
224
+ regions = self._regions()
225
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(regions["m1"])
226
+ self.cell.shapes(self.get_layer("SIS_junction")).insert(regions["straight"])
227
+ self.cell.shapes(self.get_layer("SIS_junction_2")).insert(regions["bent"])
228
+ insert_spacer(
229
+ self.cell, self.layout, regions["hsq"], self.spacer_gradient, [pya.DPoint(0, self.hsq_y_offset / 2)]
230
+ )
231
+ self.add_protection(pya.Region(regions["m1"].bbox()).sized(self.margin / dbu))
232
+ mh = self.middle_height
233
+ self.refpoints["junction"] = pya.DPoint(0, 0)
234
+ self.refpoints["upper_pad"] = pya.DPoint(0, (mh / 2 + self.upper_pad_height + mh / 2 - self.upper_pad_trim) / 2)
235
+ self.refpoints["lower_pad"] = pya.DPoint(
236
+ 0, -(mh / 2 + self.lower_pad_height + mh / 2 - self.lower_pad_trim) / 2
237
+ )
238
+
239
+
240
+ def junction_ground_pad_regions(
241
+ dbu,
242
+ box_size=500,
243
+ pad_size=400,
244
+ pad_r_inner=40,
245
+ pad_r_outer=20,
246
+ corner_points=64,
247
+ bridge_width=50,
248
+ junction_y=-225,
249
+ finger_width=0.26,
250
+ second_finger_width=0.2,
251
+ straight_finger_y=-2,
252
+ straight_pad_width=1.2,
253
+ straight_finger_length=3,
254
+ straight_window=(52, 50),
255
+ bent_finger_y=-4,
256
+ bent_pad_width=1,
257
+ bent_finger_length=3,
258
+ bent_conn_height=0.5,
259
+ bent_window=(52, 49),
260
+ bent_offset=1,
261
+ ) -> dict:
262
+ """Legacy ``testPad.create_testPad`` geometry in dbu: ``{"m1", "m3", "straight", "bent"}`` Regions."""
263
+ pad_box = pya.Polygon(pya.Box(-box_size / dbu / 2, -box_size / dbu / 2, box_size / dbu / 2, box_size / dbu / 2))
264
+ pad = pya.Polygon(pya.Box(-pad_size / dbu / 2, -pad_size / dbu / 2, pad_size / dbu / 2, pad_size / dbu / 2))
265
+ pad = pad.round_corners(pad_r_inner / dbu, pad_r_outer / dbu, corner_points)
266
+ cutout = pya.Polygon(
267
+ pya.Box(-bridge_width / 2 / dbu, -box_size / dbu / 2, bridge_width / 2 / dbu, -pad_size / dbu / 2)
268
+ )
269
+ m1 = pya.Region(pad_box) - pya.Region(pad) - pya.Region(cutout)
270
+ m3 = pya.Region(pad_box) - pya.Region(cutout)
271
+ straight = coerced_straight_finger(
272
+ dbu,
273
+ straight_pad_width,
274
+ 3,
275
+ finger_width,
276
+ straight_finger_length,
277
+ straight_window[0],
278
+ straight_window[1],
279
+ 0,
280
+ straight_finger_y,
281
+ ).transformed(pya.Trans(0, True, 0 / dbu, junction_y / dbu))
282
+ bent = coerced_bent_finger(
283
+ dbu,
284
+ bent_pad_width,
285
+ second_finger_width,
286
+ bent_finger_length,
287
+ bent_conn_height,
288
+ bent_window[0],
289
+ bent_window[1],
290
+ 0,
291
+ bent_finger_y,
292
+ False,
293
+ ).transformed(pya.Trans(0, False, 0 / dbu, (junction_y + bent_offset) / dbu))
294
+ return {"m1": m1, "m3": m3, "straight": straight, "bent": bent}
295
+
296
+
297
+ class JunctionGroundPad(Element):
298
+ """Rounded probe pad joined to ground by a bridge carrying a trilayer junction (legacy ``testPad.py``)."""
299
+
300
+ qcc_category = "test_structure"
301
+
302
+ box_size = Param(pdt.TypeDouble, "Etch window size", 500, unit="μm")
303
+ pad_size = Param(pdt.TypeDouble, "Pad size", 400, unit="μm")
304
+ pad_r_inner = Param(pdt.TypeDouble, "Pad inner corner radius", 40, unit="μm")
305
+ pad_r_outer = Param(pdt.TypeDouble, "Pad outer corner radius", 20, unit="μm")
306
+ corner_points = Param(pdt.TypeInt, "Points per full circle of the pad corners", 64)
307
+ bridge_width = Param(pdt.TypeDouble, "Width of the bridge to ground", 50, unit="μm")
308
+ junction_y = Param(pdt.TypeDouble, "Junction position on the bridge (y)", -225, unit="μm")
309
+ finger_width = Param(pdt.TypeDouble, "Straight finger width (legacy 0.2·size + 0.06)", 0.26, unit="μm")
310
+ second_finger_width = Param(pdt.TypeDouble, "Bent finger width", 0.2, unit="μm")
311
+
312
+ def _regions(self) -> dict:
313
+ return junction_ground_pad_regions(
314
+ self.layout.dbu,
315
+ box_size=self.box_size,
316
+ pad_size=self.pad_size,
317
+ pad_r_inner=self.pad_r_inner,
318
+ pad_r_outer=self.pad_r_outer,
319
+ corner_points=self.corner_points,
320
+ bridge_width=self.bridge_width,
321
+ junction_y=self.junction_y,
322
+ finger_width=self.finger_width,
323
+ second_finger_width=self.second_finger_width,
324
+ )
325
+
326
+ @classmethod
327
+ def qcc_keepout(cls, params: dict) -> list:
328
+ """3/0 keep-out (local µm): the legacy ``testPad.py`` 3/0 (the etch window minus the ground bridge)."""
329
+ from quantcore_circuits.layouts.others.keepout import as_cell, dpolygons # pylint: disable=C0415
330
+
331
+ return dpolygons(cls._regions(as_cell(cls, params))["m3"])
332
+
333
+ def build(self):
334
+ dbu = self.layout.dbu
335
+ regions = self._regions()
336
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(regions["m1"])
337
+ self.cell.shapes(self.get_layer("SIS_junction")).insert(regions["straight"])
338
+ self.cell.shapes(self.get_layer("SIS_junction_2")).insert(regions["bent"])
339
+ self.add_protection(pya.Region(regions["m1"].bbox()).sized(self.margin / dbu))
340
+ self.refpoints["pad_center"] = pya.DPoint(0, 0)
341
+ self.refpoints["junction"] = pya.DPoint(0, self.junction_y)
342
+
343
+
344
+ def probe_pad_pair_regions(
345
+ dbu,
346
+ pad_width=500.0,
347
+ upper_pad_height=400.0,
348
+ lower_pad_height=400.0,
349
+ middle_height=200.0,
350
+ window_extra=100.0,
351
+ pad_trim=50.0,
352
+ cutout=11.0,
353
+ tip_width=5.0,
354
+ tip_y=6.0,
355
+ tip_apex=4.5,
356
+ ) -> dict:
357
+ """Legacy ``chip_11m_TestJJ16x_pads.create_testPad`` pads (commented out there), in dbu: ``{"m1", "m3"}`` —
358
+ 1/0 = window − upper pad − its tip triangle − centre cut-out, 3/0 = window − lower pad − its triangle − cut-out."""
359
+ h = upper_pad_height + middle_height + lower_pad_height
360
+ window = pya.Polygon(
361
+ pya.Box((-pad_width - window_extra) / dbu / 2, -h / 2 / dbu, (pad_width + window_extra) / dbu / 2, h / dbu / 2)
362
+ )
363
+ pad1 = pya.Polygon(
364
+ pya.Box(
365
+ -pad_width / dbu / 2,
366
+ middle_height / dbu / 2,
367
+ pad_width / dbu / 2,
368
+ (upper_pad_height + middle_height / 2 - pad_trim) / dbu,
369
+ )
370
+ )
371
+ pad2 = pya.Polygon(
372
+ pya.Box(
373
+ -pad_width / dbu / 2,
374
+ -middle_height / dbu / 2,
375
+ pad_width / dbu / 2,
376
+ (-middle_height / 2 - lower_pad_height + pad_trim) / dbu,
377
+ )
378
+ )
379
+ p1 = pya.Point(-tip_width / dbu / 2, tip_y / dbu)
380
+ p2 = pya.Point(tip_width / dbu / 2, tip_y / dbu)
381
+ p3 = pya.Point(0 / dbu, tip_apex / dbu)
382
+ t1 = pya.Polygon([p1, p2, p3])
383
+ t2 = pya.Polygon([pya.Point(p1.x, -p1.y), pya.Point(p2.x, -p2.y), pya.Point(p3.x, -p3.y)])
384
+ cut = pya.Polygon(pya.Box(-cutout / 2 / dbu, -cutout / dbu / 2, cutout / 2 / dbu, cutout / dbu / 2))
385
+ m1 = pya.Region(window) - pya.Region(pad1) - pya.Region(t1) - cut
386
+ m3 = pya.Region(window) - pya.Region(pad2) - pya.Region(t2) - cut
387
+ return {"m1": m1, "m3": m3}
388
+
389
+
390
+ class ProbePadPair(Element):
391
+ """Probe-pad pair of the chip_11m junction test array (legacy ``chip_11m_TestJJ16x_pads.create_testPad``, whose
392
+ pads are commented out there; chip_11f lands the ``JX_500`` junctions on such pads).
393
+
394
+ A ``pad_width + window_extra`` × (pads + ``middle_height``) window: the upper pad is kept in the base metal (1/0
395
+ = window − upper pad − its tip − the centre ``cutout``), the lower pad in the second metal (the legacy 3/0 =
396
+ window − lower pad − its tip − cut-out, returned by :meth:`qcc_keepout`). At the legacy sizes the pads end
397
+ ``middle_height / 2`` (100 µm) from the junction, as drawn; set ``middle_height`` to the cut-out height (11 µm)
398
+ to bring them to it. ``junction_type`` ``"Trilayer Junction Compact"`` (or any trilayer cell) places that
399
+ junction centred in the cut-out (``junction_params`` passed on, e.g. ``{"finger_width": 0.2, "lj_nH": …}``;
400
+ the compact junction's 12 µm window overlaps the 11 µm cut-out by 0.5 µm per side, the "1 µm overlap" request).
401
+ No ports (DC probe pads); refpoints ``junction``, ``upper_pad``, ``lower_pad``.
402
+ """
403
+
404
+ qcc_category = "test_structure"
405
+
406
+ pad_width = Param(pdt.TypeDouble, "Pad width", 500, unit="μm")
407
+ upper_pad_height = Param(pdt.TypeDouble, "Upper (base-metal) pad height", 400, unit="μm")
408
+ lower_pad_height = Param(pdt.TypeDouble, "Lower (second-metal) pad height", 400, unit="μm")
409
+ middle_height = Param(pdt.TypeDouble, "Distance between the pads (junction region)", 200, unit="μm")
410
+ window_extra = Param(pdt.TypeDouble, "Window wider than the pads by", 100, unit="μm")
411
+ pad_trim = Param(pdt.TypeDouble, "Pads shortened by (towards the window edge)", 50, unit="μm")
412
+ cutout = Param(pdt.TypeDouble, "Centre cut-out (junction site) size", 11, unit="μm")
413
+ junction_type = Param(
414
+ pdt.TypeString,
415
+ "Junction in the cut-out: none (legacy) or a trilayer cell",
416
+ "No Squid",
417
+ choices=["No Squid", "Trilayer Junction Compact", "Quantcore Junction", "Trilayer Junction"],
418
+ )
419
+ junction_params = Param(pdt.TypeString, "Junction cell parameters (JSON dict)", "{}")
420
+
421
+ def _regions(self) -> dict:
422
+ names = "pad_width upper_pad_height lower_pad_height middle_height window_extra pad_trim cutout".split()
423
+ return probe_pad_pair_regions(self.layout.dbu, **{n: getattr(self, n) for n in names})
424
+
425
+ @classmethod
426
+ def qcc_keepout(cls, params: dict) -> list:
427
+ """3/0 keep-out (local µm): the legacy script's second-metal pattern (``m3``)."""
428
+ from quantcore_circuits.layouts.others.keepout import as_cell, dpolygons # pylint: disable=C0415
429
+
430
+ return dpolygons(cls._regions(as_cell(cls, params))["m3"])
431
+
432
+ @classmethod
433
+ def qcc_params(cls, params: dict) -> dict:
434
+ import json # pylint: disable=import-outside-toplevel
435
+
436
+ params = dict(params)
437
+ if isinstance(params.get("junction_params"), dict):
438
+ params["junction_params"] = json.dumps(params["junction_params"], sort_keys=True)
439
+ return params
440
+
441
+ def build(self):
442
+ from quantcore_circuits.layouts.junctions.trilayer import _json_dict, trilayer_classes # pylint: disable=C0415
443
+
444
+ dbu = self.layout.dbu
445
+ regions = self._regions()
446
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(regions["m1"])
447
+ self.add_protection(pya.Region(regions["m1"].bbox()).sized(self.margin / dbu))
448
+ if self.junction_type != "No Squid":
449
+ cls = trilayer_classes().get(self.junction_type)
450
+ if cls is None:
451
+ self.raise_error_on_cell(f"ProbePadPair: junction_type {self.junction_type!r} is not a trilayer cell")
452
+ params = _json_dict(self.junction_params)
453
+ if cls.__name__ != "TrilayerJunctionCompact": # a full-size window spans the cut-out exactly
454
+ params = {"window_height": self.cutout, "window_width": self.cutout, **params}
455
+ cell = cls.create(self.layout, **params)
456
+ h = float(cell.pcell_parameters_by_name().get("window_height", self.cutout))
457
+ self.insert_cell(cell, pya.DTrans(0, -h / 2))
458
+ mh = self.middle_height
459
+ self.refpoints["junction"] = pya.DPoint(0, 0)
460
+ self.refpoints["upper_pad"] = pya.DPoint(0, (mh / 2 + self.upper_pad_height + mh / 2 - self.pad_trim) / 2)
461
+ self.refpoints["lower_pad"] = pya.DPoint(0, -(mh / 2 + self.lower_pad_height + mh / 2 - self.pad_trim) / 2)
@@ -0,0 +1,119 @@
1
+ """Ports as seen by quantcore_circuits: KQC refpoints ``port_<name>`` + optional ``port_<name>_corner``.
2
+
3
+ A port has a position, an *outward* unit direction (``corner - port``; the direction a connecting waveguide comes
4
+ from) and the CPW centre width ``a`` / gap ``b`` at that point.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import math
10
+ from dataclasses import dataclass
11
+
12
+ from kqcircuits.defaults import default_layers
13
+ from kqcircuits.elements.element import get_refpoints
14
+ from kqcircuits.pya_resolver import pya
15
+
16
+
17
+ @dataclass
18
+ class Port:
19
+ name: str
20
+ pos: pya.DPoint
21
+ dir: pya.DVector | None # outward unit vector, None if the port has no corner refpoint
22
+ a: float | None = None
23
+ b: float | None = None
24
+
25
+ @property
26
+ def angle(self) -> float | None:
27
+ return None if self.dir is None else math.degrees(math.atan2(self.dir.y, self.dir.x))
28
+
29
+ @property
30
+ def corner(self) -> pya.DPoint | None:
31
+ return None if self.dir is None else self.pos + self.dir
32
+
33
+ def transformed(self, trans: pya.DCplxTrans) -> Port:
34
+ d = None
35
+ if self.dir is not None:
36
+ d = trans * self.dir
37
+ d = d / d.length()
38
+ return Port(self.name, trans * self.pos, d, self.a, self.b)
39
+
40
+ def as_dict(self) -> dict:
41
+ return {
42
+ "name": self.name,
43
+ "at": [round(self.pos.x, 6), round(self.pos.y, 6)],
44
+ "dir": None if self.angle is None else round(self.angle, 6),
45
+ "a": self.a,
46
+ "b": self.b,
47
+ }
48
+
49
+
50
+ def direction_vector(angle_deg: float) -> pya.DVector:
51
+ rad = math.radians(angle_deg)
52
+ x, y = math.cos(rad), math.sin(rad)
53
+ # snap exact axis directions so 90° multiples stay exact
54
+ x, y = (round(x) if abs(x - round(x)) < 1e-12 else x), (round(y) if abs(y - round(y)) < 1e-12 else y)
55
+ return pya.DVector(x, y)
56
+
57
+
58
+ def ports_from_refpoints(refpoints: dict, a: float | None = None, b: float | None = None) -> dict[str, Port]:
59
+ """Extract ports from a refpoint dict (as returned by ``get_refpoints(..., rec_levels=0)``)."""
60
+ ports = {}
61
+ for key, pos in refpoints.items():
62
+ if not key.startswith("port") or key.endswith("_corner"):
63
+ continue
64
+ name = key[len("port_") :] if key.startswith("port_") else key
65
+ if not name:
66
+ name = "port"
67
+ corner = refpoints.get(f"{key}_corner")
68
+ d = None
69
+ if corner is not None and (corner - pos).length() > 0:
70
+ v = corner - pos
71
+ d = v / v.length()
72
+ ports[name] = Port(name, pos, d, a, b)
73
+ return ports
74
+
75
+
76
+ def cell_ports(cell: pya.Cell, a: float | None = None, b: float | None = None, rec_levels: int = 0) -> dict[str, Port]:
77
+ """Ports of a cell in its own coordinates (only the cell's own refpoints by default)."""
78
+ layout = cell.layout()
79
+ refp = get_refpoints(layout.layer(default_layers["refpoints"]), cell, pya.DTrans(), rec_levels)
80
+ return ports_from_refpoints(dict(refp), a, b)
81
+
82
+
83
+ class CellBuildError(RuntimeError):
84
+ """A PCell's build() failed. KLayout swallows the exception and draws it on the error layer; this re-raises it."""
85
+
86
+
87
+ def check_cell(cell: pya.Cell, what: str = "") -> pya.Cell:
88
+ """Raise :class:`CellBuildError` if ``cell`` (or any child) failed to build."""
89
+ if cell is None:
90
+ raise CellBuildError(f"{what or 'cell'}: PCell could not be created (not registered in its library?)")
91
+ layout = cell.layout()
92
+ it = cell.begin_shapes_rec(layout.error_layer())
93
+ messages = []
94
+ while not it.at_end():
95
+ shape = it.shape()
96
+ if shape.is_text():
97
+ messages.append(shape.text_string)
98
+ it.next()
99
+ for err_text in _kqc_error_texts(cell):
100
+ messages.append(err_text)
101
+ if messages:
102
+ first = messages[0].split("\n")[0]
103
+ raise CellBuildError(
104
+ f"{what or cell.name}: {first}" + (f" (+{len(messages) - 1} more)" if len(messages) > 1 else "")
105
+ )
106
+ return cell
107
+
108
+
109
+ def _kqc_error_texts(cell: pya.Cell) -> list[str]:
110
+ """Errors from KQC ``raise_error_on_cell`` (stored as the ``error_on_cell`` instance property)."""
111
+ out = []
112
+ target = cell
113
+ if cell.is_library_cell():
114
+ target = cell.library().layout().cell(cell.library_cell_index())
115
+ for inst in target.each_inst():
116
+ msg = inst.property("error_on_cell")
117
+ if msg:
118
+ out.append(str(msg))
119
+ return out
File without changes