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,69 @@
|
|
|
1
|
+
"""Extension points for tool and solver adapters (Python entry points).
|
|
2
|
+
|
|
3
|
+
A plugin is a separately installable package (for example the ``qcc-sonnet`` adapter) that declares entry points:
|
|
4
|
+
|
|
5
|
+
``quantcore_circuits.analyses``
|
|
6
|
+
an :class:`AnalysisPlugin` instance — a new ``sim_groups.*.analyses`` name, e.g. ``"sonnet_s"``. Its
|
|
7
|
+
``export(setup, job_dir, **settings)`` writes the solver input into the job directory; qcc adds ``job.json``.
|
|
8
|
+
``quantcore_circuits.cells``
|
|
9
|
+
a module whose KQC Element classes are registered next to the built-in layouts (extra component libraries).
|
|
10
|
+
|
|
11
|
+
Example ``pyproject.toml`` of a plugin::
|
|
12
|
+
|
|
13
|
+
[project.entry-points."quantcore_circuits.analyses"]
|
|
14
|
+
sonnet_s = "qcc_sonnet:SONNET"
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import inspect
|
|
20
|
+
from collections.abc import Callable
|
|
21
|
+
from dataclasses import dataclass, field
|
|
22
|
+
from functools import cache
|
|
23
|
+
from importlib.metadata import entry_points
|
|
24
|
+
from typing import Literal
|
|
25
|
+
|
|
26
|
+
ANALYSIS_GROUP = "quantcore_circuits.analyses"
|
|
27
|
+
CELL_GROUP = "quantcore_circuits.cells"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class AnalysisPlugin:
|
|
32
|
+
name: str
|
|
33
|
+
kind: Literal["capacitance", "eigenmode", "driven"]
|
|
34
|
+
solver: str
|
|
35
|
+
export: Callable # export(setup, job_dir, **settings) -> None
|
|
36
|
+
defaults: dict = field(default_factory=dict)
|
|
37
|
+
description: str = ""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@cache
|
|
41
|
+
def analysis_plugins() -> dict[str, AnalysisPlugin]:
|
|
42
|
+
out = {}
|
|
43
|
+
for ep in entry_points(group=ANALYSIS_GROUP):
|
|
44
|
+
plugin = ep.load()
|
|
45
|
+
if not isinstance(plugin, AnalysisPlugin):
|
|
46
|
+
raise TypeError(f"entry point {ep.name!r} must load an AnalysisPlugin, got {type(plugin)}")
|
|
47
|
+
out[plugin.name] = plugin
|
|
48
|
+
return out
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def register_cell_plugins() -> list[type]:
|
|
52
|
+
"""Import ``quantcore_circuits.cells`` entry points and register their PCells in the KQC libraries."""
|
|
53
|
+
from kqcircuits.elements.element import Element # pylint: disable=import-outside-toplevel
|
|
54
|
+
|
|
55
|
+
from quantcore_circuits import layouts # pylint: disable=import-outside-toplevel
|
|
56
|
+
|
|
57
|
+
classes = []
|
|
58
|
+
for ep in entry_points(group=CELL_GROUP):
|
|
59
|
+
module = ep.load()
|
|
60
|
+
for name, obj in inspect.getmembers(module, inspect.isclass):
|
|
61
|
+
if (
|
|
62
|
+
obj.__module__ == module.__name__
|
|
63
|
+
and not name.startswith("_")
|
|
64
|
+
and issubclass(obj, Element)
|
|
65
|
+
and obj.build is not Element.build
|
|
66
|
+
):
|
|
67
|
+
classes.append(obj)
|
|
68
|
+
layouts.register_pcell_classes(classes)
|
|
69
|
+
return classes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Live dashboard (React app in ``reviewer/``, served by :mod:`.server`).
|
|
2
|
+
|
|
3
|
+
From a notebook::
|
|
4
|
+
|
|
5
|
+
dash = qcc.review.connect("examples/q1_r1_feedline.json") # starts the server (background) + opens the browser
|
|
6
|
+
... # every Run/loop step updates it live
|
|
7
|
+
dash.disconnect() # stops the server
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import webbrowser
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Dashboard:
|
|
16
|
+
"""Handle on a dashboard server running in this process (see :func:`connect`)."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, design, port: int = 8765, run_dir=None):
|
|
19
|
+
self.design, self.port, self.run_dir = design, port, run_dir
|
|
20
|
+
self.server = None
|
|
21
|
+
self.external = False
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def url(self) -> str:
|
|
25
|
+
return f"http://127.0.0.1:{self.port}/"
|
|
26
|
+
|
|
27
|
+
@property
|
|
28
|
+
def running(self) -> bool:
|
|
29
|
+
return self.server is not None or self.external
|
|
30
|
+
|
|
31
|
+
def connect(self, open_browser: bool = True) -> Dashboard:
|
|
32
|
+
from quantcore_circuits.review.server import serve # pylint: disable=import-outside-toplevel
|
|
33
|
+
|
|
34
|
+
if self.running:
|
|
35
|
+
return self
|
|
36
|
+
try:
|
|
37
|
+
self.server = serve(self.design, port=self.port, open_browser=False, run_dir=self.run_dir, background=True)
|
|
38
|
+
except OSError:
|
|
39
|
+
self.external = True # something (e.g. `qcc review` in a terminal) already serves this port
|
|
40
|
+
if open_browser:
|
|
41
|
+
webbrowser.open(self.url)
|
|
42
|
+
return self
|
|
43
|
+
|
|
44
|
+
def disconnect(self) -> None:
|
|
45
|
+
if self.server is not None:
|
|
46
|
+
self.server.shutdown()
|
|
47
|
+
self.server.server_close()
|
|
48
|
+
self.server = None
|
|
49
|
+
self.external = False
|
|
50
|
+
|
|
51
|
+
def __repr__(self) -> str:
|
|
52
|
+
state = "external" if self.external else ("running" if self.server else "stopped")
|
|
53
|
+
return f"<Dashboard {self.url} {state}>"
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def connect(design, port: int = 8765, open_browser: bool = True, run_dir=None) -> Dashboard:
|
|
57
|
+
return Dashboard(design, port, run_dir).connect(open_browser)
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"""Live dashboard backend: serves the React app (``reviewer/`` → ``review/static``) and the run state.
|
|
2
|
+
|
|
3
|
+
API (contract: ``reviewer/contract/state.ts``):
|
|
4
|
+
|
|
5
|
+
- ``GET /api/state`` — ``build/<design>/state.json`` (a fresh state is created from the design if missing)
|
|
6
|
+
- ``GET /api/events`` — Server-Sent Events: ``event: state`` whenever ``state.json`` changes, a ping every 15 s
|
|
7
|
+
- ``GET /files/<p>`` — files inside the run directory (screenshots under ``shots/``)
|
|
8
|
+
- ``POST /api/rebuild`` — rebuild the layout, write the OAS (+ klive if KLayout is open), headless screenshot, update
|
|
9
|
+
the *Layout* step
|
|
10
|
+
|
|
11
|
+
Standard library only; binds to localhost.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import mimetypes
|
|
18
|
+
import threading
|
|
19
|
+
import time
|
|
20
|
+
import webbrowser
|
|
21
|
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from urllib.parse import unquote, urlparse
|
|
24
|
+
|
|
25
|
+
STATIC = Path(__file__).parent / "static"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def rebuild_layout(run, design_source) -> dict:
|
|
29
|
+
"""Build → OAS (+ sidecar) → klive (if available) → headless KLayout screenshot → state."""
|
|
30
|
+
from quantcore_circuits.assembly import build, write_layout # pylint: disable=import-outside-toplevel
|
|
31
|
+
from quantcore_circuits.live import klive_available, send_to_klive # pylint: disable=import-outside-toplevel
|
|
32
|
+
from quantcore_circuits.live.snapshot import snapshot # pylint: disable=import-outside-toplevel
|
|
33
|
+
|
|
34
|
+
run.start("layout")
|
|
35
|
+
t0 = time.perf_counter()
|
|
36
|
+
try:
|
|
37
|
+
result = build(design_source)
|
|
38
|
+
except Exception as e: # noqa: BLE001 pylint: disable=broad-except
|
|
39
|
+
run.fail("layout", f"{type(e).__name__}: {e}")
|
|
40
|
+
return {"ok": False, "error": f"{type(e).__name__}: {e}"}
|
|
41
|
+
out = Path("build") / f"{result.design.name}.oas"
|
|
42
|
+
write_layout(result, out)
|
|
43
|
+
if klive_available():
|
|
44
|
+
send_to_klive(out)
|
|
45
|
+
png = snapshot(out, run.dir / "shots" / "chip.png", size=(1400, 1400))
|
|
46
|
+
run.screenshot(png, "Chip", "layout", "Full chip (headless KLayout render)", "headless", "chip")
|
|
47
|
+
lengths = ", ".join(f"{n} {v:.1f} µm" for n, v in result.route_lengths().items())
|
|
48
|
+
run.done("layout", f"built in {time.perf_counter() - t0:.2f} s · {lengths}", hash=result.hash)
|
|
49
|
+
return {"ok": True}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def waiting_state(root: Path) -> dict:
|
|
53
|
+
"""What the dashboard shows before any run exists (follow mode): an empty state that says what to do."""
|
|
54
|
+
from quantcore_circuits.track import Run # pylint: disable=import-outside-toplevel
|
|
55
|
+
|
|
56
|
+
st = Run._empty() # noqa: SLF001
|
|
57
|
+
st["design"] = {
|
|
58
|
+
"name": "waiting for a run",
|
|
59
|
+
"path": "",
|
|
60
|
+
"hash": "",
|
|
61
|
+
"pdk": "",
|
|
62
|
+
"stack": {"substrate": "", "epsR": 0, "thickness_um": 0},
|
|
63
|
+
"chipBox": [0, 0, 1000, 1000],
|
|
64
|
+
"instances": 0,
|
|
65
|
+
"routes": 0,
|
|
66
|
+
}
|
|
67
|
+
st["log"] = [
|
|
68
|
+
{
|
|
69
|
+
"t": st["updated"],
|
|
70
|
+
"level": "info",
|
|
71
|
+
"msg": f"No run under {root}/ yet. In the notebook: from quantcore_circuits import track; "
|
|
72
|
+
"track.start('name') (or set QCC_TRACK=1)",
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
return st
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def live_run_dir(root: Path, run: str | None = None) -> Path | None:
|
|
79
|
+
"""The run directory to show: ``root/<run>`` if named, else the one ``root/_live.json`` points at (the run that
|
|
80
|
+
saw the latest tracked event), else the most recently updated ``root/*/state.json``."""
|
|
81
|
+
if run:
|
|
82
|
+
return root / run
|
|
83
|
+
try:
|
|
84
|
+
ptr = json.loads((root / "_live.json").read_text(encoding="utf-8"))
|
|
85
|
+
d = root / ptr["run"]
|
|
86
|
+
if (d / "state.json").exists():
|
|
87
|
+
return d
|
|
88
|
+
except (OSError, ValueError, KeyError):
|
|
89
|
+
pass
|
|
90
|
+
states = sorted(root.glob("*/state.json"), key=lambda p: p.stat().st_mtime, reverse=True)
|
|
91
|
+
return states[0].parent if states else None
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def make_handler(run_dir, design_source, root: Path | None = None):
|
|
95
|
+
"""``run_dir``: a Path (one run) or a callable returning the current run directory (or None): follow mode."""
|
|
96
|
+
from quantcore_circuits.track import Run # pylint: disable=import-outside-toplevel
|
|
97
|
+
|
|
98
|
+
lock = threading.Lock()
|
|
99
|
+
follow = callable(run_dir)
|
|
100
|
+
|
|
101
|
+
def cur_dir() -> Path | None:
|
|
102
|
+
return run_dir() if follow else run_dir
|
|
103
|
+
|
|
104
|
+
def cur_state() -> Path | None:
|
|
105
|
+
d = cur_dir()
|
|
106
|
+
return d / "state.json" if d is not None else None
|
|
107
|
+
|
|
108
|
+
class Handler(BaseHTTPRequestHandler):
|
|
109
|
+
def log_message(self, fmt, *args): # keep the console quiet
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
def _send(self, body: bytes, ctype: str, code: int = 200):
|
|
113
|
+
self.send_response(code)
|
|
114
|
+
self.send_header("Content-Type", ctype)
|
|
115
|
+
self.send_header("Content-Length", str(len(body)))
|
|
116
|
+
self.send_header("Cache-Control", "no-store")
|
|
117
|
+
self.end_headers()
|
|
118
|
+
self.wfile.write(body)
|
|
119
|
+
|
|
120
|
+
def _json(self, data, code=200):
|
|
121
|
+
self._send(json.dumps(data).encode("utf-8"), "application/json; charset=utf-8", code)
|
|
122
|
+
|
|
123
|
+
def _file(self, path: Path):
|
|
124
|
+
if not path.is_file():
|
|
125
|
+
return self._send(b"not found", "text/plain", 404)
|
|
126
|
+
ctype = mimetypes.guess_type(path.name)[0] or "application/octet-stream"
|
|
127
|
+
return self._send(path.read_bytes(), ctype)
|
|
128
|
+
|
|
129
|
+
def _events(self):
|
|
130
|
+
self.send_response(200)
|
|
131
|
+
self.send_header("Content-Type", "text/event-stream")
|
|
132
|
+
self.send_header("Cache-Control", "no-store")
|
|
133
|
+
self.send_header("Connection", "keep-alive")
|
|
134
|
+
self.end_headers()
|
|
135
|
+
last, last_ping = None, time.time()
|
|
136
|
+
try:
|
|
137
|
+
while True:
|
|
138
|
+
sp = cur_state()
|
|
139
|
+
m = (str(sp), sp.stat().st_mtime) if sp is not None and sp.exists() else None
|
|
140
|
+
if m != last:
|
|
141
|
+
last = m
|
|
142
|
+
self.wfile.write(f"event: state\ndata: {json.dumps({'updated': m})}\n\n".encode())
|
|
143
|
+
self.wfile.flush()
|
|
144
|
+
elif time.time() - last_ping > 15:
|
|
145
|
+
self.wfile.write(b": ping\n\n")
|
|
146
|
+
self.wfile.flush()
|
|
147
|
+
last_ping = time.time()
|
|
148
|
+
time.sleep(0.3)
|
|
149
|
+
except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError):
|
|
150
|
+
return
|
|
151
|
+
|
|
152
|
+
def do_GET(self): # noqa: N802
|
|
153
|
+
path = unquote(urlparse(self.path).path)
|
|
154
|
+
if path == "/api/state":
|
|
155
|
+
sp = cur_state()
|
|
156
|
+
if sp is None or (not sp.exists() and design_source is None):
|
|
157
|
+
return self._json(waiting_state(root or Path("build")))
|
|
158
|
+
if not sp.exists():
|
|
159
|
+
with lock:
|
|
160
|
+
Run(design_source, cur_dir())
|
|
161
|
+
return self._send(sp.read_bytes(), "application/json; charset=utf-8")
|
|
162
|
+
if path == "/api/events":
|
|
163
|
+
return self._events()
|
|
164
|
+
if path.startswith("/files/"):
|
|
165
|
+
base = cur_dir()
|
|
166
|
+
if base is None:
|
|
167
|
+
return self._send(b"not found", "text/plain", 404)
|
|
168
|
+
target = (base / path[len("/files/") :]).resolve()
|
|
169
|
+
if base.resolve() not in target.parents:
|
|
170
|
+
return self._send(b"forbidden", "text/plain", 403)
|
|
171
|
+
return self._file(target)
|
|
172
|
+
rel = path.lstrip("/") or "index.html"
|
|
173
|
+
target = (STATIC / rel).resolve()
|
|
174
|
+
if STATIC.resolve() not in target.parents or not target.is_file():
|
|
175
|
+
target = STATIC / "index.html"
|
|
176
|
+
return self._file(target)
|
|
177
|
+
|
|
178
|
+
def do_POST(self): # noqa: N802
|
|
179
|
+
if urlparse(self.path).path == "/api/rebuild":
|
|
180
|
+
src, d = design_source, cur_dir()
|
|
181
|
+
if follow: # the design file of the run being shown
|
|
182
|
+
sp = cur_state()
|
|
183
|
+
path = json.loads(sp.read_text(encoding="utf-8")).get("design", {}).get("path") if sp else None
|
|
184
|
+
src = path if path and Path(path).exists() else None
|
|
185
|
+
if src is None or d is None:
|
|
186
|
+
return self._json({"ok": False, "error": "this run has no design file to rebuild"})
|
|
187
|
+
with lock:
|
|
188
|
+
return self._json(rebuild_layout(Run(src, d), src))
|
|
189
|
+
return self._json({"ok": False, "error": "unknown endpoint"}, 404)
|
|
190
|
+
|
|
191
|
+
return Handler
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def serve(
|
|
195
|
+
design, port: int = 8765, open_browser: bool = True, run_dir: str | Path | None = None, background: bool = False
|
|
196
|
+
):
|
|
197
|
+
"""Serve the dashboard for ``design`` on http://127.0.0.1:``port``. ``background=True`` returns the server
|
|
198
|
+
(running in a daemon thread) instead of blocking, for use from Jupyter."""
|
|
199
|
+
from quantcore_circuits.design import load_design # pylint: disable=import-outside-toplevel
|
|
200
|
+
from quantcore_circuits.track import run_dir_for # pylint: disable=import-outside-toplevel
|
|
201
|
+
|
|
202
|
+
name = load_design(design).name
|
|
203
|
+
run_dir = Path(run_dir) if run_dir else run_dir_for(name)
|
|
204
|
+
run_dir.mkdir(parents=True, exist_ok=True)
|
|
205
|
+
server = ThreadingHTTPServer(("127.0.0.1", port), make_handler(run_dir, design))
|
|
206
|
+
server.daemon_threads = True
|
|
207
|
+
url = f"http://127.0.0.1:{port}/"
|
|
208
|
+
print(f"qcc dashboard: {url} (design {name}, run dir {run_dir})")
|
|
209
|
+
if open_browser:
|
|
210
|
+
threading.Timer(0.5, lambda: webbrowser.open(url)).start()
|
|
211
|
+
if background:
|
|
212
|
+
threading.Thread(target=server.serve_forever, daemon=True).start()
|
|
213
|
+
return server
|
|
214
|
+
try:
|
|
215
|
+
server.serve_forever()
|
|
216
|
+
except KeyboardInterrupt:
|
|
217
|
+
pass
|
|
218
|
+
finally:
|
|
219
|
+
server.server_close()
|
|
220
|
+
return None
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def serve_live(
|
|
224
|
+
root: str | Path | None = None,
|
|
225
|
+
run: str | None = None,
|
|
226
|
+
port: int = 8765,
|
|
227
|
+
open_browser: bool = True,
|
|
228
|
+
background: bool = False,
|
|
229
|
+
):
|
|
230
|
+
"""Serve the dashboard in follow mode: it shows the run named ``run``, or (default) whichever run saw the latest
|
|
231
|
+
tracked event (``<root>/_live.json``, written by :func:`quantcore_circuits.track.start`), switching by itself
|
|
232
|
+
when a notebook moves on to another design. Same API as :func:`serve`."""
|
|
233
|
+
from quantcore_circuits.track import default_root # pylint: disable=import-outside-toplevel
|
|
234
|
+
|
|
235
|
+
root = Path(root) if root is not None else default_root()
|
|
236
|
+
server = ThreadingHTTPServer(("127.0.0.1", port), make_handler(lambda: live_run_dir(root, run), None, root))
|
|
237
|
+
server.daemon_threads = True
|
|
238
|
+
url = f"http://127.0.0.1:{server.server_address[1]}/"
|
|
239
|
+
print(f"qcc dashboard: {url} (following {'run ' + run if run else 'the latest run'} under {root}/)")
|
|
240
|
+
if open_browser:
|
|
241
|
+
threading.Timer(0.5, lambda: webbrowser.open(url)).start()
|
|
242
|
+
if background:
|
|
243
|
+
threading.Thread(target=server.serve_forever, daemon=True).start()
|
|
244
|
+
return server
|
|
245
|
+
try:
|
|
246
|
+
server.serve_forever()
|
|
247
|
+
except KeyboardInterrupt:
|
|
248
|
+
pass
|
|
249
|
+
finally:
|
|
250
|
+
server.server_close()
|
|
251
|
+
return None
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|