qcc_kplugin.flow¶
Simulate, Results and Fab: the last three steps of the Quantcore Flow strip (G4 – G6).
ACTIONS fills the menu’s Simulate / Results / Fab submenus; simulate / results / fab are what the
panel’s Flow buttons call.
Simulate (automatic): the components selected in KLayout are the subset (nothing selected: asks for the default subset or the whole chip).
qcc sim autoruns in the background — subset, export, solve in a new non-graphical AEDT (never the one you have open), analyse — and the status bar shows its progress. KLayout stays usable; when it ends the layout is rebuilt so the Results tab shows the values.Simulate (manual): the Simulate dialog’s Export the job only button (
export_job) writes the job folder with a README (what to run, what to bring back); Import results… (a menu item) reads a solved job folder or a results.json back (format:qcc results template --format).Results shows the latest values against the targets; Propose next revision previews old → new knob values (
loop.feedback; 21 qubit classes with λ/4 or λ/2 readouts, through the generic surrogate incodesign.py; what it cannot tune is listed as Not tuned), and Apply writes them to design.json through the session (undo works) and rebuilds.Fab writes the fab mask (
qcc mask), the netlist (circuit.json),design.py(the drawn chip as a Designer script) and a PNG into one folder.
Everything slow runs as a qcc subprocess through qcc_kplugin.jobs (never in KLayout’s UI thread, never a
modal dialog from a timer). The functions take wait=True for tests, which blocks until the job ended.
Attributes¶
Classes¶
A |
|
A non-modal window with a title, text and a Close button (results of background jobs: never modal from a timer). |
|
Latest values against the targets (the sidecar's |
|
|
Functions¶
|
AEDT fails on Windows when its |
|
Write a proposal's knobs to design.json through the session (one undo step) and rebuild. |
|
|
|
|
|
A small modal question: one button per choice and Cancel. Returns |
|
The Simulate dialog's Export the job only button: write the job folder (geometry, AEDT scripts, job.json, |
|
Flow ▸ Fab: the fab mask ( |
|
Flow ▸ Simulate ▸ Import results…: a solved job folder or a results.json → analysed against the design; the |
|
Read-only text in a non-modal window, with optional extra buttons |
|
|
|
Flow ▸ Simulate ▸ Open results file…: pick a results file (e.g. the |
|
Simulate ▸ Open simulation layout…: export the job geometry of the selection, the default subset or a saved sim |
|
Flow ▸ Results ▸ Propose next revision…: |
|
Flow ▸ Results: the latest values against the targets in a window (and the panel's Results tab). |
|
|
|
A |
|
Quantcore ▸ Design ▸ Save as Python script…: |
|
Instances and routes selected with KLayout's own select tool (their |
|
Open the GDS of the exported job folder in a new layout tab (not the design's view): layers get readable names |
|
A readable name for a KQC simulation layer ( |
|
|
|
The Simulate dialog's pre-check, for Open simulation layout: an eigenmode / driven layout puts a lumped L‖C |
|
|
|
|
|
Flow ▸ Simulate: the Simulate dialog ( |
|
What to simulate and how → |
Module Contents¶
- class qcc_kplugin.flow.FlowJob(steps, label, done, cwd=None, status_file=None)¶
Bases:
qcc_kplugin.jobs.JobA
jobs.Jobthat shows its own progress (a status file theqcccommand writes plus the AEDT progress line in its output) and can be stopped (only the process tree it started).- cancel() None¶
Stop the job: the
qccprocess and the AEDT it started (taskkill /T), nothing else.
- poll() None¶
- progress_line() str¶
- status() dict¶
- cancelled = False¶
- last_step = ''¶
- status_file¶
- class qcc_kplugin.flow.ProposalWindow(proposal: dict, path: pathlib.Path)¶
Bases:
_WindowA non-modal window with a title, text and a Close button (results of background jobs: never modal from a timer).
- apply()¶
- table¶
- class qcc_kplugin.flow.ResultsDialog¶
Bases:
_WindowLatest values against the targets (the sidecar’s
results: the same rows as the panel’s Results tab), plus the tune buttons. Refreshes itself when the layout is rebuilt.- refresh() None¶
- header¶
- tree¶
- class qcc_kplugin.flow.SimJob(steps, label, done, cwd=None, status_file=None, record=None)¶
Bases:
FlowJobqcc sim auto, started detached so it outlives KLayout (seesimrun). Its output goes to<design>.flow/sim_run.logand the run recordsim_run.jsonkeeps its pid and outcome. Withrecord(a run from an earlier KLayout session) nothing is started: the job watches that run’s pid and ends when it does.- flow_dir¶
- record = None¶
- qcc_kplugin.flow.aedt_path_too_long(job_dir) bool¶
AEDT fails on Windows when its
*.aedtresultsfolders pass 260 characters; the job folder name is repeated in them (the same rule asquantcore_circuits.guiflow.aedt_path_too_long).
- qcc_kplugin.flow.apply_proposal(proposal: dict, path: pathlib.Path, wait: bool = False)¶
Write a proposal’s knobs to design.json through the session (one undo step) and rebuild.
- qcc_kplugin.flow.ask_dir(title: str, start: str) str | None¶
- qcc_kplugin.flow.ask_file(title: str, start: str, pattern: str = 'JSON (*.json)') str | None¶
- qcc_kplugin.flow.choose(title: str, text: str, choices: list[str], checkbox: str | None = None)¶
A small modal question: one button per choice and Cancel. Returns
(index, checked)or None. (An auto-accepted dialog returns the first choice, which is how the GUI smoke test drives it.)
- qcc_kplugin.flow.export_job(wait: bool = False, names=None, subset: str | None = None, folder: str | None = None, analysis: str | None = None, settings: dict | None = None)¶
The Simulate dialog’s Export the job only button: write the job folder (geometry, AEDT scripts, job.json, README.md with what to run and what to bring back, results_template.json) for the selected components, to solve by hand or elsewhere.
- qcc_kplugin.flow.fab(wait: bool = False, folder: str | None = None, force: bool = False)¶
Flow ▸ Fab: the fab mask (
qcc mask, PDK fab layers, cheese and corner rounding), the netlist (circuit.json),design.pyand a PNG, all into one folder.
- qcc_kplugin.flow.import_results(wait: bool = False, source: str | None = None)¶
Flow ▸ Simulate ▸ Import results…: a solved job folder or a results.json → analysed against the design; the Results tab and dialog show the outcome.
- qcc_kplugin.flow.info_window(title: str, text: str, buttons: dict | None = None) _Window¶
Read-only text in a non-modal window, with optional extra buttons
{key: (label, function)}.
- qcc_kplugin.flow.open_folder(path) None¶
- qcc_kplugin.flow.open_results_file(wait: bool = False, source: str | None = None)¶
Flow ▸ Simulate ▸ Open results file…: pick a results file (e.g. the
<name>_<group>_results.jsona run saved inbuild/<name>, or one solved by hand) and analyse it against the design, without the job-folder question.
- qcc_kplugin.flow.open_sim_layout(wait: bool = False, names=None, subset: str | None = None, analysis: str | None = None, group: str | None = None)¶
Simulate ▸ Open simulation layout…: export the job geometry of the selection, the default subset or a saved sim group (the same path as Export the job only, no AEDT) to a temporary folder and open the GDS that AEDT imports in a new layout tab, with readable layer names: the cut-out metal and gaps, the junction sheets and the port polygons. The design and its build are never touched. An eigenmode / driven layout with a qubit that has no L_J is not exported: a window names the qubit and offers the Q3D layout instead (
sim_layout_missing_lj()).
- qcc_kplugin.flow.propose(wait: bool = False)¶
Flow ▸ Results ▸ Propose next revision…:
loop.feedbackin the background, then a preview of old → new knob values with Apply (writes them to design.json; Quantcore > Edit > Undo takes them back).
- qcc_kplugin.flow.results(wait: bool = False, quiet: bool = False)¶
Flow ▸ Results: the latest values against the targets in a window (and the panel’s Results tab).
quiet(called when a background job ends, i.e. from a timer): a failure goes to the status bar and the log, no dialog.
- qcc_kplugin.flow.results_dir() pathlib.Path¶
<design folder>/build/<name>: whereqcc sim autosaves<name>_<group>_results.json(simsetup.run_dir;build/<name>is also where convergence.json and the run state live).
- qcc_kplugin.flow.resume_runs(force: bool = False)¶
A
qcc sim autorun of this design started in an earlier KLayout session: one that ended meanwhile is imported (its results are in the run state: the layout is rebuilt and the Results tab filled); one still going is watched and imported when it ends. Returns the watching job, or None. Called when a design is opened.
- qcc_kplugin.flow.save_python(wait: bool = False, path: str | None = None)¶
Quantcore ▸ Design ▸ Save as Python script…:
qcc design to-python(the drawn chip as a Designer script, to continue it as code; the fab export puts the same script beside the mask).
- qcc_kplugin.flow.selected_names() list[str]¶
Instances and routes selected with KLayout’s own select tool (their
idproperty is the design name).
- qcc_kplugin.flow.show_sim_gds(job_dir) str | None¶
Open the GDS of the exported job folder in a new layout tab (not the design’s view): layers get readable names and colours; the port polygons of
<sim>.jsonare added as two extra layers in memory (the file is not changed). Returns the tab’s title, or None when the folder holds no GDS.
- qcc_kplugin.flow.sim_layer_name(name: str) str¶
A readable name for a KQC simulation layer (
1t1_gap,1t1_signal_2,1t1_ground).
- qcc_kplugin.flow.sim_layout_args(design, target, subset: str, names, analysis: str, group: str | None = None) list¶
qcc sim subsetarguments of the simulation layout: the job export with nothing written to the design (and no AEDT): the selection, the default subset or a saved sim group, totarget.
- qcc_kplugin.flow.sim_layout_missing_lj(subset: str, names, analysis: str, group: str | None, design_data: dict) str¶
The Simulate dialog’s pre-check, for Open simulation layout: an eigenmode / driven layout puts a lumped L‖C sheet on each junction, so a qubit without an L_J would fail the export. The warning that names them and says where to set the value, or “” (all set, or a capacitance analysis, which needs none).
- qcc_kplugin.flow.sim_settings_saved() dict¶
- qcc_kplugin.flow.simlayout_root() pathlib.Path¶
- qcc_kplugin.flow.simulate(wait: bool = False, names=None, subset: str | None = None, window: bool | None = None, analysis: str | None = None, settings: dict | None = None)¶
Flow ▸ Simulate: the Simulate dialog (
simulate_dialog(): what is rendered, Q3D or eigenmode, the solver settings, the last run’s convergence), thenqcc sim autoin the background (or the job export). A run in progress is offered to stop instead.subset(“selection” | “default” | “whole”) withnames/window/analysis/settingsskips the dialog (tests; no settings: the fast ones).
- qcc_kplugin.flow.simulate_dialog(names: list[str])¶
What to simulate and how →
{"scope": selection\|default\|whole, "analysis", "settings", "window", "action": run\|export\|layout}or None (cancelled). The analysis (Q3D capacitance or HFSS eigenmode; driven runs are for scripts) is preset from the selection (simsetup.recommend()). The solver settings (passes, convergence, modes, mesh seeds) are filled with the fast values and can be changed; the last values are kept. The last run’s convergence (convergence.json) is shown.
- qcc_kplugin.flow.ACTIONS¶
- qcc_kplugin.flow.AEDT_PATH_LIMIT = 250¶
- qcc_kplugin.flow.CFG_AEDT_WINDOW = 'qcc-kplugin-aedt-window'¶
- qcc_kplugin.flow.CFG_SIM = 'qcc-kplugin-sim-settings'¶
- qcc_kplugin.flow.DEFAULT_LAYOUT_CHOICES¶
- qcc_kplugin.flow.DIALOGS: list = []¶
- qcc_kplugin.flow.PORT_LAYERS¶
- qcc_kplugin.flow.SIMLAYOUT_PREFIX = 'qcc_simlayout'¶