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,418 @@
1
+ """Resolve ``design.json`` cell references to Element classes and introspect their ports."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib
6
+ import json
7
+ import math
8
+ from collections.abc import Mapping
9
+ from functools import cache
10
+
11
+ from kqcircuits.elements.element import Element
12
+ from kqcircuits.pya_resolver import pya
13
+
14
+ from quantcore_circuits import layouts
15
+ from quantcore_circuits.layouts.ports import Port, cell_ports, check_cell
16
+
17
+ # KQC libraries searched for bare class names, as (library path, library name)
18
+ _KQC_LIBRARIES = (
19
+ ("elements", "Element Library"),
20
+ ("junctions", "Junction Library"),
21
+ ("qubits", "Qubit Library"),
22
+ ("chips", "Chip Library"),
23
+ ("test_structures", "Test Structure Library"),
24
+ )
25
+
26
+
27
+ @cache
28
+ def resolve_cell(ref: str) -> type[Element]:
29
+ """Resolve a cell reference.
30
+
31
+ Accepts a dotted class path (``"kqcircuits.qubits.swissmon.Swissmon"``, ``"quantcore_circuits.layouts.Xmon"``),
32
+ a bare class name of any quantcore_circuits/KQC PCell (``"Xmon"``, ``"Swissmon"``, ``"FingerCapacitorSquare"``),
33
+ or ``"metal:<Class>"`` for a Quantum Metal qlibrary component (``"metal:TransmonPocket"``).
34
+ """
35
+ if ref.startswith("static:"):
36
+ raise ValueError("static cells are not Element classes; handle them with quantcore_circuits.assembly")
37
+ if ref.startswith("metal:"):
38
+ from quantcore_circuits.layouts.metal import resolve # pylint: disable=import-outside-toplevel
39
+
40
+ return resolve(ref)
41
+ if "." in ref:
42
+ module_name, _, cls_name = ref.rpartition(".")
43
+ try:
44
+ module = importlib.import_module(module_name)
45
+ except ImportError as e:
46
+ raise ValueError(f"cannot import {module_name!r} for cell {ref!r}: {e}") from e
47
+ cls = getattr(module, cls_name, None)
48
+ if cls is None:
49
+ raise ValueError(f"{module_name!r} has no cell {cls_name!r}")
50
+ return cls
51
+ import quantcore_circuits.layouts as comps # pylint: disable=import-outside-toplevel
52
+
53
+ cls = getattr(comps, ref, None)
54
+ if isinstance(cls, type) and issubclass(cls, Element):
55
+ return cls
56
+ from kqcircuits.util.library_helper import element_by_class_name # pylint: disable=import-outside-toplevel
57
+
58
+ layouts.ensure_loaded()
59
+ for path, name in _KQC_LIBRARIES:
60
+ found = element_by_class_name(ref, path, name)
61
+ if found is not None:
62
+ return found
63
+ raise ValueError(f"unknown cell {ref!r}")
64
+
65
+
66
+ def cell_ref(cls: type[Element]) -> str:
67
+ """Canonical reference string for a class (inverse of :func:`resolve_cell`)."""
68
+ return f"{cls.__module__}.{cls.__name__}"
69
+
70
+
71
+ def default_params(cls: type[Element]) -> dict:
72
+ return {name: p.default for name, p in cls.get_schema().items() if not name.startswith("_")}
73
+
74
+
75
+ def _shape(value):
76
+ """A JSON shape → KLayout object for a KQC ``TypeShape`` parameter.
77
+
78
+ ``[[x, y], ...]`` or ``{"points": [[x, y], ...], "width": w}`` → ``pya.DPath``; ``{"polygon": [[x, y], ...]}`` →
79
+ ``pya.DPolygon``; a KLayout string (``"(0,0;100,0) w=10 bx=0 ex=0 r=false"``) → ``pya.DPath.from_s``. Anything else
80
+ (already a ``DPath``/``DPolygon``) passes through.
81
+ """
82
+ if isinstance(value, str) and value.strip().startswith("("):
83
+ return pya.DPath.from_s(value)
84
+ if isinstance(value, dict) and "polygon" in value:
85
+ return pya.DPolygon([pya.DPoint(float(x), float(y)) for x, y in value["polygon"]])
86
+ if isinstance(value, dict) and "points" in value:
87
+ pts = [pya.DPoint(float(x), float(y)) for x, y in value["points"]]
88
+ return pya.DPath(pts, float(value.get("width", 0.0)))
89
+ if isinstance(value, (list, tuple)) and value and all(isinstance(p, (list, tuple)) and len(p) == 2 for p in value):
90
+ return pya.DPath([pya.DPoint(float(x), float(y)) for x, y in value], 0.0)
91
+ return value
92
+
93
+
94
+ def shape_params(cls: type[Element], params: dict) -> dict:
95
+ """``params`` with JSON shapes converted for the class's ``TypeShape`` parameters (``design.json`` stores shapes as
96
+ point lists; KQC expects ``pya.DPath``/``DPolygon``)."""
97
+ from kqcircuits.util.parameters import pdt # pylint: disable=import-outside-toplevel
98
+
99
+ schema = cls.get_schema()
100
+ return {k: _shape(v) if k in schema and schema[k].data_type == pdt.TypeShape else v for k, v in params.items()}
101
+
102
+
103
+ def create_cell(layout: pya.Layout, cls: type[Element], what: str = "", **params) -> pya.Cell:
104
+ """``cls.create`` that raises :class:`CellBuildError` instead of silently producing an error cell."""
105
+ unknown = set(params) - set(cls.get_schema())
106
+ if unknown:
107
+ raise ValueError(f"{what or cls.__name__}: unknown parameter(s) {sorted(unknown)} for {cls.__name__}")
108
+ return check_cell(cls.create(layout, **shape_params(cls, params)), what or cls.__name__)
109
+
110
+
111
+ def _float_list(value, i: int, default: float) -> float:
112
+ try:
113
+ return float(list(value)[i])
114
+ except (TypeError, ValueError, IndexError):
115
+ return default
116
+
117
+
118
+ def _taper_b(p: dict) -> dict:
119
+ a2, b2 = float(p.get("a2", -1)), float(p.get("b2", -1))
120
+ return {"b": (p["a"] if a2 < 0 else a2, p["b"] if b2 < 0 else b2)}
121
+
122
+
123
+ def _airbridge_connection(p: dict) -> dict:
124
+ # the right taper is WaveguideCoplanarTaper(a=bridge_width, b=bridge_gap_width) with its own a2/b2 defaults
125
+ if not p.get("with_right_waveguide", True):
126
+ return {}
127
+ from kqcircuits.elements.waveguide_coplanar_taper import ( # pylint: disable=import-outside-toplevel
128
+ WaveguideCoplanarTaper,
129
+ )
130
+
131
+ schema = WaveguideCoplanarTaper.get_schema()
132
+ a, b = float(p.get("bridge_width", 20)), float(p.get("bridge_gap_width", 12))
133
+ return _taper_b({"a": a, "b": b, "a2": schema["a2"].default, "b2": schema["b2"].default})
134
+
135
+
136
+ def _fluxline_straight(p: dict) -> dict:
137
+ g = float(p.get("fluxline_gap_width", 3))
138
+ return {"flux": (float(p["a"]) / float(p["b"]) * g, g)}
139
+
140
+
141
+ def _quarter_wave(p: dict) -> dict:
142
+ return {"resonator_b": (float(p.get("res_a", 10)), float(p.get("res_b", 10)))}
143
+
144
+
145
+ def _swissmon(p: dict) -> dict:
146
+ # coupler ports sit in the qubit's own gap (wider than b): only the centre width is the port's
147
+ return {f"cplr{i}": (_float_list(p.get("port_width"), i, p["a"]), p["b"]) for i in range(3)}
148
+
149
+
150
+ def _circular_couplers(p: dict) -> dict:
151
+ n = len(list(p.get("couplers_a") or []))
152
+ return {
153
+ f"coupler_{i + 1}": (_float_list(p.get("couplers_a"), i, p["a"]), _float_list(p.get("couplers_b"), i, p["b"]))
154
+ for i in range(n)
155
+ }
156
+
157
+
158
+ # Port CPW widths of KQC classes whose ports are not drawn at the element's a/b (audit issue 4), by exact class
159
+ # (``module.qualname``): {port: (a, b)} from the full parameter dict, as a Quantcore class's ``qcc_port_widths``
160
+ KQC_PORT_WIDTHS = {
161
+ "kqcircuits.elements.waveguide_coplanar_taper.WaveguideCoplanarTaper": _taper_b,
162
+ "kqcircuits.elements.airbridge_connection.AirbridgeConnection": _airbridge_connection,
163
+ "kqcircuits.elements.fluxlines.fluxline_straight.FluxlineStraight": _fluxline_straight,
164
+ "kqcircuits.elements.quarter_wave_cpw_resonator.QuarterWaveCpwResonator": _quarter_wave,
165
+ "kqcircuits.qubits.swissmon.Swissmon": _swissmon,
166
+ "kqcircuits.qubits.circular_transmon_single_island.CircularTransmonSingleIsland": _circular_couplers,
167
+ "kqcircuits.qubits.concentric_transmon.ConcentricTransmon": _circular_couplers,
168
+ }
169
+
170
+
171
+ def port_width_hook(cls: type[Element]):
172
+ """``qcc_port_widths`` of a class, or the :data:`KQC_PORT_WIDTHS` entry of a KQC class, or None."""
173
+ hook = getattr(cls, "qcc_port_widths", None)
174
+ return hook if hook is not None else KQC_PORT_WIDTHS.get(f"{cls.__module__}.{cls.__qualname__}")
175
+
176
+
177
+ def _unit(dx: float, dy: float) -> pya.DVector:
178
+ length = math.hypot(dx, dy)
179
+ x, y = dx / length, dy / length
180
+ # exact axis directions stay exact (as ports.direction_vector)
181
+ return pya.DVector(*(round(v) if abs(v - round(v)) < 1e-12 else v for v in (x, y)))
182
+
183
+
184
+ def x_coupler_arms(p: dict) -> dict[str, list[tuple[float, float]]]:
185
+ """Centre lines of the four arms of KQC ``CapacitiveXCoupler`` (its ``build``): arm-end refpoint name →
186
+ ``[end, (bend), capacitor centre]`` in µm. Each arm is a CPW (the element a/b) from its end through a
187
+ FingerCapacitorSquare (at the last point) to the centre splitter at the origin. '+': p11 S, p21 E, p31 N, p41 W;
188
+ 'x': the corners (p11 lower left, counter-clockwise), with a straight lead along the longer side when the box is
189
+ not square."""
190
+ length, height = float(p.get("x_coupler_length", 500)), float(p.get("x_coupler_height", 500))
191
+ center, lead = min(length, height), abs(length - height) / 2
192
+ if str(p.get("x_coupler_variant", "+")) == "x":
193
+ if height > length:
194
+ base = [(-center / 2, -lead - length / 2), (-length / 2, -center / 2), (-length / 4, -center / 4)]
195
+ else:
196
+ base = [(-lead - center / 2, -height / 2), (-center / 2, -height / 2), (-center / 4, -height / 4)]
197
+ signs = {"p11": (1, 1), "p21": (-1, 1), "p31": (-1, -1), "p41": (1, -1)}
198
+ arms = {k: [(sx * x, sy * y) for x, y in base] for k, (sx, sy) in signs.items()}
199
+ else:
200
+ v = [(0.0, -height / 2), (0.0, -height / 3), (0.0, -height / 4)]
201
+ h = [(length / 2, 0.0), (length / 3, 0.0), (length / 4, 0.0)]
202
+ arms = {"p11": v, "p21": h, "p31": [(-x, -y) for x, y in v], "p41": [(-x, -y) for x, y in h]}
203
+ # a square 'x' box has no bend (KQC drops the coinciding node)
204
+ return {k: [q for i, q in enumerate(pts) if i == 0 or q != pts[i - 1]] for k, pts in arms.items()}
205
+
206
+
207
+ def _x_coupler_ports(refpoints: dict, p: dict) -> dict[str, Port]:
208
+ """KQC ``CapacitiveXCoupler`` draws no port refpoints, only its arm ends ``p11``..``p41`` (the refpoints of
209
+ KQC's own ``get_sim_ports``): each is a flush CPW end (element a/b) facing out along its arm."""
210
+ ports = {}
211
+ for name, pts in x_coupler_arms(p).items():
212
+ if name in refpoints and len(pts) > 1:
213
+ (x0, y0), (x1, y1) = pts[0], pts[1]
214
+ ports[name] = Port(name, refpoints[name], _unit(x0 - x1, y0 - y1), p.get("a"), p.get("b"))
215
+ return ports
216
+
217
+
218
+ def _curved_ports(refpoints: dict, p: dict) -> dict[str, Port]: # noqa: ARG001
219
+ """KQC ``WaveguideCoplanarCurved`` (origin at the arc centre, arc of radius r from angle 0 to ``alpha``) draws no
220
+ ports: ``a`` at (r, 0) and ``b`` at angle ``alpha``, both flush CPW ends facing out along the tangent."""
221
+ r, alpha = float(p.get("r", 100)), float(p.get("alpha", math.pi))
222
+ s = 1.0 if alpha >= 0 else -1.0
223
+ c, si = math.cos(alpha), math.sin(alpha)
224
+ return {
225
+ "a": Port("a", pya.DPoint(r, 0), pya.DVector(0, -s), p.get("a"), p.get("b")),
226
+ "b": Port("b", pya.DPoint(r * c, r * si), _unit(-s * si, s * c), p.get("a"), p.get("b")),
227
+ }
228
+
229
+
230
+ # Ports of KQC classes that draw no port refpoints although their CPW ends are well defined, by exact class
231
+ # (``module.qualname``): ``fn(refpoints, full params) -> {name: Port}`` (local frame). A port the cell itself declares
232
+ # (``port_<name>`` refpoint) wins over the override. Metadata only: the drawing is not touched.
233
+ KQC_EXTRA_PORTS = {
234
+ "kqcircuits.elements.capacitive_x_coupler.CapacitiveXCoupler": _x_coupler_ports,
235
+ "kqcircuits.elements.waveguide_coplanar_curved.WaveguideCoplanarCurved": _curved_ports,
236
+ }
237
+
238
+
239
+ def element_cell_ports(cls: type[Element], cell: pya.Cell, params: dict) -> dict[str, Port]:
240
+ """Ports of an already created element cell, with CPW widths.
241
+
242
+ ``a``/``b`` come from the element parameters; a class may override them per port with a classmethod
243
+ ``qcc_port_widths(params) -> {port_name: (a, b)}`` (e.g. the Xmon claw tails); KQC classes get theirs from
244
+ :data:`KQC_PORT_WIDTHS`. KQC classes without port refpoints get theirs from :data:`KQC_EXTRA_PORTS`.
245
+ """
246
+ full = {**default_params(cls), **params}
247
+ ports = cell_ports(cell, full.get("a"), full.get("b"))
248
+ extra = KQC_EXTRA_PORTS.get(f"{cls.__module__}.{cls.__qualname__}")
249
+ if extra is not None:
250
+ from kqcircuits.defaults import default_layers # pylint: disable=import-outside-toplevel
251
+ from kqcircuits.elements.element import get_refpoints # pylint: disable=import-outside-toplevel
252
+
253
+ refp = dict(get_refpoints(cell.layout().layer(default_layers["refpoints"]), cell, pya.DTrans(), 0))
254
+ for name, port in extra(refp, full).items():
255
+ ports.setdefault(name, port)
256
+ hook = port_width_hook(cls)
257
+ if hook is not None:
258
+ for name, (a, b) in hook(full).items():
259
+ if name in ports:
260
+ ports[name].a, ports[name].b = a, b
261
+ return ports
262
+
263
+
264
+ def element_ports(cls: type[Element], layout: pya.Layout | None = None, **params) -> dict[str, Port]:
265
+ """Ports of an element in its local frame (builds the cell in ``layout`` or a scratch layout)."""
266
+ layout = layout or pya.Layout()
267
+ cell = create_cell(layout, cls, **params)
268
+ return element_cell_ports(cls, cell, params)
269
+
270
+
271
+ # KQC base-element parameters a designer does not set by hand (faces, protection, EPR preview, simulation junction pads)
272
+ _SCHEMA_SKIP = {
273
+ "n", "margin", "face_ids", "display_name", "protect_opposite_face", "opposing_face_id_groups",
274
+ "duplicate_face_ids", "duplicate_layers", "etch_opposite_face", "etch_opposite_face_margin",
275
+ "junction_total_length", "junction_upper_pad_width", "junction_upper_pad_length", "junction_lower_pad_width",
276
+ "junction_lower_pad_length", "include_background_gap",
277
+ }
278
+
279
+
280
+ def element_schema(cls: type[Element]) -> list[dict]:
281
+ """The parameters a designer edits, for the KLayout panel: ``[{"name", "default", "type", "description",
282
+ "unit", "choices"}]`` (JSON-safe defaults; internal / face / EPR parameters left out)."""
283
+ out = []
284
+ for name, p in cls.get_schema().items():
285
+ if name.startswith("_") or name in _SCHEMA_SKIP or getattr(p, "hidden", False):
286
+ continue
287
+ default = p.default
288
+ try:
289
+ json.dumps(default)
290
+ except TypeError:
291
+ continue # layers, shapes, points: not edited as text
292
+ kw = getattr(p, "kwargs", None) or {}
293
+ choices = kw.get("choices") or getattr(p, "choices", None) or []
294
+ out.append({
295
+ "name": name,
296
+ "default": default,
297
+ "type": type(default).__name__,
298
+ "description": p.description,
299
+ "unit": kw.get("unit") or getattr(p, "unit", None) or "",
300
+ "choices": [c[1] if isinstance(c, (list, tuple)) else c for c in choices],
301
+ })
302
+ return out
303
+
304
+
305
+ def element_outline(cls: type[Element], max_points: int = 400, **params) -> dict:
306
+ """A light outline of an element in its local frame, for a placement preview (the KLayout plugin's ghost):
307
+ ``{"bbox": [x0, y0, x1, y1], "outline": [[[x, y], ...], ...], "ports": [...]}`` in µm.
308
+
309
+ The outline is the merged etched shape (the ``base_metal_gap`` layers; else every drawn layer), smoothed so the preview stays a few hundred points; a
310
+ shape too fine to keep (junction fingers) is dropped, the bbox always stays."""
311
+ layout = pya.Layout()
312
+ cell = create_cell(layout, cls, **params)
313
+ ports = element_cell_ports(cls, cell, params)
314
+ region = pya.Region()
315
+ names = {li: layout.get_info(li).name or "" for li in layout.layer_indexes()}
316
+ gap = [li for li, n in names.items() if "base_metal_gap" in n] # the etched shape: what the component looks like
317
+ skip = ("avoidance", "refpoints", "ports", "spacer", "SIS_junction")
318
+ for li in gap or [li for li, n in names.items() if not any(k in n for k in skip)]:
319
+ region.insert(cell.begin_shapes_rec(li))
320
+ region.merge()
321
+ bbox = cell.dbbox()
322
+ out: list = []
323
+ if not region.is_empty():
324
+ size = max(bbox.width(), bbox.height(), 1.0)
325
+ for frac in (0.002, 0.005, 0.01, 0.02, 0.05):
326
+ d = int(size * frac / layout.dbu)
327
+ simple = region.hulls().smoothed(d).merged() if d else region.hulls()
328
+ polys = [poly for poly in simple.each() if poly.area() * layout.dbu**2 >= (size * frac) ** 2]
329
+ if sum(poly.num_points() for poly in polys) <= max_points:
330
+ out = [[[round(pt.x * layout.dbu, 2), round(pt.y * layout.dbu, 2)] for pt in poly.each_point_hull()]
331
+ for poly in polys]
332
+ break
333
+ return {
334
+ "bbox": [round(bbox.left, 2), round(bbox.bottom, 2), round(bbox.right, 2), round(bbox.top, 2)],
335
+ "outline": out,
336
+ "ports": [p.as_dict() for p in ports.values()],
337
+ }
338
+
339
+
340
+ def trilayer_junction(cell_ref: str, lj_nH: float | None = None, squid: bool = False, pdk=None) -> tuple[dict, dict]:
341
+ """``(params, junction)`` that make a qubit's junction the Quantcore trilayer junction (design decisions #6 / #21).
342
+
343
+ ``params`` are the instance parameters to merge: ``junction_type`` = ``"Quantcore Junction"`` (``squid``:
344
+ ``"Quantcore Squid"``) plus, when ``lj_nH`` is given, the sizing for that L_J (SQUID: the parallel total) on the
345
+ PDK junction rule — ``junction_params: {"lj_nH": ...}`` for cells that forward one (Xmon, ``metal:<Class>``, the
346
+ QPDK / SQDMetal qubits), KQC's ``junction_width`` (straight finger, µm; bent finger at the PDK 0.6 µm) for KQC
347
+ qubits. ``junction`` is the drawn junction's ``{"Lj_nH", "Cj_fF"}`` for the instance's ``junction`` (LOM).
348
+ Without ``lj_nH`` the PDK nominal device is drawn: a 0.5 × 0.6 µm junction (45 kΩ) or a SQUID whose parallel
349
+ R_n is 45 kΩ (two 0.25 × 0.6 µm junctions of 90 kΩ; the window is for the whole SQUID, 2026-11-13).
350
+
351
+ >>> params, junction = trilayer_junction("Swissmon", lj_nH=12.0)
352
+ >>> d.add("QB", "Swissmon", junction=junction, **params) # doctest: +SKIP
353
+ """
354
+ from quantcore_circuits.circuit.bridges import ( # pylint: disable=import-outside-toplevel
355
+ fingers_for_lj,
356
+ junction_from_fingers,
357
+ junction_process,
358
+ lj_from_rn,
359
+ )
360
+
361
+ cls = resolve_cell(cell_ref)
362
+ schema = cls.get_schema()
363
+ if "junction_type" not in schema:
364
+ raise ValueError(f"{cell_ref}: no junction_type parameter (not a qubit with a junction)")
365
+ proc = junction_process(pdk)
366
+ n = 2 if squid else 1
367
+ params: dict = {"junction_type": "Quantcore Squid" if squid else "Quantcore Junction"}
368
+ straight, bent = proc.nominal_fingers_um
369
+ if squid and not lj_nH: # the R_n window is for the whole SQUID (2026-11-13): nominal device, not junction
370
+ straight, bent, _ = fingers_for_lj(lj_from_rn(proc.rn_nominal_kohm * 1e3, proc.gap_meV), n, proc)
371
+ if lj_nH:
372
+ straight, bent, _ = fingers_for_lj(float(lj_nH), n, proc)
373
+ if "junction_params" in schema:
374
+ params["junction_params"] = {"lj_nH": float(lj_nH)}
375
+ elif "junction_width" in schema:
376
+ if abs(bent - proc.bent_finger_um) > 1e-9: # below the minimum finger the bent finger carries the area
377
+ raise ValueError(
378
+ f"{cell_ref}: L_J {lj_nH} nH needs a {bent} µm bent finger; KQC qubits only set the straight "
379
+ "finger (junction_width)"
380
+ )
381
+ params["junction_width"] = straight
382
+ else:
383
+ raise ValueError(f"{cell_ref}: no way to size its junction (no junction_params / junction_width)")
384
+ drawn = junction_from_fingers(straight, bent, n, proc)
385
+ return params, {"Lj_nH": round(drawn.lj_nH, 4), "Cj_fF": round(drawn.cj_fF, 3)}
386
+
387
+
388
+ class _LazyComponents(Mapping):
389
+ """``ref → Element class``; classes are resolved on access (Metal entries import Quantum Metal)."""
390
+
391
+ def __init__(self, refs: list[str]):
392
+ self._refs = list(refs)
393
+
394
+ def __getitem__(self, ref: str) -> type[Element]:
395
+ if ref not in self._refs:
396
+ raise KeyError(ref)
397
+ return resolve_cell(ref)
398
+
399
+ def __iter__(self):
400
+ return iter(self._refs)
401
+
402
+ def __len__(self) -> int:
403
+ return len(self._refs)
404
+
405
+ def __repr__(self) -> str:
406
+ return f"<{len(self._refs)} components: {', '.join(self._refs[:8])}{', ...' if len(self._refs) > 8 else ''}>"
407
+
408
+
409
+ def list_components(category: str | None = None, source: str | None = None, chips: bool = False) -> Mapping:
410
+ """Components usable as ``cell`` (``ref → class``, resolved lazily), from :func:`.catalog.catalog`.
411
+
412
+ Quantcore cells, KQC elements and Quantum Metal components (``metal:<Class>``); whole chips only with
413
+ ``chips=True`` (or ``category="chip"``).
414
+ """
415
+ from quantcore_circuits.layouts.catalog import catalog # pylint: disable=import-outside-toplevel
416
+
417
+ entries = catalog(category=category, source=source, chips=chips or category == "chip")
418
+ return _LazyComponents([c.ref for c in entries])
File without changes