quantcore_circuits.lom.fragment =============================== .. py:module:: quantcore_circuits.lom.fragment .. autoapi-nested-parse:: LOM fragments: the lumped model of one layout component, and how its layout ports attach to it. A component's LOM model is a :class:`Fragment` built from the instance (cell parameters, junction values, PDK): * ``nodes`` — local node name → ``{"island": FEM net label}`` (e.g. ``"island"`` → ``"Q1.island"``). Local names ``island`` / ``island1`` / ``island2`` are qubit islands (a floating transmon has two), ``pad`` a 50 Ω port conductor; anything else is a coupler / line conductor, * ``elements`` — lumped branches between local nodes or ``"gnd"`` with an *estimated* value (see :mod:`.estimates` and :mod:`.calibration`), and the ``fem`` source that can replace the estimate (``"cmatrix"``), * ``port_nodes`` — layout port → local node; ``"gnd"`` for galvanically grounded ports; ``"control:"`` for ports that carry a control line (flux bias, drive) rather than a circuit connection, * ``lines`` — distributed CPW sections inside the component (a resonator, a meander, a plain waveguide). The builder decides what a line is once it knows what its ends connect to (wire, λ/4 or λ/2 resonator), and it adds the length of routes that continue the line (see :class:`Line`). * ``hangers`` — coupled-line sections of a line to a conductor *outside* the component that no port carries (a legacy resonator whose coupler runs next to a separate feedline cell). A design coupling without a value between the instance (or its line node) and that conductor (``d.couple("K_R1", "R1", "FL")``) becomes the ``HANGER`` element; each entry is ``{"line": , "coupling_length_um", "ground_gap_um", "end": "short"|"open"}`` (the line end the section is at), optionally ``"source"``. * ``straps`` — local nodes that are ground straps when no port on them is joined (route, wire coupling or snap): an airbridge over a waveguide lands on the ground plane on both sides, so its ports map to ``gnd`` (no element). Cells declare their model with a ``qcc_lom(name, instance, pdk) -> Fragment`` classmethod, or are registered with :func:`register_lom` (KQC cells: :mod:`.kqc_models`; Quantum Metal wrapper cells ``"metal:"``: :mod:`.metal_models`; ported legacy cells: :mod:`.quantcore_models`). Cells without a model get one bare node per port (and a note). Attributes ---------- .. autoapisummary:: quantcore_circuits.lom.fragment.LomFn quantcore_circuits.lom.fragment.METAL_PREFIX quantcore_circuits.lom.fragment.QUBIT_NODES Classes ------- .. autoapisummary:: quantcore_circuits.lom.fragment.EffectiveJunction quantcore_circuits.lom.fragment.Element quantcore_circuits.lom.fragment.Fragment quantcore_circuits.lom.fragment.Line Functions --------- .. autoapisummary:: quantcore_circuits.lom.fragment.cell_params quantcore_circuits.lom.fragment.drawn_junction quantcore_circuits.lom.fragment.effective_junction quantcore_circuits.lom.fragment.generic_fragment quantcore_circuits.lom.fragment.instance_junction quantcore_circuits.lom.fragment.junction_element quantcore_circuits.lom.fragment.junction_from_element quantcore_circuits.lom.fragment.junction_kind quantcore_circuits.lom.fragment.junction_value quantcore_circuits.lom.fragment.junction_values quantcore_circuits.lom.fragment.lom_model quantcore_circuits.lom.fragment.metal_class quantcore_circuits.lom.fragment.missing_junction_message quantcore_circuits.lom.fragment.port_resistor quantcore_circuits.lom.fragment.register_lom quantcore_circuits.lom.fragment.registered quantcore_circuits.lom.fragment.squid_l_eff Module Contents --------------- .. py:class:: EffectiveJunction A component's junction as the LOM and every simulation take it (lumped, fixed at design time). ``lj0_nH``: L_J at zero flux (a SQUID: both junctions in parallel); ``lj_eff_nH``: at ``flux_phi0`` with asymmetry ``asym`` (a single JJ: ``lj0_nH``); None when nothing gives a value. ``kind``: ``"JJ"``, ``"SQUID"`` or None (no junction). ``source``: ``"design"``, ``"drawn (PDK junction rule)"``, a model's own fallback (e.g. a Metal option), or None. .. py:method:: as_dict() -> dict Plain JSON (the build sidecar's ``instances..junction``). .. py:method:: describe() -> str ``junction L 6.734 nH, C 15 fF (drawn Quantcore Squid, PDK junction rule; Φ = 0, d = 0)``. .. py:attribute:: asym :type: float :value: 0.0 .. py:attribute:: cj_fF :type: float :value: 0.0 .. py:attribute:: flux_phi0 :type: float :value: 0.0 .. py:attribute:: kind :type: str | None :value: 'JJ' .. py:attribute:: lj0_nH :type: float | None .. py:property:: lj_eff_nH :type: float | None .. py:attribute:: source :type: str | None :value: None .. py:class:: Element .. py:attribute:: knob :type: dict | None :value: None .. py:attribute:: name :type: str .. py:attribute:: nodes :type: tuple[str, str] .. py:attribute:: note :type: str :value: '' .. py:attribute:: type :type: str .. py:attribute:: value :type: dict .. py:class:: Fragment .. py:attribute:: elements :type: list[Element] :value: [] .. py:attribute:: hangers :type: list[dict] :value: [] .. py:attribute:: knobs :type: dict[str, tuple[float, float]] .. py:attribute:: lines :type: list[Line] :value: [] .. py:attribute:: nodes :type: dict[str, dict] .. py:attribute:: notes :type: list[str] :value: [] .. py:attribute:: port_nodes :type: dict[str, str] .. py:attribute:: straps :type: list[str] :value: [] .. py:class:: Line A CPW section inside a component, on local node ``node`` (one conductor: both ends are that node). ``ports`` are the layout ports at its two ends (``None`` for an end inside the component, e.g. the coupling capacitor of a KQC ``QuarterWaveCpwResonator``). ``term`` is what each end is when nothing connects to it: ``"short"`` (KQC waveguides with ``term = 0`` end in the ground plane), ``"open"`` (a termination gap or a coupling capacitor). ``resonator=True`` makes it a resonator whatever its ends connect to (a meander between two couplers is a λ/2 bus); otherwise a line between two connected conductors is a wire and only a line with a free end is a (stub) resonator. ``couplings`` are coupled-line sections to other local nodes (a hanger: ``{"node": "pl", "coupling_length_um": 500, "ground_gap_um": 10}``). Lines joined end to end (a route between two line ports, a wire coupling or snap between them, a termination on a line end) are one line for the builder. ``through=True`` marks a pass-through section (a taper, an airbridge crossing): it only extends whatever line it joins, which is named after its main line or route, not after it (``length_um`` 0: the builder takes the distance between its two ports). .. py:attribute:: a_um :type: float .. py:attribute:: b_um :type: float .. py:attribute:: couplings :type: list[dict] :value: [] .. py:attribute:: knob :type: str | None :value: None .. py:attribute:: length_um :type: float .. py:attribute:: name :type: str .. py:attribute:: node :type: str .. py:attribute:: ports :type: tuple[str | None, str | None] .. py:attribute:: resonator :type: bool :value: False .. py:attribute:: term :type: tuple[str, str] :value: ('short', 'short') .. py:attribute:: through :type: bool :value: False .. py:function:: cell_params(inst) -> dict Cell parameter defaults merged with the instance's parameters (KQC / Quantcore cells), with the junction the build draws: an unset KQC default ``junction_type`` (``"Manhattan"``, ...) is the PDK trilayer junction (``assembly.plan.pdk_junction_type``), so the LOM and the simulations take the drawn junction's PDK value. .. py:function:: drawn_junction(params: dict, process=None) -> tuple[float, float, str] | None (L_J nH, C_J fF, source) of the trilayer junction a qubit draws — its ``junction_type`` is a trilayer cell (``"Quantcore Junction"``, ``"Trilayer Squid"``, ...), sized by ``junction_params`` (Xmon, ``metal:``) or KQC ``junction_width`` — on the PDK junction rule (``process``: a junction process; None the default); None for other junction types. .. py:function:: effective_junction(inst, params: dict | None = None, pdk=None, kind: str | None = None) -> EffectiveJunction The junction values of an instance: the design's ``junction`` (L_J0, C_J, Φ, d; first entry of a list), else the drawn trilayer junction on the PDK junction rule (:func:`drawn_junction` of ``params``), else no L. ``params``: the cell parameters the drawn junction is read from (``junction_type``, ``junction_params``, ``junction_width``); None: the cell defaults merged with the instance's. ``kind``: ``"JJ"`` / ``"SQUID"`` / None as the model knows it; None derives it from ``junction_type``. ``pdk``: a junction process for the drawn values (None: the default Quantcore process, which the layout cells draw with). Φ and d are design values whatever gives L_J (they are simulation values, not fab values). .. py:function:: generic_fragment(name: str, inst, ports: list[str]) -> Fragment No LOM model: every layout port becomes its own bare node (connectivity is kept, values are not). .. py:function:: instance_junction(name: str, inst, pdk=None) -> EffectiveJunction | None The junction of a placed component as its LOM model gives it (its ``JJ`` / ``SQUID`` element: the export uses the same L_J0, C_J, Φ, d as the LOM). None: the component has no junction (its model has no such element, or a cell without a model is a Metal wrapper or has no ``junction_type``); another cell without a model and with a ``junction_type`` gets :func:`effective_junction`. .. py:function:: junction_element(name: str, a: str, b: str, inst, kind: str = 'JJ', note: str = '', drawn_params: dict | None = None) -> Element The ``J_`` element of a qubit between nodes a and b (:func:`effective_junction`: the design's ``junction``, else the drawn trilayer junction of ``drawn_params`` — None: the cell's merged parameters). .. py:function:: junction_from_element(el: Element) -> EffectiveJunction The :class:`EffectiveJunction` of a model's ``JJ`` / ``SQUID`` element (``Lj_nH`` is L_J0; an amplifier that applies its own static bias keeps L_J0 in ``Lj0_nH`` and the bias in ``bias_phi0``). .. py:function:: junction_kind(junction_type: str) -> str | None ``"SQUID"``, ``"JJ"`` or None (no junction) from a KQC/Quantcore ``junction_type`` name. .. py:function:: junction_value(ej: EffectiveJunction) -> dict A ``JJ`` / ``SQUID`` element value: ``Lj_nH`` (L_J0), ``Cj_fF``, ``source`` and, for a SQUID, ``asym`` and ``flux_phi0`` (the LOM applies them when it fills the circuit: :func:`squid_l_eff`). .. py:function:: junction_values(inst) -> tuple[float | None, float] (Lj nH or None, Cj fF) of an instance (first entry when the design gives a list per junction). .. py:function:: lom_model(cell_ref: str) -> LomFn | None The LOM model of a cell reference, or None (static cells, unknown cells, cells without a model). .. py:function:: metal_class(cell_ref: str) -> str | None Metal class name of a wrapper cell reference (``"metal:TransmonPocket"`` → ``"TransmonPocket"``). .. py:function:: missing_junction_message(name: str, inst, ej: EffectiveJunction | None = None) -> str Why ``name`` has no junction L_J and where to set it (KLayout component dialog or design.json). .. py:function:: port_resistor(name: str, node: str = 'pad', r_ohm: float = 50.0, note: str = '') -> Element .. py:function:: register_lom(cell_name: str) Decorator: ``@register_lom("Swissmon") def swissmon_lom(name, inst, pdk) -> Fragment``. KQC/Quantcore cells are registered by class name (subclasses inherit the model); Quantum Metal wrapper cells by ``"metal:"``. .. py:function:: registered() -> dict[str, LomFn] All registered LOM models (cell / ``metal:`` class name → model function). .. py:function:: squid_l_eff(lj0_nH: float, flux_phi0: float = 0.0, asym: float = 0.0) -> float L of a DC SQUID (no loop inductance) at flux Φ/Φ0 with asymmetry d: L_J0 / (\|cos πΦ\| √(1 + d² tan² πΦ)) = L_J0 / √(cos² πΦ + d² sin² πΦ). Raises at Φ = ½ with d = 0 (no finite L). .. py:data:: LomFn .. py:data:: METAL_PREFIX :value: 'metal:' .. py:data:: QUBIT_NODES :value: ('island', 'island1', 'island2')