quantcore_circuits.assembly.builder =================================== .. py:module:: quantcore_circuits.assembly.builder .. autoapi-nested-parse:: Build a design into a KQC chip cell and write it out. Classes ------- .. autoapisummary:: quantcore_circuits.assembly.builder.BuildResult Functions --------- .. autoapisummary:: quantcore_circuits.assembly.builder.build quantcore_circuits.assembly.builder.show quantcore_circuits.assembly.builder.write_layout Module Contents --------------- .. py:class:: BuildResult .. py:method:: require_complete(what: str = 'this') -> None Raise when a route failed (a ``keep_going`` build): ``what`` needs every route. .. py:method:: route_lengths() -> dict[str, float] .. py:attribute:: cell :type: kqcircuits.pya_resolver.pya.Cell .. py:attribute:: design :type: quantcore_circuits.design.Design .. py:property:: failed_routes :type: dict Routes left out of this build (``build(keep_going=True)`` only): ``{name: FailedRoute}``. .. py:property:: hash :type: str .. py:attribute:: layout :type: kqcircuits.pya_resolver.pya.Layout .. py:attribute:: plan :type: quantcore_circuits.assembly.plan.BuildPlan .. py:property:: refpoints :type: dict[str, kqcircuits.pya_resolver.pya.DPoint] Chip-level refpoints, e.g. ``Q1_port_claw_n``, ``FL_port_a`` (instance name prefixes). .. py:attribute:: source :type: pathlib.Path | None :value: None .. py:attribute:: top :type: kqcircuits.pya_resolver.pya.Cell .. py:function:: build(source, layout: kqcircuits.pya_resolver.pya.Layout | None = None, keep_going: bool = False, last_good: dict | None = None, **chip_overrides) -> BuildResult Build ``source`` (path, dict or :class:`Design`) into a ``DesignChip`` cell. ``chip_overrides`` replace chip parameters for this build only (e.g. ``with_grid=False`` for simulation). ``keep_going`` leaves a route that cannot be built out of the layout instead of raising (it is listed in ``result.failed_routes``, with its ``last_good`` geometry when given); the default is strict. .. py:function:: show(source, path: str | pathlib.Path | None = None, **chip_overrides) -> BuildResult Build, write and open in KLayout via klive (the Jupyter equivalent of ``qcc watch``). KLayout is started (with the layout) when klive is not listening and raised to the front, unless ``QCC_KLAYOUT_GUI=0``. .. py:function:: write_layout(result: BuildResult, path: str | pathlib.Path, layers=None, sidecar: bool = True) -> pathlib.Path Write the chip as static geometry (no PCell context), atomically so a live viewer never reads half a file. Also writes ``.qcc.json`` (ports, instances, routes) for the KLayout plugin unless ``sidecar=False``.