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,158 @@
1
+ """Consensus across estimators (M10): per parameter the estimator values, spread, chosen value, residual, pass/fail.
2
+
3
+ Selection policy (configurable, first available wins): pyEPR for χ/α when eigenmode data exists, SQcircuit for qubit
4
+ spectra, QuCat for κ and χ, Metal LOM as the C-matrix reference. A parameter whose relative spread exceeds its
5
+ ``spread_tol`` is *flagged*: the estimators disagree, which is a modelling problem rather than a design problem.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import json
11
+ from dataclasses import asdict, dataclass, field
12
+ from pathlib import Path
13
+
14
+ POLICY: dict[str, list[str]] = {
15
+ "f_q_GHz": ["pyepr", "sqcircuit", "scqubits", "qucat", "metal_lom"],
16
+ "alpha_MHz": ["pyepr", "sqcircuit", "scqubits", "qucat", "metal_lom"],
17
+ "chi_MHz": ["pyepr", "qucat", "sqcircuit", "scqubits", "metal_lom", "qutip"],
18
+ # pyEPR values exist only for eigenmode jobs: the FEM resonator frequency and the eigenmode κ (f/Q with the
19
+ # feedline terminated in 50 Ω) then win over the λ/4 + coupled-line LOM estimates
20
+ "f_GHz": ["pyepr", "qucat", "sqcircuit", "scqubits", "metal_lom"],
21
+ "g_MHz": ["metal_lom", "scqubits"],
22
+ "kappa_MHz": ["pyepr", "qucat", "metal_lom"],
23
+ "EJ_GHz": ["metal_lom", "sqcircuit"],
24
+ "EC_GHz": ["metal_lom", "sqcircuit"],
25
+ }
26
+ SPREAD_TOL = {"f_q_GHz": 0.01, "alpha_MHz": 0.05, "chi_MHz": 0.15, "f_GHz": 0.005, "g_MHz": 0.10, "kappa_MHz": 0.2}
27
+ LABELS = {
28
+ "f_q_GHz": ("f_q", "GHz", "qubit frequency"),
29
+ "alpha_MHz": ("α", "MHz", "anharmonicity"),
30
+ "chi_MHz": ("χ", "MHz", "dispersive shift"),
31
+ "f_GHz": ("f_r", "GHz", "resonator frequency"),
32
+ "g_MHz": ("g", "MHz", "coupling"),
33
+ "kappa_MHz": ("κ", "MHz", "linewidth"),
34
+ "EJ_GHz": ("E_J", "GHz", "Josephson energy"),
35
+ "EC_GHz": ("E_C", "GHz", "charging energy"),
36
+ }
37
+
38
+
39
+ @dataclass
40
+ class Row:
41
+ param: str # "Q1.f_q_GHz"
42
+ quantity: str # "f_q_GHz"
43
+ symbol: str
44
+ unit: str
45
+ values: dict[str, float]
46
+ chosen: float | None
47
+ chosen_by: str | None
48
+ spread_rel: float | None
49
+ flagged: bool
50
+ target: float | None = None
51
+ tol: float | None = None
52
+ residual: float | None = None # (chosen − target) / tol
53
+ status: str = "unknown" # pass | fail | unknown
54
+ notes: list[str] = field(default_factory=list)
55
+
56
+
57
+ def consensus(estimates: dict[str, dict], targets: dict | None = None, policy=None, spread_tol=None) -> list[Row]:
58
+ """``estimates``: estimator → ParamSet; ``targets``: param → {"value", "tol"} (``CircuitModel.targets`` form)."""
59
+ policy = {**POLICY, **(policy or {})}
60
+ spread_tol = {**SPREAD_TOL, **(spread_tol or {})}
61
+ targets = targets or {}
62
+ params = sorted({k for ps in estimates.values() if "error" not in ps for k in ps})
63
+ rows = []
64
+ for param in params:
65
+ quantity = param.split(".", 1)[1] if "." in param else param
66
+ if quantity not in LABELS:
67
+ continue
68
+ values = {n: ps[param] for n, ps in estimates.items() if "error" not in ps and param in ps}
69
+ order = policy.get(quantity, list(values))
70
+ chosen_by = next((n for n in order if n in values), next(iter(values), None))
71
+ chosen = values.get(chosen_by)
72
+ spread = None
73
+ if len(values) > 1:
74
+ vs = list(values.values())
75
+ mean = sum(vs) / len(vs)
76
+ spread = (max(vs) - min(vs)) / abs(mean) if mean else None
77
+ symbol, unit, _ = LABELS[quantity]
78
+ row = Row(
79
+ param,
80
+ quantity,
81
+ symbol,
82
+ unit,
83
+ values,
84
+ chosen,
85
+ chosen_by,
86
+ spread,
87
+ bool(spread is not None and spread > spread_tol.get(quantity, 0.05)),
88
+ )
89
+ t = targets.get(param)
90
+ if t is not None:
91
+ tv = t.value if hasattr(t, "value") else t.get("value")
92
+ tt = t.tol if hasattr(t, "tol") else t.get("tol")
93
+ row.target, row.tol = tv, tt
94
+ if tv is not None and tt and chosen is not None:
95
+ row.residual = (chosen - tv) / tt
96
+ row.status = "pass" if abs(row.residual) <= 1 else "fail"
97
+ rows.append(row)
98
+ return rows
99
+
100
+
101
+ def flag_near_resonance(rows: list[Row], pairs, factor: float = 5.0) -> list[str]:
102
+ """Flag qubit–resonator pairs with |f_q − f_r| < ``factor``·g: the modes hybridise, so dispersive quantities and
103
+ the estimators' mode labels disagree by construction (not an estimator bug). ``pairs``: objects with ``qubit``
104
+ and ``resonator`` names (``FilledCircuit.pairs``). Adds a note and ``flagged`` to the f_q, f_r, χ and g rows and
105
+ returns the notes."""
106
+ by = {r.param: r for r in rows}
107
+ out = []
108
+ for p in pairs:
109
+ fq, fr, g = by.get(f"{p.qubit}.f_q_GHz"), by.get(f"{p.resonator}.f_GHz"), by.get(f"{p.resonator}.g_MHz")
110
+ if not (fq and fr and g) or None in (fq.chosen, fr.chosen, g.chosen):
111
+ continue
112
+ delta_mhz = abs(fq.chosen - fr.chosen) * 1e3
113
+ if delta_mhz < factor * abs(g.chosen):
114
+ note = (
115
+ f"{p.qubit}–{p.resonator}: |Δ| = {delta_mhz:.0f} MHz < {factor:g} g (g = {g.chosen:.0f} MHz) — modes "
116
+ "hybridise; dispersive values and estimator mode labels are unreliable"
117
+ )
118
+ out.append(note)
119
+ for key in (f"{p.qubit}.f_q_GHz", f"{p.resonator}.f_GHz", f"{p.resonator}.chi_MHz", f"{p.resonator}.g_MHz"):
120
+ if key in by:
121
+ by[key].notes.append(note)
122
+ by[key].flagged = True
123
+ return out
124
+
125
+
126
+ def goal(rows: list[Row]) -> dict:
127
+ with_target = [r for r in rows if r.target is not None]
128
+ passed = sum(r.status == "pass" for r in with_target)
129
+ return {
130
+ "reached": bool(with_target) and passed == len(with_target),
131
+ "passed": passed,
132
+ "total": len(with_target),
133
+ "summary": f"{passed} of {len(with_target)} targets within tolerance",
134
+ }
135
+
136
+
137
+ def report_markdown(rows: list[Row], title: str = "Consensus") -> str:
138
+ names = sorted({n for r in rows for n in r.values})
139
+ head = "| parameter | " + " | ".join(names) + " | chosen | spread | target | residual/tol | status |"
140
+ lines = [f"# {title}", "", head, "|" + "---|" * (len(names) + 6)]
141
+ for r in rows:
142
+ vals = " | ".join(f"{r.values[n]:.4g}" if n in r.values else "–" for n in names)
143
+ spread = f"{100 * r.spread_rel:.2f} %" if r.spread_rel is not None else "–"
144
+ flag = " ⚑" if r.flagged else ""
145
+ tgt = f"{r.target:g} ± {r.tol:g}" if r.target is not None else "–"
146
+ res = f"{r.residual:+.2f}" if r.residual is not None else "–"
147
+ lines.append(
148
+ f"| {r.param} ({r.unit}) | {vals} | **{r.chosen:.4g}** ({r.chosen_by}) | {spread}{flag} | {tgt} | {res} |"
149
+ f" {r.status} |"
150
+ )
151
+ return "\n".join(lines) + "\n"
152
+
153
+
154
+ def save(rows: list[Row], path) -> Path:
155
+ path = Path(path)
156
+ path.parent.mkdir(parents=True, exist_ok=True)
157
+ path.write_text(json.dumps([asdict(r) for r in rows], indent=2) + "\n", encoding="utf-8")
158
+ return path
@@ -0,0 +1,28 @@
1
+ """``circuit.json`` for a sim group (or the whole chip), derived from the design's components and connectivity.
2
+
3
+ Thin wrapper over :func:`quantcore_circuits.lom.builder.lom_from_design`: the sim group's selection decides which
4
+ components and routes enter the circuit (``"chip"`` = all). The same model is filled from FEM results
5
+ (:func:`~quantcore_circuits.circuit.fill.fill`) or used with its component estimates (layout → LOM only).
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from quantcore_circuits.circuit.schema import CircuitModel
11
+ from quantcore_circuits.lom.builder import DEFAULT_TOL, lom_from_design
12
+
13
+ __all__ = ["DEFAULT_TOL", "circuit_from_design"]
14
+
15
+
16
+ def circuit_from_design(source, group: str, plan=None) -> CircuitModel:
17
+ """``plan``: the design's build plan when the caller has it already (``plan_for_lom``; planned here otherwise)."""
18
+ from quantcore_circuits.design import load_design # pylint: disable=import-outside-toplevel
19
+ from quantcore_circuits.sim_tools.builder import group_spec # pylint: disable=import-outside-toplevel
20
+
21
+ design = load_design(source)
22
+ g = group_spec(design, group)
23
+ from quantcore_circuits.assembly.last_good import plan_for_lom # pylint: disable=import-outside-toplevel
24
+
25
+ if plan is None:
26
+ plan = plan_for_lom(design, source) # a failed route: its last good one, with a warning
27
+ model = lom_from_design(design, g.select, name=f"{design.name}_{group}", plan=plan).model
28
+ return model.model_copy(update={"group": group})
@@ -0,0 +1,198 @@
1
+ """Matplotlib schematic of a LOM circuit (``circuit.json``) with the element values that went into the simulation.
2
+
3
+ QuCat's own ``Network.show()`` only works for networks made in its GUI, so this draws the lumped circuit directly:
4
+ a ground rail at the bottom, one bus per conductor (node), elements to ground hanging down from it, and elements
5
+ between two conductors drawn between (or arching over) the buses. Used by ``qcc circuit simulate --png`` and shown in
6
+ the KLayout plugin's LOM tab. Needs matplotlib only (imported when drawing).
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from pathlib import Path
12
+
13
+ _COLORS = {
14
+ "C": "#1f77b4",
15
+ "L": "#2ca02c",
16
+ "JJ": "#d62728",
17
+ "SQUID": "#d62728",
18
+ "TLres": "#9467bd",
19
+ "R": "#7f7f7f",
20
+ "HANGER": "#ff7f0e",
21
+ }
22
+ _NICE = {"JJ": "JJ", "SQUID": "SQUID", "TLres": "λ/4", "HANGER": "hanger", "R": "R", "L": "L", "C": "C"}
23
+
24
+
25
+ def value_text(v, unit: str = "", fmt: str = ".3g") -> str:
26
+ """A netlist value with its unit. A pair (e.g. a resonator's C and L, ``unit`` "fF, nH") reads "302 fF ‖ 1.49 nH":
27
+ the comma-separated units go one per value."""
28
+ if isinstance(v, (list, tuple)):
29
+ units = [u.strip() for u in (unit or "").split(",")]
30
+ if len(units) != len(v):
31
+ units = [unit] * len(v) if len(units) == 1 else [""] * len(v)
32
+ return " ‖ ".join(f"{x:{fmt}} {u}".strip() if isinstance(x, (int, float)) else f"{x} {u}".strip()
33
+ for x, u in zip(v, units))
34
+ if isinstance(v, (int, float)):
35
+ return f"{v:{fmt}} {unit}".strip()
36
+ return str(v)
37
+
38
+
39
+ def _label(name: str, row: dict | None, btype: str) -> str:
40
+ if not row:
41
+ return name
42
+ v, unit = row.get("value"), row.get("unit", "")
43
+ if isinstance(v, (list, tuple)):
44
+ txt = value_text(v, unit)
45
+ elif isinstance(v, (int, float)):
46
+ txt = value_text(v, unit)
47
+ else:
48
+ txt = btype
49
+ return f"{name}\n{txt}"
50
+
51
+
52
+ def _symbol(ax, kind: str, x: float, y: float, vertical: bool, color: str) -> None:
53
+ """A small schematic symbol centred at (x, y)."""
54
+ w, h = (0.16, 0.30) if vertical else (0.30, 0.16)
55
+ if kind == "C": # two plates
56
+ if vertical:
57
+ for dy in (-0.05, 0.05):
58
+ ax.plot([x - w, x + w], [y + dy, y + dy], color=color, lw=2.2, solid_capstyle="butt")
59
+ else:
60
+ for dx in (-0.05, 0.05):
61
+ ax.plot([x + dx, x + dx], [y - h, y + h], color=color, lw=2.2, solid_capstyle="butt")
62
+ return
63
+ from matplotlib.patches import Rectangle # pylint: disable=import-outside-toplevel
64
+
65
+ ax.add_patch(Rectangle((x - w, y - h), 2 * w, 2 * h, fc="white", ec=color, lw=1.8, zorder=3))
66
+ if kind in ("JJ", "SQUID"): # a cross in the box
67
+ ax.plot([x - w, x + w], [y - h, y + h], color=color, lw=1.8, zorder=4)
68
+ ax.plot([x - w, x + w], [y + h, y - h], color=color, lw=1.8, zorder=4)
69
+ elif kind == "R": # zigzag
70
+ xs = (
71
+ [x - w + i * 2 * w / 6 for i in range(7)]
72
+ if not vertical
73
+ else [x + (0.07 if i % 2 else -0.07) for i in range(7)]
74
+ )
75
+ ys = (
76
+ [y + (0.06 if i % 2 else -0.06) for i in range(7)]
77
+ if not vertical
78
+ else [y - h + i * 2 * h / 6 for i in range(7)]
79
+ )
80
+ ax.plot(xs, ys, color=color, lw=1.5, zorder=4)
81
+
82
+
83
+ def draw_circuit(model, netlist: list[dict] | None, path: str | Path, title: str = "") -> Path:
84
+ """Draw ``model`` (a :class:`CircuitModel`) to the PNG ``path``; ``netlist`` rows (``LomResult.netlist``) give
85
+ the values printed next to each element."""
86
+ import matplotlib # pylint: disable=import-outside-toplevel
87
+
88
+ matplotlib.use("Agg")
89
+ import matplotlib.pyplot as plt # pylint: disable=import-outside-toplevel
90
+
91
+ rows = {r["element"]: r for r in (netlist or [])}
92
+ ground = {n for n, s in model.nodes.items() if s.ground}
93
+ nodes = [n for n in model.nodes if n not in ground]
94
+ to_ground, between = {n: [] for n in nodes}, []
95
+ for name, b in model.branches.items():
96
+ a, c = b.nodes
97
+ if a in ground and c in ground:
98
+ continue
99
+ if a in ground or c in ground:
100
+ to_ground[c if a in ground else a].append((name, b))
101
+ else:
102
+ between.append((name, b, a, c))
103
+ # order the conductors so that coupled ones sit next to each other (walk the node-to-node branches)
104
+ adj = {n: [] for n in nodes}
105
+ for _, _, a, c in between:
106
+ adj[a].append(c)
107
+ adj[c].append(a)
108
+ order, seen = [], set()
109
+ for start in nodes:
110
+ stack = [start]
111
+ while stack:
112
+ n = stack.pop(0)
113
+ if n in seen:
114
+ continue
115
+ seen.add(n)
116
+ order.append(n)
117
+ stack = [m for m in adj[n] if m not in seen] + stack
118
+ # columns: width from the number of elements hanging off a node
119
+ xs, x = {}, 0.0
120
+ for n in order:
121
+ width = max(1, len(to_ground[n])) * 2.1 # room for a 9 pt label beside each element
122
+ xs[n] = (x, x + width)
123
+ x += width + 2.0
124
+ total = max(x - 2.0, 3.0)
125
+ ytop, ybase = 3.0, 0.0
126
+ fig_w = min(max(7.0, total * 0.9), 18.0)
127
+ fig, ax = plt.subplots(figsize=(fig_w, 4.2), dpi=110)
128
+ ax.axhline(ybase, xmin=0, xmax=1, color="black", lw=2.5)
129
+ ax.text(-0.2, ybase - 0.25, "ground", ha="left", va="top", fontsize=9)
130
+ for n in order:
131
+ x0, x1 = xs[n]
132
+ ax.plot([x0, x1], [ytop, ytop], color="black", lw=3, solid_capstyle="round")
133
+ ax.text((x0 + x1) / 2, ytop + 0.12, n, ha="center", va="bottom", fontsize=12, weight="bold")
134
+ for i, (name, b) in enumerate(to_ground[n]):
135
+ bx = x0 + 0.75 + i * 2.1
136
+ color = _COLORS.get(b.type, "black")
137
+ mid = (ytop + ybase) / 2
138
+ ax.plot([bx, bx], [ytop, mid + 0.35], color="black", lw=1.2)
139
+ ax.plot([bx, bx], [mid - 0.35, ybase], color="black", lw=1.2)
140
+ _symbol(ax, b.type, bx, mid, True, color)
141
+ ax.text(
142
+ bx + 0.28,
143
+ mid,
144
+ _label(name, rows.get(name), _NICE.get(b.type, b.type)),
145
+ fontsize=9,
146
+ va="center",
147
+ color=color,
148
+ )
149
+ levels = {}
150
+ for name, b, a, c in between:
151
+ ax0, cx0 = xs[a][0], xs[c][0]
152
+ left, right = (a, c) if ax0 < cx0 else (c, a)
153
+ gap = abs(order.index(a) - order.index(c))
154
+ color = _COLORS.get(b.type, "black")
155
+ if gap == 1:
156
+ xa, xb = xs[left][1], xs[right][0]
157
+ xm = (xa + xb) / 2
158
+ levels[(left, right)] = levels.setdefault((left, right), 0) + 1
159
+ ax.plot([xa, xm - 0.35], [ytop, ytop], color="black", lw=1.2)
160
+ ax.plot([xm + 0.35, xb], [ytop, ytop], color="black", lw=1.2)
161
+ _symbol(ax, b.type, xm, ytop, False, color)
162
+ ax.text(
163
+ xm,
164
+ ytop - 0.4 - 0.55 * (levels[(left, right)] - 1),
165
+ _label(name, rows.get(name), _NICE.get(b.type, b.type)),
166
+ fontsize=9,
167
+ ha="center",
168
+ va="top",
169
+ color=color,
170
+ )
171
+ else: # an arch over the buses in between
172
+ n_same = levels.setdefault(("arch", gap), 0)
173
+ h = ytop + 0.9 + 0.9 * (gap - 1) + 0.5 * n_same
174
+ levels[("arch", gap)] = n_same + 1
175
+ xa, xb = xs[left][1] - 0.3, xs[right][0] + 0.3
176
+ ax.plot([xa, xa, xb, xb], [ytop, h, h, ytop], color="black", lw=1.2)
177
+ _symbol(ax, b.type, (xa + xb) / 2, h, False, color)
178
+ ax.text(
179
+ (xa + xb) / 2,
180
+ h + 0.25,
181
+ _label(name, rows.get(name), _NICE.get(b.type, b.type)),
182
+ fontsize=9,
183
+ ha="center",
184
+ va="bottom",
185
+ color=color,
186
+ )
187
+ top = ytop + 0.8 + (max((g for (k, g) in levels if k == "arch"), default=0) * 0.9 if levels else 0)
188
+ ax.set_xlim(-0.6, total + 0.6)
189
+ ax.set_ylim(ybase - 0.9, top + 0.2)
190
+ ax.set_aspect("auto")
191
+ ax.axis("off")
192
+ if title:
193
+ ax.set_title(title, fontsize=11)
194
+ out = Path(path)
195
+ out.parent.mkdir(parents=True, exist_ok=True)
196
+ fig.savefig(out, bbox_inches="tight", pad_inches=0.15) # no empty margins: the KLayout panel shows it small
197
+ plt.close(fig)
198
+ return out