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.
- quantcore_circuits/__init__.py +57 -0
- quantcore_circuits/analysis/__init__.py +12 -0
- quantcore_circuits/analysis/_metal.py +70 -0
- quantcore_circuits/analysis/amplifiers.py +263 -0
- quantcore_circuits/analysis/circuits.py +117 -0
- quantcore_circuits/analysis/epr.py +231 -0
- quantcore_circuits/analysis/epr_lumped.py +372 -0
- quantcore_circuits/analysis/extract.py +119 -0
- quantcore_circuits/analysis/lom.py +80 -0
- quantcore_circuits/analysis/results.py +549 -0
- quantcore_circuits/analysis/store.py +81 -0
- quantcore_circuits/analysis/synthesis.py +118 -0
- quantcore_circuits/analysis/transmon.py +126 -0
- quantcore_circuits/assembly/__init__.py +17 -0
- quantcore_circuits/assembly/builder.py +127 -0
- quantcore_circuits/assembly/drc.py +683 -0
- quantcore_circuits/assembly/last_good.py +137 -0
- quantcore_circuits/assembly/netlist.py +174 -0
- quantcore_circuits/assembly/plan.py +605 -0
- quantcore_circuits/assembly/sidecar.py +270 -0
- quantcore_circuits/autotrack.py +605 -0
- quantcore_circuits/cards.py +878 -0
- quantcore_circuits/circuit/__init__.py +14 -0
- quantcore_circuits/circuit/adapters.py +305 -0
- quantcore_circuits/circuit/bridges.py +353 -0
- quantcore_circuits/circuit/consensus.py +158 -0
- quantcore_circuits/circuit/derive.py +28 -0
- quantcore_circuits/circuit/draw.py +198 -0
- quantcore_circuits/circuit/fill.py +828 -0
- quantcore_circuits/circuit/hamiltonian.py +193 -0
- quantcore_circuits/circuit/kinetic.py +102 -0
- quantcore_circuits/circuit/schema.py +139 -0
- quantcore_circuits/cli.py +1085 -0
- quantcore_circuits/codesign.py +1038 -0
- quantcore_circuits/data/selftest_q1_r1.json +44 -0
- quantcore_circuits/design/__init__.py +44 -0
- quantcore_circuits/design/io.py +98 -0
- quantcore_circuits/design/pyscript.py +395 -0
- quantcore_circuits/design/schema.py +398 -0
- quantcore_circuits/designer.py +625 -0
- quantcore_circuits/guiflow.py +991 -0
- quantcore_circuits/kqc_files.py +208 -0
- quantcore_circuits/layouts/__init__.py +118 -0
- quantcore_circuits/layouts/catalog.py +520 -0
- quantcore_circuits/layouts/chips/__init__.py +0 -0
- quantcore_circuits/layouts/chips/design_chip.py +325 -0
- quantcore_circuits/layouts/chips/frame.py +235 -0
- quantcore_circuits/layouts/junctions/__init__.py +0 -0
- quantcore_circuits/layouts/junctions/jj_fingers.py +99 -0
- quantcore_circuits/layouts/junctions/legacy_junctions.py +237 -0
- quantcore_circuits/layouts/junctions/sim_gap.py +48 -0
- quantcore_circuits/layouts/junctions/trilayer.py +541 -0
- quantcore_circuits/layouts/metal/__init__.py +105 -0
- quantcore_circuits/layouts/metal/component.py +332 -0
- quantcore_circuits/layouts/metal/geometry.py +462 -0
- quantcore_circuits/layouts/others/__init__.py +0 -0
- quantcore_circuits/layouts/others/amplifiers.py +1139 -0
- quantcore_circuits/layouts/others/bond_pad.py +119 -0
- quantcore_circuits/layouts/others/connector_pads.py +190 -0
- quantcore_circuits/layouts/others/couplers.py +21 -0
- quantcore_circuits/layouts/others/cpw_segment.py +131 -0
- quantcore_circuits/layouts/others/cpwe.py +661 -0
- quantcore_circuits/layouts/others/keepout.py +66 -0
- quantcore_circuits/layouts/others/legacy_resonators.py +645 -0
- quantcore_circuits/layouts/others/markers.py +201 -0
- quantcore_circuits/layouts/others/qpdk_cells.py +263 -0
- quantcore_circuits/layouts/others/shapes.py +114 -0
- quantcore_circuits/layouts/others/spirals.py +140 -0
- quantcore_circuits/layouts/others/sqdmetal_cells.py +90 -0
- quantcore_circuits/layouts/others/test_pads.py +461 -0
- quantcore_circuits/layouts/ports.py +119 -0
- quantcore_circuits/layouts/qubits/__init__.py +0 -0
- quantcore_circuits/layouts/qubits/legacy_transmon.py +124 -0
- quantcore_circuits/layouts/qubits/qpdk_cells.py +374 -0
- quantcore_circuits/layouts/qubits/sqdmetal_cells.py +376 -0
- quantcore_circuits/layouts/qubits/trilayer_concentric.py +65 -0
- quantcore_circuits/layouts/qubits/xmon.py +375 -0
- quantcore_circuits/layouts/registry.py +418 -0
- quantcore_circuits/layouts/wafers/__init__.py +0 -0
- quantcore_circuits/layouts/wafers/fab_export.py +454 -0
- quantcore_circuits/layouts/wafers/legacy_wafer.py +111 -0
- quantcore_circuits/layouts/wafers/wafer.py +469 -0
- quantcore_circuits/live/__init__.py +6 -0
- quantcore_circuits/live/klayout.py +225 -0
- quantcore_circuits/live/klive.py +61 -0
- quantcore_circuits/live/snapshot.py +185 -0
- quantcore_circuits/live/watch.py +93 -0
- quantcore_circuits/lom/__init__.py +15 -0
- quantcore_circuits/lom/builder.py +932 -0
- quantcore_circuits/lom/calibration.py +82 -0
- quantcore_circuits/lom/estimates.py +235 -0
- quantcore_circuits/lom/fragment.py +421 -0
- quantcore_circuits/lom/kqc_models.py +734 -0
- quantcore_circuits/lom/metal_models.py +917 -0
- quantcore_circuits/lom/quantcore_models.py +784 -0
- quantcore_circuits/lom/simulate.py +636 -0
- quantcore_circuits/lom/synthesize.py +189 -0
- quantcore_circuits/loop.py +610 -0
- quantcore_circuits/optimise.py +423 -0
- quantcore_circuits/pdk/__init__.py +451 -0
- quantcore_circuits/plots.py +876 -0
- quantcore_circuits/plugins.py +69 -0
- quantcore_circuits/review/__init__.py +57 -0
- quantcore_circuits/review/server.py +251 -0
- quantcore_circuits/review/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- quantcore_circuits/review/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- quantcore_circuits/review/static/assets/index-CDHdrFyA.css +1 -0
- quantcore_circuits/review/static/assets/index-CSx05Og4.js +409 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-700-normal-CjBOestx.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-700-normal-DrXBdSj3.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-700-normal-BjwYoWNd.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-cyrillic-ext-700-normal-LO58E6JB.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-700-normal-BUv2fZ6O.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-700-normal-C3JjAnD8.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-700-normal-BoQ6DsYi.woff +0 -0
- quantcore_circuits/review/static/assets/inter-greek-ext-700-normal-qfdV9bQt.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-700-normal-Ca8adRJv.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-latin-ext-700-normal-TidjK2hL.woff +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-700-normal-BZaoP0fm.woff +0 -0
- quantcore_circuits/review/static/assets/inter-vietnamese-700-normal-DlLaEgI2.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- quantcore_circuits/review/static/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- quantcore_circuits/review/static/index.html +14 -0
- quantcore_circuits/review/static/logo-quantcore-black.png +0 -0
- quantcore_circuits/review/static/logo-quantcore-white.png +0 -0
- quantcore_circuits/review/static/sample/chip.png +0 -0
- quantcore_circuits/review/static/sample/chip_rev1.png +0 -0
- quantcore_circuits/review/static/sample/q1.png +0 -0
- quantcore_circuits/review/static/sample/q2.png +0 -0
- quantcore_circuits/review/static/sample-state.json +3747 -0
- quantcore_circuits/route/__init__.py +5 -0
- quantcore_circuits/route/router.py +694 -0
- quantcore_circuits/route/waveguide.py +187 -0
- quantcore_circuits/selftest.py +224 -0
- quantcore_circuits/sim_tools/__init__.py +6 -0
- quantcore_circuits/sim_tools/aedt_attach.py +66 -0
- quantcore_circuits/sim_tools/aedt_progress.py +224 -0
- quantcore_circuits/sim_tools/aedt_project.py +302 -0
- quantcore_circuits/sim_tools/aedt_scripts.py +397 -0
- quantcore_circuits/sim_tools/aedt_session.py +275 -0
- quantcore_circuits/sim_tools/ansys.py +90 -0
- quantcore_circuits/sim_tools/builder.py +1690 -0
- quantcore_circuits/sim_tools/export.py +470 -0
- quantcore_circuits/sim_tools/geometry_check.py +342 -0
- quantcore_circuits/sim_tools/hfss.py +583 -0
- quantcore_circuits/sim_tools/palace.py +197 -0
- quantcore_circuits/sim_tools/runner.py +179 -0
- quantcore_circuits/sim_tools/subset.py +364 -0
- quantcore_circuits/track.py +671 -0
- quantcore_circuits-0.0.1.dist-info/METADATA +204 -0
- quantcore_circuits-0.0.1.dist-info/RECORD +272 -0
- quantcore_circuits-0.0.1.dist-info/WHEEL +5 -0
- quantcore_circuits-0.0.1.dist-info/entry_points.txt +2 -0
- quantcore_circuits-0.0.1.dist-info/licenses/LICENSE +674 -0
- quantcore_circuits-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""Last good routes: what a route looked like the last time it built.
|
|
2
|
+
|
|
3
|
+
A ``qcc build --keep-going`` (the KLayout plugin's builds) leaves a failed route out of the layout. So that nothing
|
|
4
|
+
downstream loses it, every successful keep-going build stores each route's polyline and length in
|
|
5
|
+
``<name>.last_good_routes.json`` next to the layout; a route that builds again replaces its entry, a route that fails
|
|
6
|
+
keeps the old one. The sidecar's ``failed_routes`` carries the entry of each failed route, the plugin draws it, and the
|
|
7
|
+
LOM (``lom_from_design``) uses it, with a warning, instead of the missing route.
|
|
8
|
+
|
|
9
|
+
Strict builds (scripts, notebooks, tests, fab export) never read or write this file.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import tempfile
|
|
17
|
+
import warnings
|
|
18
|
+
from dataclasses import replace
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
from kqcircuits.pya_resolver import pya
|
|
22
|
+
from kqcircuits.util.node import Node
|
|
23
|
+
|
|
24
|
+
from quantcore_circuits.route.router import RoutePlan, RoutingError
|
|
25
|
+
|
|
26
|
+
SCHEMA = "qcc-last-good-routes/0.1"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def store_path(layout_path: str | Path) -> Path:
|
|
30
|
+
"""``<layout stem>.last_good_routes.json`` beside the layout."""
|
|
31
|
+
p = Path(layout_path)
|
|
32
|
+
return p.with_name(p.stem + ".last_good_routes.json")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def design_store_path(design_path: str | Path) -> Path:
|
|
36
|
+
"""Where the plugin's builds of a design file keep it: ``<design dir>/build/<design stem>...``."""
|
|
37
|
+
p = Path(design_path)
|
|
38
|
+
return p.parent / "build" / f"{p.stem}.last_good_routes.json"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def load(path: str | Path | None) -> dict:
|
|
42
|
+
"""``{route: entry}`` of a store file; empty when there is none (or it cannot be read)."""
|
|
43
|
+
try:
|
|
44
|
+
data = json.loads(Path(path).read_text(encoding="utf-8"))
|
|
45
|
+
except (OSError, TypeError, ValueError):
|
|
46
|
+
return {}
|
|
47
|
+
routes = data.get("routes") if isinstance(data, dict) else None
|
|
48
|
+
return dict(routes) if isinstance(routes, dict) else {}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def entry_of(rp: RoutePlan, route) -> dict:
|
|
52
|
+
"""What is stored of a built route: its sharp polyline, length and CPW, enough to stand in for it."""
|
|
53
|
+
return {
|
|
54
|
+
"polyline": [[round(p.x, 4), round(p.y, 4)] for p in rp.polyline()],
|
|
55
|
+
"length": rp.length,
|
|
56
|
+
"target_length": rp.target_length,
|
|
57
|
+
"type": route.type,
|
|
58
|
+
"a": rp.params.get("a"),
|
|
59
|
+
"b": rp.params.get("b"),
|
|
60
|
+
"r": rp.params.get("r"),
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def update(path: str | Path, plan, previous: dict | None = None) -> dict:
|
|
65
|
+
"""Write the store after a keep-going build: the routes of the design, as they built now, or as they last built
|
|
66
|
+
(``previous``, or what the file holds) when they failed now. Returns the new ``{route: entry}``."""
|
|
67
|
+
path = Path(path)
|
|
68
|
+
old = load(path) if previous is None else previous
|
|
69
|
+
routes = plan.design.routes
|
|
70
|
+
out = {n: e for n, e in old.items() if n in routes}
|
|
71
|
+
for name, rp in plan.routes.items():
|
|
72
|
+
out[name] = entry_of(rp, routes[name])
|
|
73
|
+
data = json.dumps({"schema": SCHEMA, "design": plan.design.name, "routes": out}, indent=1)
|
|
74
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
75
|
+
fd, tmp = tempfile.mkstemp(suffix=".json", dir=path.parent)
|
|
76
|
+
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
|
77
|
+
f.write(data)
|
|
78
|
+
os.replace(tmp, path)
|
|
79
|
+
return out
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def standin(name: str, entry: dict, defaults: dict | None = None) -> RoutePlan:
|
|
83
|
+
"""A :class:`RoutePlan` rebuilt from a stored entry (not drawn: used where a length / width is needed)."""
|
|
84
|
+
params = {k: entry[k] for k in ("a", "b", "r") if entry.get(k) is not None}
|
|
85
|
+
for k, v in (defaults or {}).items():
|
|
86
|
+
params.setdefault(k, v)
|
|
87
|
+
nodes = [Node(pya.DPoint(*p)) for p in entry.get("polyline") or []]
|
|
88
|
+
return RoutePlan(name, nodes, params, entry.get("target_length"), entry.get("length"))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def resolve(plan):
|
|
92
|
+
"""``plan`` with each failed route replaced by its last good route (a copy; ``plan`` itself is not changed), for
|
|
93
|
+
the LOM and other readers of route lengths. Each replacement is named in ``plan.warnings`` and in a Python
|
|
94
|
+
warning. A failed route without a last good one raises :class:`RoutingError` naming it. Plans without failures
|
|
95
|
+
come back as they are."""
|
|
96
|
+
if not getattr(plan, "failed", None):
|
|
97
|
+
return plan
|
|
98
|
+
routes, warns, missing = dict(plan.routes), list(getattr(plan, "warnings", [])), []
|
|
99
|
+
for name, f in plan.failed.items():
|
|
100
|
+
if f.last_good and f.last_good.get("polyline"):
|
|
101
|
+
routes[name] = standin(name, f.last_good)
|
|
102
|
+
length = f.last_good.get("length")
|
|
103
|
+
warns.append(
|
|
104
|
+
f"WARNING: route {name} failed to build ({_reason(f.error, name)}); using its last good route"
|
|
105
|
+
+ (f" ({length:.1f} µm)" if isinstance(length, (int, float)) else "")
|
|
106
|
+
)
|
|
107
|
+
else:
|
|
108
|
+
missing.append(f"{name} ({_reason(f.error, name)})")
|
|
109
|
+
if missing:
|
|
110
|
+
raise RoutingError(
|
|
111
|
+
"no route for " + "; ".join(missing) + ": it failed to build and no earlier good route is stored; "
|
|
112
|
+
"fix the route (it is drawn in red in KLayout), then build again"
|
|
113
|
+
)
|
|
114
|
+
for w in warns[len(getattr(plan, "warnings", [])):]:
|
|
115
|
+
warnings.warn(w, RuntimeWarning, stacklevel=3)
|
|
116
|
+
out = replace(plan, routes=routes, failed={})
|
|
117
|
+
out.warnings = warns
|
|
118
|
+
return out
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _reason(error: str, name: str) -> str:
|
|
122
|
+
head = f"route {name}: "
|
|
123
|
+
return error[len(head):] if error.startswith(head) else error
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def plan_for_lom(design, source=None):
|
|
127
|
+
"""The build plan the LOM reads. A design file whose plugin builds stored last good routes beside the layout
|
|
128
|
+
(``build/<stem>.last_good_routes.json``) is planned with ``keep_going``: a failed route is replaced by its last
|
|
129
|
+
good one with a warning (:func:`resolve`). Everything else is the strict plan, which raises on a failed route."""
|
|
130
|
+
from quantcore_circuits.assembly.plan import plan_design # pylint: disable=import-outside-toplevel
|
|
131
|
+
|
|
132
|
+
store = {}
|
|
133
|
+
if isinstance(source, (str, Path)):
|
|
134
|
+
store = load(design_store_path(source))
|
|
135
|
+
if not store:
|
|
136
|
+
return plan_design(design)
|
|
137
|
+
return resolve(plan_design(design, keep_going=True, last_good=store))
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"""Netlist check: connections declared in ``design.json`` vs. the geometric netlist KQC extracts from the layout.
|
|
2
|
+
|
|
3
|
+
*Declared* connections come from routes with two port ends (``from`` ↔ ``to``), from snap placements with
|
|
4
|
+
``gap == 0`` (``snap`` ↔ ``to``) and from ``wire`` couplings. Route ends that are free or hangers are declared
|
|
5
|
+
*open* (connected to nothing).
|
|
6
|
+
|
|
7
|
+
*Extracted* connections come from KQC ``export_cell_netlist``: KLayout joins overlapping port texts into nets.
|
|
8
|
+
Waveguides, meanders and other unnamed sub-elements inside routes are treated as wire, so following them from one
|
|
9
|
+
named-instance pin to the next gives the galvanic connections between design ports.
|
|
10
|
+
|
|
11
|
+
``check_netlist`` reports ``opens`` (declared, not found in the layout) and ``shorts`` (found, not declared) with
|
|
12
|
+
the port coordinates in µm.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import tempfile
|
|
19
|
+
from dataclasses import dataclass, field
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
from quantcore_circuits.design.schema import CHIP
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class NetlistIssue:
|
|
27
|
+
kind: str # "open" | "short"
|
|
28
|
+
ports: tuple[str, ...]
|
|
29
|
+
where: list[tuple[float, float]]
|
|
30
|
+
|
|
31
|
+
def __str__(self) -> str:
|
|
32
|
+
at = ", ".join(f"({x:.1f}, {y:.1f})" for x, y in self.where)
|
|
33
|
+
return f"{self.kind}: {' <-> '.join(self.ports)} at {at}"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass
|
|
37
|
+
class NetlistReport:
|
|
38
|
+
declared: set[frozenset[str]]
|
|
39
|
+
extracted: set[frozenset[str]]
|
|
40
|
+
issues: list[NetlistIssue] = field(default_factory=list)
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def ok(self) -> bool:
|
|
44
|
+
return not self.issues
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def opens(self) -> list[NetlistIssue]:
|
|
48
|
+
return [i for i in self.issues if i.kind == "open"]
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def shorts(self) -> list[NetlistIssue]:
|
|
52
|
+
return [i for i in self.issues if i.kind == "short"]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def declared_connections(design, skip=()) -> set[frozenset[str]]:
|
|
56
|
+
"""Port groups that ``design`` says are galvanically connected (singletons = open ends). ``skip`` names routes
|
|
57
|
+
that were not built (failed): the check reports them once, as ``route_failed``, not as opens."""
|
|
58
|
+
out: set[frozenset[str]] = set()
|
|
59
|
+
for rname, route in design.routes.items():
|
|
60
|
+
if rname in skip:
|
|
61
|
+
continue
|
|
62
|
+
ends = [e for e in (route.from_, route.to) if isinstance(e, str)]
|
|
63
|
+
if any(e.split(".", 1)[0] == CHIP for e in ends):
|
|
64
|
+
continue # chip launchers live inside DesignChip itself, not as named instances
|
|
65
|
+
out.add(frozenset(ends))
|
|
66
|
+
for name, inst in design.instances.items():
|
|
67
|
+
p = inst.place
|
|
68
|
+
if p.snap and p.to and abs(p.gap) < 1e-9:
|
|
69
|
+
out.add(frozenset({p.snap if "." in p.snap else f"{name}.{p.snap}", p.to}))
|
|
70
|
+
for c in design.couplings.values(): # wire couplings: galvanic joins of overlapping ports
|
|
71
|
+
if c.type == "wire":
|
|
72
|
+
out.add(frozenset(c.between))
|
|
73
|
+
return out
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def extract_netlist(cell) -> dict:
|
|
77
|
+
"""KQC ``export_cell_netlist`` of ``cell`` as a dict."""
|
|
78
|
+
from kqcircuits.util.netlist_extraction import export_cell_netlist # pylint: disable=import-outside-toplevel
|
|
79
|
+
|
|
80
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
81
|
+
path = Path(tmp) / "netlist.json"
|
|
82
|
+
export_cell_netlist(cell, str(path))
|
|
83
|
+
if not path.exists(): # KQC writes nothing when the cell has no circuit (no port texts connect anywhere)
|
|
84
|
+
return {}
|
|
85
|
+
return json.loads(path.read_text(encoding="utf-8"))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def extracted_connections(netlist: dict, instance_names: set[str]) -> set[frozenset[str]]:
|
|
89
|
+
"""Connected groups of named-instance ports in a KQC netlist (unnamed sub-circuits are wire)."""
|
|
90
|
+
parent: dict = {}
|
|
91
|
+
|
|
92
|
+
def find(x):
|
|
93
|
+
parent.setdefault(x, x)
|
|
94
|
+
while parent[x] != x:
|
|
95
|
+
parent[x] = parent[parent[x]]
|
|
96
|
+
x = parent[x]
|
|
97
|
+
return x
|
|
98
|
+
|
|
99
|
+
def union(a, b):
|
|
100
|
+
parent[find(a)] = find(b)
|
|
101
|
+
|
|
102
|
+
subs = netlist.get("subcircuits", {})
|
|
103
|
+
|
|
104
|
+
def named(sid) -> str | None:
|
|
105
|
+
name = subs.get(str(sid), {}).get("instance_name")
|
|
106
|
+
return name if name in instance_names else None
|
|
107
|
+
|
|
108
|
+
for pins in netlist.get("nets", {}).values():
|
|
109
|
+
# An unnamed KQC port (``add_port("")``, refpoint ``port``, e.g. Launcher) has no pin name: KLayout calls it $N
|
|
110
|
+
keys = [(p["subcircuit_id"], "port" if p["pin"].startswith("$") else p["pin"]) for p in pins]
|
|
111
|
+
for k in keys:
|
|
112
|
+
find(k)
|
|
113
|
+
if named(k[0]) is None: # wire: all pins of an unnamed sub-circuit are one conductor
|
|
114
|
+
union(k, ("wire", k[0]))
|
|
115
|
+
for a, b in zip(keys, keys[1:]):
|
|
116
|
+
union(a, b)
|
|
117
|
+
groups: dict = {}
|
|
118
|
+
for key in list(parent):
|
|
119
|
+
if key[0] == "wire":
|
|
120
|
+
continue
|
|
121
|
+
inst = named(key[0])
|
|
122
|
+
if inst is not None:
|
|
123
|
+
groups.setdefault(find(key), set()).add(f"{inst}.{key[1]}")
|
|
124
|
+
return {frozenset(g) for g in groups.values()}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _merge_groups(groups: set[frozenset[str]], pairs) -> set[frozenset[str]]:
|
|
128
|
+
"""``groups`` with every pair in ``pairs`` joined (union-find over port names)."""
|
|
129
|
+
parent: dict[str, str] = {}
|
|
130
|
+
|
|
131
|
+
def find(x):
|
|
132
|
+
parent.setdefault(x, x)
|
|
133
|
+
while parent[x] != x:
|
|
134
|
+
parent[x] = parent[parent[x]]
|
|
135
|
+
x = parent[x]
|
|
136
|
+
return x
|
|
137
|
+
|
|
138
|
+
for g in groups:
|
|
139
|
+
if not g:
|
|
140
|
+
continue
|
|
141
|
+
first, *rest = sorted(g)
|
|
142
|
+
for x in rest:
|
|
143
|
+
parent[find(x)] = find(first)
|
|
144
|
+
find(first)
|
|
145
|
+
for a, b in pairs:
|
|
146
|
+
parent[find(a)] = find(b)
|
|
147
|
+
out: dict[str, set[str]] = {}
|
|
148
|
+
for x in parent:
|
|
149
|
+
out.setdefault(find(x), set()).add(x)
|
|
150
|
+
return {frozenset(g) for g in out.values()}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def check_netlist(result) -> NetlistReport:
|
|
154
|
+
"""Compare ``result`` (a :class:`~quantcore_circuits.assembly.BuildResult`) with its design (see module doc)."""
|
|
155
|
+
design = result.design
|
|
156
|
+
# galvanic connectivity is transitive: a port in two declared connections (a feedline pad that is also wired to
|
|
157
|
+
# an overlapping cell) makes one group, as the extraction does
|
|
158
|
+
declared = _merge_groups(declared_connections(design, skip=set(result.plan.failed)), [])
|
|
159
|
+
netlist = extract_netlist(result.cell)
|
|
160
|
+
extracted = extracted_connections(netlist, set(design.instances))
|
|
161
|
+
ports = result.plan.all_ports()
|
|
162
|
+
|
|
163
|
+
def where(names) -> list[tuple[float, float]]:
|
|
164
|
+
return [(ports[n].pos.x, ports[n].pos.y) for n in sorted(names) if n in ports]
|
|
165
|
+
|
|
166
|
+
# ``wire`` couplings join metal that overlaps without coinciding port texts, which KLayout's extraction cannot
|
|
167
|
+
# see: the check trusts them and merges each wire pair into the extracted groups.
|
|
168
|
+
extracted = _merge_groups(extracted, [c.between for c in design.couplings.values() if c.type == "wire"])
|
|
169
|
+
# Ports the design does not mention (e.g. an unused claw) are not checked.
|
|
170
|
+
mentioned = set().union(*declared) if declared else set()
|
|
171
|
+
found = {frozenset(g & mentioned) for g in extracted if g & mentioned}
|
|
172
|
+
issues = [NetlistIssue("open", tuple(sorted(g)), where(g)) for g in sorted(declared - found, key=sorted)]
|
|
173
|
+
issues += [NetlistIssue("short", tuple(sorted(g)), where(g)) for g in sorted(found - declared, key=sorted)]
|
|
174
|
+
return NetlistReport(declared, found, issues)
|