quantcore_circuits.circuit.fill¶
Fill a CircuitModel with element values (M9): component estimates, FEM results, design values.
Each branch carries three numbers side by side, never overwriting one another:
estimate— from the layout’s LOM (component calibration, CPW formulas, coupled-line κ),extracted— from a simulation (C-matrix nets matched to node islands), when a job is given,design— what the design asked for (LOM synthesis of the targets).
The chosen value is extracted when present, else estimate; estimators always use the chosen value, so the
same analysis runs on a circuit exported from KLayout (estimates only) and on one filled from HFSS/Q3D.
Stack correction: if the job was simulated on another substrate than the design’s PDK (e.g. an old silicon run of a design that moved to sapphire), capacitances are rescaled by (εr,design + 1)/(εr,job + 1) and a note says so. A cut coupler port’s CPW stub is removed from the pad capacitance (it is part of the routed λ/4 length).
Subsets (phase C, quantcore_circuits.sim_tools.subset): a job fills only the branches owned by the components
its sim group selected (a branch’s owner is the instance or route that put it in the netlist; a declared coupling is
owned by both ends and needs both ends chosen, or one end on a feedline). Every other branch keeps its estimate and
its source says it was outside the subset. fill(model, design, [job_a, job_b]) merges several subset jobs into
one whole-chip circuit; each branch’s source names the job it came from (cmatrix:<simulation>). Two more
read-back rules apply to every job:
line nets — a C-matrix net that carries a distributed line (a route the box cuts, labelled with the route’s name, or a route the job keeps whole, e.g. the whole-chip
chipgroup) has the line’s own capacitance in its row sum, which the LOM already models as a transmission line: its branches to ground keep their estimates (a note says so), its mutual capacitances are taken from the FEM. This is the fix for tutorial 02’s whole-chip readouts (f_r −49 %: a λ/2 line’s ≈ 1060 fF landed on a lumped branch).one FEM value, several branches — branches on the same node pair (e.g. a capacitor pad and the qubit’s readout pad on one node, both to ground) share the FEM value in proportion to their estimates, instead of each getting the whole of it.
Classes¶
Everything the estimator adapters need for one grounded transmon + λ/4 readout pair. |
Functions¶
|
Which design components each branch belongs to: the instance whose LOM model made it ( |
|
Values for every branch of |
|
(L nH, extra) of a |
|
(results.json dict, job.json dict or None) from a job directory, results file or dict. |
|
(C fF, L nH) of the parallel LC equivalent of a TL resonator's fundamental at its open end: |
|
Analytic loaded transmon–resonator model from the 2-node capacitance network + λ/4 LC. |
Module Contents¶
- class quantcore_circuits.circuit.fill.BranchValue¶
- design: float | None = None¶
- estimate: float | None = None¶
- extra: dict¶
- extracted: float | None = None¶
- nodes: tuple[str, str]¶
- property origin: str¶
- source: str = ''¶
- type: str¶
- unit: str¶
- property value: float | None¶
Chosen value: FEM if available, else the component estimate.
- class quantcore_circuits.circuit.fill.FilledCircuit¶
- branch_table() list[dict]¶
- cmatrix: dict | None¶
- design: object¶
- job: str | None = None¶
- jobs: list[dict] = []¶
- notes: list[str] = []¶
- pairs: list[TransmonReadout]¶
- results: dict¶
- values: dict[str, BranchValue]¶
- class quantcore_circuits.circuit.fill.TransmonReadout¶
Everything the estimator adapters need for one grounded transmon + λ/4 readout pair.
- asym: float = 0.0¶
- property c_coupler_fF: float¶
- property c_island_fF: float¶
- property cg_fF: float¶
- cj_fF: float¶
- ck_fF: float | None = None¶
- cmatrix_fF: numpy.ndarray¶
- property ej_sum_ratio: float¶
E_J(Φ = 0) / E_J at the bias, = L(Φ) / L_J0 (1 without a flux bias): scales an E_J to the SQUID’s sum.
- f_r_GHz: float¶
- feedline: str | None = None¶
- flux_phi0: float = 0.0¶
- kappa_MHz: float | None = None¶
- kind: str = 'lambda/4'¶
- labels: list[str]¶
- lj0_nH: float | None = None¶
- lj_nH: float¶
- qubit: str¶
- resonator: str¶
- squid: bool = False¶
- z0_ohm: float¶
- quantcore_circuits.circuit.fill.branch_owners(model: quantcore_circuits.circuit.schema.CircuitModel, design) dict[str, set[str]]¶
Which design components each branch belongs to: the instance whose LOM model made it (
C_Q1,Cg_Q2_bus,C_C_Q0_a→C_Q0,Port_P_Q0→P_Q0), the route for a resonator (R1) or its hanger (K_R1), both ends for a declared coupling (C_<coupling>or the coupling’s own name). Unknown names fall back to the components named by the branch’s nodes.
- quantcore_circuits.circuit.fill.fill(model: quantcore_circuits.circuit.schema.CircuitModel, design_source, job_or_results=None, synthesis: dict | None = None, stack_correction: str = 'auto', scope='auto', plan=None) FilledCircuit¶
Values for every branch of
model(see module docstring);job_or_resultsis optional, or a list of jobs (subset jobs: each fills its own components, merged into one circuit).scope:"auto"(default) — a job fills only the branches owned by its sim group’s selection (all of them for the whole-chipchipgroup or a bare results dict);None— every branch whose nodes have FEM nets (the behaviour before subsets); or a set of component names.design_source=Nonefills a stand-alonecircuit.json(e.g. exported from KLayout) from its own stored estimates: resonators use their stored f/Z0, no design values.plan: the design’s build plan when the caller has it already (plan_for_lom), so it is not planned again.
- quantcore_circuits.circuit.fill.junction_branch(kind: str, v: dict) tuple[float | None, dict]¶
(L nH, extra) of a
JJ/SQUIDbranch value: a SQUID’s L at itsflux_phi0andasym(squid_l_eff();Lj_nHis L_J0 and is kept asextra["Lj0_nH"]when the flux changes it). The estimators, QuCat and the pairs use this L.
- quantcore_circuits.circuit.fill.load_results(job_or_results) tuple[dict, dict | None]¶
(results.json dict, job.json dict or None) from a job directory, results file or dict.
- quantcore_circuits.circuit.fill.resonator_lc(f_GHz: float, z0_ohm: float, kind: str = 'lambda/4') tuple[float, float]¶
(C fF, L nH) of the parallel LC equivalent of a TL resonator’s fundamental at its open end: C = π/(4 ω Z0) for λ/4, π/(2 ω Z0) for λ/2, L = 1/(ω² C).
- quantcore_circuits.circuit.fill.two_node_model(p: TransmonReadout) dict¶
Analytic loaded transmon–resonator model from the 2-node capacitance network + λ/4 LC.
Island (1) and coupler/resonator node (2): C = [[C1 + Cg, −Cg], [−Cg, C2 + Cg]] with C1 = island→ground (+Cj), C2 = coupler→ground + C_r. Then EC = e²(C⁻¹)₁₁/2h, f_r = 1/(2π√(L_r/(C⁻¹)₂₂)), and the exchange coupling g = 2e(C⁻¹)₁₂ Q_zpf ⟨1|n|0⟩/h with Q_zpf = √(ħω_r/(2(C⁻¹)₂₂)).