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,201 @@
1
+ """Alignment, dicing and e-beam markers (ported from QWri ``Marker.lym``, ``boundaryBox.lym``, the marker functions of
2
+ ``components/python/draw.py`` and the e-beam marker of ``die_creator.py``).
3
+
4
+ Every DesignChip already draws the PDK die frame (:mod:`quantcore_circuits.layouts.chips.frame`: dicing Ls,
5
+ alignment grids, device ID), so these are *optional* cells for legacy-style layouts. They draw on the PDK marker
6
+ layers by default (PDK v2, 2026-11-03): dicing markers on ``marker_0`` (1000/0), alignment markers on ``marker_1``
7
+ (1001/0), the boundary box on ``chip_boundary`` (100/0). ``marker_layer`` takes any qcc layer name
8
+ (:data:`~quantcore_circuits.pdk.QCC_LAYERS`) or KQC layer name; ``base_metal_gap_wo_grid`` reproduces the legacy fab
9
+ output (layer 1/0, etched into the base metal). ``CornerMarker(hsq=True)`` is the legacy HSQ marker (chip_05: legacy
10
+ 500/0 + 150/0 → qcc ``hsq`` (50/0) + ``hsq_boundary``). Geometry is computed in database units with the same pya
11
+ calls as the legacy code. Markers have no ports.
12
+ """
13
+
14
+ from kqcircuits.elements.element import Element
15
+ from kqcircuits.pya_resolver import pya
16
+ from kqcircuits.util.parameters import Param, pdt
17
+
18
+ from quantcore_circuits.pdk import QCC_LAYERS
19
+
20
+
21
+ def corner_marker_region(dbu, thickness=50.0, width=500.0) -> pya.Region:
22
+ """Legacy ``Marker.produce_impl``: an L of two half-arms (+x and −y from the origin), in dbu."""
23
+ horz = pya.Region().insert(pya.Box(0, -thickness / dbu / 2, width / dbu / 2, 0))
24
+ vert = pya.Region().insert(pya.Box(0, -width / dbu / 2, thickness / dbu / 2, 0))
25
+ return horz + vert
26
+
27
+
28
+ def cross_marker_region(dbu, length=20.0, width=2.0) -> pya.Region:
29
+ """Legacy ``draw.marker`` (20 µm cross, 2 µm arms by default), in dbu."""
30
+ hl, hw = round(length / 2 / dbu), round(width / 2 / dbu)
31
+ return pya.Region([pya.Box(-hw, -hl, hw, hl), pya.Box(-hl, -hw, hl, hw)])
32
+
33
+
34
+ def global_marker_region(dbu, size=50.0, dx=200.0, dy=400.0) -> pya.Region:
35
+ """Legacy ``draw.global_marker``: six ``size`` squares at (±dx, 0) and (±dx, ±dy), in dbu."""
36
+ h = size / 2
37
+ out = pya.Region()
38
+ for x in (-dx, dx):
39
+ for y in (0.0, -dy, dy):
40
+ out.insert(pya.Box(round((x - h) / dbu), round((y - h) / dbu), round((x + h) / dbu), round((y + h) / dbu)))
41
+ return out
42
+
43
+
44
+ def dicing_marker_region(dbu, length=500.0, width=50.0) -> pya.Region:
45
+ """Legacy ``draw.marker_dicing`` (500 µm cross with 50 µm arms by default), in dbu."""
46
+ hl, hw = round(length / 2 / dbu), round(width / 2 / dbu)
47
+ return pya.Region([pya.Box(-hw, -hl, hw, hl), pya.Box(-hl, -hw, hl, hw)])
48
+
49
+
50
+ def alignment_marker_region(dbu, chip_width=7500.0, chip_height=7500.0, size=5.0, pitch=100.0, inset=150.0):
51
+ """Legacy ``draw.marker_align``: a 2×2 group of ``size`` squares (``pitch`` apart) near each chip corner. Frame:
52
+ chip lower-left corner at the origin (as the legacy function). The right/top groups sit ``inset + pitch + size``
53
+ from the chip edge (legacy: 150 + 105 µm), the left/bottom ones ``inset`` from it."""
54
+ s, p = size / dbu, pitch / dbu
55
+ out = pya.Region()
56
+ x_left, y_bottom = inset / dbu, inset / dbu
57
+ x_right = (chip_width - inset - pitch - size) / dbu
58
+ y_top = (chip_height - inset - pitch - size) / dbu
59
+ for x0, y0 in ((x_left, y_bottom), (x_left, y_top), (x_right, y_top), (x_right, y_bottom)):
60
+ for dx, dy in ((0, 0), (0, p), (p, p), (p, 0)):
61
+ out.insert(pya.Box(round(x0 + dx), round(y0 + dy), round(x0 + dx + s), round(y0 + dy + s)))
62
+ return out
63
+
64
+
65
+ def ebeam_marker_region(dbu, size=600.0, hole=20.0, offset=100.0) -> pya.Region:
66
+ """E-beam marker of legacy ``die_creator.create_die``: a ``size`` window etched around four ``hole`` squares of
67
+ metal at (±offset, ±offset), in dbu."""
68
+ container = pya.Region(pya.Box(-size / dbu / 2, -size / dbu / 2, size / dbu / 2, size / dbu / 2))
69
+ square = pya.Region(pya.Box(-hole / dbu / 2, -hole / dbu / 2, hole / dbu / 2, hole / dbu / 2))
70
+ for x, y in ((-offset, -offset), (-offset, offset), (offset, offset), (offset, -offset)):
71
+ container -= square.transformed(pya.Trans(0, False, x / dbu, y / dbu))
72
+ return container
73
+
74
+
75
+ def boundary_box_region(dbu, size=5000.0, width=5.0) -> pya.Region:
76
+ """Legacy ``BoundBox.produce_impl``: the ``size`` square plus a small cross at each corner, in dbu."""
77
+ box = pya.Box(-size / dbu / 2, -size / dbu / 2, +size / dbu / 2, size / dbu / 2)
78
+ horz = pya.Region().insert(pya.Box(-width / dbu, -width / dbu / 2, width / dbu, width / dbu / 2))
79
+ vert = pya.Region().insert(pya.Box(-width / dbu / 2, -width / dbu, width / dbu / 2, width / dbu))
80
+ marker = horz + vert
81
+ marker.merge()
82
+ out = pya.Region().insert(box)
83
+ half = int(size / dbu / 2)
84
+ for x, y in ((-half, -half), (-half, half), (half, half), (half, -half)):
85
+ out.insert(marker.transformed(pya.Trans(x, y)))
86
+ return out
87
+
88
+
89
+ class _Marker(Element):
90
+ marker_layer = Param(
91
+ pdt.TypeString,
92
+ "Layer: qcc name (marker_0..3, chip_boundary, ...) or KQC name (base_metal_gap_wo_grid = legacy etch)",
93
+ "marker_1",
94
+ )
95
+
96
+ qcc_category = "marker"
97
+
98
+ def _etch(self, region: pya.Region):
99
+ if self.marker_layer in QCC_LAYERS:
100
+ self.cell.shapes(self.layout.layer(QCC_LAYERS[self.marker_layer])).insert(region)
101
+ return
102
+ self.cell.shapes(self.get_layer(self.marker_layer)).insert(region)
103
+ if self.marker_layer.startswith("base_metal"):
104
+ self.add_protection(pya.Region(region.bbox()).sized(self.margin / self.layout.dbu))
105
+
106
+
107
+ class CornerMarker(_Marker):
108
+ """L-shaped chip-corner alignment marker (legacy ``Marker``); ``hsq=True`` draws the HSQ variant."""
109
+
110
+ thickness = Param(pdt.TypeDouble, "Arm thickness", 50, unit="μm")
111
+ width = Param(pdt.TypeDouble, "Marker size (full cross width; each arm is width / 2 long)", 500, unit="μm")
112
+ hsq = Param(pdt.TypeBoolean, "HSQ marker (qcc hsq + hsq_boundary layers instead of the base-metal etch)", False)
113
+
114
+ @classmethod
115
+ def qcc_keepout(cls, params: dict) -> list:
116
+ """3/0 keep-out (local µm), legacy ``Marker.lym`` ``fab_l``: the marker cross itself (none for the HSQ
117
+ variant, whose ``fab_l`` the chips set to the HSQ write-field layer 150/0)."""
118
+ from quantcore_circuits.layouts.others.keepout import DBU, dpolygons, full_params # pylint: disable=C0415
119
+
120
+ p = full_params(cls, params)
121
+ return [] if p["hsq"] else dpolygons(corner_marker_region(DBU, p["thickness"], p["width"]))
122
+
123
+ def build(self):
124
+ region = corner_marker_region(self.layout.dbu, self.thickness, self.width)
125
+ if self.hsq:
126
+ self.cell.shapes(self.layout.layer(QCC_LAYERS["hsq"])).insert(region)
127
+ self.cell.shapes(self.layout.layer(QCC_LAYERS["hsq_boundary"])).insert(region)
128
+ else:
129
+ self._etch(region)
130
+
131
+
132
+ class CrossMarker(_Marker):
133
+ """Small alignment cross (legacy ``draw.marker``, used beside the ``cpwe`` bond pads)."""
134
+
135
+ length = Param(pdt.TypeDouble, "Cross length", 20, unit="μm")
136
+ width = Param(pdt.TypeDouble, "Arm width", 2, unit="μm")
137
+
138
+ def build(self):
139
+ self._etch(cross_marker_region(self.layout.dbu, self.length, self.width))
140
+
141
+
142
+ class GlobalMarker(_Marker):
143
+ """Global alignment marker: six squares in two columns (legacy ``draw.global_marker``)."""
144
+
145
+ size = Param(pdt.TypeDouble, "Square size", 50, unit="μm")
146
+ dx = Param(pdt.TypeDouble, "Column offset from the centre", 200, unit="μm")
147
+ dy = Param(pdt.TypeDouble, "Row pitch", 400, unit="μm")
148
+
149
+ def build(self):
150
+ self._etch(global_marker_region(self.layout.dbu, self.size, self.dx, self.dy))
151
+
152
+
153
+ class DicingMarker(_Marker):
154
+ """Dicing cross (legacy ``draw.marker_dicing``)."""
155
+
156
+ length = Param(pdt.TypeDouble, "Cross length", 500, unit="μm")
157
+ width = Param(pdt.TypeDouble, "Arm width", 50, unit="μm")
158
+ marker_layer = Param(pdt.TypeString, "Layer (qcc or KQC name)", "marker_0")
159
+
160
+ def build(self):
161
+ self._etch(dicing_marker_region(self.layout.dbu, self.length, self.width))
162
+
163
+
164
+ class AlignmentMarkers(_Marker):
165
+ """E-beam alignment squares at the four chip corners (legacy ``draw.marker_align``); origin = chip lower-left."""
166
+
167
+ chip_width = Param(pdt.TypeDouble, "Chip width", 7500, unit="μm")
168
+ chip_height = Param(pdt.TypeDouble, "Chip height", 7500, unit="μm")
169
+ size = Param(pdt.TypeDouble, "Square size", 5, unit="μm")
170
+ pitch = Param(pdt.TypeDouble, "Square pitch in a group", 100, unit="μm")
171
+ inset = Param(pdt.TypeDouble, "Inset of the lower-left group from the chip corner", 150, unit="μm")
172
+
173
+ def build(self):
174
+ self._etch(
175
+ alignment_marker_region(
176
+ self.layout.dbu, self.chip_width, self.chip_height, self.size, self.pitch, self.inset
177
+ )
178
+ )
179
+
180
+
181
+ class EbeamMarker(_Marker):
182
+ """E-beam marker: four metal squares in an etched window (legacy ``die_creator``)."""
183
+
184
+ size = Param(pdt.TypeDouble, "Window size", 600, unit="μm")
185
+ hole = Param(pdt.TypeDouble, "Square size", 20, unit="μm")
186
+ offset = Param(pdt.TypeDouble, "Square offset from the centre (x and y)", 100, unit="μm")
187
+
188
+ def build(self):
189
+ self._etch(ebeam_marker_region(self.layout.dbu, self.size, self.hole, self.offset))
190
+
191
+
192
+ class BoundaryBox(_Marker):
193
+ """Chip boundary square with corner crosses (legacy ``BoundBox``, layer 9/0 → qcc ``chip_boundary``)."""
194
+
195
+ size = Param(pdt.TypeDouble, "Box size", 5000, unit="μm")
196
+ width = Param(pdt.TypeDouble, "Corner cross half-length", 5, unit="μm")
197
+
198
+ marker_layer = Param(pdt.TypeString, "Layer (qcc or KQC name)", "chip_boundary")
199
+
200
+ def build(self):
201
+ self._etch(boundary_box_region(self.layout.dbu, self.size, self.width))
@@ -0,0 +1,263 @@
1
+ """Cells re-implemented from gdsfactory/quantum-rf-pdk (QPDK, MIT licence, © the QPDK authors): the geometry is
2
+ re-drawn here as KQC Elements in µm (QPDK was read, never imported or run).
3
+
4
+ * :class:`NeckTermination` — ``qpdk/cells/vortex.py::neck_termination`` (Shulga et al. 2026): a CPW that tapers into
5
+ a narrow neck shorted to ground inside an etched window lined with flux-trapping holes.
6
+ * :class:`GatemonCoupler` — ``qpdk/cells/gatemon.py::gatemon_coupler``: a straight CPW with a capacitive reference
7
+ port ``qubit`` for a :class:`~quantcore_circuits.layouts.qubits.qpdk_cells.Gatemon` island.
8
+ * :class:`HyperbolicVertexCoupler` — ``qpdk/cells/hyperbolic.py::hyperbolic_vertex_coupler`` (Kollár et al. 2019): a
9
+ disk cut into ``q`` pie-slice pins with a CPW lead per pin.
10
+
11
+ QPDK draws metal on ``M1_DRAW`` and the etch on ``M1_ETCH`` and exports ``M1_ETCH − M1_DRAW``; here that difference
12
+ is drawn on ``base_metal_gap_wo_grid`` (PDK v2 fab 1/0). QPDK port names are kept (``o1``, ``o2``, ``qubit``, …).
13
+ CPW widths at the ports are the element's ``a``/``b`` (QPDK ``cpw``: 10/6 µm, the KQC defaults).
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import math
19
+
20
+ from kqcircuits.elements.element import Element
21
+ from kqcircuits.pya_resolver import pya
22
+ from kqcircuits.util.parameters import Param, pdt
23
+
24
+
25
+ def _box(dbu, x0, y0, x1, y1) -> pya.Box:
26
+ return pya.DBox(x0, y0, x1, y1).to_itype(dbu)
27
+
28
+
29
+ # ---- neck termination -------------------------------------------------------------------------------------------
30
+ def neck_profile(width, neck_width, taper_length, neck_length, taper_shape="linear"):
31
+ """QPDK ``neck_termination`` centre-conductor width profile [(x, w), ...] from the port (x = 0) to the short."""
32
+ if taper_shape == "linear":
33
+ profile = [(0.0, width), (taper_length, neck_width)]
34
+ else:
35
+ n = 41
36
+ profile = [
37
+ (
38
+ taper_length * i / (n - 1),
39
+ neck_width + (width - neck_width) * (1 + math.cos(math.pi * i / (n - 1))) / 2,
40
+ )
41
+ for i in range(n)
42
+ ]
43
+ profile.append((taper_length + neck_length, neck_width))
44
+ return profile
45
+
46
+
47
+ def neck_trap_hole_centres(window_length, window_width, rows, size, pitch, offset, keepout):
48
+ """Centres of QPDK's flux-trap holes around the window (one square grid, open at the port end)."""
49
+ if not rows:
50
+ return []
51
+ half = size / 2
52
+ x0 = window_length + offset + half
53
+ y0 = window_width / 2 + offset + half
54
+ n_inner_x = math.floor((x0 - half) / pitch)
55
+ n_inner_y = math.floor((y0 - half) / pitch)
56
+ out = []
57
+ for i in range(-n_inner_x, rows):
58
+ x = x0 + i * pitch
59
+ for k in range(-n_inner_y, rows):
60
+ y_abs = y0 + k * pitch
61
+ if i < 0 and k < 0:
62
+ continue # inside the window's footprint
63
+ if i >= 0 and y_abs < (keepout + size) / 2:
64
+ continue # current path from the neck into the ground
65
+ out += [(x, y_abs), (x, -y_abs)]
66
+ return out
67
+
68
+
69
+ class NeckTermination(Element):
70
+ """Shorted CPW end through a taper and a narrow neck in an etched window (QPDK ``neck_termination``).
71
+
72
+ Re-implemented from gdsfactory/quantum-rf-pdk ``qpdk/cells/vortex.py`` (MIT). Port ``o1`` at the origin faces −x
73
+ (CPW ``a``/``b``); the window runs from x = 0 to ``taper_length + neck_length`` (``window_width`` across), the
74
+ centre conductor tapers from ``a`` to ``neck_width`` over ``taper_length`` and the neck joins the ground at the
75
+ window's far edge (refpoints ``neck_start``, ``neck_end`` = the short). ``trap_hole_rows`` rows of square holes
76
+ line the two long sides and the far end, with a hole-free column ``trap_hole_keepout`` wide on the neck axis;
77
+ the ring is open at the port end. LOM: the taper + neck is a short series line and the neck inductance to
78
+ ground at ``neck_end``.
79
+ """
80
+
81
+ taper_length = Param(pdt.TypeDouble, "Taper length", 100, unit="μm")
82
+ taper_shape = Param(pdt.TypeString, "Taper profile", "linear", choices=["linear", "smooth"])
83
+ neck_width = Param(pdt.TypeDouble, "Neck width", 2, unit="μm")
84
+ neck_length = Param(pdt.TypeDouble, "Neck length", 325, unit="μm")
85
+ window_width = Param(pdt.TypeDouble, "Etched window width (across the line)", 380, unit="μm")
86
+ trap_hole_rows = Param(pdt.TypeInt, "Rows of flux-trap holes around the window (0 = none)", 4)
87
+ trap_hole_size = Param(pdt.TypeDouble, "Trap hole side", 4, unit="μm")
88
+ trap_hole_pitch = Param(pdt.TypeDouble, "Trap hole pitch", 5.5, unit="μm")
89
+ trap_hole_offset = Param(pdt.TypeDouble, "Ground strip between window and first hole row", 6, unit="μm")
90
+ trap_hole_keepout = Param(pdt.TypeDouble, "Hole-free column on the neck axis at the far end", 24, unit="μm")
91
+
92
+ qcc_category = "termination"
93
+
94
+ def _check(self):
95
+ for name in ("taper_length", "neck_width", "neck_length"):
96
+ if not getattr(self, name) > 0:
97
+ return f"{name} must be positive, got {getattr(self, name)}"
98
+ if self.neck_width >= self.a:
99
+ return f"neck_width ({self.neck_width}) must be smaller than the CPW width a ({self.a})"
100
+ if self.window_width < self.a + 2 * self.b:
101
+ return f"window_width ({self.window_width}) must be at least the CPW footprint ({self.a + 2 * self.b})"
102
+ if self.trap_hole_rows < 0:
103
+ return f"trap_hole_rows must be >= 0, got {self.trap_hole_rows}"
104
+ if self.trap_hole_rows and not 0 < self.trap_hole_size < self.trap_hole_pitch:
105
+ return "trap_hole_size must be positive and smaller than trap_hole_pitch"
106
+ if self.trap_hole_rows and (self.trap_hole_offset < 0 or self.trap_hole_keepout <= self.neck_width):
107
+ return "trap_hole_offset must be >= 0 and trap_hole_keepout must exceed neck_width"
108
+ return ""
109
+
110
+ def build(self):
111
+ problem = self._check()
112
+ if problem:
113
+ self.raise_error_on_cell(f"NeckTermination: {problem}")
114
+ dbu = self.layout.dbu
115
+ length = self.taper_length + self.neck_length
116
+ profile = neck_profile(self.a, self.neck_width, self.taper_length, self.neck_length, self.taper_shape)
117
+ conductor = [pya.DPoint(x, -w / 2) for x, w in profile] + [pya.DPoint(x, w / 2) for x, w in reversed(profile)]
118
+ window = pya.Region(_box(dbu, 0, -self.window_width / 2, length, self.window_width / 2))
119
+ etch = window - pya.Region(pya.DPolygon(conductor).to_itype(dbu))
120
+ h = self.trap_hole_size / 2
121
+ for x, y in neck_trap_hole_centres(
122
+ length,
123
+ self.window_width,
124
+ self.trap_hole_rows,
125
+ self.trap_hole_size,
126
+ self.trap_hole_pitch,
127
+ self.trap_hole_offset,
128
+ self.trap_hole_keepout,
129
+ ):
130
+ etch.insert(_box(dbu, x - h, y - h, x + h, y + h))
131
+ etch.merge()
132
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(etch)
133
+ self.add_protection(pya.Region(etch.bbox()).sized(self.margin / dbu))
134
+ self.add_port("o1", pya.DPoint(0, 0), pya.DVector(-1, 0))
135
+ self.refpoints["neck_start"] = pya.DPoint(self.taper_length, 0)
136
+ self.refpoints["neck_end"] = pya.DPoint(length, 0)
137
+
138
+
139
+ # ---- gatemon coupler --------------------------------------------------------------------------------------------
140
+ class GatemonCoupler(Element):
141
+ """Straight CPW ``o1`` → ``o2`` with a capacitive island reference port ``qubit`` (QPDK ``gatemon_coupler``).
142
+
143
+ Re-implemented from gdsfactory/quantum-rf-pdk ``qpdk/cells/gatemon.py`` (MIT). The line runs along +x from ``o1``
144
+ (origin, faces −x) to ``o2`` (x = ``length``, faces +x), CPW ``a``/``b``. Port ``qubit`` sits
145
+ ``pocket_gap_top`` beyond the conductor edge at ``coupling_position`` on the ``qubit_side`` and faces away from
146
+ the line: snap a :class:`Gatemon` ``readout`` port to it, and the gatemon's pocket opens into the line's gap
147
+ there. No metal crosses that gap; ``coupling_capacitance`` (fF, QPDK's nominal 5.4 fF, not an extraction) is
148
+ the C between the line at ``coupling_position`` and the island for the LOM model.
149
+ """
150
+
151
+ length = Param(pdt.TypeDouble, "Line length", 600, unit="μm")
152
+ coupling_position = Param(pdt.TypeDouble, "Island centre measured from o1", 200, unit="μm")
153
+ island_width = Param(pdt.TypeDouble, "Island width (reference plane)", 150, unit="μm")
154
+ pocket_gap_top = Param(pdt.TypeDouble, "Island edge to conductor edge", 40, unit="μm")
155
+ qubit_side = Param(pdt.TypeString, "Island side of the line", "bottom", choices=["bottom", "top"])
156
+ coupling_capacitance = Param(pdt.TypeDouble, "Nominal line-island capacitance (LOM)", 5.4, unit="fF")
157
+
158
+ qcc_category = "coupler"
159
+
160
+ @classmethod
161
+ def qcc_port_widths(cls, params: dict) -> dict:
162
+ """``qubit`` is a reference plane, not a CPW end: a = island width, b = the island-to-line clearance."""
163
+ return {"qubit": (float(params.get("island_width", 150)), float(params.get("pocket_gap_top", 40)))}
164
+
165
+ def build(self):
166
+ if not 0 < self.coupling_position < self.length or min(self.island_width, self.pocket_gap_top) <= 0:
167
+ self.raise_error_on_cell("GatemonCoupler: invalid coupling reference plane")
168
+ if self.coupling_capacitance < 0:
169
+ self.raise_error_on_cell("GatemonCoupler: coupling_capacitance must be >= 0")
170
+ dbu = self.layout.dbu
171
+ a, b = self.a, self.b
172
+ gaps = pya.Region(_box(dbu, 0, a / 2, self.length, a / 2 + b))
173
+ gaps.insert(_box(dbu, 0, -a / 2 - b, self.length, -a / 2))
174
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(gaps)
175
+ self.add_protection(pya.Region(gaps.bbox()).sized(self.margin / dbu))
176
+ self.add_port("o1", pya.DPoint(0, 0), pya.DVector(-1, 0))
177
+ self.add_port("o2", pya.DPoint(self.length, 0), pya.DVector(1, 0))
178
+ side = -1 if self.qubit_side == "bottom" else 1
179
+ self.add_port(
180
+ "qubit", pya.DPoint(self.coupling_position, side * (a / 2 + self.pocket_gap_top)), pya.DVector(0, side)
181
+ )
182
+ self.refpoints["coupling_point"] = pya.DPoint(self.coupling_position, 0)
183
+
184
+
185
+ # ---- hyperbolic vertex coupler ----------------------------------------------------------------------------------
186
+ def _unit(angle_deg: float) -> pya.DVector:
187
+ a = math.radians(angle_deg)
188
+ return pya.DVector(math.cos(a), math.sin(a))
189
+
190
+
191
+ def _snap(v: float, grid: float = 1e-3) -> float:
192
+ return round(v / grid) * grid
193
+
194
+
195
+ def vertex_coupler_port_offsets(q, rotation, pin_radius, lead_length):
196
+ """QPDK ``_vertex_coupler_port_offsets``: lead ends at ``pin_radius + lead_length``, snapped to the 1 nm grid."""
197
+ reach = pin_radius + lead_length
198
+ return [
199
+ (_snap(_unit(rotation + 360 * k / q).x * reach), _snap(_unit(rotation + 360 * k / q).y * reach))
200
+ for k in range(q)
201
+ ]
202
+
203
+
204
+ class HyperbolicVertexCoupler(Element):
205
+ """``q``-pin capacitive disk coupler at a hyperbolic-lattice vertex (QPDK ``hyperbolic_vertex_coupler``).
206
+
207
+ Re-implemented from gdsfactory/quantum-rf-pdk ``qpdk/cells/hyperbolic.py`` (MIT). A metal disk of
208
+ ``pin_radius`` is cut into ``q`` pie-slice pins by radial gaps ``pin_gap`` wide (centred between the pins) and
209
+ isolated from ground by a ``ground_gap`` ring; pin ``k`` points along ``rotation + 360 k / q`` degrees and feeds
210
+ a CPW lead (``a``/``b``) that overlaps the disk by ``a`` and ends at port ``o<k+1>``, ``lead_length`` beyond the
211
+ rim (snapped to 1 nm), facing away from the centre (generally not Manhattan). The disk is centred at the
212
+ origin (refpoint ``center``).
213
+ """
214
+
215
+ q = Param(pdt.TypeInt, "Number of pins", 3)
216
+ rotation = Param(pdt.TypeDouble, "Direction of pin 0", 0, unit="°")
217
+ pin_radius = Param(pdt.TypeDouble, "Disk radius", 40, unit="μm")
218
+ pin_gap = Param(pdt.TypeDouble, "Radial gap between pins", 4, unit="μm")
219
+ ground_gap = Param(pdt.TypeDouble, "Disk to ground clearance", 6, unit="μm")
220
+ lead_length = Param(pdt.TypeDouble, "CPW lead beyond the disk", 20, unit="μm")
221
+
222
+ qcc_category = "coupler"
223
+
224
+ def build(self):
225
+ q, r, width, gap = int(self.q), self.pin_radius, self.a, self.b
226
+ if q < 2:
227
+ self.raise_error_on_cell(f"HyperbolicVertexCoupler: q must be at least 2, got {q}")
228
+ pin_chord = 2 * r * math.sin(math.pi / q) - self.pin_gap
229
+ inner_chord = 2 * (r - width) * math.sin(math.pi / q) - self.pin_gap
230
+ if min(pin_chord, inner_chord) <= width:
231
+ self.raise_error_on_cell(
232
+ f"HyperbolicVertexCoupler: pins of a {q}-pin coupler with pin_radius={r} µm are narrower "
233
+ f"({min(pin_chord, inner_chord):.1f} µm) than the lead ({width} µm)"
234
+ )
235
+ dbu = self.layout.dbu
236
+
237
+ def strip(end: pya.DVector, length: float, w: float) -> pya.Region:
238
+ start = end * (1 - length / end.length())
239
+ return pya.Region(
240
+ pya.DPath([pya.DPoint(start.x, start.y), pya.DPoint(end.x, end.y)], w).polygon().to_itype(dbu)
241
+ )
242
+
243
+ def disk(radius: float) -> pya.Region:
244
+ return pya.Region(pya.DPolygon.ellipse(pya.DBox(-radius, -radius, radius, radius), 128).to_itype(dbu))
245
+
246
+ metal = disk(r)
247
+ for k in range(q):
248
+ metal -= strip(_unit(self.rotation + 360 * (k + 0.5) / q) * 2 * r, 2 * r, self.pin_gap)
249
+ clearance = disk(r + self.ground_gap)
250
+ ports = []
251
+ for k, (x, y) in enumerate(vertex_coupler_port_offsets(q, self.rotation, r, self.lead_length)):
252
+ end = pya.DVector(x, y)
253
+ reach = end.length() - r + width
254
+ metal += strip(end, reach, width)
255
+ clearance += strip(end, reach, width + 2 * gap)
256
+ ports.append((f"o{k + 1}", pya.DPoint(x, y), end / end.length()))
257
+ metal.merge()
258
+ etch = (clearance - metal).merged()
259
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(etch)
260
+ self.add_protection(pya.Region(etch.bbox()).sized(self.margin / dbu))
261
+ for name, pos, direction in ports:
262
+ self.add_port(name, pos, direction)
263
+ self.refpoints["center"] = pya.DPoint(0, 0)
@@ -0,0 +1,114 @@
1
+ """Primitive shapes from the QWri library: ``ArcPath`` (``Arc.lym`` "Arc"), ``SpiralPath`` (``spiral.lym``
2
+ "Spiral") and ``TextLabel`` (the chips' ``pya.TextGenerator`` labels: qubit numbers, "JS=…", "TOP=…nm"), drawn where
3
+ the legacy code draws (layer 1/0 → ``base_metal_gap_wo_grid``, i.e. etched); set ``metal`` to draw them as metal
4
+ (``base_metal_addition``) instead. Same pya calls as the legacy code. No ports.
5
+ """
6
+
7
+ import math
8
+
9
+ from kqcircuits.elements.element import Element
10
+ from kqcircuits.pya_resolver import pya
11
+ from kqcircuits.util.parameters import Param, pdt
12
+
13
+
14
+ def legacy_arc_points(dbu, length, n, flag, arc_length, angle=3 * math.pi / 2, angle_begin=math.pi / 2):
15
+ """Legacy ``Arc.arc`` from the origin (``length``/``arc_length`` in µm), points in dbu."""
16
+ n = max(int(n), 32) # legacy coerce
17
+ length, arc_length = length / dbu, arc_length / dbu
18
+ direction = -1 if flag else 1
19
+ pts = []
20
+ current_angle = angle_begin
21
+ if length < arc_length:
22
+ radius = arc_length / math.pi
23
+ angle = float(direction * (math.pi * length)) / arc_length + angle_begin
24
+ else:
25
+ radius = length / math.pi
26
+ da = (angle - current_angle) / n
27
+ init = pya.Point(pya.DPoint(0.0, 0.0))
28
+ r_point = pya.Point(pya.DPoint(init.x, init.y - radius))
29
+ for _ in range(n + 1):
30
+ pts.append(
31
+ pya.Point(
32
+ pya.DPoint(r_point.x + radius * math.cos(current_angle), r_point.y + radius * math.sin(current_angle))
33
+ )
34
+ )
35
+ current_angle = (current_angle + float(direction * da)) % (2 * math.pi)
36
+ return pts
37
+
38
+
39
+ def spiral_points(dbu, inner_r, outer_r, width, spacing, n):
40
+ """Legacy ``Spiral.produce_impl`` (Archimedean, pitch ``width + spacing`` per turn), points in dbu."""
41
+ n = max(int(n), 4)
42
+ inner, outer = inner_r / dbu, outer_r / dbu
43
+ da = math.pi * 2 / n
44
+ dr = (width + spacing) / n / dbu
45
+ pts, r, a = [], inner, 0.0
46
+ while r < outer:
47
+ pts.append(pya.Point.from_dpoint(pya.DPoint(r * math.cos(a), r * math.sin(a))))
48
+ r += dr
49
+ a = (a + da) % (math.pi * 2)
50
+ return pts
51
+
52
+
53
+ class _Shape(Element):
54
+ metal = Param(pdt.TypeBoolean, "Draw as metal (base_metal_addition) instead of etched", False)
55
+
56
+ qcc_category = "shape"
57
+
58
+ def _draw(self, region: pya.Region):
59
+ layer = "base_metal_addition" if self.metal else "base_metal_gap_wo_grid"
60
+ self.cell.shapes(self.get_layer(layer)).insert(region)
61
+ self.add_protection(pya.Region(region.bbox()).sized(self.margin / self.layout.dbu))
62
+
63
+
64
+ class ArcPath(_Shape):
65
+ """Circular arc path starting at the origin (legacy "Arc"): ``length`` ≥ ``arc_length`` → half circle of that
66
+ length, shorter → a partial arc of radius ``arc_length / π``."""
67
+
68
+ length = Param(pdt.TypeDouble, "Path length", 100, unit="μm")
69
+ width = Param(pdt.TypeDouble, "Path width", 5, unit="μm")
70
+ arc_length = Param(pdt.TypeDouble, "Arc length of a half circle", 100, unit="μm")
71
+ clockwise = Param(pdt.TypeBoolean, "Turn clockwise (legacy flag)", False)
72
+ arc_points = Param(pdt.TypeInt, "Points on the arc", 64)
73
+
74
+ def build(self):
75
+ dbu = self.layout.dbu
76
+ pts = legacy_arc_points(dbu, self.length, self.arc_points, self.clockwise, self.arc_length)
77
+ self._draw(pya.Region(pya.Path(pts, self.width / dbu)))
78
+
79
+
80
+ class SpiralPath(_Shape):
81
+ """Archimedean spiral path from ``inner_r`` to ``outer_r`` (legacy "Spiral")."""
82
+
83
+ inner_r = Param(pdt.TypeDouble, "Inner radius", 1, unit="μm")
84
+ outer_r = Param(pdt.TypeDouble, "Outer radius", 10, unit="μm")
85
+ width = Param(pdt.TypeDouble, "Path width", 1, unit="μm")
86
+ spacing = Param(pdt.TypeDouble, "Spacing between turns", 1, unit="μm")
87
+ turn_points = Param(pdt.TypeInt, "Points per turn", 64)
88
+
89
+ def build(self):
90
+ dbu = self.layout.dbu
91
+ pts = spiral_points(dbu, self.inner_r, self.outer_r, self.width, self.spacing, self.turn_points)
92
+ if len(pts) >= 2:
93
+ self._draw(pya.Region(pya.Path(pts, self.width / dbu)))
94
+
95
+
96
+ class TextLabel(_Shape):
97
+ """Text etched into the ground (legacy chips 01–06: ``TextGenerator.default_generator().text(text, dbu, mag,
98
+ inv)`` inserted on 1/0, and on 3/0 which the fab export derives from 1/0).
99
+
100
+ ``mag`` is the legacy magnification (200 for "JS=…" / "TOP=…nm", 300 for the qubit numbers); ``inverted`` = legacy
101
+ ``inv``: the text's box with the letters cut out (metal letters in an etched box). The legacy origin is kept:
102
+ the text starts at (0, 0), so the legacy insertion points apply unchanged.
103
+ """
104
+
105
+ text = Param(pdt.TypeString, "Text", "QC")
106
+ mag = Param(pdt.TypeDouble, "Magnification (legacy TextGenerator mag)", 200)
107
+ inverted = Param(pdt.TypeBoolean, "Inverted: box minus letters (legacy inv)", False)
108
+ bias = Param(pdt.TypeDouble, "Bias (legacy TextGenerator bias)", 0, unit="μm")
109
+
110
+ def build(self):
111
+ gen = pya.TextGenerator.default_generator()
112
+ region = gen.text(self.text, self.layout.dbu, self.mag, self.inverted, self.bias)
113
+ if not region.is_empty():
114
+ self._draw(region)