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,57 @@
1
+ """quantcore-circuits: KQCircuits-native superconducting-qubit design loop.
2
+
3
+ LOM → layout (design.json → KQC chip, router-based CPWs and meanders) → live view (klive) → simulation job export
4
+ (HFSS/Q3D via KQC scripts, Elmer, Palace) → parameter extraction (LOM, EPR, scqubits, QuCat, SQcircuit, QuTiP) →
5
+ feedback into design.json.
6
+
7
+ Typical use (``import quantcore_circuits as qcc``)::
8
+
9
+ design = qcc.load_design("examples/q1_r1_feedline.json")
10
+ result = qcc.build(design) # KQC chip cell + resolved plan (ports, route lengths)
11
+ qcc.show(design) # write OAS and open/reload it in KLayout via klive
12
+
13
+ Heavy sub-packages (layouts/KQC, analysis stacks) are imported lazily.
14
+ """
15
+
16
+ from importlib import import_module
17
+
18
+ __version__ = "0.0.1"
19
+
20
+ _LAZY = {
21
+ "load_design": "quantcore_circuits.design",
22
+ "save_design": "quantcore_circuits.design",
23
+ "design_hash": "quantcore_circuits.design",
24
+ "Design": "quantcore_circuits.design",
25
+ "build": "quantcore_circuits.assembly",
26
+ "show": "quantcore_circuits.assembly",
27
+ "write_layout": "quantcore_circuits.assembly",
28
+ "plan_design": "quantcore_circuits.assembly",
29
+ "get_pdk": "quantcore_circuits.pdk",
30
+ "Designer": "quantcore_circuits.designer",
31
+ "lom_from_design": "quantcore_circuits.lom",
32
+ }
33
+ # submodules reachable as attributes without importing them up front (qcc.review.connect(...), qcc.lom, ...)
34
+ _SUBMODULES = {
35
+ "review",
36
+ "lom",
37
+ "loop",
38
+ "plots",
39
+ "designer",
40
+ "codesign",
41
+ "circuit",
42
+ "track",
43
+ "cards",
44
+ "live",
45
+ "sim_tools",
46
+ }
47
+
48
+
49
+ def __getattr__(name):
50
+ if name in _LAZY:
51
+ return getattr(import_module(_LAZY[name]), name)
52
+ if name in _SUBMODULES:
53
+ return import_module(f"quantcore_circuits.{name}")
54
+ raise AttributeError(f"module 'quantcore_circuits' has no attribute {name!r}")
55
+
56
+
57
+ __all__ = sorted(_LAZY) + ["__version__"]
@@ -0,0 +1,12 @@
1
+ """Parameter extraction: LOM (Quantum Metal), EPR (pyEPR), scqubits, QuCat, SQcircuit, QuTiP; results store.
2
+
3
+ Submodules import their (heavy) backends lazily:
4
+
5
+ * :mod:`.transmon` — conversions, scqubits spectrum, inverse problem, dressed transmon + resonator
6
+ * :mod:`.lom` — Metal LOM 2.0 from a capacitance matrix
7
+ * :mod:`.epr` — pyEPR Hamiltonian from eigenmode participation data
8
+ * :mod:`.circuits` — QuCat lumped network, SQcircuit transmon, QuTiP model
9
+ * :mod:`.synthesis` — targets → Lj, C_Σ, Cg, resonator length ("LOM → layout")
10
+ * :mod:`.results` / :mod:`.extract` — solver outputs → parameters comparable to ``design.targets``
11
+ * :mod:`.store` — SQLite results store keyed by design hash
12
+ """
@@ -0,0 +1,70 @@
1
+ """Use Quantum Metal (Apache-2.0) analysis code without vendoring it.
2
+
3
+ ``import qiskit_metal.<anything>`` runs the whole package ``__init__`` (designs, renderers, geopandas: ~10 s). Some
4
+ Metal modules only need numpy/scipy, so they are loaded straight from their files in the installed package. The LOM
5
+ engine (``lom_core_analysis``) needs the real package and is imported normally, but lazily.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import importlib.util
11
+ import sys
12
+ from functools import cache
13
+ from pathlib import Path
14
+
15
+
16
+ @cache
17
+ def metal_root() -> Path:
18
+ spec = importlib.util.find_spec("qiskit_metal") # top-level find_spec does not execute the package
19
+ if spec is None or not spec.submodule_search_locations:
20
+ raise ImportError(
21
+ "quantum-metal is not installed "
22
+ "(bash scripts/fetch_other_libs.sh, then pip install -e third_party/qiskit-metal)"
23
+ )
24
+ return Path(list(spec.submodule_search_locations)[0])
25
+
26
+
27
+ @cache
28
+ def load_standalone(relpath: str):
29
+ """Load ``qiskit_metal/<relpath>.py`` as an isolated module (only for numpy/scipy-only modules)."""
30
+ path = metal_root() / f"{relpath}.py"
31
+ name = "_qcc_metal_" + relpath.replace("/", "_")
32
+ spec = importlib.util.spec_from_file_location(name, path)
33
+ module = importlib.util.module_from_spec(spec)
34
+ sys.modules[name] = module
35
+ spec.loader.exec_module(module)
36
+ return module
37
+
38
+
39
+ def cpw():
40
+ """``qiskit_metal.analyses.em.cpw_calculations`` (guided_wavelength, lumped_cpw)."""
41
+ return load_standalone("analyses/em/cpw_calculations")
42
+
43
+
44
+ def kappa():
45
+ """``qiskit_metal.analyses.em.kappa_calculation`` (kappa_in)."""
46
+ return load_standalone("analyses/em/kappa_calculation")
47
+
48
+
49
+ _compat_applied = False
50
+
51
+
52
+ def apply_scqubits_compat() -> None:
53
+ """Metal's fix for scqubits <= 4.3.1 with qutip >= 5.3 (``csc_array``) and numpy 2 aliases. Idempotent."""
54
+ global _compat_applied # pylint: disable=global-statement
55
+ if _compat_applied:
56
+ return
57
+ import scqubits # noqa: F401 pylint: disable=import-outside-toplevel,unused-import
58
+
59
+ load_standalone("analyses/quantization/_scqubits_compat").apply()
60
+ _compat_applied = True
61
+
62
+
63
+ def lom_core():
64
+ """``qiskit_metal.analyses.quantization.lom_core_analysis`` (heavy import)."""
65
+ import warnings # pylint: disable=import-outside-toplevel
66
+
67
+ with warnings.catch_warnings():
68
+ warnings.simplefilter("ignore")
69
+ from qiskit_metal.analyses.quantization import lom_core_analysis # pylint: disable=import-outside-toplevel
70
+ return lom_core_analysis
@@ -0,0 +1,263 @@
1
+ """Parametric-amplifier models for the amplifier design notebooks (agent ``amplifiers``): numpy / scipy only.
2
+
3
+ * **Linear networks** — ABCD matrices over a frequency axis (``series``, ``shunt``, ``cascade``, ``s_params``), the
4
+ Bloch exponent of a periodic unit (``bloch``: cosh γ = (A + D)/2), ladders of JJ / KI cells (``jj_cell``,
5
+ ``ki_cell``), a SQUID-terminated λ/4 CPW resonator (``cpw_jpa_s11``) and the resonance / linewidth of a reflection
6
+ (``resonance``: f0 at the steepest phase, κ/2π = 4 / max|dφ/df|, a lossless one-port).
7
+ * **Resonant paramps** — the linearised single-mode Langevin equation in the pump frame (``paramp_reflection``):
8
+ ȧ = −(κ/2 + iδ0) a − i g a† + √κ_e a_in, a_out = √κ_e a − a_in. Flux pumping (Yamamoto 2008; QPDK
9
+ ``vacask_cpw_parametric_amplifier``): ω0(t) = ω0 + δω cos ω_p t → g = δω/2, threshold δω = κ, peak gain
10
+ ((1 + r²)/(1 − r²))², r = δω/κ (Roy & Devoret 2016). Kerr (current) pumping (Eichler & Wallraff 2014; twpa-sim
11
+ ``twpa.jpa``): pump photons n from n[(κ/2)² + (Δ − K n)²] = κ_e Φ_in, then δ0 = ω0 − ω_p + 2Kn, g = K n.
12
+ * **Travelling-wave gain** — coupled-mode equations with an undepleted pump for a line whose inductance is
13
+ L(I) = L0 (1 + ε I + ξ I²) (Chaudhuri, Gao & Irwin 2015; Malnou et al. 2021; O'Brien et al. 2014):
14
+ 4WM (ω_s + ω_i = 2ω_p): SPM α_p = k_p ξ I_p²/8, XPM α_{s,i} = k_{s,i} ξ I_p²/4, coupling γ_{s,i} = k_{s,i} ξ I_p²/8,
15
+ Δβ = (2k_p − k_s − k_i) + 2α_p − α_s − α_i; 3WM (ω_s + ω_i = ω_p): γ_{s,i} = k_{s,i} ε I_p/4,
16
+ Δβ = (k_p − k_s − k_i) + α_p − α_s − α_i; G = 1 + (γ_s γ_i / g²) sinh²(g N), g² = γ_s γ_i − (Δβ/2)² (k per cell,
17
+ N cells). A JJ line has ξ = 1/(2 I_c²) (QPDK: the pump's own inductance × (1 + x/8), the signal's × (1 + x/4),
18
+ x = (I_p/I_c)²); a KI line ε = 2 I_dc/(I*² + I_dc²), ξ = 1/(I*² + I_dc²) on its kinetic share α_k.
19
+
20
+ These are first-order models: they explain trends and reproduce the sources' headline numbers, they are not a
21
+ harmonic-balance solution (JosephsonCircuits.jl / VACASK are not in this environment).
22
+ """
23
+
24
+ from __future__ import annotations
25
+
26
+ import math
27
+
28
+ import numpy as np
29
+
30
+ PHI0 = 2.067833848e-15 # Wb
31
+ H_PLANCK = 6.62607015e-34
32
+
33
+
34
+ def lj_from_ic(ic_A: float) -> float:
35
+ """Josephson inductance L_J = Φ0 / (2π I_c), H."""
36
+ return PHI0 / (2 * math.pi * ic_A)
37
+
38
+
39
+ def ic_from_lj(lj_H: float) -> float:
40
+ return PHI0 / (2 * math.pi * lj_H)
41
+
42
+
43
+ def squid_ls(ls0, flux_phi0, asym: float = 0.0):
44
+ """L_s(Φ) of a DC SQUID (no loop inductance): L_s0 / √(cos² πΦ + d² sin² πΦ)."""
45
+ x = np.pi * np.asarray(flux_phi0, dtype=float)
46
+ return ls0 / np.sqrt(np.cos(x) ** 2 + asym**2 * np.sin(x) ** 2)
47
+
48
+
49
+ # ---- ABCD networks ---------------------------------------------------------------------------------------------------
50
+ def series(z) -> np.ndarray:
51
+ z = np.atleast_1d(np.asarray(z, dtype=complex))
52
+ m = np.zeros(z.shape + (2, 2), dtype=complex)
53
+ m[..., 0, 0] = m[..., 1, 1] = 1
54
+ m[..., 0, 1] = z
55
+ return m
56
+
57
+
58
+ def shunt(y) -> np.ndarray:
59
+ y = np.atleast_1d(np.asarray(y, dtype=complex))
60
+ m = np.zeros(y.shape + (2, 2), dtype=complex)
61
+ m[..., 0, 0] = m[..., 1, 1] = 1
62
+ m[..., 1, 0] = y
63
+ return m
64
+
65
+
66
+ def cascade(*mats) -> np.ndarray:
67
+ out = mats[0]
68
+ for m in mats[1:]:
69
+ out = out @ m
70
+ return out
71
+
72
+
73
+ def power(m: np.ndarray, n: int) -> np.ndarray:
74
+ """``m`` (…, 2, 2) to the n-th power per frequency (repeated squaring)."""
75
+ out = np.broadcast_to(np.eye(2, dtype=complex), m.shape).copy()
76
+ base = m.copy()
77
+ while n:
78
+ if n & 1:
79
+ out = out @ base
80
+ base = base @ base
81
+ n >>= 1
82
+ return out
83
+
84
+
85
+ def s_params(abcd: np.ndarray, z0: float = 50.0) -> tuple[np.ndarray, np.ndarray]:
86
+ """(S11, S21) of a two-port between z0 ports."""
87
+ a, b, c, d = abcd[..., 0, 0], abcd[..., 0, 1], abcd[..., 1, 0], abcd[..., 1, 1]
88
+ den = a + b / z0 + c * z0 + d
89
+ return (a + b / z0 - c * z0 - d) / den, 2 / den
90
+
91
+
92
+ def bloch(unit: np.ndarray) -> np.ndarray:
93
+ """Complex Bloch exponent γ of a periodic unit: cosh γ = (A + D)/2 (Re γ: attenuation, Im γ: phase per unit),
94
+ branch with Im γ ≥ 0, unwrapped along the frequency axis."""
95
+ g = np.arccosh((unit[..., 0, 0] + unit[..., 1, 1]) / 2)
96
+ g = np.where(g.imag < 0, -g, g)
97
+ return g
98
+
99
+
100
+ def unwrap_bloch(phase) -> np.ndarray:
101
+ """Unfold a Bloch phase per unit (``bloch(unit).imag``, folded into [0, π]) along an increasing frequency axis:
102
+ after each Bragg stop band the folded phase runs back from π to 0 (or 0 to π); the true phase keeps increasing
103
+ (2mπ ± φ, the smallest candidate not below the previous value). Needed for long units (a KI-TWPA supercell of 54
104
+ cells passes the zone edge inside the band)."""
105
+ phase = np.asarray(phase, dtype=float)
106
+ out = np.empty_like(phase)
107
+ prev = 0.0
108
+ two_pi = 2 * np.pi
109
+ for i, p in enumerate(phase):
110
+ m = np.floor(prev / two_pi)
111
+ cands = [two_pi * (m + j) + s * p for j in (0, 1, 2) for s in (1, -1)]
112
+ prev = min(c for c in cands if c >= prev - 1e-9)
113
+ out[i] = prev
114
+ return out
115
+
116
+
117
+ def char_impedance(unit: np.ndarray) -> np.ndarray:
118
+ """Bloch impedance of a symmetric unit: √(B/C)."""
119
+ return np.sqrt(unit[..., 0, 1] / unit[..., 1, 0])
120
+
121
+
122
+ # ---- ladders --------------------------------------------------------------------------------------------------------
123
+ def jj_cell(f, lj_H, cj_F, cg_F, resonator: tuple[float, float, float] | None = None) -> np.ndarray:
124
+ """Symmetric JTWPA unit cell: half shunt — series (L_J ∥ C_J) — half shunt. ``resonator`` = (C_c, L_r, C_r):
125
+ the shunt gains C_c in series with L_r ∥ C_r (O'Brien 2014 resonant phase matching)."""
126
+ w = 2 * np.pi * np.asarray(f, dtype=float)
127
+ z_j = 1j * w * lj_H / (1 - w**2 * lj_H * cj_F)
128
+ y = 1j * w * cg_F
129
+ if resonator is not None:
130
+ cc, lr, cr = resonator
131
+ z_r = 1j * w * lr / (1 - w**2 * lr * cr)
132
+ y = y + 1 / (1 / (1j * w * cc) + z_r)
133
+ return cascade(shunt(y / 2), series(z_j), shunt(y / 2))
134
+
135
+
136
+ def jtwpa_unit(f, lj_H, cj_F, cg_F, every: int = 0, resonator=None, cg_loaded_F=None) -> np.ndarray:
137
+ """One repeat unit of a (resonator-loaded) JJ chain: ``every`` cells with the resonator on the last (or one
138
+ plain cell when ``every`` is 0)."""
139
+ if not every or resonator is None:
140
+ return jj_cell(f, lj_H, cj_F, cg_F)
141
+ plain = jj_cell(f, lj_H, cj_F, cg_F)
142
+ loaded = jj_cell(f, lj_H, cj_F, cg_F if cg_loaded_F is None else cg_loaded_F, resonator)
143
+ return cascade(*([plain] * (every - 1)), loaded)
144
+
145
+
146
+ def ki_cell(f, l_H, c_F, l_stub_H: float = 0.0) -> np.ndarray:
147
+ """KI-TWPA cell (twpa-sim ``Cell``, shunt-series): two finger capacitors C/2 to ground, each through its
148
+ stub inductance, then the series spine inductance."""
149
+ w = 2 * np.pi * np.asarray(f, dtype=float)
150
+ yf = 1 / (1j * w * l_stub_H + 1 / (1j * w * c_F / 2))
151
+ return cascade(shunt(yf), series(1j * w * l_H), shunt(yf)) # symmetric: one finger each side of the spine
152
+
153
+
154
+ def ki_supercell(f, l_H, c_u_F, c_l_F, unloaded: int, loaded: int, stub_u_H=0.0, stub_l_H=0.0) -> np.ndarray:
155
+ """twpa-sim supercell: unloaded/2 plain cells, ``loaded`` cells with the shorter fingers, unloaded/2 plain."""
156
+ u = ki_cell(f, l_H, c_u_F, stub_u_H)
157
+ lo = ki_cell(f, l_H, c_l_F, stub_l_H)
158
+ half = power(u, unloaded // 2)
159
+ return cascade(half, power(lo, loaded), half)
160
+
161
+
162
+ # ---- SQUID-terminated λ/4 JPA ---------------------------------------------------------------------------------------
163
+ def cpw_jpa_s11(
164
+ f, cc_F, z0_ohm, vp_m_s, length_um, ls_H, z_port: float = 50.0, loss_tangent: float = 0.0, eps_fill: float = 1.0
165
+ ):
166
+ """Reflection of port — C_c — λ/4 CPW (Z0, v_p, ``length_um``) — L_s to ground (the SQUID), exact TL formula.
167
+ ``loss_tangent`` adds dielectric loss (α = β tanδ / 2 · ``eps_fill``)."""
168
+ w = 2 * np.pi * np.asarray(f, dtype=float)
169
+ beta = w / vp_m_s * (1 - 0.5j * loss_tangent * eps_fill)
170
+ t = np.tan(beta * length_um * 1e-6)
171
+ zl = 1j * w * ls_H
172
+ zin = z0_ohm * (zl + 1j * z0_ohm * t) / (z0_ohm + 1j * zl * t) + 1 / (1j * w * cc_F)
173
+ return (zin - z_port) / (zin + z_port)
174
+
175
+
176
+ def resonance(f, s) -> tuple[float, float]:
177
+ """(f0 Hz, κ/2π Hz) of a one-port resonance in a reflection trace: the steepest phase and 4 / max|dφ/df|
178
+ (exact for a lossless reflection resonator; overcoupled traces stay close)."""
179
+ f = np.asarray(f, dtype=float)
180
+ phi = np.unwrap(np.angle(np.asarray(s)))
181
+ slope = np.abs(np.gradient(phi, f))
182
+ i = int(np.argmax(slope))
183
+ return float(f[i]), float(4.0 / slope[i])
184
+
185
+
186
+ # ---- single-mode paramps --------------------------------------------------------------------------------------------
187
+ def paramp_reflection(omega, kappa_e, kappa_i, delta0, g):
188
+ """(S_ss, S_si): signal reflection and idler conversion at offset ``omega`` (rad/s) from the pump frame of a
189
+ single-mode paramp with detuning ``delta0`` and pump coupling ``g`` (rad/s)."""
190
+ omega = np.asarray(omega, dtype=float)
191
+ k = kappa_e + kappa_i
192
+ m11 = k / 2 + 1j * (delta0 - omega)
193
+ m22 = k / 2 - 1j * (delta0 + omega)
194
+ m12, m21 = 1j * g, -1j * np.conj(g)
195
+ det = m11 * m22 - m12 * m21
196
+ return kappa_e * m22 / det - 1, kappa_e * (-m12) / det
197
+
198
+
199
+ def flux_pumped_gain(detuning_Hz, kappa_Hz, r, kappa_i_Hz: float = 0.0):
200
+ """Phase-preserving gain |S_ss|² vs signal detuning from f_p/2 (pump at 2 f0), pump ratio r = δω/κ."""
201
+ k = 2 * np.pi * kappa_Hz
202
+ ki = 2 * np.pi * kappa_i_Hz
203
+ s, _ = paramp_reflection(2 * np.pi * np.asarray(detuning_Hz), k - ki, ki, 0.0, r * k / 2)
204
+ return np.abs(s) ** 2
205
+
206
+
207
+ def flux_pumped_peak_gain(r):
208
+ r = np.asarray(r, dtype=float)
209
+ return ((1 + r**2) / (1 - r**2)) ** 2
210
+
211
+
212
+ def kerr_pump_photons(delta_p, kerr, kappa_e, kappa_i, flux_in) -> list[tuple[float, bool]]:
213
+ """Intracavity pump photons n (all non-negative roots) for pump detuning Δ = ω_p − ω0, self-Kerr K (rad/s,
214
+ negative for a junction), incident photon flux Φ_in (1/s); each with its linear stability."""
215
+ k = kappa_e + kappa_i
216
+ roots = np.roots([kerr**2, -2 * delta_p * kerr, delta_p**2 + k**2 / 4, -kappa_e * flux_in])
217
+ out = []
218
+ for n in sorted(float(r.real) for r in roots if abs(r.imag) < 1e-6 * max(abs(r), 1) and r.real >= 0):
219
+ d0 = -delta_p + 2 * kerr * n
220
+ stable = (abs(kerr * n) ** 2 - d0**2) < k**2 / 4
221
+ out.append((n, bool(stable)))
222
+ return out
223
+
224
+
225
+ def kerr_gain(omega, delta_p, kerr, kappa_e, kappa_i, n):
226
+ """|S_ss|² of a Kerr paramp at pump photon number n (pump frame)."""
227
+ s, _ = paramp_reflection(omega, kappa_e, kappa_i, -delta_p + 2 * kerr * n, kerr * n)
228
+ return np.abs(s) ** 2
229
+
230
+
231
+ # ---- travelling-wave gain (coupled modes, undepleted pump) ----------------------------------------------------------
232
+ def cme_gain(k_s, k_i, k_p, n_cells: float, ip_A: float, xi: float = 0.0, eps: float = 0.0, mode: str = "4wm"):
233
+ """Signal power gain of a TWPA of ``n_cells`` cells (k in rad/cell), pump amplitude ``ip_A``; returns
234
+ (G, Δβ per cell, g per cell). See the module docstring for the coefficients."""
235
+ k_s, k_i = np.asarray(k_s, dtype=float), np.asarray(k_i, dtype=float)
236
+ a_p = k_p * xi * ip_A**2 / 8
237
+ a_s, a_i = k_s * xi * ip_A**2 / 4, k_i * xi * ip_A**2 / 4
238
+ if mode == "4wm":
239
+ gs, gi = k_s * xi * ip_A**2 / 8, k_i * xi * ip_A**2 / 8
240
+ dbeta = (2 * k_p - k_s - k_i) + 2 * a_p - a_s - a_i
241
+ elif mode == "3wm":
242
+ gs, gi = k_s * eps * ip_A / 4, k_i * eps * ip_A / 4
243
+ dbeta = (k_p - k_s - k_i) + a_p - a_s - a_i
244
+ else:
245
+ raise ValueError(f"mode must be '4wm' or '3wm', got {mode!r}")
246
+ g2 = gs * gi - (dbeta / 2) ** 2
247
+ g = np.sqrt(g2.astype(complex))
248
+ with np.errstate(invalid="ignore", divide="ignore"):
249
+ ratio = np.where(np.abs(g2) > 1e-30, gs * gi / g2, 0.0)
250
+ gain = 1 + ratio * np.sinh(g * n_cells) ** 2
251
+ gain = np.where(np.abs(g2) > 1e-30, gain, 1 + gs * gi * n_cells**2)
252
+ return np.real(gain), dbeta, np.real(g)
253
+
254
+
255
+ def ki_nonlinearity(i_star_A: float, i_dc_A: float = 0.0, alpha_k: float = 1.0, kerr_factor: float = 1.0):
256
+ """(ε, ξ) of a KI line, twpa-sim ``Bias``: ε = 2 I_dc/(I*² + I_dc²), ξ = kerr/(I*² + I_dc²), times the kinetic
257
+ share α_k of the line inductance (only L_k is current-dependent)."""
258
+ d = i_star_A**2 + i_dc_A**2
259
+ return alpha_k * 2 * i_dc_A / d, alpha_k * kerr_factor / d
260
+
261
+
262
+ def db(x):
263
+ return 10 * np.log10(np.asarray(x, dtype=float))
@@ -0,0 +1,117 @@
1
+ """Circuit-quantisation cross-checks: QuCat (lumped network incl. losses), SQcircuit (exact transmon), QuTiP (model).
2
+
3
+ All return qcc conventions (GHz / MHz, α < 0, χ = E11 − E10 − E01 + E00).
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ import math
9
+
10
+ import numpy as np
11
+
12
+
13
+ def quarter_wave_lc(f_r_GHz: float, z0: float = 50.0) -> tuple[float, float]:
14
+ """Lumped (C fF, L nH) of a λ/4 resonator near resonance, seen from its open end: C = π/(4 ω Z0)."""
15
+ w = 2 * math.pi * f_r_GHz * 1e9
16
+ c = math.pi / (4 * w * z0)
17
+ return c / 1e-15, 1 / (w**2 * c) / 1e-9
18
+
19
+
20
+ def qucat_from_cmatrix(
21
+ cmatrix_fF,
22
+ labels: list[str],
23
+ island: str,
24
+ lj_nH: float,
25
+ resonators: dict[str, tuple[float, float]] | None = None,
26
+ loads: dict[str, float] | None = None,
27
+ ) -> dict:
28
+ """Quantise a Maxwell C-matrix (signal nets, ground excluded) + grounded junction with QuCat.
29
+
30
+ ``resonators``: ``{node: (f_r_GHz, Z0)}`` — a λ/4 resonator (equivalent parallel LC) from ``node`` to ground.
31
+ ``loads``: ``{node: R_ohm}`` — resistive loads (e.g. 50 Ω feedline) for κ. Returns all modes and the qubit-like
32
+ one (largest anharmonicity) with f, κ, α, χ to every other mode.
33
+ """
34
+ from qucat import C, J, L, Network, R # pylint: disable=import-outside-toplevel
35
+
36
+ c = np.asarray(cmatrix_fF, dtype=float)
37
+ idx = {name: i + 1 for i, name in enumerate(labels)} # node 0 = ground
38
+ comps = []
39
+ n = len(labels)
40
+ for i in range(n):
41
+ to_ground = c[i].sum()
42
+ if to_ground > 1e-6:
43
+ comps.append(C(0, i + 1, to_ground * 1e-15))
44
+ for j in range(i + 1, n):
45
+ if -c[i, j] > 1e-6:
46
+ comps.append(C(i + 1, j + 1, -c[i, j] * 1e-15))
47
+ comps.append(J(0, idx[island], "Lj"))
48
+ for node, (f_r, z0) in (resonators or {}).items():
49
+ # the coupler pad is the resonator's open end: equivalent parallel LC from that node to ground
50
+ cr, lr = quarter_wave_lc(f_r, z0)
51
+ comps += [C(0, idx[node], cr * 1e-15), L(0, idx[node], lr * 1e-9)]
52
+ for node, r_ohm in (loads or {}).items():
53
+ comps.append(R(0, idx[node], r_ohm))
54
+ import contextlib # pylint: disable=import-outside-toplevel
55
+ import io # pylint: disable=import-outside-toplevel
56
+ import warnings # pylint: disable=import-outside-toplevel
57
+
58
+ with warnings.catch_warnings(), contextlib.redirect_stdout(io.StringIO()):
59
+ warnings.simplefilter("ignore")
60
+ cir = Network(comps)
61
+ f, k, a, chi = cir.f_k_A_chi(Lj=lj_nH * 1e-9)
62
+ f, k, a, chi = np.real(f), np.real(k), np.real(a), np.real(chi)
63
+ q = int(np.argmax(a))
64
+ return {
65
+ "modes_GHz": (f / 1e9).tolist(),
66
+ "kappa_MHz": (k / 1e6).tolist(),
67
+ "qubit_mode": q,
68
+ "f_q_GHz": float(f[q] / 1e9),
69
+ "alpha_MHz": float(-a[q] / 1e6),
70
+ "chi_MHz": [float(-chi[q, m] / 1e6) for m in range(len(f))],
71
+ "kappa_q_MHz": float(k[q] / 1e6),
72
+ }
73
+
74
+
75
+ def sqcircuit_transmon(c_sigma_fF: float, lj_nH: float, ncut: int = 30) -> dict:
76
+ """Grounded transmon (single node) diagonalised with SQcircuit; returns f01 (GHz) and α (MHz)."""
77
+ import SQcircuit as sq # pylint: disable=import-outside-toplevel
78
+
79
+ from quantcore_circuits.analysis.transmon import ej_from_lj # pylint: disable=import-outside-toplevel
80
+
81
+ sq.set_unit_freq("GHz")
82
+ cq = sq.Capacitor(c_sigma_fF, "fF")
83
+ jj = sq.Junction(ej_from_lj(lj_nH), "GHz")
84
+ cr = sq.Circuit({(0, 1): [cq, jj]})
85
+ cr.set_trunc_nums([ncut])
86
+ efreqs, _ = cr.diag(4)
87
+ ev = np.sort(np.real(efreqs)) - np.min(np.real(efreqs))
88
+ return {"f_q_GHz": float(ev[1]), "alpha_MHz": float((ev[2] - 2 * ev[1]) * 1e3)}
89
+
90
+
91
+ def qutip_transmon_resonator(
92
+ f_q_GHz: float, alpha_MHz: float, f_r_GHz: float, g_MHz: float, nq: int = 5, nr: int = 12
93
+ ) -> dict:
94
+ """Kerr-transmon + resonator with exchange coupling g (QuTiP); dressed f_q, f_r and χ by state overlap."""
95
+ import qutip as qt # pylint: disable=import-outside-toplevel
96
+
97
+ b = qt.tensor(qt.destroy(nq), qt.qeye(nr))
98
+ a = qt.tensor(qt.qeye(nq), qt.destroy(nr))
99
+ alpha = alpha_MHz / 1e3
100
+ g = g_MHz / 1e3
101
+ h = f_q_GHz * b.dag() * b + alpha / 2 * b.dag() * b.dag() * b * b + f_r_GHz * a.dag() * a
102
+ h += g * (b.dag() * a + b * a.dag())
103
+ evals, evecs = h.eigenstates()
104
+
105
+ def level(q, r):
106
+ bare = qt.tensor(qt.basis(nq, q), qt.basis(nr, r))
107
+ overlaps = [abs(bare.overlap(v)) for v in evecs]
108
+ return float(evals[int(np.argmax(overlaps))])
109
+
110
+ e00, e10, e01, e11, e20 = level(0, 0), level(1, 0), level(0, 1), level(1, 1), level(2, 0)
111
+ return {
112
+ "f_q_GHz": e10 - e00,
113
+ "f_r_GHz": e01 - e00,
114
+ "alpha_MHz": (e20 - 2 * e10 + e00) * 1e3,
115
+ "chi_MHz": (e11 - e10 - e01 + e00) * 1e3,
116
+ "hamiltonian": h,
117
+ }