quantcore_circuits.assembly.builder

Build a design into a KQC chip cell and write it out.

Classes

Functions

build(source[, layout, keep_going, last_good]) → BuildResult

Build source (path, dict or Design) into a DesignChip cell.

show(source[, path]) → BuildResult

Build, write and open in KLayout via klive (the Jupyter equivalent of qcc watch). KLayout is started

write_layout(result, path[, layers, sidecar]) → pathlib.Path

Write the chip as static geometry (no PCell context), atomically so a live viewer never reads half a file.

Module Contents

class quantcore_circuits.assembly.builder.BuildResult
require_complete(what: str = 'this') → None

Raise when a route failed (a keep_going build): what needs every route.

route_lengths() → dict[str, float]
cell: kqcircuits.pya_resolver.pya.Cell
design: quantcore_circuits.design.Design
property failed_routes: dict

Routes left out of this build (build(keep_going=True) only): {name: FailedRoute}.

property hash: str
layout: kqcircuits.pya_resolver.pya.Layout
plan: quantcore_circuits.assembly.plan.BuildPlan
property refpoints: dict[str, kqcircuits.pya_resolver.pya.DPoint]

Chip-level refpoints, e.g. Q1_port_claw_n, FL_port_a (instance name prefixes).

source: pathlib.Path | None = None
top: kqcircuits.pya_resolver.pya.Cell
quantcore_circuits.assembly.builder.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 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.

quantcore_circuits.assembly.builder.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.

quantcore_circuits.assembly.builder.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 <name>.qcc.json (ports, instances, routes) for the KLayout plugin unless sidecar=False.