quantcore_circuits.design.schema ================================ .. py:module:: quantcore_circuits.design.schema .. autoapi-nested-parse:: Pydantic schema for ``design.json`` (schema ``qcc/0.1``). The design file is the single source of truth: geometry is always regenerated from it. Units are µm and degrees. The structure follows gdsfactory's ``Netlist``/``Instance``/``Placement`` ideas, but cells are KQC Elements and connections are KQC refpoint ports (``port_`` + ``port__corner``). Port references are strings ``"."``. The reserved instance name ``chip`` refers to chip-level ports (e.g. launchers: ``"chip.WN"``). Attributes ---------- .. autoapisummary:: quantcore_circuits.design.schema.CHIP quantcore_circuits.design.schema.RouteEndSpec quantcore_circuits.design.schema.SCHEMA_VERSION Classes ------- .. autoapisummary:: quantcore_circuits.design.schema.Chip quantcore_circuits.design.schema.Coupling quantcore_circuits.design.schema.Design quantcore_circuits.design.schema.FreeEnd quantcore_circuits.design.schema.HangerEnd quantcore_circuits.design.schema.Instance quantcore_circuits.design.schema.Junction quantcore_circuits.design.schema.Launchers quantcore_circuits.design.schema.Place quantcore_circuits.design.schema.PortSpec quantcore_circuits.design.schema.Route quantcore_circuits.design.schema.SimGroup quantcore_circuits.design.schema.Waypoint Functions --------- .. autoapisummary:: quantcore_circuits.design.schema.split_port_ref Module Contents --------------- .. py:class:: Chip Bases: :py:obj:`_Model` Chip-level settings, passed to the KQC ``Chip`` base class (``box``, ``with_grid``, ``name_chip``, ...). .. py:attribute:: box :type: tuple[float, float, float, float] :value: (0.0, 0.0, 10000.0, 10000.0) .. py:attribute:: cell :type: str :value: 'quantcore_circuits.assembly.DesignChip' .. py:attribute:: launchers :type: str | Launchers | None :value: None .. py:attribute:: params :type: dict[str, Any] .. py:class:: Coupling Bases: :py:obj:`_Model` A lumped element the layout implies but no route or snap carries, e.g. two qubit arms facing each other. ``between`` holds two ends, each ``""`` (its main island), ``"."``, ``"."`` or ``""`` (the route's conductor, e.g. a hanger declared against a routed feedline). The LOM builder adds the element between those nodes; ``fem: True`` lets a C-matrix replace the value by island name. ``type: "wire"`` is a galvanic join with no element and no geometry: both ends must be ports (``"."``), their LOM nodes merge into one conductor, and the netlist check counts the pair as a declared connection. It is for cells whose metal overlaps instead of meeting port to port (legacy chips keep their absolute positions, e.g. a resonator end drawn inside an Xmon claw tail). .. py:attribute:: between :type: tuple[str, str] .. py:attribute:: fem :type: bool :value: True .. py:attribute:: note :type: str :value: '' .. py:attribute:: type :type: Literal['C', 'L', 'wire'] :value: 'C' .. py:attribute:: value :type: float | None :value: None .. py:class:: Design Bases: :py:obj:`_Model` .. py:method:: to_json_dict() -> dict[str, Any] .. py:attribute:: chip :type: Chip .. py:attribute:: couplings :type: dict[str, Coupling] .. py:attribute:: instances :type: dict[str, Instance] .. py:attribute:: name :type: str :value: 'design' .. py:attribute:: nets :type: Literal['derived'] | list[list[str]] :value: 'derived' .. py:attribute:: pdk :type: str :value: 'quantcore_nb_sapphire_v1' .. py:attribute:: routes :type: dict[str, Route] .. py:attribute:: schema_ :type: str .. py:attribute:: sim_groups :type: dict[str, SimGroup] .. py:attribute:: targets :type: dict[str, dict[str, float]] .. py:class:: FreeEnd Bases: :py:obj:`_Model` A route end that is not a port: a point, a direction (deg) and a termination gap. ``dir`` follows the port convention: it points from this end *towards the route* (for a resonator that ends heading down, ``dir`` is 90). ``term`` is the KQC termination length: 0 shorts the centre conductor to ground (λ/4 short end), a positive value leaves an open end with that gap. .. py:attribute:: at :type: tuple[float, float] .. py:attribute:: dir :type: float | None :value: None .. py:attribute:: term :type: float :value: 0.0 .. py:class:: HangerEnd Bases: :py:obj:`_Model` End a route in a coupler running parallel to another route (e.g. a λ/4 resonator hanging off a feedline). The coupler is centred at arclength ``s`` (µm, measured along the target route's node polyline), on the ``side`` (relative to the target route's direction of travel), separated from it by a ``ground_gap`` metal strip between the two CPW gaps. The route approaches the coupler perpendicularly at one end and terminates at the other: ``direction="forward"`` terminates downstream (in the target route's travel direction). ``end="short"`` grounds the termination (λ/4 short end), ``end="open"`` leaves an ``open_gap`` gap. ``bend=True`` (default) brings the route into the coupler with a 90° bend (perpendicular to the target route); ``bend=False`` enters it straight, along the coupler axis (the route must then arrive in line with the coupler). Instead of ``s``, ``near=(x, y)`` (µm, chip coordinates) centres the coupler at the point of the target route nearest to that point, so it stays put when the target route's start moves (e.g. a pad moved to the die edge). ``coupler_gap`` / ``line_gap`` (µm, None = the CPW's own gap ``b``) narrow the two gaps that face each other along the coupler: this route's gap on the line's side and the line's gap on this route's side. The centre lines come closer by what they save (stronger coupling at the same ``ground_gap`` strip); the outer gaps keep ``b``. The build draws the extra ground as ``base_metal_addition`` over the coupler length. .. py:attribute:: bend :type: bool :value: True .. py:attribute:: coupler_gap :type: float | None :value: None .. py:attribute:: direction :type: Literal['forward', 'backward'] :value: 'forward' .. py:attribute:: end :type: Literal['short', 'open'] :value: 'short' .. py:attribute:: ground_gap :type: float :value: 6.0 .. py:attribute:: hanger :type: str .. py:attribute:: length :type: float .. py:attribute:: line_gap :type: float | None :value: None .. py:attribute:: near :type: tuple[float, float] | None :value: None .. py:attribute:: open_gap :type: float :value: 6.0 .. py:attribute:: s :type: float | None :value: None .. py:attribute:: side :type: Literal['left', 'right'] :value: 'left' .. py:class:: Instance Bases: :py:obj:`_Model` A placed component. ``cell`` is a dotted class path (``"quantcore_circuits.layouts.Xmon"``, ``"kqcircuits.qubits.swissmon.Swissmon"``), a short name known to :mod:`quantcore_circuits.layouts` (``"Xmon"``), or ``"static:"`` for freeform cells with ``ports``. .. py:attribute:: cell :type: str .. py:attribute:: junction :type: Junction | None :value: None .. py:attribute:: params :type: dict[str, Any] .. py:attribute:: place :type: Place .. py:attribute:: ports :type: list[PortSpec] | None :value: None .. py:class:: Junction Bases: :py:obj:`_Model` Lumped junction values for the LOM and the simulations (not geometry or fab), fixed per component. ``Lj_nH`` is L_J at zero flux (a SQUID: both junctions in parallel), ``Cj_fF`` its capacitance. A SQUID also has ``flux_phi0`` (static flux Φ/Φ0) and ``asym`` (d = (I_c1 − I_c2)/(I_c1 + I_c2)); the defaults (0, 0) are a symmetric SQUID at its sweet spot. Each field also takes a list, one value per junction (the first one is used). Without ``Lj_nH`` the drawn trilayer junction's PDK value is used (``lom.fragment.effective_junction``). .. py:attribute:: Cj_fF :type: float | list[float] :value: 0.0 .. py:attribute:: Lj_nH :type: float | list[float] | None :value: None .. py:attribute:: asym :type: float | list[float] :value: 0.0 .. py:attribute:: flux_phi0 :type: float | list[float] :value: 0.0 .. py:class:: Launchers Bases: :py:obj:`_Model` KQC sample-holder launchers with names: ``assign`` maps pad numbers to port names (KQC ``launcher_assignments``); only assigned pads are drawn unless ``enabled`` lists names to keep. ``type`` is a KQC sample holder ("ARD24", "SMA8", "DC24"). Any of ``n`` (pads in total, or ``[top, right, bottom, left]`` per side), ``launcher_type`` ("RF"/"DC"), ``width``, ``gap``, ``indent``, ``pitch`` and ``frame_gap`` (µm) override that preset, or, with ``type="custom"``, define the launchers outright (KQC ``produce_n_launchers``); then the chip keeps its own box. .. py:attribute:: assign :type: dict[int, str] .. py:attribute:: enabled :type: list[str] | None :value: None .. py:attribute:: frame_gap :type: float | None :value: None .. py:attribute:: gap :type: float | None :value: None .. py:attribute:: indent :type: float | None :value: None .. py:attribute:: launcher_type :type: Literal['RF', 'DC'] | None :value: None .. py:attribute:: n :type: int | list[int] | None :value: None .. py:attribute:: pitch :type: float | None :value: None .. py:attribute:: type :type: str :value: 'custom' .. py:attribute:: width :type: float | None :value: None .. py:class:: Place Bases: :py:obj:`_Model` Placement of an instance: absolute (``at``/``rot``) or port-to-port snap (``snap``/``to``). For a snap, the instance is rotated so that its ``snap`` port faces the ``to`` port (outward directions anti-parallel) and translated so that both ports coincide; ``gap`` then pushes it out along the target port direction. ``rot`` is ignored for snaps; ``mirror`` is applied before solving the rotation. ``edge`` (``"n"``/``"s"``/``"e"``/``"w"``, or ``"auto"`` = the die edge nearest ``at``; absolute placements only) slides the instance perpendicular to that die edge so the outer edge of its etch sits the PDK's ``frame.pad_edge`` (100 µm) from it — the Quantcore pad rule; ``at`` keeps the position along the edge. .. py:attribute:: at :type: tuple[float, float] | None :value: None .. py:attribute:: edge :type: Literal['n', 's', 'e', 'w', 'auto'] | None :value: None .. py:attribute:: gap :type: float :value: 0.0 .. py:property:: is_snap :type: bool .. py:attribute:: mirror :type: bool :value: False .. py:attribute:: rot :type: float :value: 0.0 .. py:attribute:: snap :type: str | None :value: None .. py:attribute:: to :type: str | None :value: None .. py:class:: PortSpec Bases: :py:obj:`_Model` Explicit port of a static (freeform) cell. Direction is the outward direction in degrees. .. py:attribute:: a :type: float | None :value: None .. py:attribute:: at :type: tuple[float, float] .. py:attribute:: b :type: float | None :value: None .. py:attribute:: dir :type: float .. py:attribute:: name :type: str .. py:class:: Route Bases: :py:obj:`_Model` A CPW connection between two ports, built with KQC ``WaveguideComposite``. ``type="meander"`` makes a fixed-``length`` route; the meander is inserted on ``meander_segment`` (default: the longest straight segment that is not part of a port stub or hanger coupler) using KQC ``Node(length_increment=...)``. .. py:method:: waypoints() -> list[Waypoint] .. py:attribute:: a :type: float | None :value: None .. py:attribute:: airbridges :type: Literal['auto', 'none'] | int :value: 'none' .. py:attribute:: b :type: float | None :value: None .. py:attribute:: from_ :type: str | FreeEnd .. py:attribute:: length :type: float | None :value: None .. py:attribute:: meander_direction :type: Literal[1, -1] :value: 1 .. py:attribute:: meander_segment :type: int | None :value: None .. py:attribute:: meanders :type: int :value: -1 .. py:attribute:: nodes :type: list[tuple[float, float] | Waypoint] .. py:attribute:: params :type: dict[str, Any] .. py:attribute:: r :type: float | None :value: None .. py:attribute:: to :type: RouteEndSpec .. py:attribute:: type :type: Literal['cpw', 'meander'] :value: 'cpw' .. py:class:: SimGroup Bases: :py:obj:`_Model` A simulation sub-problem: the selected instances (plus routes between them) cut out with a margin. .. py:attribute:: analyses :type: list[str] .. py:attribute:: margin_um :type: float :value: 300.0 .. py:attribute:: ports :type: dict[str, Literal['edge', 'internal', 'keep', 'cut']] .. py:attribute:: select :type: list[str] .. py:attribute:: settings :type: dict[str, Any] .. py:class:: Waypoint Bases: :py:obj:`_Model` A route waypoint with optional KQC ``Node`` extras (airbridge, taper, ...). ``r`` is the bend radius of the corner *at this waypoint only* (µm); the route's ``r`` applies to every other corner. ``None`` (default) uses the route radius. .. py:attribute:: a :type: float | None :value: None .. py:attribute:: airbridge :type: bool :value: False .. py:attribute:: at :type: tuple[float, float] .. py:attribute:: b :type: float | None :value: None .. py:attribute:: params :type: dict[str, Any] .. py:attribute:: r :type: float | None :value: None .. py:function:: split_port_ref(ref: str) -> tuple[str, str] Split ``"Q1.claw_n"`` into ``("Q1", "claw_n")``. .. py:data:: CHIP :value: 'chip' .. py:data:: RouteEndSpec .. py:data:: SCHEMA_VERSION :value: 'qcc/0.1'