quantcore_circuits.layouts.metal.geometry¶
Quantum Metal side of the metal:<Class> wrapper: class lookup, option handling and geometry extraction.
Quantum Metal is imported lazily (the first import takes 5–13 s), so importing this module is cheap and works inside the KLayout GUI, where Metal is usually not installed.
qlibrary_index()lists theqiskit_metal.qlibrarycomponents by reading their source (no import).template_options()/normalise_options()validate user options against the class defaults. Bare numbers on length options (defaults such as'30um') are µm, as everywhere in quantcore_circuits.metal_geometry()instantiates the component once in a shared headlessDesignPlanarat the origin with orientation 0, reads its rows ofdesign.qgeometry.tables(poly,path,junction) and its pins, converts design units (mm) to µm, then deletes the component. Results are cached per (class, options, a, b).
The Element’s a/b drive Metal’s design variables cpw_width/cpw_gap, so Metal pins that default to
cpw_width match the chip’s CPW.
Attributes¶
Classes¶
A Metal component's geometry in µm (polygons as |
|
Functions¶
|
Canonical spelling of a Metal class reference (qlibrary class name, or a dotted path kept as is). |
|
Round the interior corners of a polyline with circular arcs of |
|
Look up a qlibrary class by name: exact, case-insensitive, or by module name ( |
|
A metal cell's |
|
A Metal option default that is a length: |
|
The QComponent class for a qlibrary name or a dotted path (imports Quantum Metal). |
|
Instantiate a Metal component headless and return its geometry in µm (cached; treat the result as |
|
Validate and normalise user options: unknown or placement options raise; bare numbers on length options |
|
A Metal length ( |
|
All public QComponent classes of |
|
|
One headless |
|
|
Default options of a Metal class (fresh copy; nested dicts included, e.g. |
|
Option names a user may set (the defaults minus placement and private |
Module Contents¶
- class quantcore_circuits.layouts.metal.geometry.MetalClassInfo¶
- category: str¶
- description: str¶
- is_route: bool¶
- module: str¶
- name: str¶
- package: str¶
- class quantcore_circuits.layouts.metal.geometry.MetalGeometry¶
A Metal component’s geometry in µm (polygons as
pya.DPolygon, paths already buffered).- junctions: tuple[MetalJunction, ...] = ()¶
- layers: dict¶
- metal: tuple = ()¶
- metal_class: str¶
- options: dict¶
- pins: dict¶
- subtract: tuple = ()¶
- class quantcore_circuits.layouts.metal.geometry.MetalJunction¶
- name: str¶
- points: tuple[tuple[float, float], ...]¶
- width: float¶
- class quantcore_circuits.layouts.metal.geometry.MetalPin¶
- gap: float¶
- middle: tuple[float, float]¶
- name: str¶
- normal: tuple[float, float]¶
- width: float¶
- quantcore_circuits.layouts.metal.geometry.canonical_class_name(metal_class: str) str¶
Canonical spelling of a Metal class reference (qlibrary class name, or a dotted path kept as is).
- quantcore_circuits.layouts.metal.geometry.fillet_polyline(points: list[kqcircuits.pya_resolver.pya.DPoint], radius: float, n: int = 64) list[kqcircuits.pya_resolver.pya.DPoint]¶
Round the interior corners of a polyline with circular arcs of
radius(reduced where segments are too short: each corner may use half of an interior segment, all of an end segment).
- quantcore_circuits.layouts.metal.geometry.find_class_info(name: str) MetalClassInfo | None¶
Look up a qlibrary class by name: exact, case-insensitive, or by module name (
JJ_Manhattan).
- quantcore_circuits.layouts.metal.geometry.flat_options(params: dict | None) dict¶
A metal cell’s
paramswith itsoptions(a dict, or the JSON text of the PCell form, e.g. what the KLayout plugin’s parameter table writes) merged into the flat keys; a flat key wins, as inMetalComponent.qcc_params. The LOM and the design checks read the flat form.
- quantcore_circuits.layouts.metal.geometry.is_length(default) bool¶
A Metal option default that is a length:
'455um'-style, or one ofMETAL_LENGTH_VARIABLES.
- quantcore_circuits.layouts.metal.geometry.metal_class(metal_class_ref: str)¶
The QComponent class for a qlibrary name or a dotted path (imports Quantum Metal).
- quantcore_circuits.layouts.metal.geometry.metal_geometry(metal_class_ref: str, options_json: str = '{}', a: float = 10.0, b: float = 6.0) MetalGeometry¶
Instantiate a Metal component headless and return its geometry in µm (cached; treat the result as read-only).
options_jsonholds normalised options (seenormalise_options()).
- quantcore_circuits.layouts.metal.geometry.normalise_options(metal_class_ref: str, options: dict) dict¶
Validate and normalise user options: unknown or placement options raise; bare numbers on length options become µm strings (
455→'455um'); nested dicts (connection_pads) are normalised against their_default_<name>template.
- quantcore_circuits.layouts.metal.geometry.parse_um(value, a: float = 10.0, b: float = 6.0) float¶
A Metal length (
'455um','0.455mm','cpw_width', or a bare number in mm) in µm.
- quantcore_circuits.layouts.metal.geometry.qlibrary_index() dict[str, MetalClassInfo]¶
All public QComponent classes of
qiskit_metal.qlibrary, read from source (fast, no import).
- quantcore_circuits.layouts.metal.geometry.qlibrary_root() pathlib.Path | None¶
One headless
DesignPlanarreused for every component (components are deleted after reading).
- quantcore_circuits.layouts.metal.geometry.template_options(metal_class_ref: str) dict¶
Default options of a Metal class (fresh copy; nested dicts included, e.g.
_default_connection_pads).
- quantcore_circuits.layouts.metal.geometry.user_options(metal_class_ref: str) list[str]¶
Option names a user may set (the defaults minus placement and private
_default_*templates).
- quantcore_circuits.layouts.metal.geometry.METAL_CATEGORY_OVERRIDES¶
- quantcore_circuits.layouts.metal.geometry.METAL_LENGTH_VARIABLES = ('cpw_width', 'cpw_gap')¶
- quantcore_circuits.layouts.metal.geometry.METAL_PACKAGE_CATEGORY¶
- quantcore_circuits.layouts.metal.geometry.PLACEMENT_OPTIONS = ('pos_x', 'pos_y', 'orientation')¶
- quantcore_circuits.layouts.metal.geometry.ROUTE_MAPPING¶
- quantcore_circuits.layouts.metal.geometry.SPECIAL_LAYERS¶