quantcore_circuits.circuit.fill =============================== .. py:module:: quantcore_circuits.circuit.fill .. autoapi-nested-parse:: Fill a :class:`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, :mod:`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:``). 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 ``chip`` group) 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 ------- .. autoapisummary:: quantcore_circuits.circuit.fill.BranchValue quantcore_circuits.circuit.fill.FilledCircuit quantcore_circuits.circuit.fill.TransmonReadout Functions --------- .. autoapisummary:: quantcore_circuits.circuit.fill.branch_owners quantcore_circuits.circuit.fill.fill quantcore_circuits.circuit.fill.junction_branch quantcore_circuits.circuit.fill.load_results quantcore_circuits.circuit.fill.resonator_lc quantcore_circuits.circuit.fill.two_node_model Module Contents --------------- .. py:class:: BranchValue .. py:attribute:: design :type: float | None :value: None .. py:attribute:: estimate :type: float | None :value: None .. py:attribute:: extra :type: dict .. py:attribute:: extracted :type: float | None :value: None .. py:attribute:: nodes :type: tuple[str, str] .. py:property:: origin :type: str .. py:attribute:: source :type: str :value: '' .. py:attribute:: type :type: str .. py:attribute:: unit :type: str .. py:property:: value :type: float | None Chosen value: FEM if available, else the component estimate. .. py:class:: FilledCircuit .. py:method:: branch_table() -> list[dict] .. py:attribute:: cmatrix :type: dict | None .. py:attribute:: design :type: object .. py:attribute:: job :type: str | None :value: None .. py:attribute:: jobs :type: list[dict] :value: [] .. py:attribute:: model :type: quantcore_circuits.circuit.schema.CircuitModel .. py:attribute:: notes :type: list[str] :value: [] .. py:attribute:: pairs :type: list[TransmonReadout] .. py:attribute:: results :type: dict .. py:attribute:: values :type: dict[str, BranchValue] .. py:class:: TransmonReadout Everything the estimator adapters need for one grounded transmon + λ/4 readout pair. .. py:attribute:: asym :type: float :value: 0.0 .. py:property:: c_coupler_fF :type: float .. py:property:: c_island_fF :type: float .. py:property:: cg_fF :type: float .. py:attribute:: cj_fF :type: float .. py:attribute:: ck_fF :type: float | None :value: None .. py:attribute:: cmatrix_fF :type: numpy.ndarray .. py:property:: ej_sum_ratio :type: 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. .. py:attribute:: f_r_GHz :type: float .. py:attribute:: feedline :type: str | None :value: None .. py:attribute:: flux_phi0 :type: float :value: 0.0 .. py:attribute:: kappa_MHz :type: float | None :value: None .. py:attribute:: kind :type: str :value: 'lambda/4' .. py:attribute:: labels :type: list[str] .. py:attribute:: lj0_nH :type: float | None :value: None .. py:attribute:: lj_nH :type: float .. py:attribute:: qubit :type: str .. py:attribute:: resonator :type: str .. py:attribute:: squid :type: bool :value: False .. py:attribute:: z0_ohm :type: float .. py:function:: 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_`` or the coupling's own name). Unknown names fall back to the components named by the branch's nodes. .. py:function:: 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_results`` is 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-chip ``chip`` group 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=None`` fills a stand-alone ``circuit.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. .. py:function:: junction_branch(kind: str, v: dict) -> tuple[float | None, dict] (L nH, extra) of a ``JJ`` / ``SQUID`` branch value: a SQUID's L at its ``flux_phi0`` and ``asym`` (:func:`~quantcore_circuits.lom.fragment.squid_l_eff`; ``Lj_nH`` is L_J0 and is kept as ``extra["Lj0_nH"]`` when the flux changes it). The estimators, QuCat and the pairs use this L. .. py:function:: 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. .. py:function:: 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). .. py:function:: 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⁻¹)₂₂)).