qcc_kplugin.simsetup

What Simulate runs: the analysis for a selection, and the last run’s convergence.

Plain Python (no pya), unit-tested outside KLayout; the dialog is in flow.py. KLayout is the quick-prototyping route: Q3D capacitance and HFSS eigenmode only (driven / full-wave S-parameter runs are for scripts). The dialog’s solver settings start at the library’s fast values (FAST) and can be changed; or change the setup in AEDT, solve there and read the result back with Import results (the job folder, after scripts/qcc_collect.py in AEDT).

  • Analysis (recommend()): a selection with a resonator, a feedline or a pad is an HFSS eigenmode run of exactly what is selected (qcc sim … -a hfss_eigenmode: the library adds the routes joining the parts and a line’s end pads; junctions are lumped L‖C ports, lines leaving the box end in 50 Ω) → f, Q, κ, χ. Qubits alone (or with couplers / capacitors) are a Q3D capacitance run: islands and couplers as nets, the resonators cut to a short stub port → the C matrix the LOM uses. The user can pick the other one.

  • Convergence (last_feedback()): after a solve, and after Import results, the library writes build/<name>/convergence.json (passes, last Δ, target, converged); the dialog shows it.

Attributes

Functions

cli_args(analysis, settings) → list[str]

qcc sim auto / subset arguments: every value explicit on top of the analysis defaults (--full), so what

last_feedback(design_path, name, analysis) → dict | None

The last solve's / import's convergence for analysis (convergence.json), or None.

missing_junctions(names, data, categories, design) → list[str]

Selected qubits without an L_J for the eigenmode / driven lumped port. The rule is the library's: the build

missing_text(names, data[, extra]) → str

The Simulate dialog's warning for names without an L_J (extra: the library's own messages by name,

parse_settings(analysis, texts) → dict

The dialog's fields → numbers (mesh seeds may be empty = none); raises ValueError naming the field.

recommend(names, data, categories) → tuple[str, str]

(analysis, why) for the selected names (instances and routes; data = the sidecar, categories =

run_dir(design_path, name) → pathlib.Path

<design folder>/build/<name> (guiflow.run_dir).

settings_for(analysis[, saved]) → dict

The values the dialog shows: the fast defaults, with the user's last values for analysis on top.

Module Contents

qcc_kplugin.simsetup.cli_args(analysis: str, settings: dict) → list[str]

qcc sim auto / subset arguments: every value explicit on top of the analysis defaults (--full), so what the dialog shows is what runs.

qcc_kplugin.simsetup.last_feedback(design_path, name: str, analysis: str) → dict | None

The last solve’s / import’s convergence for analysis (convergence.json), or None.

qcc_kplugin.simsetup.missing_junctions(names, data: dict, categories: dict, design: dict) → list[str]

Selected qubits without an L_J for the eigenmode / driven lumped port. The rule is the library’s: the build sidecar’s instances.<name>.junction (Lj_eff_nH None, or an error at Φ = ½ with d = 0) says it, which counts a drawn trilayer junction’s PDK value. A sidecar without that entry (an older build) falls back to the design’s own junction.Lj_nH.

qcc_kplugin.simsetup.missing_text(names, data: dict, extra: dict | None = None) → str

The Simulate dialog’s warning for names without an L_J (extra: the library’s own messages by name, e.g. qcc design junctions): which, why, and where to set the value. “” for none.

qcc_kplugin.simsetup.parse_settings(analysis: str, texts: dict) → dict

The dialog’s fields → numbers (mesh seeds may be empty = none); raises ValueError naming the field.

qcc_kplugin.simsetup.recommend(names, data: dict, categories: dict) → tuple[str, str]

(analysis, why) for the selected names (instances and routes; data = the sidecar, categories = component ref → class).

qcc_kplugin.simsetup.run_dir(design_path, name: str) → pathlib.Path

<design folder>/build/<name> (guiflow.run_dir).

qcc_kplugin.simsetup.settings_for(analysis: str, saved: dict | None = None) → dict

The values the dialog shows: the fast defaults, with the user’s last values for analysis on top.

qcc_kplugin.simsetup.ANALYSES
qcc_kplugin.simsetup.CAPACITANCE_ANALYSES
qcc_kplugin.simsetup.FAST
qcc_kplugin.simsetup.LABELS
qcc_kplugin.simsetup.WIDE_CATEGORIES = ('resonator', 'launcher', 'waveguide', 'termination')