quantcore_circuits.assembly.plan

Design → build plan: resolve classes, parameters, snaps and routes outside of any PCell.

The plan is plain JSON-able data that 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

PlacementError

Inappropriate argument value (of correct type).

Classes

BuildPlan

FailedRoute

A route that could not be built (plan_design(keep_going=True)): why, the path the design asks for, and the

PlacedInstance

Functions

plan_design(design[, scratch, keep_going, last_good]) → BuildPlan

Resolve a design into a BuildPlan. Raises on any placement or routing problem.

snap_trans(own, target[, mirror, gap]) → kqcircuits.pya_resolver.pya.DCplxTrans

Transform that puts own (local) onto target (absolute), facing each other.

Module Contents

exception quantcore_circuits.assembly.plan.PlacementError

Bases: ValueError

Inappropriate argument value (of correct type).

class quantcore_circuits.assembly.plan.BuildPlan
all_ports() → dict[str, quantcore_circuits.layouts.ports.Port]
port(ref: str) → quantcore_circuits.layouts.ports.Port
to_json() → str

Serialise what DesignChip.build needs.

cheese: dict | None = None
chip_params: dict
chip_ports: dict[str, quantcore_circuits.layouts.ports.Port]
design: quantcore_circuits.design.schema.Design
device_id: str = ''
failed: dict[str, FailedRoute]
frame: dict | None = None
instances: dict[str, PlacedInstance]
keep_going: bool = False
launchers: str | dict | None
metal: list = []
pad_edge: float | None = None
routes: dict[str, quantcore_circuits.route.router.RoutePlan]
warnings: list = []
class quantcore_circuits.assembly.plan.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.

attempt: list = []
error: str
last_good: dict | None = None
name: str
class quantcore_circuits.assembly.plan.PlacedInstance
cell: str
local_ports: dict[str, quantcore_circuits.layouts.ports.Port]
name: str
params: dict
property ports: dict[str, quantcore_circuits.layouts.ports.Port]
trans: kqcircuits.pya_resolver.pya.DCplxTrans
quantcore_circuits.assembly.plan.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 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 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.

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