quantcore_circuits.autotrack

Automatic run tracking: the library’s own calls record into build/<run>/state.json for the dashboard.

Switch it on with one line (from quantcore_circuits import track; track.start("t04")) or QCC_TRACK=1 in the environment (a name instead of 1 names the run). From then on the hooks in the library report to the Session:

library call

what the dashboard gets

write_layout

Layout step, design block, headless KLayout snapshot (shots/chip*.png, background)

assembly.drc.check

DRC counts on the Layout step

circuit.fill.fill

circuit (values, estimate vs FEM) and C-matrix, femCompare table, Extract step

lom.simulate.simulate

Hamiltonian step, targets with values, goal, plots, cards, one history row per design

analysis.extract.*

(old API) targets with values

optimise.optimise

one history row per evaluation, with the knobs

loop.analyse/feedback

as before (explicit Run or the session’s)

FEM jobs under build/jobs

a watcher thread polls job.json / solve.log / *_convergence.txt / results/results.json (and the tutorials’ kept results) once a second

Run naming: track.start("t04") records everything into build/t04 whatever the design is called (the tutorial’s revisions all land in one run); track.start() keeps one run per design name (build/<design>, what loop.analyse and Run(design) use). build/_live.json points at the run that saw the latest event; qcc dashboard follows it.

Nothing here may break a notebook: every handler is wrapped, a failure is logged once in the run’s log.

Attributes

Classes

Functions

quiet(session)

Module Contents

class quantcore_circuits.autotrack.Session(name: str | None = None, root: str | pathlib.Path = 'build', reset: bool = True, snapshots: bool = True, watch: bool = True)
flush(timeout: float = 30.0) → None

Wait until the background jobs (snapshots, cards) queued so far are done (scripts, tests).

handle(event: str, kw: dict, run=None) → None
on_compare(run, targets, extracted, design=None)

The old extract/compare API: values vs targets.

on_drc(run, report, design)
on_fill(run, filled, job=None)
on_layout(run, result, path)
on_lom(run, result, filled)
on_optimise(run, index, knobs, metrics, error, tol, design)
on_optimise_end(run, converged, error=None, evaluations=0, design=None)
on_stage(run, step, phase, label='', detail='')

A library stage (render / export): running → done / failed; nested stages of a step mark the outermost.

on_synthesis(run, targets, result)
run_for(design=None, model_name: str | None = None)

The Run events about design (a Design, or None + model_name) go to; made and reset on first use.

stop()
current = None
lom_designs: dict[str, dict[str, dict]]
lom_hashes: dict[str, list[str]]
lom_last: dict[str, tuple]
lom_rows: dict[str, dict[str, dict]]
name = None
pending: list[tuple[str, dict]] = []
quiet_depth = 0
reset = True
root
runs: dict[str, object]
snapshots = True
quantcore_circuits.autotrack.quiet(session)
quantcore_circuits.autotrack.MAX_SHOTS = 12
quantcore_circuits.autotrack.POINTER = '_live.json'