quantcore_circuits.assembly.plan ================================ .. py:module:: quantcore_circuits.assembly.plan .. autoapi-nested-parse:: Design → build plan: resolve classes, parameters, snaps and routes outside of any PCell. The plan is plain JSON-able data that :class:`~quantcore_circuits.layouts.chips.design_chip.DesignChip` replays. Every element cell is first built in a scratch layout with *exactly* the parameters the chip will use, so port positions measured here are the ports of the final layout. Exceptions ---------- .. autoapisummary:: quantcore_circuits.assembly.plan.PlacementError Classes ------- .. autoapisummary:: quantcore_circuits.assembly.plan.BuildPlan quantcore_circuits.assembly.plan.FailedRoute quantcore_circuits.assembly.plan.PlacedInstance Functions --------- .. autoapisummary:: quantcore_circuits.assembly.plan.plan_design quantcore_circuits.assembly.plan.snap_trans Module Contents --------------- .. py:exception:: PlacementError Bases: :py:obj:`ValueError` Inappropriate argument value (of correct type). .. py:class:: BuildPlan .. py:method:: all_ports() -> dict[str, quantcore_circuits.layouts.ports.Port] .. py:method:: port(ref: str) -> quantcore_circuits.layouts.ports.Port .. py:method:: to_json() -> str Serialise what ``DesignChip.build`` needs. .. py:attribute:: cheese :type: dict | None :value: None .. py:attribute:: chip_params :type: dict .. py:attribute:: chip_ports :type: dict[str, quantcore_circuits.layouts.ports.Port] .. py:attribute:: design :type: quantcore_circuits.design.schema.Design .. py:attribute:: device_id :type: str :value: '' .. py:attribute:: failed :type: dict[str, FailedRoute] .. py:attribute:: frame :type: dict | None :value: None .. py:attribute:: instances :type: dict[str, PlacedInstance] .. py:attribute:: keep_going :type: bool :value: False .. py:attribute:: launchers :type: str | dict | None .. py:attribute:: metal :type: list :value: [] .. py:attribute:: pad_edge :type: float | None :value: None .. py:attribute:: routes :type: dict[str, quantcore_circuits.route.router.RoutePlan] .. py:attribute:: warnings :type: list :value: [] .. py:class:: FailedRoute A route that could not be built (``plan_design(keep_going=True)``): why, the path the design asks for, and the route's last successful geometry (``last_good``: ``polyline``, ``length``, ... from an earlier build) if any. .. py:attribute:: attempt :type: list :value: [] .. py:attribute:: error :type: str .. py:attribute:: last_good :type: dict | None :value: None .. py:attribute:: name :type: str .. py:class:: PlacedInstance .. py:attribute:: cell :type: str .. py:attribute:: local_ports :type: dict[str, quantcore_circuits.layouts.ports.Port] .. py:attribute:: name :type: str .. py:attribute:: params :type: dict .. py:property:: ports :type: dict[str, quantcore_circuits.layouts.ports.Port] .. py:attribute:: trans :type: kqcircuits.pya_resolver.pya.DCplxTrans .. py:function:: plan_design(design: quantcore_circuits.design.schema.Design, scratch: kqcircuits.pya_resolver.pya.Layout | None = None, keep_going: bool = False, last_good: dict | None = None) -> BuildPlan Resolve a design into a :class:`BuildPlan`. Raises on any placement or routing problem. ``keep_going`` (the plugin's builds): a route that cannot be built does not stop the rest. It is left out of ``plan.routes`` and listed in ``plan.failed`` with the reason, the path the design asks for and, from ``last_good`` (``{route: stored geometry}``, see :mod:`quantcore_circuits.assembly.last_good`), the route's last good geometry. A route hanging on a failed route fails with its own reason. Placement problems still raise. .. py:function:: snap_trans(own: quantcore_circuits.layouts.ports.Port, target: quantcore_circuits.layouts.ports.Port, mirror: bool = False, gap: float = 0.0) -> kqcircuits.pya_resolver.pya.DCplxTrans Transform that puts ``own`` (local) onto ``target`` (absolute), facing each other.