quantcore_circuits.layouts.catalog

Catalog of every component usable as a design.json cell: Quantcore cells, KQCircuits elements and Quantum Metal qlibrary components, each with a category.

>>> from quantcore_circuits.layouts.catalog import catalog, find
>>> [c.ref for c in catalog(category="launcher")]           # BondPad, Launcher, LauncherDC, metal:Launchpad...
>>> find("TransmonPocket").ref                               # 'metal:TransmonPocket'
>>> find("Xmon").port_names()                                # ports of a default instance (built lazily)

Listing is cheap: KQC classes are imported (≈1 s), Quantum Metal classes are read from source without importing Metal. Ports are computed on demand (Component.ports_of()), which builds the cell (and imports Metal for metal: entries).

catalog() lists components (cell=True) and, with chips=True, whole KQC chips (category chip; usable as cells for reference, not as components). routes=True adds the Metal routes, which are not cells (cell=False; ROUTE_MAPPING says which qcc route replaces each).

Catalog decisions (2026-11-15; docs/components/DUPLICATES.md): EXCLUDED refs are not listed (they may still resolve by ref); LEGACY cells stay listed and placeable with a legacy reason; ALIASES groups cells of the same kind with the same circuit that are drawn differently (alias_of / aliases, a marker only: nothing is redirected).

Attributes

Classes

Component

One catalog entry. ref is what goes into design.json cell (or Designer.add).

Functions

alias_group(ref) → list[str]

The refs of ref's alias group, canonical first ([] when ref has no aliases).

catalog([category, source, chips, routes, ports]) → list[Component]

Catalog entries (fresh copies), Quantcore first, then KQC, then Metal; each group sorted by category and name.

categories() → dict[str, list[str]]

Category → refs (components and chips).

find(name) → Component | None

The entry for a ref or name: exact ref, then exact name, then case-insensitive (Metal routes included).

listing(entries) → list[str]

The plain qcc components listing of entries: a <category>: header per category, then one

Module Contents

class quantcore_circuits.layouts.catalog.Component

One catalog entry. ref is what goes into design.json cell (or Designer.add).

as_dict() → dict
listing_line() → str

One line of the plain qcc components listing: ref, source, tag, description, note.

port_names() → list[str]

Port names of a default instance (cached on the entry).

ports_of(**params) → dict

Ports (Port objects, local frame) of an instance with params (design.json style).

resolve()

The Element class of this entry.

tag() → str

Marker for listings: (legacy), (alias of <ref>), both, or "".

alias_of: str = ''
aliases: list[str] = []
category: str
cell: bool = True
description: str = ''
legacy: str = ''
module: str
name: str
note: str = ''
ports: list[str] | None = None
ref: str
source: str
quantcore_circuits.layouts.catalog.alias_group(ref: str) → list[str]

The refs of ref’s alias group, canonical first ([] when ref has no aliases).

quantcore_circuits.layouts.catalog.catalog(category: str | None = None, source: str | None = None, chips: bool = True, routes: bool = False, ports: bool = False) → list[Component]

Catalog entries (fresh copies), Quantcore first, then KQC, then Metal; each group sorted by category and name.

category/source filter; chips=False drops whole chips; routes=True adds the Metal routes (not cells); ports=True also builds every entry to fill ports (slow; imports Quantum Metal).

quantcore_circuits.layouts.catalog.categories() → dict[str, list[str]]

Category → refs (components and chips).

quantcore_circuits.layouts.catalog.find(name: str) → Component | None

The entry for a ref or name: exact ref, then exact name, then case-insensitive (Metal routes included).

quantcore_circuits.layouts.catalog.listing(entries: list[Component]) → list[str]

The plain qcc components listing of entries: a <category>: header per category, then one Component.listing_line() per entry (legacy and alias cells tagged).

quantcore_circuits.layouts.catalog.ALIASES: dict[str, dict[str, str]]
quantcore_circuits.layouts.catalog.CATEGORIES = ('qubit', 'junction', 'coupler', 'capacitor', 'resonator', 'launcher', 'termination',...
quantcore_circuits.layouts.catalog.EXCLUDED
quantcore_circuits.layouts.catalog.LEGACY
quantcore_circuits.layouts.catalog.NOTES
quantcore_circuits.layouts.catalog.SOURCES = ('quantcore', 'kqc', 'metal')