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,197 @@
|
|
|
1
|
+
"""Palace adapter: KQC Elmer export + KQC gmsh mesher → Palace config.
|
|
2
|
+
|
|
3
|
+
``export_palace`` writes a normal KQC Elmer job (geometry, layer stack, ports, mesh sizes and KQC's
|
|
4
|
+
``scripts/gmsh_helpers.py``) and adds:
|
|
5
|
+
|
|
6
|
+
* ``palace_job.json`` — what to generate (``Electrostatic`` or ``Eigenmode``) and solver settings,
|
|
7
|
+
* ``run_palace.sh`` — ``python -m quantcore_circuits.sim_tools.palace prepare .`` then ``mpirun palace palace.json``.
|
|
8
|
+
|
|
9
|
+
``prepare`` (run where gmsh is available, usually the Linux server) meshes with KQC's ``produce_mesh`` in MSH 2.2
|
|
10
|
+
(required by MFEM/Palace), reads the physical groups and writes ``palace.json``:
|
|
11
|
+
|
|
12
|
+
* volumes → ``Domains.Materials`` (permittivity / loss tangent from the KQC ``material_dict``; vacuum ε=1),
|
|
13
|
+
* Electrostatic: ``Ground`` = ``excitation_0_boundary``, ``Terminal`` k = ``excitation_k_boundary`` (same order as
|
|
14
|
+
Q3D ``Net<k>`` / Elmer capacitance bodies, so C-matrix labels from ``job.json`` apply unchanged),
|
|
15
|
+
* Eigenmode: ``PEC`` = all metal boundaries + outer box; junction ports → ``LumpedPort`` with ``L = Lj``,
|
|
16
|
+
``C = Cj``; other internal ports → 50 Ω ``LumpedPort`` (gives κ in ``port-Q.csv``).
|
|
17
|
+
|
|
18
|
+
Lengths stay in µm (``Model.L0 = 1e-6``).
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import json
|
|
24
|
+
import os
|
|
25
|
+
import re
|
|
26
|
+
import sys
|
|
27
|
+
from pathlib import Path
|
|
28
|
+
|
|
29
|
+
PALACE_JOB = "palace_job.json"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def export_palace(setup, job_dir: Path, **cfg) -> Path:
|
|
33
|
+
from kqcircuits.simulations.export.elmer.elmer_export import export_elmer # pylint: disable=C0415
|
|
34
|
+
from kqcircuits.simulations.export.elmer.mesh_size_helpers import refine_metal_edges # pylint: disable=C0415
|
|
35
|
+
|
|
36
|
+
eig = setup.analysis == "palace_eig"
|
|
37
|
+
mesh_size = {"global_max": cfg.get("mesh_global_max", 100.0), **refine_metal_edges(cfg.get("mesh_edge", 4.0))}
|
|
38
|
+
common = {
|
|
39
|
+
"mesh_size": mesh_size,
|
|
40
|
+
"mesh_options": {"Mesh.MshFileVersion": 2.2},
|
|
41
|
+
"workflow": {"run_gmsh_gui": False, "run_elmergrid": False, "run_elmer": False, "run_paraview": False},
|
|
42
|
+
}
|
|
43
|
+
if eig:
|
|
44
|
+
# wave_equation makes KQC's mesher create port surfaces (needed for the junction LumpedPort)
|
|
45
|
+
export_elmer(
|
|
46
|
+
[setup.simulation], path=job_dir, tool="wave_equation", frequency=cfg.get("target_GHz", 3.0), **common
|
|
47
|
+
)
|
|
48
|
+
else:
|
|
49
|
+
export_elmer([setup.simulation], path=job_dir, tool="capacitance", **common)
|
|
50
|
+
spec = {
|
|
51
|
+
"problem": "Eigenmode" if eig else "Electrostatic",
|
|
52
|
+
"order": cfg.get("order", 2),
|
|
53
|
+
"n_modes": cfg.get("n_modes", 2),
|
|
54
|
+
"target_GHz": cfg.get("target_GHz", 3.0),
|
|
55
|
+
"simulation": setup.simulation.name.lower().replace(".", "-"),
|
|
56
|
+
"mpi_processes": cfg.get("mpi_processes", 8),
|
|
57
|
+
}
|
|
58
|
+
(job_dir / PALACE_JOB).write_text(json.dumps(spec, indent=2) + "\n", encoding="utf-8")
|
|
59
|
+
sh = job_dir / "run_palace.sh"
|
|
60
|
+
sh.write_text(
|
|
61
|
+
'#!/bin/bash\nset -e\ncd "$(dirname "$0")"\n'
|
|
62
|
+
f"${{QCC_PYTHON:-python3}} -m quantcore_circuits.sim_tools.palace prepare .\n"
|
|
63
|
+
f"${{QCC_MPIRUN:-mpirun}} -np ${{QCC_NP:-{spec['mpi_processes']}}} ${{QCC_PALACE:-palace}} palace.json\n",
|
|
64
|
+
encoding="utf-8",
|
|
65
|
+
newline="\n",
|
|
66
|
+
)
|
|
67
|
+
return job_dir
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def read_physical_names(msh_path: Path) -> dict[str, tuple[int, int]]:
|
|
71
|
+
"""``$PhysicalNames`` of an ASCII .msh → {name: (dim, tag)}."""
|
|
72
|
+
text = Path(msh_path).read_text(encoding="utf-8", errors="replace")
|
|
73
|
+
block = re.search(r"\$PhysicalNames\s*\n(\d+)\s*\n(.*?)\$EndPhysicalNames", text, re.S)
|
|
74
|
+
if not block:
|
|
75
|
+
raise ValueError(f"{msh_path}: no $PhysicalNames section")
|
|
76
|
+
out = {}
|
|
77
|
+
for line in block.group(2).strip().splitlines():
|
|
78
|
+
m = re.match(r'\s*(\d+)\s+(\d+)\s+"(.*)"', line)
|
|
79
|
+
if m:
|
|
80
|
+
out[m.group(3)] = (int(m.group(1)), int(m.group(2)))
|
|
81
|
+
return out
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _axis_direction(v) -> str | list:
|
|
85
|
+
x, y = v[0], v[1]
|
|
86
|
+
if abs(x) < 1e-12 and abs(y) > 0:
|
|
87
|
+
return "+Y" if y > 0 else "-Y"
|
|
88
|
+
if abs(y) < 1e-12 and abs(x) > 0:
|
|
89
|
+
return "+X" if x > 0 else "-X"
|
|
90
|
+
n = (x * x + y * y) ** 0.5
|
|
91
|
+
return [x / n, y / n, 0.0]
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def palace_config(sim_json: dict, physical: dict[str, tuple[int, int]], spec: dict, mesh_file: str) -> dict:
|
|
95
|
+
"""Palace configuration dict from a KQC simulation JSON and mesh physical groups."""
|
|
96
|
+
materials_db = sim_json.get("material_dict", {})
|
|
97
|
+
if isinstance(materials_db, str):
|
|
98
|
+
import ast # pylint: disable=import-outside-toplevel
|
|
99
|
+
|
|
100
|
+
materials_db = ast.literal_eval(materials_db)
|
|
101
|
+
volumes = {n: t for n, (d, t) in physical.items() if d == 3}
|
|
102
|
+
surfaces = {n: t for n, (d, t) in physical.items() if d == 2}
|
|
103
|
+
|
|
104
|
+
materials = []
|
|
105
|
+
layers = sim_json["layers"]
|
|
106
|
+
for name, tag in volumes.items():
|
|
107
|
+
layer = layers.get(name, {})
|
|
108
|
+
mat = layer.get("material", "vacuum")
|
|
109
|
+
if mat == "pec":
|
|
110
|
+
continue
|
|
111
|
+
props = materials_db.get(mat, {})
|
|
112
|
+
entry = {"Attributes": [tag], "Permeability": 1.0, "Permittivity": props.get("permittivity", 1.0)}
|
|
113
|
+
if props.get("dielectric_loss_tangent"):
|
|
114
|
+
entry["LossTan"] = props["dielectric_loss_tangent"]
|
|
115
|
+
materials.append(entry)
|
|
116
|
+
|
|
117
|
+
exc = {}
|
|
118
|
+
for n, t in surfaces.items():
|
|
119
|
+
m = re.fullmatch(r"excitation_(\d+)_boundary", n)
|
|
120
|
+
if m:
|
|
121
|
+
exc[int(m.group(1))] = t
|
|
122
|
+
boundaries: dict = {}
|
|
123
|
+
if spec["problem"] == "Electrostatic":
|
|
124
|
+
boundaries["Ground"] = {"Attributes": [exc[0]]} if 0 in exc else {"Attributes": []}
|
|
125
|
+
boundaries["Terminal"] = [{"Index": k, "Attributes": [t]} for k, t in sorted(exc.items()) if k > 0]
|
|
126
|
+
solver = {"Order": spec["order"], "Device": "CPU", "Electrostatic": {"Save": 0}}
|
|
127
|
+
else:
|
|
128
|
+
pec = sorted(exc.values()) + ([surfaces["domain_boundary"]] if "domain_boundary" in surfaces else [])
|
|
129
|
+
boundaries["PEC"] = {"Attributes": pec}
|
|
130
|
+
ports = []
|
|
131
|
+
for port in sim_json.get("ports", []):
|
|
132
|
+
name = f"port_{port['number']}"
|
|
133
|
+
if name not in surfaces:
|
|
134
|
+
continue
|
|
135
|
+
sig, gnd = port.get("signal_location"), port.get("ground_location")
|
|
136
|
+
direction = _axis_direction([sig[0] - gnd[0], sig[1] - gnd[1]]) if sig and gnd else "+Y"
|
|
137
|
+
entry = {"Index": port["number"], "Attributes": [surfaces[name]], "Direction": direction}
|
|
138
|
+
if port.get("junction"):
|
|
139
|
+
entry["L"] = port.get("inductance", 0.0)
|
|
140
|
+
if port.get("capacitance"):
|
|
141
|
+
entry["C"] = port["capacitance"]
|
|
142
|
+
else:
|
|
143
|
+
entry["R"] = port.get("resistance", 50.0)
|
|
144
|
+
ports.append(entry)
|
|
145
|
+
if ports:
|
|
146
|
+
boundaries["LumpedPort"] = ports
|
|
147
|
+
solver = {
|
|
148
|
+
"Order": spec["order"],
|
|
149
|
+
"Device": "CPU",
|
|
150
|
+
"Eigenmode": {"N": spec["n_modes"], "Target": spec["target_GHz"], "Save": spec["n_modes"], "Tol": 1e-8},
|
|
151
|
+
}
|
|
152
|
+
solver["Linear"] = {"Type": "Default", "KSPType": "Default", "Tol": 1e-8, "MaxIts": 500}
|
|
153
|
+
return {
|
|
154
|
+
"Problem": {"Type": spec["problem"], "Verbose": 2, "Output": "postpro"},
|
|
155
|
+
"Model": {"Mesh": mesh_file, "L0": 1e-6},
|
|
156
|
+
"Domains": {"Materials": materials},
|
|
157
|
+
"Boundaries": boundaries,
|
|
158
|
+
"Solver": solver,
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def prepare(job_dir: str | Path) -> Path:
|
|
163
|
+
"""Mesh (KQC ``produce_mesh``, MSH 2.2) and write ``palace.json`` in ``job_dir``."""
|
|
164
|
+
job_dir = Path(job_dir).resolve()
|
|
165
|
+
spec = json.loads((job_dir / PALACE_JOB).read_text(encoding="utf-8"))
|
|
166
|
+
sim_json_path = job_dir / f"{spec['simulation']}.json"
|
|
167
|
+
if not sim_json_path.exists(): # KQC may have adjusted the name; take the single simulation json
|
|
168
|
+
candidates = [
|
|
169
|
+
p
|
|
170
|
+
for p in job_dir.glob("*.json")
|
|
171
|
+
if p.name not in (PALACE_JOB, "job.json") and not p.name.endswith("_VERSIONS.json")
|
|
172
|
+
]
|
|
173
|
+
sim_json_path = candidates[0]
|
|
174
|
+
sim_json = json.loads(sim_json_path.read_text(encoding="utf-8"))
|
|
175
|
+
sys.path.insert(0, str(job_dir / "scripts"))
|
|
176
|
+
from gmsh_helpers import produce_mesh # pylint: disable=import-outside-toplevel,import-error
|
|
177
|
+
|
|
178
|
+
mesh_name = sim_json.get("mesh_name", sim_json_path.stem)
|
|
179
|
+
msh = job_dir / f"{mesh_name}.msh"
|
|
180
|
+
cwd = os.getcwd()
|
|
181
|
+
try:
|
|
182
|
+
os.chdir(job_dir)
|
|
183
|
+
produce_mesh(sim_json, msh)
|
|
184
|
+
finally:
|
|
185
|
+
os.chdir(cwd)
|
|
186
|
+
config = palace_config(sim_json, read_physical_names(msh), spec, msh.name)
|
|
187
|
+
out = job_dir / "palace.json"
|
|
188
|
+
out.write_text(json.dumps(config, indent=2) + "\n", encoding="utf-8")
|
|
189
|
+
return out
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
if __name__ == "__main__": # python -m quantcore_circuits.sim_tools.palace prepare <job_dir>
|
|
193
|
+
if len(sys.argv) >= 3 and sys.argv[1] == "prepare":
|
|
194
|
+
print(prepare(sys.argv[2]))
|
|
195
|
+
else:
|
|
196
|
+
print("usage: python -m quantcore_circuits.sim_tools.palace prepare <job_dir>")
|
|
197
|
+
sys.exit(2)
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""Run simulation jobs locally or through a filesystem queue (lab server).
|
|
2
|
+
|
|
3
|
+
Local run: executes the job's launcher — Ansys: ``ansysedt -ng … -RunScriptAndExit scripts/qcc_solve.py`` in a new
|
|
4
|
+
batch AEDT (:mod:`.aedt_scripts`; never attaches to an open AEDT); Elmer: KQC ``simulation.bat``/``.sh``; Palace:
|
|
5
|
+
``run_palace.sh`` — then collects results into ``results/results.json``. On a timeout only the process tree the
|
|
6
|
+
runner started is killed.
|
|
7
|
+
|
|
8
|
+
Queue (``qcc runner serve QUEUE``): ``QUEUE/pending/<job>`` → ``running/`` → ``done/`` | ``failed/``. Submitting
|
|
9
|
+
copies the job directory into ``pending/``. SLURM can replace :func:`run_job` later without changing the layout.
|
|
10
|
+
|
|
11
|
+
Ansys (verified with AEDT 2024 R1 on Windows, 2026-11-03): ``ansysedt -ng
|
|
12
|
+
-features=SF6694_NON_GRAPHICAL_COMMAND_EXECUTION -RunScriptAndExit scripts/qcc_solve.py -ScriptArgs <sim>.json`` with
|
|
13
|
+
``ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE=1`` (the way pyaedt launches non-graphical AEDT).
|
|
14
|
+
TODO(verify on the Linux server): the same under AEDT 2024 R2.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import json
|
|
20
|
+
import os
|
|
21
|
+
import shutil
|
|
22
|
+
import subprocess
|
|
23
|
+
import time
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
|
|
26
|
+
from quantcore_circuits.sim_tools.export import read_job, update_job
|
|
27
|
+
|
|
28
|
+
QUEUE_DIRS = ("pending", "running", "done", "failed")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def launcher_command(job_dir: Path) -> list[str]:
|
|
32
|
+
job = read_job(job_dir)
|
|
33
|
+
if job["solver"] == "palace":
|
|
34
|
+
return ["bash", "run_palace.sh"]
|
|
35
|
+
if job["solver"] != "ansys":
|
|
36
|
+
return ["cmd", "/c", "simulation.bat"] if os.name == "nt" else ["bash", "simulation.sh"]
|
|
37
|
+
from quantcore_circuits.sim_tools.aedt_scripts import SOLVE_SCRIPT, write_scripts # pylint: disable=C0415
|
|
38
|
+
from quantcore_circuits.sim_tools.ansys import find_ansys_executable # pylint: disable=import-outside-toplevel
|
|
39
|
+
|
|
40
|
+
if not (Path(job_dir) / "scripts" / SOLVE_SCRIPT).exists():
|
|
41
|
+
write_scripts(job_dir) # a job exported before the qcc AEDT scripts existed
|
|
42
|
+
exe = find_ansys_executable() or Path("ansysedt")
|
|
43
|
+
sim_json = f"{job['simulation_name']}.json"
|
|
44
|
+
return [
|
|
45
|
+
str(exe),
|
|
46
|
+
"-ng",
|
|
47
|
+
"-features=SF6694_NON_GRAPHICAL_COMMAND_EXECUTION",
|
|
48
|
+
"-RunScriptAndExit",
|
|
49
|
+
f"scripts/{SOLVE_SCRIPT}",
|
|
50
|
+
"-ScriptArgs",
|
|
51
|
+
sim_json,
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def run_job(
|
|
56
|
+
job_dir: str | Path,
|
|
57
|
+
timeout: float | None = None,
|
|
58
|
+
dry_run: bool = False,
|
|
59
|
+
aedt: str | None = None,
|
|
60
|
+
progress: float | None = None,
|
|
61
|
+
) -> dict:
|
|
62
|
+
"""Run the job synchronously; returns the updated job.json. Raises nothing for solver failures (see status).
|
|
63
|
+
|
|
64
|
+
Ansys jobs with ``aedt="gui"`` / ``"attach"`` (or ``QCC_AEDT_MODE``) run through
|
|
65
|
+
:func:`quantcore_circuits.sim_tools.hfss.solve_job` (a new AEDT window / the open one); batch Ansys jobs print
|
|
66
|
+
a progress line every ``progress`` s (30; :mod:`.aedt_progress`)."""
|
|
67
|
+
job_dir = Path(job_dir).resolve()
|
|
68
|
+
cmd = launcher_command(job_dir)
|
|
69
|
+
if dry_run:
|
|
70
|
+
return {**read_job(job_dir), "command": cmd}
|
|
71
|
+
ansys = read_job(job_dir)["solver"] == "ansys"
|
|
72
|
+
if ansys:
|
|
73
|
+
from quantcore_circuits.sim_tools.aedt_session import progress_interval, resolve_mode # pylint: disable=C0415
|
|
74
|
+
|
|
75
|
+
if resolve_mode(aedt) != "batch":
|
|
76
|
+
from quantcore_circuits.sim_tools.hfss import solve_job # pylint: disable=import-outside-toplevel
|
|
77
|
+
|
|
78
|
+
solve_job(job_dir, timeout=timeout, aedt=aedt, progress=progress)
|
|
79
|
+
return read_job(job_dir)
|
|
80
|
+
every = progress_interval(progress)
|
|
81
|
+
else:
|
|
82
|
+
every = None
|
|
83
|
+
update_job(job_dir, status="running", started=time.time(), command=cmd)
|
|
84
|
+
log = (job_dir / "run.log").open("w", encoding="utf-8")
|
|
85
|
+
try:
|
|
86
|
+
env = {**os.environ, "ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE": "1"}
|
|
87
|
+
proc = subprocess.Popen( # noqa: S603
|
|
88
|
+
cmd, cwd=job_dir, env=env, stdout=log, stderr=subprocess.STDOUT, start_new_session=os.name != "nt"
|
|
89
|
+
)
|
|
90
|
+
update_job(job_dir, pid=proc.pid)
|
|
91
|
+
try:
|
|
92
|
+
code = _wait(proc, job_dir, timeout, every)
|
|
93
|
+
except subprocess.TimeoutExpired as e:
|
|
94
|
+
from quantcore_circuits.sim_tools.hfss import _kill_tree # pylint: disable=import-outside-toplevel
|
|
95
|
+
|
|
96
|
+
_kill_tree(proc.pid) # only the process tree this runner started
|
|
97
|
+
proc.wait()
|
|
98
|
+
log.write(f"\n[qcc runner] {type(e).__name__}: {e}; killed process tree {proc.pid}\n")
|
|
99
|
+
code = -1
|
|
100
|
+
except OSError as e:
|
|
101
|
+
log.write(f"\n[qcc runner] {type(e).__name__}: {e}\n")
|
|
102
|
+
code = -1
|
|
103
|
+
finally:
|
|
104
|
+
log.close()
|
|
105
|
+
from quantcore_circuits.analysis.results import collect_results # pylint: disable=import-outside-toplevel
|
|
106
|
+
|
|
107
|
+
results = collect_results(job_dir)
|
|
108
|
+
ok = code == 0 and any(k in results for k in ("cmatrix", "eigenmodes", "epr", "sparams"))
|
|
109
|
+
return update_job(job_dir, status="done" if ok else "failed", returncode=code, finished=time.time())
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _wait(proc: subprocess.Popen, job_dir: Path, timeout: float | None, every: float | None) -> int:
|
|
113
|
+
"""``proc.wait(timeout)``, printing an AEDT progress line every ``every`` s (None: just wait)."""
|
|
114
|
+
if not every:
|
|
115
|
+
return proc.wait(timeout=timeout)
|
|
116
|
+
from quantcore_circuits.sim_tools.aedt_progress import echo, format_progress, read_progress # pylint: disable=C0415
|
|
117
|
+
|
|
118
|
+
t0 = time.time()
|
|
119
|
+
while True:
|
|
120
|
+
left = None if timeout is None else timeout - (time.time() - t0)
|
|
121
|
+
if left is not None and left <= 0:
|
|
122
|
+
raise subprocess.TimeoutExpired(proc.args, timeout)
|
|
123
|
+
try:
|
|
124
|
+
code = proc.wait(timeout=every if left is None else min(every, left))
|
|
125
|
+
except subprocess.TimeoutExpired:
|
|
126
|
+
echo(format_progress(read_progress(job_dir), time.time() - t0, f"batch pid {proc.pid}"))
|
|
127
|
+
continue
|
|
128
|
+
echo(format_progress(read_progress(job_dir), time.time() - t0, f"batch pid {proc.pid}"))
|
|
129
|
+
return code
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def submit(job_dir: str | Path, queue: str | Path) -> Path:
|
|
133
|
+
queue = Path(queue)
|
|
134
|
+
for d in QUEUE_DIRS:
|
|
135
|
+
(queue / d).mkdir(parents=True, exist_ok=True)
|
|
136
|
+
target = queue / "pending" / Path(job_dir).name
|
|
137
|
+
if target.exists():
|
|
138
|
+
raise FileExistsError(f"{target} already queued")
|
|
139
|
+
shutil.copytree(job_dir, target)
|
|
140
|
+
update_job(target, status="queued", queued=time.time())
|
|
141
|
+
return target
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def serve(queue: str | Path, poll: float = 5.0, once: bool = False, log=print) -> None:
|
|
145
|
+
"""Process queued jobs one at a time (oldest first)."""
|
|
146
|
+
queue = Path(queue)
|
|
147
|
+
for d in QUEUE_DIRS:
|
|
148
|
+
(queue / d).mkdir(parents=True, exist_ok=True)
|
|
149
|
+
log(f"[qcc runner] serving {queue}")
|
|
150
|
+
while True:
|
|
151
|
+
pending = sorted((queue / "pending").iterdir(), key=lambda p: p.stat().st_mtime)
|
|
152
|
+
if not pending:
|
|
153
|
+
if once:
|
|
154
|
+
return
|
|
155
|
+
time.sleep(poll)
|
|
156
|
+
continue
|
|
157
|
+
job = pending[0]
|
|
158
|
+
running = queue / "running" / job.name
|
|
159
|
+
shutil.move(str(job), str(running))
|
|
160
|
+
log(f"[qcc runner] running {job.name}")
|
|
161
|
+
result = run_job(running)
|
|
162
|
+
final = queue / ("done" if result["status"] == "done" else "failed") / job.name
|
|
163
|
+
shutil.move(str(running), str(final))
|
|
164
|
+
log(f"[qcc runner] {job.name}: {result['status']} -> {final}")
|
|
165
|
+
if once:
|
|
166
|
+
return
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def queue_status(queue: str | Path) -> dict[str, list[str]]:
|
|
170
|
+
queue = Path(queue)
|
|
171
|
+
return {d: sorted(p.name for p in (queue / d).iterdir()) if (queue / d).exists() else [] for d in QUEUE_DIRS}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def job_summary(job_dir: str | Path) -> str:
|
|
175
|
+
job = read_job(job_dir)
|
|
176
|
+
res_path = Path(job_dir) / "results" / "results.json"
|
|
177
|
+
res = json.loads(res_path.read_text(encoding="utf-8")) if res_path.exists() else {}
|
|
178
|
+
have = [k for k in ("cmatrix", "eigenmodes", "epr", "sparams") if k in res]
|
|
179
|
+
return f"{job['simulation_name']}: {job['status']} ({job['analysis']}, results: {', '.join(have) or 'none'})"
|