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,661 @@
1
+ """CPW-E cells (ported from the ``components/python/cpwe.py`` drawing library of the Glasgow group, used by the
2
+ ``pymacros/Cong`` macros: bond pads, the capacitively coupled λ/4 resonators, finger/gap capacitors, tapers, meanders).
3
+
4
+ The legacy library draws the CPW *gaps* (etched) with an implicit pen ``(x, y, ori)`` in nm (dbu 0.001); arcs are
5
+ KLayout ``Basic.ARC`` cells. :class:`CpwePen` reproduces it call for call (same ``pya`` boxes, transforms and ARC
6
+ PCell), collecting the gaps in a Region. The cells below wrap one legacy function each, horizontal (``ori='h'``),
7
+ starting at the origin, with parameters in µm (``a``/``b`` = legacy ``w``/``s``):
8
+
9
+ * :class:`CpweBondPad` (``b_pad``): open end + wide line + taper; port ``a`` at the CPW end.
10
+ * :class:`CpweQuarterWaveResonator` (``quarter_cap_coupled``): open coupler arm, bend, taper, meander, shorted end.
11
+ * :class:`CpweFingerCapacitor` (``finger_cap``), :class:`CpweGapCapacitor` (``gap_cap``),
12
+ :class:`CpweFingerLine` (``finger_line``), :class:`CpweTaper` (``tapper``), :class:`CpweOpenEnd` (``term_open``),
13
+ :class:`CpweMeanderLine` (``meander_line``; with ``lead`` = legacy ``quarter_wave``).
14
+
15
+ Geometry → ``base_metal_gap_wo_grid``. Ports face outward; CPW widths from the relevant ``w``/``s``.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ import numpy as np
21
+ from kqcircuits.elements.element import Element
22
+ from kqcircuits.pya_resolver import pya
23
+ from kqcircuits.util.parameters import Param, pdt
24
+
25
+
26
+ def exp_pts(x_start, x_end, y_start, y_end, b, t_type, npts):
27
+ """Legacy ``draw.exp_pts`` (exponential taper profiles)."""
28
+ points = np.linspace(0, 1, npts)
29
+ x = np.linspace(x_start, x_end, npts)
30
+ if t_type == 1:
31
+ y = (y_start - y_end) * np.exp(-1 * b * points) + (y_start - (y_start - y_end))
32
+ elif t_type == 2:
33
+ y = y_start + (y_end - y_start) * (np.exp(b * points)) / (np.exp(b))
34
+ else:
35
+ p1 = np.linspace(-0.5, 0, int(npts / 2))
36
+ p2 = np.linspace(0, 0.5, int(npts / 2))
37
+ y1 = (y_end - y_start) * (0.5 * np.exp(b * p1)) + (y_end - (y_end - y_start))
38
+ y2 = (y_end - y_start) * (1 - 0.5 * np.exp(-b * p2)) + (y_end - (y_end - y_start))
39
+ x = (0.5 + np.concatenate((p1, p2))) * (x_end - x_start) + x_start
40
+ y = np.concatenate((y1, y2))
41
+ return [(x[i], y[i]) for i in range(len(points))]
42
+
43
+
44
+ class CpwePen:
45
+ """The legacy ``cpwe`` functions, drawing into ``self.region`` (dbu = nm) instead of the global current cell."""
46
+
47
+ def __init__(self, dbu: float = 0.001):
48
+ self.dbu = dbu
49
+ self.region = pya.Region()
50
+ self._scratch = pya.Layout()
51
+ self._scratch.dbu = dbu
52
+ self._arc_layer = self._scratch.layer(1, 0)
53
+
54
+ def _insert(self, shape):
55
+ self.region.insert(shape)
56
+
57
+ def line(self, x, y, ori, w, s, length, rev):
58
+ ang = 0 if ori == "h" else 1
59
+ turn = 0 if not rev else 2
60
+ x_last, y_last = x, y
61
+ for box in (pya.Box(0, -1 * 0.5 * w - s, length, -1 * 0.5 * w), pya.Box(0, 0.5 * w, length, 0.5 * w + s)):
62
+ if ang == 0:
63
+ x_last = x - length if rev else x + length
64
+ self._insert(box.transformed(pya.Trans(0 + turn, False, x, y)))
65
+ else:
66
+ y_last = y - length if rev else y + length
67
+ self._insert(box.transformed(pya.Trans(1 + turn, False, x, y)))
68
+ return x_last, y_last, length
69
+
70
+ def finger_cap(self, x, y, ori, w, s, f_sep, f_length, f_n, rev):
71
+ ang = 0 if ori == "h" else 1
72
+ turn = 2 if rev else 0
73
+ x_last, y_last, l_tot = x, y, f_length + f_sep
74
+ f_width = (w - ((f_n - 1) * f_sep)) / f_n
75
+ boxes = [
76
+ pya.Box(0, -1 * 0.5 * w - s, f_length + f_sep, -1 * 0.5 * w),
77
+ pya.Box(0, 0.5 * w + s, f_length + f_sep, 0.5 * w),
78
+ ]
79
+ count = 0
80
+ for i in range(f_n):
81
+ if count == 0:
82
+ boxes.append(
83
+ pya.Box(0, -0.5 * w + i * (f_width + f_sep), f_length, -0.5 * w + f_width + i * (f_width + f_sep))
84
+ )
85
+ count = 1
86
+ else:
87
+ boxes.append(
88
+ pya.Box(
89
+ f_sep,
90
+ -0.5 * w + i * (f_width + f_sep),
91
+ f_length + f_sep,
92
+ -0.5 * w + f_width + i * (f_width + f_sep),
93
+ )
94
+ )
95
+ count = 0
96
+ invertbox = pya.Box(0, -1 * 0.5 * w, f_length + f_sep, 0.5 * w)
97
+ invpat = pya.Region(boxes) ^ pya.Region(invertbox)
98
+ if ang == 0:
99
+ x_last = x - (f_length + f_sep) if rev else x + f_length + f_sep
100
+ self._insert(invpat.transformed(pya.Trans(turn, False, x, y)))
101
+ else:
102
+ y_last = y - (f_length + f_sep) if rev else y + f_length + f_sep
103
+ self._insert(invpat.transformed(pya.Trans(1 + turn, False, x, y)))
104
+ return x_last, y_last, l_tot
105
+
106
+ def gap_cap(self, x, y, ori, w, s, cap_sep, rev):
107
+ ang = 0 if ori == "h" else 1
108
+ turn = 2 if rev else 0
109
+ x_last, y_last = x, y
110
+ box = pya.Box(0, -1 * 0.5 * w - s, cap_sep, 1 * 0.5 * w + s)
111
+ if ang == 0:
112
+ x_last = x - cap_sep if rev else x + cap_sep
113
+ self._insert(box.transformed(pya.Trans(turn, False, x, y)))
114
+ else:
115
+ y_last = y - cap_sep if rev else y + cap_sep
116
+ self._insert(box.transformed(pya.Trans(1 + turn, False, x, y)))
117
+ return x_last, y_last, cap_sep
118
+
119
+ def finger_line(self, x, y, ori, w, s, f_sep, f_length, f_width, f_n, rev):
120
+ ang = 1 if ori == "h" else 0
121
+ turn = 2 if rev else 0
122
+ total_len = f_sep * (f_n - 1) + f_width * f_n
123
+ x_last, y_last = x, y
124
+ boxes1, boxes2 = [], []
125
+ count = 0
126
+ for i in range(f_n):
127
+ y0, y1 = 0 + i * (f_width + f_sep), f_width + i * (f_width + f_sep)
128
+ if count == 0:
129
+ boxes1.append(pya.Box(-0.5 * w - s, y0, -0.5 * w - s + f_length, y1))
130
+ boxes2.append(pya.Box(0.5 * w + s, y0, 0.5 * w + s - f_length, y1))
131
+ count = 1
132
+ else:
133
+ boxes1.append(pya.Box(-0.5 * w, y0, -0.5 * w - f_length, y1))
134
+ boxes2.append(pya.Box(0.5 * w, y0, 0.5 * w + f_length, y1))
135
+ count = 0
136
+ invertbox1 = pya.Box(-1 * 0.5 * w - s, 0, -1 * 0.5 * w, (f_width * f_n) + (f_sep * (f_n - 1)))
137
+ invertbox2 = pya.Box(0.5 * w, 0, 0.5 * w + s, (f_width * f_n) + (f_sep * (f_n - 1)))
138
+ for pattern in (pya.Region(boxes1) ^ pya.Region(invertbox1), pya.Region(boxes2) ^ pya.Region(invertbox2)):
139
+ if ang == 0:
140
+ y_last = y - total_len if rev else y + total_len
141
+ self._insert(pattern.transformed(pya.Trans(turn, False, x, y)))
142
+ else:
143
+ x_last = x - total_len if rev else x + total_len
144
+ self._insert(pattern.transformed(pya.Trans(turn + 3, False, x, y)))
145
+ return x_last, y_last, total_len
146
+
147
+ def tapper(self, x, y, ori, w_start, s_start, w_end, s_end, length, t_type, weight, rev):
148
+ ang = 0 if ori == "h" else 1
149
+ turn = 2 if rev else 0
150
+ x_last, y_last = x, y
151
+ poly_pts = []
152
+ if t_type == 0:
153
+ poly_pts.append(
154
+ [
155
+ pya.Point(0, -0.5 * w_start - s_start),
156
+ pya.Point(0, -0.5 * w_start),
157
+ pya.Point(length, -0.5 * w_end),
158
+ pya.Point(length, -0.5 * w_end - s_end),
159
+ ]
160
+ )
161
+ poly_pts.append(
162
+ [
163
+ pya.Point(0, 0.5 * w_start + s_start),
164
+ pya.Point(0, 0.5 * w_start),
165
+ pya.Point(length, 0.5 * w_end),
166
+ pya.Point(length, 0.5 * w_end + s_end),
167
+ ]
168
+ )
169
+ else:
170
+ for sign in (-1, 1):
171
+ outer = exp_pts(
172
+ 0,
173
+ length,
174
+ y_start=sign * (0.5 * w_start + s_start),
175
+ y_end=sign * (0.5 * w_end + s_end),
176
+ b=weight,
177
+ t_type=t_type,
178
+ npts=100,
179
+ )
180
+ inner = exp_pts(
181
+ 0, length, y_start=sign * 0.5 * w_start, y_end=sign * 0.5 * w_end, b=weight, t_type=t_type, npts=100
182
+ )
183
+ inner.reverse()
184
+ poly_pts.append([pya.Point(x1, y1) for x1, y1 in outer + inner])
185
+ for pts in poly_pts:
186
+ if ang == 0:
187
+ x_last = x - length if rev else x + length
188
+ self._insert(pya.Polygon(pts).transformed(pya.Trans(turn, False, x, y)))
189
+ else:
190
+ y_last = y - length if rev else y + length
191
+ self._insert(pya.Polygon(pts).transformed(pya.Trans(1 + turn, False, x, y)))
192
+ return x_last, y_last, length
193
+
194
+ def _basic_arc(self, x_um, y_um, start, end, r1, r2, npoints):
195
+ cell = self._scratch.create_cell(
196
+ "ARC",
197
+ "Basic",
198
+ {
199
+ "layer": pya.LayerInfo(1, 0),
200
+ "actual_start_angle": start,
201
+ "actual_end_angle": end,
202
+ "actual_radius1": r1,
203
+ "actual_radius2": r2,
204
+ "npoints": npoints,
205
+ },
206
+ )
207
+ region = pya.Region(cell.begin_shapes_rec(self._arc_layer))
208
+ disp = pya.DCellInstArray(cell.cell_index(), pya.DTrans(pya.DVector(x_um, y_um))).trans.disp
209
+ self._insert(region.transformed(pya.Trans(disp.to_itype(self.dbu))))
210
+
211
+ def arc(self, x, y, ori, w, s, turn, start_angle, end_angle, m_radius, npoints):
212
+ rot = np.sqrt((end_angle - start_angle) ** 2)
213
+ dirc = (end_angle - start_angle) / rot
214
+ l_tot = (2 * np.pi * m_radius) * (rot / 360)
215
+ if dirc == -1:
216
+ start_angle, end_angle = end_angle, start_angle
217
+ if ori == "v":
218
+ if turn == "l":
219
+ x_last = x - m_radius - (rot - 90) * (m_radius) / 90
220
+ y_last = y + m_radius * dirc - (rot - 90) * (m_radius) * dirc / 90
221
+ x = (x - m_radius) / 1000
222
+ else:
223
+ start_angle = start_angle + (180 - rot) + ((180 - rot) / 90) * 180 * (1 - dirc) / 2
224
+ end_angle = end_angle + (180 - rot) + ((180 - rot) / 90) * 180 * (1 - dirc) / 2
225
+ x_last = x + m_radius + (rot - 90) * (m_radius) / 90
226
+ y_last = y + m_radius * dirc - (rot - 90) * (m_radius) * dirc / 90
227
+ x = (x + m_radius) / 1000
228
+ y = y / 1000
229
+ else:
230
+ if turn == "l":
231
+ start_angle = start_angle + 270 + (180 - rot) + (1 - dirc) * (180 - rot)
232
+ end_angle = end_angle + 270 + (180 - rot) + (1 - dirc) * (180 - rot)
233
+ y_last = y - m_radius - (rot - 90) * (m_radius) / 90
234
+ x_last = x + m_radius * dirc - (rot - 90) * (m_radius) * dirc / 90
235
+ y = (y - m_radius) / 1000
236
+ else:
237
+ start_angle = start_angle + 270
238
+ end_angle = end_angle + 270
239
+ y_last = y + m_radius + (rot - 90) * (m_radius) / 90
240
+ x_last = x + m_radius * dirc - (rot - 90) * (m_radius) * dirc / 90
241
+ y = (y + m_radius) / 1000
242
+ x = x / 1000
243
+ r_in, r_out = (m_radius - 0.5 * w - s) / 1000, (m_radius - 0.5 * w) / 1000
244
+ self._basic_arc(x, y, start_angle, end_angle, r_in, r_out, npoints)
245
+ r_in, r_out = (m_radius + 0.5 * w) / 1000, (m_radius + 0.5 * w + s) / 1000
246
+ self._basic_arc(x, y, start_angle, end_angle, r_in, r_out, npoints)
247
+ return x_last, y_last, l_tot
248
+
249
+ def term_open(self, x, y, ori, w, s, length, rev):
250
+ ang = 0 if ori == "h" else 1
251
+ turn = 2 if rev else 0
252
+ x_last, y_last = x, y
253
+ box = pya.Box(0, -0.5 * w - s, length, 0.5 * w + s)
254
+ if ang == 0:
255
+ x_last = x - length if rev else x + length
256
+ self._insert(box.transformed(pya.Trans(turn, False, x, y)))
257
+ else:
258
+ y_last = y - length if rev else y + length
259
+ self._insert(box.transformed(pya.Trans(1 + turn, False, x, y)))
260
+ return x_last, y_last, length
261
+
262
+ def marker(self, x, y):
263
+ self._insert(pya.Box(x - 1000, y - 10000, x + 1000, y + 10000))
264
+ self._insert(pya.Box(x - 10000, y - 1000, x + 10000, y + 1000))
265
+
266
+ def meander_line(self, x, y, ori, w, s, m_radius, m_length, m_bias, n, flip, term_early):
267
+ m_length = int(m_length)
268
+ ltot = 0
269
+ if not flip:
270
+ up = int(m_length * m_bias)
271
+ down = m_length - up
272
+ st, sp, rt, rp, rq, rr, t = False, True, 0, 90, 180, 360, "r"
273
+ x, y, length = self.arc(x, y, ori, w, s, t, rt, rp, m_radius, 1000)
274
+ ltot += length
275
+ ori = "v" if ori == "h" else "h"
276
+ for step in (
277
+ ("line", up - m_radius, st),
278
+ ("arc", rt, rq),
279
+ ("line", m_length, sp),
280
+ ("arc", rq, rr),
281
+ ):
282
+ x, y, length = self._step(x, y, ori, w, s, t, m_radius, step)
283
+ ltot += length
284
+ for _ in range(n - 1):
285
+ for step in (("line", m_length, st), ("arc", rt, rq), ("line", m_length, sp), ("arc", rq, rr)):
286
+ x, y, length = self._step(x, y, ori, w, s, t, m_radius, step)
287
+ ltot += length
288
+ if not term_early:
289
+ for step in (("line", down - m_radius, False), ("arc", rt, rp)):
290
+ x, y, length = self._step(x, y, ori, w, s, t, m_radius, step)
291
+ ltot += length
292
+ else:
293
+ up = int(m_length * (1 - m_bias))
294
+ down = m_length - up
295
+ st, sp, t = True, False, "r"
296
+ x, y, length = self.arc(x, y, ori, w, s, "l", 0, 90, m_radius, 1000)
297
+ ltot += length
298
+ ori = "v" if ori == "h" else "h"
299
+ for step in (("line", up - m_radius, st), ("arc", 180, 360), ("line", m_length, sp), ("arc", 0, 180)):
300
+ x, y, length = self._step(x, y, ori, w, s, t, m_radius, step)
301
+ ltot += length
302
+ for _ in range(n - 1):
303
+ for step in (("line", m_length, st), ("arc", 180, 360), ("line", m_length, sp), ("arc", 0, 180)):
304
+ x, y, length = self._step(x, y, ori, w, s, t, m_radius, step)
305
+ ltot += length
306
+ if not term_early:
307
+ for step in (("line", down - m_radius, st), ("arc", 360, 270)):
308
+ x, y, length = self._step(x, y, ori, w, s, t, m_radius, step)
309
+ ltot += length
310
+ return x, y, ltot
311
+
312
+ def _step(self, x, y, ori, w, s, t, m_radius, step):
313
+ if step[0] == "line":
314
+ return self.line(x, y, ori, w, s, step[1], step[2])
315
+ return self.arc(x, y, ori, w, s, t, step[1], step[2], m_radius, 1000)
316
+
317
+ def b_pad(self, x, y, ori, wb, sb, w, s, tl, bl, btl, t_type, weight, rev, mirror, markers):
318
+ l_tot = 0
319
+ if not mirror:
320
+ x, y, length = self.term_open(x, y, ori, wb, sb, tl, rev)
321
+ l_tot += length
322
+ x, y, length = self.line(x, y, ori, wb, sb, bl, rev)
323
+ l_tot += length
324
+ x, y, length = self.tapper(x, y, ori, wb, sb, w, s, btl, t_type, weight, rev)
325
+ l_tot += length
326
+ if markers:
327
+ self.marker(x, y - (50000 + w + s))
328
+ self.marker(x, y + (50000 + w + s))
329
+ else:
330
+ if markers:
331
+ self.marker(x, y - (50000 + w + s))
332
+ self.marker(x, y + (50000 + w + s))
333
+ x, y, length = self.tapper(x, y, ori, w, s, wb, sb, btl, t_type, weight, rev)
334
+ l_tot += length
335
+ x, y, length = self.line(x, y, ori, wb, sb, bl, rev)
336
+ l_tot += length
337
+ x, y, length = self.term_open(x, y, ori, wb, sb, tl, rev)
338
+ l_tot += length
339
+ return x, y, l_tot
340
+
341
+ def quarter_cap_coupled(
342
+ self, x, y, ori, w, s, wcap, scap, cap_len, cap_rad, t_len, m_radius, m_length, m_n, ex1, ex2, flip
343
+ ):
344
+ ltot = 0
345
+ if flip:
346
+ st, sp, t = True, False, "r"
347
+ a1, a2, a3, a4, a5 = 360, 270, 180, 0, 360
348
+ else:
349
+ sp, st, t = True, False, "l"
350
+ a1, a2, a3, a4, a5 = 0, 90, 180, 360, 0
351
+ x, y, _ = self.term_open(x, y, ori, wcap, scap, scap, st)
352
+ x, y, length = self.line(x, y, ori, wcap, scap, cap_len, st)
353
+ ltot += length
354
+ x, y, length = self.arc(x, y, ori, wcap, scap, t, a1, a2, cap_rad, 1000)
355
+ ltot += length
356
+ ori = "v"
357
+ x, y, length = self.tapper(x, y, ori, wcap, scap, w, s, t_len, 0, 0, sp)
358
+ ltot += length
359
+ x, y, length = self.line(x, y, ori, w, s, m_length + m_radius + ex1, sp)
360
+ ltot += length
361
+ x, y, length = self.arc(x, y, ori, w, s, t, a4, a3, m_radius, 1000)
362
+ ltot += length
363
+ x, y, length = self.line(x, y, ori, w, s, m_length, st)
364
+ ltot += length
365
+ x, y, length = self.arc(x, y, ori, w, s, t, a3, a5, m_radius, 1000)
366
+ ltot += length
367
+ for _ in range(m_n - 1):
368
+ x, y, length = self.line(x, y, ori, w, s, m_length, sp)
369
+ ltot += length
370
+ x, y, length = self.arc(x, y, ori, w, s, t, a4, a3, m_radius, 1000)
371
+ ltot += length
372
+ x, y, length = self.line(x, y, ori, w, s, m_length, st)
373
+ ltot += length
374
+ x, y, length = self.arc(x, y, ori, w, s, t, a3, a5, m_radius, 1000)
375
+ ltot += length
376
+ x, y, length = self.line(x, y, ori, w, s, ex2, sp)
377
+ ltot += length
378
+ return x, y, ltot
379
+
380
+
381
+ def _nm(um: float) -> float:
382
+ """µm → legacy nm units (kept as float, as the legacy scripts pass them)."""
383
+ return um * 1000.0
384
+
385
+
386
+ class _Cpwe(Element):
387
+ qcc_category = "waveguide"
388
+
389
+ def _emit(self, pen: CpwePen):
390
+ dbu = self.layout.dbu
391
+ region = pen.region.merged()
392
+ self.cell.shapes(self.get_layer("base_metal_gap_wo_grid")).insert(region)
393
+ if not region.is_empty():
394
+ self.add_protection(pya.Region(region.bbox()).sized(self.margin / dbu))
395
+
396
+ def _port(self, name, x_nm, y_nm, direction):
397
+ self.add_port(name, pya.DPoint(x_nm / 1000.0, y_nm / 1000.0), direction)
398
+
399
+
400
+ class CpweBondPad(_Cpwe):
401
+ """Bond pad: open end ``tl``, wide line ``bl`` (``pad_width``/``pad_gap``), taper ``btl`` to the CPW ``a``/``b``
402
+ (legacy ``cpwe.b_pad``, horizontal). Port ``a`` at the CPW end facing +x (``mirror``: at the origin, −x).
403
+ Refpoints ``pad_center`` and ``lumped_signal`` / ``lumped_ground`` (across the side gap at the pad centre: the
404
+ simulation builder's 50 Ω lumped port, as for ``BondPad``)."""
405
+
406
+ pad_width = Param(pdt.TypeDouble, "Pad centre width (legacy wb)", 500, unit="μm")
407
+ pad_gap = Param(pdt.TypeDouble, "Pad gap (legacy sb)", 300, unit="μm")
408
+ end_length = Param(pdt.TypeDouble, "Open-end length (legacy tl)", 10, unit="μm")
409
+ pad_length = Param(pdt.TypeDouble, "Pad length before the taper (legacy bl)", 50, unit="μm")
410
+ taper_length = Param(pdt.TypeDouble, "Taper length (legacy btl)", 500, unit="μm")
411
+ taper_type = Param(pdt.TypeInt, "Taper profile: 0 linear, 1–3 exponential (legacy t_type)", 3)
412
+ weight = Param(pdt.TypeDouble, "Exponent weight of the taper", 25)
413
+ mirror = Param(pdt.TypeBoolean, "Mirrored: taper first, pad at the +x end", False)
414
+ markers = Param(pdt.TypeBoolean, "Alignment crosses beside the taper end", False)
415
+
416
+ qcc_category = "launcher"
417
+
418
+ def build(self):
419
+ pen = CpwePen(self.layout.dbu)
420
+ x, y, _ = pen.b_pad(
421
+ 0,
422
+ 0,
423
+ "h",
424
+ _nm(self.pad_width),
425
+ _nm(self.pad_gap),
426
+ _nm(self.a),
427
+ _nm(self.b),
428
+ _nm(self.end_length),
429
+ _nm(self.pad_length),
430
+ _nm(self.taper_length),
431
+ self.taper_type,
432
+ self.weight,
433
+ False,
434
+ self.mirror,
435
+ self.markers,
436
+ )
437
+ self._emit(pen)
438
+ if self.mirror:
439
+ self._port("a", 0, 0, pya.DVector(-1, 0))
440
+ else:
441
+ self._port("a", x, y, pya.DVector(1, 0))
442
+ centre = self.taper_length + self.pad_length / 2 if self.mirror else self.end_length + self.pad_length / 2
443
+ self.refpoints["pad_center"] = pya.DPoint(centre, 0)
444
+ # lumped-port terminals (as BondPad): across the pad's side gap at the pad centre
445
+ self.refpoints["lumped_signal"] = pya.DPoint(centre, self.pad_width / 2)
446
+ self.refpoints["lumped_ground"] = pya.DPoint(centre, self.pad_width / 2 + self.pad_gap)
447
+
448
+
449
+ class CpweQuarterWaveResonator(_Cpwe):
450
+ """λ/4 resonator capacitively coupled through an open-ended arm parallel to the feedline (legacy
451
+ ``cpwe.quarter_cap_coupled``): open end at the origin, coupler arm along x (``cap_length``, CPW
452
+ ``cap_width``/``cap_gap``), bend, taper to the resonator CPW ``a``/``b``, meander, shorted end.
453
+
454
+ Refpoints: ``open_end`` (origin), ``short_end``, ``coupler_center``. :meth:`qcc_resonator_length` gives the
455
+ legacy returned length (µm, without the open-end box)."""
456
+
457
+ cap_width = Param(pdt.TypeDouble, "Coupler centre width (legacy wcap)", 3, unit="μm")
458
+ cap_gap = Param(pdt.TypeDouble, "Coupler gap (legacy scap)", 1.6, unit="μm")
459
+ cap_length = Param(pdt.TypeDouble, "Coupler length (legacy cap_len)", 200, unit="μm")
460
+ cap_radius = Param(pdt.TypeDouble, "Coupler bend radius (legacy cap_rad)", 20, unit="μm")
461
+ taper_length = Param(pdt.TypeDouble, "Taper to the resonator CPW (legacy t_len)", 20, unit="μm")
462
+ meander_radius = Param(pdt.TypeDouble, "Meander radius (legacy m_radius)", 50, unit="μm")
463
+ meander_length = Param(pdt.TypeDouble, "Meander straight length (legacy m_length)", 1000, unit="μm")
464
+ meanders = Param(pdt.TypeInt, "Meander periods (legacy m_n)", 2)
465
+ excess_1 = Param(pdt.TypeDouble, "Extra length before the meander (legacy ex1)", 300, unit="μm")
466
+ excess_2 = Param(pdt.TypeDouble, "Extra length after the meander (legacy ex2)", 70.26554, unit="μm")
467
+ flip = Param(pdt.TypeBoolean, "Mirror (legacy flip)", True)
468
+
469
+ qcc_category = "resonator"
470
+
471
+ @staticmethod
472
+ def _draw(p: dict, dbu: float):
473
+ pen = CpwePen(dbu)
474
+ end = pen.quarter_cap_coupled(
475
+ 0,
476
+ 0,
477
+ "h",
478
+ _nm(p["a"]),
479
+ _nm(p["b"]),
480
+ _nm(p["cap_width"]),
481
+ _nm(p["cap_gap"]),
482
+ _nm(p["cap_length"]),
483
+ _nm(p["cap_radius"]),
484
+ _nm(p["taper_length"]),
485
+ _nm(p["meander_radius"]),
486
+ _nm(p["meander_length"]),
487
+ p["meanders"],
488
+ _nm(p["excess_1"]),
489
+ _nm(p["excess_2"]),
490
+ p["flip"],
491
+ )
492
+ return pen, end
493
+
494
+ @classmethod
495
+ def qcc_resonator_length(cls, params: dict) -> float:
496
+ """Centre-line length from the open end to the short (legacy return value, without the open-end box), µm."""
497
+ p = {k: v.default for k, v in cls.get_schema().items()} | dict(params)
498
+ return float(cls._draw(p, 0.001)[1][2]) / 1000.0
499
+
500
+ def build(self):
501
+ names = ("a", "b", "cap_width", "cap_gap", "cap_length", "cap_radius", "taper_length", "meander_radius")
502
+ names += ("meander_length", "meanders", "excess_1", "excess_2", "flip")
503
+ pen, (x, y, _length) = self._draw({n: getattr(self, n) for n in names}, self.layout.dbu)
504
+ self._emit(pen)
505
+ self.refpoints["open_end"] = pya.DPoint(0, 0)
506
+ self.refpoints["short_end"] = pya.DPoint(x / 1000.0, y / 1000.0)
507
+ self.refpoints["coupler_center"] = pya.DPoint(
508
+ (-1 if self.flip else 1) * (self.cap_gap + self.cap_length / 2), 0
509
+ )
510
+
511
+
512
+ class CpweFingerCapacitor(_Cpwe):
513
+ """Interdigital capacitor interrupting the centre line (legacy ``cpwe.finger_cap``); ports ``a`` (−x), ``b``."""
514
+
515
+ finger_gap = Param(pdt.TypeDouble, "Finger separation (legacy f_sep)", 2, unit="μm")
516
+ finger_length = Param(pdt.TypeDouble, "Finger length (legacy f_length)", 50, unit="μm")
517
+ fingers = Param(pdt.TypeInt, "Number of fingers (legacy f_n)", 4)
518
+
519
+ qcc_category = "capacitor"
520
+
521
+ def build(self):
522
+ pen = CpwePen(self.layout.dbu)
523
+ x, y, _ = pen.finger_cap(
524
+ 0, 0, "h", _nm(self.a), _nm(self.b), _nm(self.finger_gap), _nm(self.finger_length), self.fingers, False
525
+ )
526
+ self._emit(pen)
527
+ self._port("a", 0, 0, pya.DVector(-1, 0))
528
+ self._port("b", x, y, pya.DVector(1, 0))
529
+
530
+
531
+ class CpweGapCapacitor(_Cpwe):
532
+ """Gap in the centre line (legacy ``cpwe.gap_cap``); ports ``a`` (−x), ``b`` (+x)."""
533
+
534
+ cap_gap = Param(pdt.TypeDouble, "Gap length (legacy cap_sep)", 5, unit="μm")
535
+
536
+ qcc_category = "capacitor"
537
+
538
+ def build(self):
539
+ pen = CpwePen(self.layout.dbu)
540
+ x, y, _ = pen.gap_cap(0, 0, "h", _nm(self.a), _nm(self.b), _nm(self.cap_gap), False)
541
+ self._emit(pen)
542
+ self._port("a", 0, 0, pya.DVector(-1, 0))
543
+ self._port("b", x, y, pya.DVector(1, 0))
544
+
545
+
546
+ class CpweFingerLine(_Cpwe):
547
+ """CPW with interdigital fingers between centre line and ground on both sides (legacy ``cpwe.finger_line``);
548
+ ports ``a`` (−x) and ``b`` (+x)."""
549
+
550
+ finger_gap = Param(pdt.TypeDouble, "Finger separation (legacy f_sep)", 2, unit="μm")
551
+ finger_length = Param(pdt.TypeDouble, "Finger length (legacy f_length)", 4, unit="μm")
552
+ finger_width = Param(pdt.TypeDouble, "Finger width (legacy f_width)", 2, unit="μm")
553
+ fingers = Param(pdt.TypeInt, "Number of fingers (legacy f_n)", 10)
554
+
555
+ qcc_category = "capacitor"
556
+
557
+ def build(self):
558
+ pen = CpwePen(self.layout.dbu)
559
+ x, y, _ = pen.finger_line(
560
+ 0,
561
+ 0,
562
+ "h",
563
+ _nm(self.a),
564
+ _nm(self.b),
565
+ _nm(self.finger_gap),
566
+ _nm(self.finger_length),
567
+ _nm(self.finger_width),
568
+ self.fingers,
569
+ False,
570
+ )
571
+ self._emit(pen)
572
+ self._port("a", 0, 0, pya.DVector(-1, 0))
573
+ self._port("b", x, y, pya.DVector(1, 0))
574
+
575
+
576
+ class CpweTaper(_Cpwe):
577
+ """Taper from ``a``/``b`` to ``a_end``/``b_end`` (legacy ``cpwe.tapper``: linear or exponential profiles)."""
578
+
579
+ a_end = Param(pdt.TypeDouble, "Centre width at the +x end", 20, unit="μm")
580
+ b_end = Param(pdt.TypeDouble, "Gap at the +x end", 12, unit="μm")
581
+ length = Param(pdt.TypeDouble, "Taper length", 100, unit="μm")
582
+ taper_type = Param(pdt.TypeInt, "Profile: 0 linear, 1–3 exponential (legacy t_type)", 0)
583
+ weight = Param(pdt.TypeDouble, "Exponent weight", 25)
584
+
585
+ @classmethod
586
+ def qcc_port_widths(cls, params: dict) -> dict:
587
+ return {"b": (params.get("a_end", 20), params.get("b_end", 12))}
588
+
589
+ def build(self):
590
+ pen = CpwePen(self.layout.dbu)
591
+ x, y, _ = pen.tapper(
592
+ 0,
593
+ 0,
594
+ "h",
595
+ _nm(self.a),
596
+ _nm(self.b),
597
+ _nm(self.a_end),
598
+ _nm(self.b_end),
599
+ _nm(self.length),
600
+ self.taper_type,
601
+ self.weight,
602
+ False,
603
+ )
604
+ self._emit(pen)
605
+ self._port("a", 0, 0, pya.DVector(-1, 0))
606
+ self._port("b", x, y, pya.DVector(1, 0))
607
+
608
+
609
+ class CpweOpenEnd(_Cpwe):
610
+ """Open CPW termination (legacy ``cpwe.term_open``): the gap box of ``length``; port ``a`` at the origin (−x)."""
611
+
612
+ length = Param(pdt.TypeDouble, "Termination length", 10, unit="μm")
613
+
614
+ qcc_category = "termination"
615
+
616
+ def build(self):
617
+ pen = CpwePen(self.layout.dbu)
618
+ pen.term_open(0, 0, "h", _nm(self.a), _nm(self.b), _nm(self.length), False)
619
+ self._emit(pen)
620
+ self._port("a", 0, 0, pya.DVector(-1, 0))
621
+
622
+
623
+ class CpweMeanderLine(_Cpwe):
624
+ """Meandered CPW (legacy ``cpwe.meander_line``; with ``lead`` > 0 it is legacy ``cpwe.quarter_wave``: lead,
625
+ meander, lead). Starts at the origin going +x; ports ``a`` (start, −x) and ``b`` (end)."""
626
+
627
+ meander_radius = Param(pdt.TypeDouble, "Bend radius (legacy m_radius)", 50, unit="μm")
628
+ meander_length = Param(pdt.TypeDouble, "Straight length (legacy m_length)", 500, unit="μm")
629
+ bias = Param(pdt.TypeDouble, "Skew of the meander (legacy m_bias)", 0.5)
630
+ meanders = Param(pdt.TypeInt, "Meander periods (legacy n)", 2)
631
+ flip = Param(pdt.TypeBoolean, "Mirror (legacy flip)", False)
632
+ term_early = Param(pdt.TypeBoolean, "End on a straight section (legacy term_early)", False)
633
+ lead = Param(pdt.TypeDouble, "Straight lead before and after (legacy quarter_wave resonator_excess)", 0, unit="μm")
634
+
635
+ def build(self):
636
+ pen = CpwePen(self.layout.dbu)
637
+ w, s = _nm(self.a), _nm(self.b)
638
+ x, y = 0, 0
639
+ if self.lead > 0:
640
+ x, y, _ = pen.line(x, y, "h", w, s, _nm(self.lead), False)
641
+ x, y, _ = pen.meander_line(
642
+ x,
643
+ y,
644
+ "h",
645
+ w,
646
+ s,
647
+ _nm(self.meander_radius),
648
+ _nm(self.meander_length),
649
+ self.bias,
650
+ self.meanders,
651
+ self.flip,
652
+ self.term_early,
653
+ )
654
+ end_dir = pya.DVector(1, 0)
655
+ if self.lead > 0:
656
+ x, y, _ = pen.line(x, y, "h", w, s, _nm(self.lead), False)
657
+ elif self.term_early:
658
+ end_dir = pya.DVector(0, 1) if not self.flip else pya.DVector(0, -1)
659
+ self._emit(pen)
660
+ self._port("a", 0, 0, pya.DVector(-1, 0))
661
+ self._port("b", x, y, end_dir)