quantcore_circuits.live.snapshot¶
KLayout screenshots of a layout, rendered by KLayout itself.
snapshot uses a headless klayout.lay.LayoutView with KQC’s default_layer_props.lyp (same colours and
stipples as the GUI), so it works in Jupyter, CI and on the server. gui_snapshot asks the running KLayout GUI
(quantcore-circuits KLayout plugin, command server on port 8083) to save its current view instead, falling back to
snapshot when the GUI is not reachable.
Attributes¶
Functions¶
|
|
|
Screenshot from the running KLayout GUI (quantcore-circuits KLayout plugin, port 8083) → |
|
Quantcore layer properties: KQC's |
|
Render |
Module Contents¶
- quantcore_circuits.live.snapshot.gui_available(port: int = GUI_PORT, timeout: float = 0.3) bool¶
- quantcore_circuits.live.snapshot.gui_snapshot(png: str | pathlib.Path, size: tuple[int, int] = (1600, 1600), layout: str | pathlib.Path | None = None, box: tuple[float, float, float, float] | None = None, port: int = GUI_PORT, timeout: float = 20.0, fallback=None) tuple[pathlib.Path, str]¶
Screenshot from the running KLayout GUI (quantcore-circuits KLayout plugin, port 8083) →
(png, "gui").layoutmakes the GUI open/reload that file first;box(µm) zooms. If the GUI is not reachable andfallback(a layout path or BuildResult; defaults tolayout) exists, it is rendered headless instead →(png, "headless").
- quantcore_circuits.live.snapshot.layer_props_path() str | None¶
Quantcore layer properties: KQC’s
default_layer_props.lypwith the ground grid (cheese) visible and every face shown like face1t1.KQC ships
'1t1 ground grid' 132/1hidden, which hid the PDK cheese band in every snapshot and KLayout view. KQC’s2t1group also shows itswaveguide path(centre lines) andbase metal gap for EBLand hides itsbase metal gap, unlike the other faces: here each face layer gets the visibility of the1t1layer of the same name, so a two-face picture has no centre lines over it. The variant is written next to the temp dir and refreshed when KQC’s file or this module changes; load it in KLayout (File → Load Layer Properties) to see the cheese there too.
- quantcore_circuits.live.snapshot.snapshot(source, png: str | pathlib.Path, size: tuple[int, int] = (1600, 1600), box: tuple[float, float, float, float] | None = None, background: str = '#ffffff', oversampling: int = 2, hide: tuple[str, ...] = HIDE) pathlib.Path¶
Render
source(an.oas/.gdspath or aBuildResult) topng.box(µm, x0 y0 x1 y1) zooms to a region; default is the whole top cell. Layers whose names contain one ofhideare switched off (helper layers that clutter a picture).
- quantcore_circuits.live.snapshot.ANNOTATION_LAYERS = ('instance names', 'refpoints', 'annotations', 'texts')¶
- quantcore_circuits.live.snapshot.GUI_PORT = 8083¶
- quantcore_circuits.live.snapshot.HIDE = ('refpoints', 'ground grid avoidance', 'waveguide path', 'waveguide length', 'annotations', 'ports')¶
- quantcore_circuits.live.snapshot.OUTLINE = ('chip boundary',)¶