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,454 @@
1
+ """Fab export: KQC layers → Quantcore fab layers, with polarity, corner rounding and cheese.
2
+
3
+ M1 (1/0) is the KQC etch region ``base_metal_gap_wo_grid + ground_grid − base_metal_addition`` (what KQC merges into
4
+ ``base_metal_gap``). Negative polarity (default, as in the legacy fab output) writes the etch; positive writes the
5
+ metal (chip box minus etch). With a ``box`` every layer is clipped to it. M3 (3/0) is the second-metal etch:
6
+ filled keep-outs per route and component (:func:`keepout_region`, :class:`~quantcore_circuits.pdk.KeepoutRule`) that
7
+ cover each 1/0 feature *and* what lies between its gaps, plus ground margin (route 10, component 24, other 9 µm; a
8
+ cell's own ``qcc_keepout`` shapes grow by ``own_grow`` = 4 µm).
9
+ JJ, spacer, frame, airbridge (300/301), TSV (700) and flip-chip face ``2b1`` (800–804) layers are
10
+ copied from their KQC / qcc source layers (a fab layer's ``faces`` say which KQC faces it reads).
11
+
12
+ The universal Quantcore (QCT) fab rules of the PDK are applied by :func:`export_fab` (``qcc mask``), never by the
13
+ simulation exports:
14
+
15
+ * **corner rounding** (:class:`~quantcore_circuits.pdk.CornerRounding`, :func:`round_corners`): every polygon of the
16
+ rounded layers gets r = fraction × its shortest dimension (capped);
17
+ * **cheese** (:class:`~quantcore_circuits.pdk.CheeseRule`, :func:`cheese_holes`): a band of grid-aligned square
18
+ holes around the components (3/0 grown by ``rows`` pitches, none within ``clearance`` = 4 µm of 3/0), inside the
19
+ design area and clear of the frame's markers and device ID — not over the whole chip.
20
+
21
+ The PDK band cheese is drawn by the chip build itself (into ``ground_grid``, see
22
+ :class:`~quantcore_circuits.pdk.CheeseRule`); a design with its own cheese (KQC's whole-area ``with_grid``, a static
23
+ cell's holes) keeps it — the original design wins. :func:`export_fab` adds the band only to a build that has no
24
+ cheese at all. The keep-outs of 3/0 are computed from the etch *without* the cheese (the clearance rule and the
25
+ band are measured to them), and then every cheese hole written on 1/0 is also written on 3/0 as the same square
26
+ (decision 2026-11-17), so 3/0 = keep-outs ∪ cheese holes. ``--no-cheese`` leaves both layers without holes.
27
+
28
+ Device layers with no PDK fab layer (``SIS_shadow``, EBL helper gaps, the unused qcc layers ``150/0``,
29
+ ``1002/0``, ``1003/0``) are not written. :func:`dropped_layers` lists the non-empty ones; :func:`export_fab` warns
30
+ (:class:`FabLayersDropped`) and reports them, so nothing vanishes silently.
31
+
32
+ Wafer-level mask sets (many chips, markers, labels) are produced with KQC's ``MaskSet``/``mask_export`` on the
33
+ written chip files; that is the next step for ``wafers/``.
34
+ """
35
+
36
+ from __future__ import annotations
37
+
38
+ import math
39
+ import warnings
40
+ from pathlib import Path
41
+
42
+ from kqcircuits.defaults import default_faces
43
+ from kqcircuits.pya_resolver import pya
44
+
45
+ from quantcore_circuits.pdk import DEFAULT_PDK, QCC_LAYERS, get_pdk
46
+
47
+
48
+ def _region(cell: pya.Cell, info: pya.LayerInfo) -> pya.Region:
49
+ layout = cell.layout()
50
+ return pya.Region(cell.begin_shapes_rec(layout.layer(info)))
51
+
52
+
53
+ # KQC face layers that carry device geometry (the rest are helpers: ports, refpoints, avoidance, waveguide_path, ...)
54
+ DEVICE_LAYERS = (
55
+ "base_metal_gap_wo_grid",
56
+ "base_metal_gap",
57
+ "base_metal_gap_for_EBL",
58
+ "base_metal_addition",
59
+ "ground_grid",
60
+ "SIS_junction",
61
+ "SIS_junction_2",
62
+ "SIS_shadow",
63
+ "airbridge_pads",
64
+ "airbridge_flyover",
65
+ "through_silicon_via",
66
+ "indium_bump",
67
+ "underbump_metallization",
68
+ )
69
+
70
+
71
+ class FabLayersDropped(UserWarning):
72
+ """Device geometry on layers PDK v2 has no fab layer for was left out of the fab export."""
73
+
74
+
75
+ def _shape_count(cell: pya.Cell, info: pya.LayerInfo) -> int:
76
+ layout = cell.layout()
77
+ index = layout.find_layer(info)
78
+ if index is None:
79
+ return 0
80
+ count = 0
81
+ it = cell.begin_shapes_rec(index)
82
+ while not it.at_end():
83
+ count += 1
84
+ it.next()
85
+ return count
86
+
87
+
88
+ def dropped_layers(cell: pya.Cell, pdk_name: str = DEFAULT_PDK) -> dict[str, int]:
89
+ """Non-empty device layers of a built cell that :func:`fab_regions` does not use: ``{"<face>_<name> (l/d)":
90
+ shape count}``. M1 uses the PDK face's ``base_metal_gap_wo_grid``, ``ground_grid`` and ``base_metal_addition``;
91
+ the other fab layers use their PDK source layer."""
92
+ pdk = get_pdk(pdk_name)
93
+ etch_parts = ("base_metal_gap_wo_grid", "ground_grid", "base_metal_addition")
94
+ used = set()
95
+ for fl in pdk.fab_layers.values():
96
+ for f in fl.faces or (pdk.face,):
97
+ if fl.source == "base_metal_gap": # M1's symbolic source: built from the three etch layers
98
+ used |= {(f, part) for part in etch_parts}
99
+ elif fl.source in default_faces.get(f, {}):
100
+ used.add((f, fl.source))
101
+ used_qcc = {fl.source for fl in pdk.fab_layers.values() if fl.source in QCC_LAYERS}
102
+ out = {}
103
+ for face, layers in default_faces.items():
104
+ for name in DEVICE_LAYERS:
105
+ if name not in layers or (face, name) in used:
106
+ continue
107
+ n = _shape_count(cell, layers[name])
108
+ if n:
109
+ out[f"{face}_{name} ({layers[name].layer}/{layers[name].datatype})"] = n
110
+ for name, info in QCC_LAYERS.items():
111
+ if name not in used_qcc:
112
+ n = _shape_count(cell, info)
113
+ if n:
114
+ out[f"qcc {name} ({info.layer}/{info.datatype})"] = n
115
+ return out
116
+
117
+
118
+ def etch_region(cell: pya.Cell, face_name: str, grid: bool = True) -> pya.Region:
119
+ """The 1/0 etch of ``face_name`` (dbu): ``base_metal_gap_wo_grid`` (+ the ``ground_grid`` cheese when ``grid``)
120
+ − ``base_metal_addition``."""
121
+ face = default_faces[face_name]
122
+ etch = _region(cell, face["base_metal_gap_wo_grid"])
123
+ if grid:
124
+ etch += _region(cell, face["ground_grid"])
125
+ return etch.merged() - _region(cell, face["base_metal_addition"])
126
+
127
+
128
+ def _etch(cell: pya.Cell, face_name: str) -> pya.Region:
129
+ return etch_region(cell, face_name)
130
+
131
+
132
+ def build_cheese(cell: pya.Cell, pdk_name: str = DEFAULT_PDK) -> int:
133
+ """Cheese holes the chip build already has (``ground_grid`` polygons of the PDK face: the PDK band or the
134
+ original design's own grid)."""
135
+ face = default_faces[get_pdk(pdk_name).face]
136
+ return _region(cell, face["ground_grid"]).count()
137
+
138
+
139
+ def _is_route(child: pya.Cell, cls) -> bool:
140
+ return (cls is not None and cls.__name__ == "WaveguideComposite") or child.name.startswith("Waveguide")
141
+
142
+
143
+ def keepout_region(cell: pya.Cell, pdk, etch: pya.Region | None = None) -> pya.Region:
144
+ """3/0 keep-outs of a built chip (dbu, filled; see :class:`~quantcore_circuits.pdk.KeepoutRule`)."""
145
+ rule = pdk.keepout
146
+ layout = cell.layout()
147
+ dbu = layout.dbu
148
+ face = default_faces[pdk.face]
149
+ gap_layer = layout.layer(face["base_metal_gap_wo_grid"])
150
+ path_layer = layout.layer(face["waveguide_path"]) # a route's centre conductor (KQC draws it at width a)
151
+ die = cell.bbox()
152
+ out = pya.Region()
153
+
154
+ def visit(parent: pya.Cell, trans: pya.ICplxTrans, depth: int) -> None:
155
+ for inst in parent.each_inst():
156
+ child = layout.cell(inst.cell_index)
157
+ t = trans * inst.cplx_trans
158
+ own = pya.Region(child.begin_shapes_rec(gap_layer)).transformed(t)
159
+ if own.is_empty():
160
+ continue
161
+ decl = child.pcell_declaration()
162
+ cls = type(decl) if decl is not None and not type(decl).__name__.startswith("PCellDeclaration") else None
163
+ hook = getattr(cls, "qcc_keepout", None) if cls is not None else None
164
+ if _is_route(child, cls):
165
+ body = (own + pya.Region(child.begin_shapes_rec(path_layer)).transformed(t)).merged()
166
+ out.insert(body.sized(rule.route_margin / dbu).hulls())
167
+ elif hook is not None:
168
+ grow = round(rule.own_grow / dbu)
169
+ for shape in hook(dict(child.pcell_parameters_by_name())):
170
+ poly = pya.DPolygon(shape) if isinstance(shape, pya.DBox) else shape
171
+ # a feature's own keep-out is filled (e.g. a bond pad's legacy ring covers its metal too) and
172
+ # grown by ``own_grow`` like every other keep-out
173
+ own_ko = pya.Region(poly.to_itype(dbu).transformed(t)).hulls()
174
+ out.insert(own_ko.sized(grow) if grow else own_ko)
175
+ elif depth < 2 and own.bbox().area() > 0.25 * die.area() and child.child_cells(): # a whole chip as a cell
176
+ visit(child, t, depth + 1)
177
+ else:
178
+ m = round(rule.component_margin / dbu)
179
+ out.insert(own.bbox().enlarged(m, m))
180
+
181
+ visit(cell, pya.ICplxTrans(), 0)
182
+ etch = etch if etch is not None else _etch(cell, pdk.face)
183
+ # everything in 1/0 is covered (frame text, shapes in the top cell): grow the etch that is not already well
184
+ # inside a keep-out (deeper than the margin), so a large cell under its own keep-out hook (a KI-TWPA serpentine,
185
+ # 0.8 M vertices) is not sized as a whole; the result is the same
186
+ margin = round(rule.other_margin / dbu)
187
+ out = out.merged()
188
+ rest = etch - out.sized(-margin) if not out.is_empty() else etch
189
+ out += rest.sized(margin)
190
+ return fill_small_holes(out.merged(), rule.fill_holes_um2 / dbu**2)
191
+
192
+
193
+ def fill_small_holes(region: pya.Region, max_area: float) -> pya.Region:
194
+ """``region`` with every hole of area < ``max_area`` (dbu²) filled; larger holes are kept."""
195
+ out = pya.Region()
196
+ for poly in region.each():
197
+ if poly.holes() == 0:
198
+ out.insert(poly)
199
+ continue
200
+ kept = pya.Polygon(list(poly.each_point_hull()), True)
201
+ for k in range(poly.holes()):
202
+ hole = pya.Polygon(list(poly.each_point_hole(k)), True)
203
+ if hole.area() >= max_area:
204
+ kept.insert_hole(list(poly.each_point_hole(k)), True)
205
+ out.insert(kept)
206
+ return out
207
+
208
+
209
+ def shortest_dimension(poly: pya.Polygon, min_edge: float) -> float:
210
+ """A polygon's shortest dimension (dbu): min(2·area/perimeter, its shortest edge ≥ ``min_edge``)."""
211
+ d = 2 * poly.area() / max(poly.perimeter(), 1)
212
+ edges = [e.length() for e in poly.each_edge() if e.length() >= min_edge]
213
+ return min([d, *edges])
214
+
215
+
216
+ def round_corners(region: pya.Region, rule, dbu: float) -> pya.Region:
217
+ """Round each polygon's corners with r = ``rule.fraction`` × its shortest dimension (≤ ``rule.max_radius``)."""
218
+ out = pya.Region()
219
+ for poly in region.merged().each():
220
+ r = min(rule.fraction * shortest_dimension(poly, rule.min_edge / dbu), rule.max_radius / dbu)
221
+ out.insert(poly.round_corners(r, r, rule.points) if r >= rule.min_radius / dbu else poly)
222
+ return out.merged()
223
+
224
+
225
+ def _round_squares(region: pya.Region, rule, dbu: float) -> pya.Region:
226
+ """:func:`round_corners` for a region of many equal boxes (a whole-area cheese grid: millions of squares): the
227
+ boxes of one size are rounded together (same radius, native), size by size; whatever is left (other polygons,
228
+ odd sizes) goes through :func:`round_corners`."""
229
+ left, out = region.merged(), pya.Region()
230
+ for _ in range(8):
231
+ first = next(iter(left.each()), None)
232
+ if first is None or not first.is_box():
233
+ break
234
+ b = first.bbox()
235
+ same = left.with_bbox_width(b.width(), False).with_bbox_height(b.height(), False)
236
+ same = same.with_area(b.width() * b.height(), False) # equal area in an equal bbox: a box
237
+ r = min(rule.fraction * shortest_dimension(first, rule.min_edge / dbu), rule.max_radius / dbu)
238
+ out += same.rounded_corners(r, r, rule.points) if r >= rule.min_radius / dbu else same
239
+ left -= same
240
+ return (out + round_corners(left, rule, dbu)).merged() if not left.is_empty() else out.merged()
241
+
242
+
243
+ def cheese_holes(keepout: pya.Region, rule, dbu: float, allowed: pya.Region | None = None, exclude=None) -> pya.Region:
244
+ """Grid-aligned square holes in a band around ``keepout`` (3/0): squares of ``rule.size`` on a ``rule.pitch``
245
+ grid lying entirely inside ``keepout`` grown by ``rule.rows`` pitches, ≥ ``rule.clearance`` from it (not even
246
+ touching it), inside ``allowed`` (the design area) and clear of ``exclude`` (frame markers, device ID). dbu region.
247
+
248
+ The band is measured like the grid, along x and y (a square Minkowski sum of 3/0). A square of half-width h
249
+ fits where its centre lies in the band eroded by h, so the centres are found by region operations, then read off
250
+ row by row on the grid (fast: no per-square region test)."""
251
+ if keepout.is_empty():
252
+ return pya.Region()
253
+ pitch, size = rule.pitch / dbu, rule.size / dbu
254
+ h = size / 2
255
+
256
+ def grown(d: float) -> pya.Region: # 3/0 grown by d along x and y (exact for curved meanders too)
257
+ d = round(d)
258
+ return keepout.minkowski_sum(pya.Box(-d, -d, d, d))
259
+
260
+ centres = grown(rule.rows * pitch - h) - grown(rule.clearance / dbu + h + 1)
261
+ if allowed is not None:
262
+ centres &= allowed.sized(-round(h))
263
+ if exclude is not None and not exclude.is_empty():
264
+ centres -= exclude.sized(round(h))
265
+ if centres.is_empty():
266
+ return pya.Region()
267
+ bb = centres.bbox()
268
+ half = pitch / 2 # holes centred on the grid (pitch/2 offset), so the grid is chip-aligned
269
+ rows = pya.Region()
270
+ for j in range(math.floor((bb.bottom - half) / pitch), math.ceil((bb.top - half) / pitch) + 1):
271
+ y = round(j * pitch + half)
272
+ rows.insert(pya.Box(bb.left - 1, y - 1, bb.right + 1, y + 1))
273
+ squares = pya.Region()
274
+ for seg in (centres & rows).each():
275
+ b = seg.bbox()
276
+ j = round((b.center().y - half) / pitch)
277
+ y = round(j * pitch + half)
278
+ for i in range(math.ceil((b.left - half) / pitch), math.floor((b.right - half) / pitch) + 1):
279
+ x = round(i * pitch + half)
280
+ squares.insert(pya.Box(round(x - h), round(y - h), round(x + h), round(y + h)))
281
+ return squares.merged()
282
+
283
+
284
+ def fab_regions(
285
+ cell: pya.Cell,
286
+ pdk_name: str = DEFAULT_PDK,
287
+ polarity: dict[str, str] | None = None,
288
+ box: pya.DBox | None = None,
289
+ rounding=None,
290
+ cheese=None,
291
+ cheese_allowed: pya.Region | None = None,
292
+ cheese_exclude: pya.Region | None = None,
293
+ grid: bool = True,
294
+ ) -> dict[str, pya.Region]:
295
+ """Fab-layer regions (dbu) of a built chip cell, keyed by PDK fab-layer name.
296
+
297
+ ``rounding`` / ``cheese``: a :class:`~quantcore_circuits.pdk.CornerRounding` / :class:`~quantcore_circuits.pdk.
298
+ CheeseRule`, ``True`` for the PDK's, or None (raw geometry, the default here; :func:`export_fab` applies them).
299
+ ``grid=False`` leaves the build's own cheese (``ground_grid``) out of 1/0 *and* 3/0. With it, 3/0 also holds the
300
+ cheese squares (the same squares as 1/0, not grown by the keep-out margin); the clearance rule is measured to the
301
+ keep-outs alone (3/0 without the cheese).
302
+ """
303
+ pdk = get_pdk(pdk_name)
304
+ face = default_faces[pdk.face]
305
+ layout = cell.layout()
306
+ dbu = layout.dbu
307
+ rounding = pdk.rounding if rounding is True else rounding
308
+ cheese = pdk.cheese if cheese is True else cheese
309
+ etch = etch_region(cell, pdk.face, grid)
310
+ raw = {}
311
+ for name, fl in pdk.fab_layers.items():
312
+ faces = fl.faces or (pdk.face,)
313
+ if fl.source == "base_metal_gap":
314
+ reg = pya.Region()
315
+ for f in faces:
316
+ reg += etch if f == pdk.face else etch_region(cell, f, grid)
317
+ elif fl.source == "derived":
318
+ reg = keepout_region(cell, pdk, etch_region(cell, pdk.face, grid=False))
319
+ elif fl.source in QCC_LAYERS:
320
+ reg = _region(cell, QCC_LAYERS[fl.source])
321
+ else:
322
+ reg = pya.Region()
323
+ for f in faces:
324
+ if fl.source in default_faces.get(f, {}):
325
+ reg += _region(cell, default_faces[f][fl.source])
326
+ reg = reg.merged()
327
+ if box is not None:
328
+ reg &= pya.Region(box.to_itype(dbu)) # nothing outside the chip goes on the mask
329
+ if rounding is not None and name in rounding.layers and not reg.is_empty():
330
+ reg = round_corners(reg, rounding, dbu)
331
+ raw[name] = reg
332
+ holes = pya.Region()
333
+ if cheese is not None and "M3" in raw and cheese.layer in raw:
334
+ holes = cheese_holes(raw["M3"], cheese, dbu, cheese_allowed, cheese_exclude) # from the keep-outs alone
335
+ raw[cheese.layer] = (raw[cheese.layer] + holes).merged()
336
+ if grid and "M3" in raw:
337
+ # the cheese is on 3/0 too, as the same squares as on 1/0 (not grown by the keep-out margin): the build's
338
+ # ground_grid (PDK band or the original design's own grid), rounded as it is on 1/0, and the export band
339
+ built = pya.Region()
340
+ for f in pdk.fab_layers["M1"].faces or (pdk.face,):
341
+ built += _region(cell, default_faces[f]["ground_grid"])
342
+ built = built.merged()
343
+ if box is not None:
344
+ built &= pya.Region(box.to_itype(dbu))
345
+ if rounding is not None and "M1" in rounding.layers and not built.is_empty():
346
+ built = _round_squares(built, rounding, dbu)
347
+ raw["M3"] = (raw["M3"] + built + holes).merged()
348
+ out = {}
349
+ for name, reg in raw.items():
350
+ if (polarity or {}).get(name, "negative") == "positive":
351
+ chip_box = box or cell.dbbox_per_layer(layout.layer(face["base_metal_gap_wo_grid"]))
352
+ reg = pya.Region(chip_box.to_itype(dbu)) - reg
353
+ out[name] = reg
354
+ return out
355
+
356
+
357
+ def frame_cheese_limits(result) -> tuple[pya.Region | None, pya.Region | None]:
358
+ """(allowed, exclude) dbu regions for the cheese of a built design: its design area, and the frame's marker
359
+ areas, dicing corners and device ID (none when the chip has no PDK die frame)."""
360
+ from quantcore_circuits.assembly.drc import device_id_block # pylint: disable=import-outside-toplevel
361
+ from quantcore_circuits.assembly.plan import die_frame # pylint: disable=import-outside-toplevel
362
+ from quantcore_circuits.layouts.chips.frame import design_area, keepouts # pylint: disable=import-outside-toplevel
363
+
364
+ frame = die_frame(result.design)
365
+ if frame is None:
366
+ return None, None
367
+ dbu = result.layout.dbu
368
+ chip = pya.DBox(*result.design.chip.box)
369
+ allowed = pya.Region(design_area(chip, frame).to_itype(dbu))
370
+ rule = result.design.chip.params.get("cheese")
371
+ if isinstance(rule, dict) and rule.get("edge"): # a design-chosen cheese rule's edge band
372
+ allowed &= pya.Region(chip.enlarged(-float(rule["edge"]), -float(rule["edge"])).to_itype(dbu))
373
+ exclude = pya.Region()
374
+ for b in keepouts(chip, frame, device_id_block(result)).values():
375
+ exclude.insert(b.to_itype(dbu))
376
+ return allowed, exclude
377
+
378
+
379
+ def export_fab(
380
+ result,
381
+ path: str | Path,
382
+ polarity: dict[str, str] | None = None,
383
+ report: dict | None = None,
384
+ cheese=True,
385
+ rounding=True,
386
+ ) -> Path:
387
+ """Write a fab-ready OAS/GDS with only the PDK fab layers (flat, static).
388
+
389
+ The PDK's fab rules apply by default: ``rounding`` (corner rounding) and ``cheese``. ``cheese=True`` keeps the
390
+ cheese the build drew (the PDK band, or the original design's own) and adds the PDK band only when the build has
391
+ none; ``False`` writes no cheese at all (the build's is left out too); a rule object adds that band. Non-empty
392
+ device layers that have no PDK fab layer are left out with a :class:`FabLayersDropped` warning; pass a dict as
393
+ ``report`` to get ``report["dropped"]`` (:func:`dropped_layers`), ``report["written"]`` (fab layer name →
394
+ polygon count), ``report["cheese_holes"]`` (holes on the mask) and ``report["cheese_source"]`` ("build",
395
+ "export" or "none")."""
396
+ pdk = get_pdk(result.design.pdk)
397
+ from quantcore_circuits.assembly.plan import pdk_cheese # pylint: disable=import-outside-toplevel
398
+
399
+ result.require_complete("fab export") # a mask must never silently lack a route
400
+ in_build = build_cheese(result.cell, result.design.pdk)
401
+ grid = cheese is not False
402
+ if cheese is True and (in_build or not pdk_cheese(result.design)):
403
+ # the build's cheese stands (PDK band or the original design's own, e.g. flux holes drawn on the etch layer:
404
+ # a design marked cheese "original" never gets the band at export either)
405
+ cheese = None
406
+ dropped = dropped_layers(result.cell, result.design.pdk)
407
+ if dropped:
408
+ listed = ", ".join(f"{k}: {n} shape(s)" for k, n in dropped.items())
409
+ warnings.warn(
410
+ f"export_fab({result.design.name}): PDK {pdk.name} has no fab layer for {listed}; not written",
411
+ FabLayersDropped,
412
+ stacklevel=2,
413
+ )
414
+ x0, y0, x1, y1 = result.design.chip.box
415
+ allowed, exclude = frame_cheese_limits(result)
416
+ regions = fab_regions(
417
+ result.cell,
418
+ result.design.pdk,
419
+ polarity,
420
+ pya.DBox(x0, y0, x1, y1),
421
+ rounding=rounding or None,
422
+ cheese=cheese or None,
423
+ cheese_allowed=allowed,
424
+ cheese_exclude=exclude,
425
+ grid=grid,
426
+ )
427
+ out = pya.Layout()
428
+ out.dbu = result.layout.dbu
429
+ top = out.create_cell(result.design.name)
430
+ for name, reg in regions.items():
431
+ fl = pdk.fab_layers[name]
432
+ top.shapes(out.layer(pya.LayerInfo(fl.layer, fl.datatype, name))).insert(reg)
433
+ if report is not None:
434
+ report["dropped"] = dropped
435
+ report["written"] = {name: reg.count() for name, reg in regions.items() if not reg.is_empty()}
436
+ rule = pdk.cheese if cheese is True else (cheese or None)
437
+ added = (
438
+ cheese_holes(
439
+ fab_regions(result.cell, result.design.pdk, None, pya.DBox(x0, y0, x1, y1), grid=False)["M3"],
440
+ rule,
441
+ result.layout.dbu,
442
+ allowed,
443
+ exclude,
444
+ ).count()
445
+ if rule is not None
446
+ else 0
447
+ )
448
+ report["cheese_holes"] = added + (in_build if grid else 0)
449
+ own = "original" if grid and not pdk_cheese(result.design) else "none"
450
+ report["cheese_source"] = "export" if added else ("build" if in_build and grid else own)
451
+ path = Path(path)
452
+ path.parent.mkdir(parents=True, exist_ok=True)
453
+ out.write(str(path))
454
+ return path
@@ -0,0 +1,111 @@
1
+ """Legacy wafer / die layouts (ported from ``pymacros/Cong/75x75_diewafer.lym``, ``components/python/die_creator.py``
2
+ and ``wafer_creator.py``). Optional: the Quantcore flow places dies with the PDK die frame
3
+ (:mod:`quantcore_circuits.layouts.chips.frame`) and exports masks with :mod:`.fab_export`.
4
+
5
+ * :class:`WaferMap75`: the 4-inch wafer map of 7.5 mm dies (Cong): die borders (PDK ``chip_boundary``, 100/0), the
6
+ 100 mm wafer circle (``wafer_boundary``, 500/0) and the row/column/die labels (``wafer_markers``, 501/0). Legacy
7
+ draws borders and labels on 1/0 and the circle on 2/0; the geometry is the same (Basic ``TEXT``/``CIRCLE`` cells,
8
+ same positions).
9
+ * :func:`die_chip_offsets` / :func:`wafer_01_die_positions`: the placement grids of ``die_creator.create_die`` (2×2
10
+ chips per 15 mm die) and ``wafer_creator.py`` (16 dies + resonator chips), in µm.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import numpy as np
16
+ from kqcircuits.elements.element import Element
17
+ from kqcircuits.pya_resolver import pya
18
+ from kqcircuits.util.parameters import Param, pdt
19
+
20
+ from quantcore_circuits.pdk import QCC_LAYERS
21
+
22
+ ROW_DIES = [4, 6, 8, 10, 10, 10, 10, 10, 8, 6, 4]
23
+ COLUMN_DIES = [5, 7, 9, 11, 11, 11, 11, 9, 7, 5]
24
+ ROW_LABELS = list("ABCDEFGHIJK")
25
+
26
+
27
+ def wafer_map_75(die=7500.0, border=50.0, rows=None, columns=None):
28
+ """Legacy ``75x75_diewafer`` in µm: (die borders as boxes, labels as (x, y, text, mag)), die lower-left corners
29
+ and their labels."""
30
+ rows = rows or ROW_DIES
31
+ columns = columns or COLUMN_DIES
32
+ d = die * 1000.0 # legacy works in nm
33
+ x0, y0 = -d * 5, -d * 5.5
34
+ wafer_x, wafer_y = np.max(rows), np.max(columns)
35
+ texts, corners = [], []
36
+ for k, n in enumerate(rows):
37
+ dx = -0.5 if 2 < k < 8 else -0.9
38
+ texts.append((x0 + ((wafer_x - n) / 2 + dx) * d, y0 + k * d + 0.3 * d, ROW_LABELS[k], 4000))
39
+ for p in range(int(n)):
40
+ if k == 4:
41
+ texts.append(
42
+ (x0 + ((wafer_x - n) / 2 + p + 0.5) * d, y0 + ((wafer_y - columns[p]) / 2 - 0.7) * d, p, 4000)
43
+ )
44
+ wx, wy = x0 + (wafer_x - n) * 0.5 * d + p * d, y0 + k * d
45
+ label = ROW_LABELS[k] + str(int(p + (wafer_x - n) / 2))
46
+ texts.append((wx + d - 800e3, wy + d - 500e3, label, 200))
47
+ corners.append((wx, wy, label))
48
+ return corners, texts
49
+
50
+
51
+ def _border_boxes(x, y, w, h, t):
52
+ """Legacy ``draw.boarder`` (its ``x + h`` for the right edge kept: dies are square)."""
53
+ return [pya.Box(x, y, x + t, y + h), pya.Box(x + t, y, x + w - t, y + t), pya.Box(x + h - t, y, x + h, y + h)] + [
54
+ pya.Box(x + h, y + h, x, y + h - t)
55
+ ]
56
+
57
+
58
+ class WaferMap75(Element):
59
+ """4-inch wafer map of 7.5 mm dies with die borders, labels and the wafer circle (legacy Cong 75x75 die wafer)."""
60
+
61
+ die_size = Param(pdt.TypeDouble, "Die pitch / size", 7500, unit="μm")
62
+ border = Param(pdt.TypeDouble, "Die border width", 50, unit="μm")
63
+ wafer_radius = Param(pdt.TypeDouble, "Wafer radius", 50000, unit="μm")
64
+ circle_points = Param(pdt.TypeInt, "Points on the wafer circle", 200)
65
+ labels = Param(pdt.TypeBoolean, "Row, column and die labels", True)
66
+
67
+ qcc_category = "marker"
68
+
69
+ def build(self):
70
+ dbu = self.layout.dbu
71
+ scale = 0.001 / dbu # legacy coordinates are nm at dbu 0.001
72
+ d, t = self.die_size * 1000.0, self.border * 1000.0
73
+ corners, texts = wafer_map_75(self.die_size, self.border)
74
+ borders = self.cell.shapes(self.layout.layer(QCC_LAYERS["chip_boundary"]))
75
+ for wx, wy, _ in corners:
76
+ for box in _border_boxes(wx, wy, d, d, t):
77
+ borders.insert(box.transformed(pya.ICplxTrans(scale)) if scale != 1 else box)
78
+ if self.labels:
79
+ layer = QCC_LAYERS["wafer_markers"]
80
+ for x, y, text, mag in texts:
81
+ cell = self.layout.create_cell("TEXT", "Basic", {"layer": layer, "text": str(text), "mag": mag})
82
+ self.cell.insert(pya.DCellInstArray(cell.cell_index(), pya.DTrans(pya.DVector(x / 1000, y / 1000))))
83
+ circle = self.layout.create_cell(
84
+ "CIRCLE",
85
+ "Basic",
86
+ {"layer": QCC_LAYERS["wafer_boundary"], "actual_radius": self.wafer_radius, "npoints": self.circle_points},
87
+ )
88
+ self.cell.insert(pya.DCellInstArray(circle.cell_index(), pya.DTrans()))
89
+ for wx, wy, label in corners:
90
+ self.refpoints[f"die_{label}"] = pya.DPoint(wx / 1000 + self.die_size / 2, wy / 1000 + self.die_size / 2)
91
+
92
+
93
+ def die_chip_offsets(chip=7500.0):
94
+ """``die_creator.create_die``: four copies of a chip centred at (±chip/2, ±chip/2) in a 2×chip die (µm)."""
95
+ h = chip / 2
96
+ return [(h, h), (-h, h), (-h, -h), (h, -h)]
97
+
98
+
99
+ def wafer_01_die_positions():
100
+ """``wafer_creator.py``: the 16 die centres (row-major, 15 mm pitch) and the resonator-chip positions (µm)."""
101
+ xs = list(np.arange(-7500 - 15000, 30000, 15000))
102
+ ys = list(np.arange(7500 + 15000, -30000, -15000))
103
+ dies = [(float(x), float(y)) for y in ys for x in xs]
104
+ res = []
105
+ res += [(-30000 - 3750, float(y)) for y in np.arange(30000 - 3750, -34000, -7500)]
106
+ res += [(float(x), -33750) for x in np.arange(-30000 - 3750, 30000, 7500)]
107
+ res += [(float(x), -33750 - 7500) for x in np.arange(-18750, 15000, 7500)]
108
+ res += [(-33750 - 7500, float(y)) for y in np.arange(11250, -24000, -7500)]
109
+ res += [(33750, float(y)) for y in np.arange(11250, -24000, -7500)]
110
+ res += [(float(x), 33750) for x in np.arange(-18750, 15000, 7500)]
111
+ return dies, res