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,119 @@
1
+ """Bond pad with CPW taper (ported from QWri ``Connector Pad 2``, fab mode).
2
+
3
+ Local frame: taper tip (CPW end) at the origin, pad body below it; port ``a`` faces +y. The pad's ground-side edge
4
+ (the bottom of the gap below the pad) is at ``y = -(pad_height + taper_length + pad_gap)`` for the square pad, which
5
+ is where the legacy chips put the chip edge. Geometry is the legacy fab output, computed with the same pya calls.
6
+ """
7
+
8
+ from kqcircuits.elements.element import Element
9
+ from kqcircuits.pya_resolver import pya
10
+ from kqcircuits.util.parameters import Param, pdt
11
+
12
+
13
+ def connector_pad_gaps(dbu, pad_width, pad_gap, pad_height, conn_height, trace_width, trace_gap, rounded):
14
+ """Legacy ``ConnectorPad2.makePAD`` with ``fab=True, sim=False``, returned in dbu (already shifted to the tip)."""
15
+ pw, ph, ch, tw, tg, gd = pad_width, pad_height, conn_height, trace_width, trace_gap, pad_gap
16
+ pad = pya.Box(int(-pw / dbu / 2), 0, int(pw / dbu / 2), int(ph / dbu))
17
+ taper = pya.Polygon(
18
+ [
19
+ pya.Point(-pw / dbu / 2, ph / dbu),
20
+ pya.Point(pw / dbu / 2, ph / dbu),
21
+ pya.Point(tw / dbu / 2, (ph + ch) / dbu),
22
+ pya.Point(-tw / dbu / 2, (ph + ch) / dbu),
23
+ ]
24
+ )
25
+ pad = pya.Region().insert([taper, pad])
26
+ taper_inv = pya.Polygon(
27
+ [
28
+ pya.Point((-pw / 2 - gd) / dbu, ph / dbu),
29
+ pya.Point((pw / 2 + gd) / dbu, ph / dbu),
30
+ pya.Point((tw / 2 + tg) / dbu, (ph + ch) / dbu),
31
+ pya.Point((-tw / 2 - tg) / dbu, (ph + ch) / dbu),
32
+ ]
33
+ )
34
+ extender = ph + 500 if rounded else gd
35
+ inv_box = pya.Box(((-pw / 2) - gd) / dbu, (-extender) / dbu, (pw / 2 + gd) / dbu, ph / dbu)
36
+ inv_pad = pya.Region().insert([taper_inv, inv_box])
37
+ if not rounded:
38
+ out = inv_pad - pad
39
+ else:
40
+ gnd_box = pya.Box(
41
+ ((-pw / 2) - gd - 50) / dbu, (-extender - 50) / dbu, (pw / 2 + gd + 50) / dbu, (ph + ch) / dbu
42
+ )
43
+ cpw = pya.Box((-tw / 2) / dbu, (ph + ch) / dbu, (tw / 2) / dbu, (ph + ch + 700) / dbu)
44
+ cpw_left = pya.Box(((-pw / 2) - gd - 50) / dbu, (ph + ch) / dbu, (-tw / 2 - tg) / dbu, (ph + ch + 700) / dbu)
45
+ cpw_right = pya.Box((tw / 2 + tg) / dbu, (ph + ch) / dbu, ((pw / 2) + gd + 50) / dbu, (ph + ch + 700) / dbu)
46
+ sub_top = pya.Box(
47
+ ((-pw / 2) - gd - 50) / dbu, (ph + ch + 200) / dbu, ((pw / 2) + gd + 50) / dbu, (ph + ch + 5000) / dbu
48
+ )
49
+ sub_below = pya.Box(
50
+ ((-pw / 2) - gd - 50) / dbu, (-ph - 1000) / dbu, ((pw / 2) + gd + 50) / dbu, (-20 - ph / 2) / dbu
51
+ )
52
+ padhalf = pya.Box(-pw / dbu / 2, (-800 - ph) / 2 / dbu, pw / dbu / 2, ph / 2 / dbu)
53
+ metal = pad + (pya.Region().insert([gnd_box]) - inv_pad)
54
+ merged = (metal + cpw + cpw_left + cpw_right + padhalf).merged()
55
+ radius = max(pw, ph) / 2 / dbu
56
+ merged.round_corners(radius, radius, 256)
57
+ metal = merged - sub_top - sub_below
58
+ out = (
59
+ pya.Region(metal.bbox())
60
+ - metal.flatten()
61
+ + pya.Box((-pw / 2 - gd) / dbu, (-ph / 2 - 70) / dbu, (pw / 2 + gd) / dbu, -ph / 2 / dbu)
62
+ )
63
+ out.transform(pya.Trans(0, int((-200) / dbu)))
64
+ out.transform(pya.Trans(0, int((-ph - ch) / dbu)))
65
+ return out
66
+
67
+
68
+ class BondPad(Element):
69
+ """Wire-bond pad tapering to a CPW (``a``/``b``); port ``a`` at the taper tip.
70
+
71
+ Ported from the legacy QWri PCell ``Connector Pad 2`` (``pymacros/QuantumPcells/connector_pad_v2.lym``), fab
72
+ mode. Refpoints ``pad_center``, ``chip_edge`` and ``lumped_signal`` / ``lumped_ground`` (the simulation lumped
73
+ port across the side gap at the pad centre)."""
74
+
75
+ qcc_category = "launcher"
76
+
77
+ pad_width = Param(pdt.TypeDouble, "Pad width", 400, unit="μm")
78
+ pad_height = Param(pdt.TypeDouble, "Pad height", 450, unit="μm")
79
+ pad_gap = Param(pdt.TypeDouble, "Gap around the pad", 225, unit="μm")
80
+ taper_length = Param(pdt.TypeDouble, "Taper length", 450, unit="μm")
81
+ rounded = Param(pdt.TypeBoolean, "Rounded pad with a 200 µm CPW stub", False)
82
+
83
+ @classmethod
84
+ def qcc_keepout(cls, params: dict) -> list:
85
+ """3/0 keep-out (local µm), legacy ``connector_pad_v2.lym`` ``fab_l``: the 1/0 etch grown by 50 µm in x."""
86
+ from quantcore_circuits.layouts.others.keepout import DBU, dpolygons, full_params # pylint: disable=C0415
87
+
88
+ p = full_params(cls, params)
89
+ gaps = connector_pad_gaps(
90
+ DBU, p["pad_width"], p["pad_gap"], p["pad_height"], p["taper_length"], p["a"], p["b"], p["rounded"]
91
+ )
92
+ return dpolygons(gaps.sized(round(50 / DBU), 0, 2))
93
+
94
+ @classmethod
95
+ def qcc_lom(cls, name: str, inst, pdk):
96
+ """A bond pad is a 50 Ω port to ground on whatever conductor its ``a`` port connects to."""
97
+ from quantcore_circuits.lom.fragment import Element, Fragment # pylint: disable=import-outside-toplevel
98
+
99
+ return Fragment(
100
+ nodes={"pad": {"island": f"{name}.pad"}},
101
+ elements=[Element(f"Port_{name}", "R", ("pad", "gnd"), {"R_ohm": 50.0, "source": "design"})],
102
+ port_nodes={"a": "pad"},
103
+ )
104
+
105
+ def build(self):
106
+ dbu = self.layout.dbu
107
+ gaps = connector_pad_gaps(
108
+ dbu, self.pad_width, self.pad_gap, self.pad_height, self.taper_length, self.a, self.b, self.rounded
109
+ )
110
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(gaps)
111
+ self.add_protection(pya.Region(gaps.bbox()).sized(self.margin / dbu))
112
+ self.add_port("a", pya.DPoint(0, 0), pya.DVector(0, 1))
113
+ self.refpoints["pad_center"] = pya.DPoint(0, -(self.taper_length + self.pad_height / 2))
114
+ self.refpoints["chip_edge"] = pya.DPoint(0, -(self.taper_length + self.pad_height + self.pad_gap))
115
+ # lumped-port terminals for whole-chip simulations, across the side gap (the back gap ends at the chip edge,
116
+ # so there is no ground metal behind the pad)
117
+ y = -(self.taper_length + self.pad_height / 2)
118
+ self.refpoints["lumped_signal"] = pya.DPoint(self.pad_width / 2, y)
119
+ self.refpoints["lumped_ground"] = pya.DPoint(self.pad_width / 2 + self.pad_gap, y)
@@ -0,0 +1,190 @@
1
+ """Legacy QWri pads: ``ConnectorPad`` (``connector_pad.lym``, "Connector Pad", the v1 bond pad of chips 01–03) and
2
+ ``TaperedPad`` (``pad.lym``, "Pad": a probe pad tapering to a junction finger).
3
+
4
+ ``ConnectorPad`` is the first version of :class:`~quantcore_circuits.layouts.others.bond_pad.BondPad` ("Connector Pad
5
+ 2"): the gap around the pad scales with the pad (``trace_gap · pad_width / trace_width``) instead of a ``pad_gap``
6
+ parameter, and the etch below the pad has no extension. Fab mode (``fab=True, sim=False``); the legacy ``sim=True``
7
+ mode (positive pad + ground ring, which chips 01–02 got by default) is not reproduced.
8
+
9
+ Frame: taper tip (CPW end) at the origin, pad below it; port ``a`` faces +y, width ``a``/``b`` (legacy
10
+ ``trace_width``/``trace_gap``). Geometry: same pya calls as the legacy code (``base_metal_gap_wo_grid``).
11
+ """
12
+
13
+ from kqcircuits.elements.element import Element
14
+ from kqcircuits.pya_resolver import pya
15
+ from kqcircuits.util.parameters import Param, pdt
16
+
17
+
18
+ def connector_pad_v1_gaps(dbu, pad_width, pad_height, conn_height, trace_width, trace_gap, rounded) -> pya.Region:
19
+ """Legacy ``ConnectorPad.makePAD`` with ``fab=True, sim=False``, in dbu (already shifted to the taper tip)."""
20
+ pw, ph, ch, tw, tg = pad_width, pad_height, conn_height, trace_width, trace_gap
21
+ if ch < 0: # legacy coerce
22
+ ch = 1
23
+ if tw >= pw:
24
+ tw = pw - 0.01
25
+ pad = pya.Box(int(-pw / dbu / 2), 0, int(pw / dbu / 2), int(ph / dbu))
26
+ taper = pya.Polygon(
27
+ [
28
+ pya.Point(-pw / dbu / 2, ph / dbu),
29
+ pya.Point(pw / dbu / 2, ph / dbu),
30
+ pya.Point(tw / dbu / 2, (ph + ch) / dbu),
31
+ pya.Point(-tw / dbu / 2, (ph + ch) / dbu),
32
+ ]
33
+ )
34
+ pad = pya.Region().insert([taper, pad])
35
+ taper_dist = tg
36
+ gd = tg * (pw / tw)
37
+ taper_inv = pya.Polygon(
38
+ [
39
+ pya.Point((-pw / 2 - gd) / dbu, ph / dbu),
40
+ pya.Point((pw / 2 + gd) / dbu, ph / dbu),
41
+ pya.Point((tw / 2 + taper_dist) / dbu, (ph + ch) / dbu),
42
+ pya.Point((-tw / 2 - taper_dist) / dbu, (ph + ch) / dbu),
43
+ ]
44
+ )
45
+ extender = ph + 500 if rounded else 0
46
+ inv_box = pya.Box(((-pw / 2) - gd) / dbu, (-ph - extender) / dbu, (pw / 2 + gd) / dbu, ph / dbu)
47
+ inv_pad = pya.Region().insert([taper_inv, inv_box])
48
+ if not rounded:
49
+ out = inv_pad - pad
50
+ else:
51
+ gnd_box = pya.Box(((-pw / 2) - gd - 50) / dbu, -extender / dbu, (pw / 2 + gd + 50) / dbu, (ph + ch) / dbu)
52
+ cpw = pya.Box((-tw / 2) / dbu, (ph + ch) / dbu, (tw / 2) / dbu, (ph + ch + 700) / dbu)
53
+ cpw_left = pya.Box(((-pw / 2) - gd - 50) / dbu, (ph + ch) / dbu, (-tw / 2 - tg) / dbu, (ph + ch + 700) / dbu)
54
+ cpw_right = pya.Box((tw / 2 + tg) / dbu, (ph + ch) / dbu, ((pw / 2) + gd + 50) / dbu, (ph + ch + 700) / dbu)
55
+ sub_top = pya.Box(
56
+ ((-pw / 2) - gd - 50) / dbu, (ph + ch + 200) / dbu, ((+pw / 2) + gd + 50) / dbu, (ph + ch + 5000) / dbu
57
+ )
58
+ sub_below = pya.Box(
59
+ ((-pw / 2) - gd - 50) / dbu, (-ph - 1000) / dbu, ((+pw / 2) + gd + 50) / dbu, (-20 - ph / 2) / dbu
60
+ )
61
+ padhalf = pya.Box(-pw / dbu / 2, (-800 - ph) / 2 / dbu, pw / dbu / 2, ph / 2 / dbu)
62
+ gnd = pya.Region().insert([gnd_box]) - inv_pad
63
+ metal = pad + gnd
64
+ merged = (metal + cpw + cpw_left + cpw_right + padhalf).merged()
65
+ radius = max(pw, ph) / 2 / dbu
66
+ merged.round_corners(radius, radius, 256)
67
+ metal = merged - sub_top - sub_below
68
+ out = (
69
+ pya.Region(metal.bbox())
70
+ - metal.flatten()
71
+ + pya.Box((-pw / 2 - gd) / dbu, (-ph / 2 - 70) / dbu, (pw / 2 + gd) / dbu, -ph / 2 / dbu)
72
+ )
73
+ out.transform(pya.Trans(0, int((-200) / dbu)))
74
+ out.transform(pya.Trans(0, int((-ph - ch) / dbu)))
75
+ return out
76
+
77
+
78
+ def tapered_pad_region(dbu, pad_width, pad_height, conn_height, finger_width, negative, width, height, x, y):
79
+ """Legacy ``Pad.makePAD`` (with its coerce rules), in dbu: a pad with a taper to ``finger_width``; ``negative``
80
+ (legacy ``ground``) returns the ``width × height`` window minus the pad shifted by (x, y)."""
81
+ pw, ph, ch, fw = pad_width, pad_height, conn_height, finger_width
82
+ if width < pw: # legacy coerce
83
+ pw = width
84
+ if height < ph + ch:
85
+ height = ph + ch
86
+ if ch < 0:
87
+ ch = 1
88
+ if fw >= pw:
89
+ fw = pw - 0.01
90
+ pad = pya.Box(-pw / dbu / 2, 0, pw / dbu / 2, ph / dbu)
91
+ taper = pya.DPolygon(
92
+ [
93
+ pya.DPoint(-pw / dbu / 2, ph / dbu),
94
+ pya.DPoint(pw / dbu / 2, ph / dbu),
95
+ pya.DPoint(fw / dbu / 2, (ph + ch) / dbu),
96
+ pya.DPoint(-fw / dbu / 2, (ph + ch) / dbu),
97
+ ]
98
+ )
99
+ region = pya.Region().insert([taper, pad])
100
+ if negative:
101
+ move = pya.DTrans(x / dbu, y / dbu)
102
+ window = pya.Region().insert(pya.Box(-width / dbu / 2, 0, width / dbu / 2, height / dbu))
103
+ region = window - region.transform(move)
104
+ return region
105
+
106
+
107
+ class ConnectorPad(Element):
108
+ """Wire-bond pad tapering to a CPW (legacy "Connector Pad", v1); port ``a`` at the taper tip.
109
+
110
+ Refpoints: ``pad_center``; ``lumped_signal`` / ``lumped_ground`` (pad edge and ground edge across the side gap at
111
+ the pad centre: the 50 Ω lumped port the simulation builder gives a pad that terminates a sim group, as for
112
+ :class:`~quantcore_circuits.layouts.others.bond_pad.BondPad`)."""
113
+
114
+ pad_width = Param(pdt.TypeDouble, "Pad width", 275, unit="μm")
115
+ pad_height = Param(pdt.TypeDouble, "Pad height", 300, unit="μm")
116
+ taper_length = Param(pdt.TypeDouble, "Taper length (legacy conn_height)", 300, unit="μm")
117
+ rounded = Param(pdt.TypeBoolean, "Rounded pad with a 200 µm CPW stub (legacy round)", False)
118
+
119
+ qcc_category = "launcher"
120
+
121
+ @classmethod
122
+ def qcc_keepout(cls, params: dict) -> list:
123
+ """3/0 keep-out (local µm), legacy ``connector_pad.lym`` ``fab_l``: the 1/0 etch grown by 50 µm in x."""
124
+ from quantcore_circuits.layouts.others.keepout import DBU, dpolygons, full_params # pylint: disable=C0415
125
+
126
+ p = full_params(cls, params)
127
+ gaps = connector_pad_v1_gaps(
128
+ DBU, p["pad_width"], p["pad_height"], p["taper_length"], p["a"], p["b"], p["rounded"]
129
+ )
130
+ return dpolygons(gaps.sized(round(50 / DBU), 0, 2))
131
+
132
+ def build(self):
133
+ dbu = self.layout.dbu
134
+ gaps = connector_pad_v1_gaps(
135
+ dbu, self.pad_width, self.pad_height, self.taper_length, self.a, self.b, self.rounded
136
+ )
137
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(gaps)
138
+ self.add_protection(pya.Region(gaps.bbox()).sized(self.margin / dbu))
139
+ self.add_port("a", pya.DPoint(0, 0), pya.DVector(0, 1))
140
+ y = -(self.taper_length + self.pad_height / 2) - (200 if self.rounded else 0)
141
+ self.refpoints["pad_center"] = pya.DPoint(0, y)
142
+ # lumped-port terminals (as BondPad): across the side gap at the pad centre; the gap is trace_gap scaled by
143
+ # pad_width / trace_width (legacy), in both modes
144
+ trace_width = min(self.a, self.pad_width - 0.01)
145
+ self.refpoints["lumped_signal"] = pya.DPoint(self.pad_width / 2, y)
146
+ self.refpoints["lumped_ground"] = pya.DPoint(self.pad_width / 2 + self.b * self.pad_width / trace_width, y)
147
+
148
+
149
+ class TaperedPad(Element):
150
+ """Probe pad tapering to a junction finger (legacy "Pad"); port ``finger`` at the taper tip.
151
+
152
+ Legacy frame: pad bottom edge at the origin, tip at ``(0, pad_height + conn_height)``. ``negative`` (legacy
153
+ ``ground``, default) etches the ``window_width × window_height`` window around the pad (shifted by ``x``/``y``);
154
+ otherwise the pad itself is drawn as metal (``base_metal_addition``)."""
155
+
156
+ pad_width = Param(pdt.TypeDouble, "Pad width", 275, unit="μm")
157
+ pad_height = Param(pdt.TypeDouble, "Pad height", 300, unit="μm")
158
+ conn_height = Param(pdt.TypeDouble, "Taper length", 300, unit="μm")
159
+ finger_width = Param(pdt.TypeDouble, "Finger (tip) width", 3, unit="μm")
160
+ negative = Param(pdt.TypeBoolean, "Etch the window around the pad (legacy ground)", True)
161
+ window_width = Param(pdt.TypeDouble, "Window width (legacy width)", 300, unit="μm")
162
+ window_height = Param(pdt.TypeDouble, "Window height (legacy height)", 650, unit="μm")
163
+ x = Param(pdt.TypeDouble, "Pad x offset in the window", 0, unit="μm")
164
+ y = Param(pdt.TypeDouble, "Pad y offset in the window", -10, unit="μm")
165
+
166
+ qcc_category = "test_structure"
167
+
168
+ @classmethod
169
+ def qcc_port_widths(cls, params: dict) -> dict:
170
+ return {"finger": (params.get("finger_width", 3), params.get("b", 6))}
171
+
172
+ def build(self):
173
+ dbu = self.layout.dbu
174
+ region = tapered_pad_region(
175
+ dbu,
176
+ self.pad_width,
177
+ self.pad_height,
178
+ self.conn_height,
179
+ self.finger_width,
180
+ self.negative,
181
+ self.window_width,
182
+ self.window_height,
183
+ self.x,
184
+ self.y,
185
+ )
186
+ layer = "base_metal_gap_wo_grid" if self.negative else "base_metal_addition"
187
+ self.cell.shapes(self.get_layer(layer)).insert(region)
188
+ self.add_protection(pya.Region(region.bbox()).sized(self.margin / dbu))
189
+ tip = pya.DPoint(self.x if self.negative else 0, (self.y if self.negative else 0) + self.pad_height)
190
+ self.add_port("finger", tip + pya.DVector(0, self.conn_height), pya.DVector(0, 1))
@@ -0,0 +1,21 @@
1
+ """Two-pad gap coupler ported from the QWri ``coupler.lym`` (``Coupler``) PCell.
2
+
3
+ The legacy coupler is the same drawing as the legacy ``Transmon``: two pads facing each other across ``gap`` with a
4
+ 10 µm lead on each outer side, positive metal only. Here it is :class:`~quantcore_circuits.layouts.qubits.
5
+ legacy_transmon.TwoPadTransmon` without the junction refpoints: a series gap capacitor between ports ``left`` and
6
+ ``right`` (metal on ``base_metal_addition``, own pocket on ``base_metal_gap_wo_grid`` when ``pocket_margin`` > 0).
7
+ """
8
+
9
+ from kqcircuits.util.parameters import Param, pdt
10
+
11
+ from quantcore_circuits.layouts.qubits.legacy_transmon import TwoPadTransmon
12
+
13
+
14
+ class PadCoupler(TwoPadTransmon):
15
+ """Series gap capacitor of two facing pads (legacy ``Coupler``); ports ``left`` / ``right``."""
16
+
17
+ qcc_category = "coupler"
18
+ qcc_junction = False
19
+
20
+ junction_type = Param(pdt.TypeString, "No junction on a coupler", "No Squid", hidden=True)
21
+ junction_params = Param(pdt.TypeString, "Unused on a coupler", "{}", hidden=True)
@@ -0,0 +1,131 @@
1
+ """Straight CPW segment and flux-trapping hole arrays (ported from QWri ``CPW.lym`` "Coplanar Waveguide" — the
2
+ feedline of chips 01–07 — and the ``flux_holes`` arrays of ``flux_holes.py`` / the legacy chips).
3
+
4
+ ``CpwSegment``: legacy fab mode with ground (``fab=True, ground=True``): the two gap strips of a straight CPW of
5
+ ``length``, centred at the origin along x; ports ``a`` (−x end) and ``b`` (+x end), CPW width ``a``/``b`` (legacy
6
+ ``cwidth``/``gap``). ``FluxHoleArray``: a regular array of square holes in the ground plane (vortex traps).
7
+ ``FluxHoles``: square holes at an explicit list of centres (the ``FluxHoles`` QComponent of the legacy design
8
+ notebook ``14.0 Two_feedline_resonator_chip.ipynb``: 5 µm squares on rows along the feedlines).
9
+ All etch into ``base_metal_gap_wo_grid`` with the legacy pya calls.
10
+ """
11
+
12
+ from kqcircuits.elements.element import Element
13
+ from kqcircuits.pya_resolver import pya
14
+ from kqcircuits.util.parameters import Param, pdt
15
+
16
+
17
+ def cpw_segment_gaps(dbu, length, cwidth, gap, lc_thickness=10.0, rc_thickness=10.0) -> pya.Region:
18
+ """Legacy ``CPW.makeCPW`` with ``fab=True, ground=True`` (incl. its coerce rules), in dbu."""
19
+ lc = lc_thickness if lc_thickness > 0 else cwidth
20
+ rc = rc_thickness if rc_thickness > 0 else cwidth
21
+ if cwidth <= gap:
22
+ cwidth = gap * 5 / 3
23
+ centre = pya.Box(-length / dbu / 2, -cwidth / dbu / 2, length / dbu / 2, cwidth / dbu / 2)
24
+ lower = pya.Box(-length / dbu / 2, -(lc + gap + cwidth / 2) / dbu, length / dbu / 2, (-gap - cwidth / 2) / dbu)
25
+ upper = pya.Box(-length / dbu / 2, +(gap + cwidth / 2) / dbu, length / dbu / 2, +(rc + gap + cwidth / 2) / dbu)
26
+ cpw = pya.Region().insert([centre, upper, lower])
27
+ return pya.Region().insert(cpw.bbox()) - cpw
28
+
29
+
30
+ def flux_hole_region(dbu, hole_size=5.0, pitch_x=20.0, pitch_y=15.0, nx=10, ny=2) -> pya.Region:
31
+ """The flux-hole arrays of the legacy chips: ``nx × ny`` squares of ``hole_size`` (first centred at the origin),
32
+ ``pitch_x`` / ``pitch_y`` apart, in dbu."""
33
+ hole = pya.Box(-hole_size / 2 / dbu, -hole_size / 2 / dbu, hole_size / 2 / dbu, hole_size / 2 / dbu)
34
+ out = pya.Region()
35
+ for i in range(int(nx)):
36
+ for j in range(int(ny)):
37
+ out.insert(hole.moved(int(round(i * pitch_x / dbu)), int(round(j * pitch_y / dbu))))
38
+ return out
39
+
40
+
41
+ class CpwSegment(Element):
42
+ """Straight CPW segment centred at the origin (legacy "Coplanar Waveguide"); ports ``a`` (−x) and ``b`` (+x)."""
43
+
44
+ length = Param(pdt.TypeDouble, "Length", 200, unit="μm")
45
+ lc_thickness = Param(pdt.TypeDouble, "Lower ground strip drawn (legacy lc_thickness)", 10, unit="μm")
46
+ rc_thickness = Param(pdt.TypeDouble, "Upper ground strip drawn (legacy rc_thickness)", 10, unit="μm")
47
+ keepout_gap = Param(pdt.TypeDouble, "3/0 keep-out growth across the line (legacy c_gap)", 0, unit="μm")
48
+
49
+ qcc_category = "waveguide"
50
+
51
+ @classmethod
52
+ def qcc_keepout(cls, params: dict) -> list:
53
+ """3/0 keep-out (local µm), legacy ``CPW.lym`` ``fab_l``: the bbox of conductor + drawn ground strips grown
54
+ by ``keepout_gap`` (legacy ``c_gap``; the chips use 0) across the line."""
55
+ from quantcore_circuits.layouts.others.keepout import DBU, dpolygons, full_params # pylint: disable=C0415
56
+
57
+ p = full_params(cls, params)
58
+ cw, gap = float(p["a"]), float(p["b"])
59
+ lc = float(p["lc_thickness"]) if float(p["lc_thickness"]) > 0 else cw
60
+ rc = float(p["rc_thickness"]) if float(p["rc_thickness"]) > 0 else cw
61
+ if cw <= gap:
62
+ cw = gap * 5 / 3
63
+ length = float(p["length"])
64
+ box = pya.Box(-length / DBU / 2, -(lc + gap + cw / 2) / DBU, length / DBU / 2, (rc + gap + cw / 2) / DBU)
65
+ return dpolygons(pya.Region(box).sized(0, round(float(p["keepout_gap"]) / DBU), 2))
66
+
67
+ def build(self):
68
+ dbu = self.layout.dbu
69
+ gaps = cpw_segment_gaps(dbu, self.length, self.a, self.b, self.lc_thickness, self.rc_thickness)
70
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(gaps)
71
+ self.add_protection(pya.Region(gaps.bbox()).sized(self.margin / dbu))
72
+ self.add_port("a", pya.DPoint(-self.length / 2, 0), pya.DVector(-1, 0))
73
+ self.add_port("b", pya.DPoint(self.length / 2, 0), pya.DVector(1, 0))
74
+
75
+
76
+ class FluxHoleArray(Element):
77
+ """Array of square flux-trapping holes in the ground plane (legacy chips' ``flux_holes``)."""
78
+
79
+ hole_size = Param(pdt.TypeDouble, "Hole size", 5, unit="μm")
80
+ pitch_x = Param(pdt.TypeDouble, "Pitch in x", 20, unit="μm")
81
+ pitch_y = Param(pdt.TypeDouble, "Pitch in y", 15, unit="μm")
82
+ nx = Param(pdt.TypeInt, "Holes in x", 10)
83
+ ny = Param(pdt.TypeInt, "Holes in y", 2)
84
+
85
+ qcc_category = "other"
86
+
87
+ def build(self):
88
+ dbu = self.layout.dbu
89
+ holes = flux_hole_region(dbu, self.hole_size, self.pitch_x, self.pitch_y, self.nx, self.ny)
90
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(holes)
91
+
92
+
93
+ def flux_holes_at(dbu, centers, hole_size=5.0) -> pya.Region:
94
+ """Square holes of ``hole_size`` centred on ``centers`` ([(x, y), ...] or a flat [x0, y0, x1, y1, ...]), dbu."""
95
+ flat = [float(v) for c in centers for v in (c if isinstance(c, list | tuple) else [c])]
96
+ if len(flat) % 2:
97
+ raise ValueError(f"centers needs x, y pairs, got {len(flat)} numbers")
98
+ h = hole_size / 2
99
+ out = pya.Region()
100
+ for x, y in zip(flat[::2], flat[1::2]):
101
+ out.insert(pya.DBox(x - h, y - h, x + h, y + h).to_itype(dbu))
102
+ return out
103
+
104
+
105
+ class FluxHoles(Element):
106
+ """Square flux-trapping holes at explicit centres (legacy notebook 14 ``FluxHoles`` QComponent, ``size`` 5 µm).
107
+
108
+ ``centers`` is a flat list ``[x0, y0, x1, y1, ...]`` in µm (local frame); ``design.json`` may also give
109
+ ``[[x0, y0], [x1, y1], ...]``. The holes etch into the ground (``base_metal_gap_wo_grid``); no ports.
110
+ """
111
+
112
+ centers = Param(pdt.TypeList, "Hole centres, flat x, y list (µm)", [0, 0])
113
+ hole_size = Param(pdt.TypeDouble, "Hole size (legacy size)", 5, unit="μm")
114
+
115
+ qcc_category = "other"
116
+
117
+ @classmethod
118
+ def qcc_params(cls, params: dict) -> dict:
119
+ """``centers`` as pairs ``[[x, y], ...]`` → the flat PCell list (unknown parameters raise ``ValueError``)."""
120
+ params = dict(params)
121
+ unknown = sorted(set(params) - set(cls.get_schema()))
122
+ if unknown:
123
+ raise ValueError(f"FluxHoles: unknown parameter(s) {unknown}")
124
+ centers = params.get("centers")
125
+ if centers is not None and any(isinstance(c, list | tuple) for c in centers):
126
+ params["centers"] = [float(v) for c in centers for v in c]
127
+ return params
128
+
129
+ def build(self):
130
+ holes = flux_holes_at(self.layout.dbu, self.centers, self.hole_size)
131
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(holes)