quantcore_circuits.circuit.schema ================================= .. py:module:: quantcore_circuits.circuit.schema .. autoapi-nested-parse:: ``circuit.json`` (schema version qcd/0.1 or later): the lumped model bound to a layout. Nodes are conductors: ``ground`` or an island that matches FEM nets (``layout.island`` = the C-matrix label, e.g. ``"Q1.island"``, plus ``aliases`` when several layout nets are one conductor). Branches connect two nodes; their ``value`` holds an explicit number, a component ``estimate`` and/or where it is filled from (``"fem": "cmatrix"``, ``"source": "design"``). ``HANGER`` is a coupled-line section between a λ/4 resonator and a feedline (κ). A branch may carry a ``knob`` linking it to a design.json parameter the optimiser may change. ``controls`` lists control lines (flux bias). Validation: a ground exists, branches reference known nodes, no node floats (every node is connected to ground through branches), and each island maps to exactly one node. Attributes ---------- .. autoapisummary:: quantcore_circuits.circuit.schema.BranchType quantcore_circuits.circuit.schema.CIRCUIT_SCHEMA Classes ------- .. autoapisummary:: quantcore_circuits.circuit.schema.BranchSpec quantcore_circuits.circuit.schema.CircuitModel quantcore_circuits.circuit.schema.NodeSpec quantcore_circuits.circuit.schema.TargetSpec Functions --------- .. autoapisummary:: quantcore_circuits.circuit.schema.load_circuit quantcore_circuits.circuit.schema.save_circuit Module Contents --------------- .. py:class:: BranchSpec Bases: :py:obj:`_M` .. py:attribute:: knob :type: dict[str, Any] | None :value: None .. py:attribute:: nodes :type: tuple[str, str] .. py:attribute:: type :type: BranchType .. py:attribute:: value :type: dict[str, Any] .. py:class:: CircuitModel Bases: :py:obj:`_M` .. py:method:: islands() -> dict[str, str] FEM net label → node (aliases included). .. py:method:: to_json_dict() -> dict .. py:method:: to_networkx() .. py:method:: unmapped_nets(labels: list[str]) -> list[str] C-matrix nets with no node (the circuit ignores them; they are usually stubs or cut-off routes). .. py:attribute:: branches :type: dict[str, BranchSpec] .. py:attribute:: controls :type: dict[str, dict[str, Any]] .. py:attribute:: design :type: str | None :value: None .. py:attribute:: estimators :type: list[str] .. py:property:: ground :type: str .. py:attribute:: group :type: str | None :value: None .. py:attribute:: knobs :type: dict[str, tuple[float, float]] .. py:attribute:: name :type: str :value: 'circuit' .. py:attribute:: nodes :type: dict[str, NodeSpec] .. py:attribute:: schema_ :type: str .. py:attribute:: targets :type: dict[str, TargetSpec] .. py:attribute:: truncation :type: dict[str, int] .. py:class:: NodeSpec Bases: :py:obj:`_M` .. py:attribute:: ground :type: bool :value: False .. py:property:: island :type: str | None .. py:attribute:: layout :type: dict[str, Any] .. py:property:: nets :type: list[str] All FEM net labels of this conductor (main island + aliases). .. py:class:: TargetSpec Bases: :py:obj:`_M` .. py:attribute:: max :type: float | None :value: None .. py:attribute:: min :type: float | None :value: None .. py:attribute:: tol :type: float | None :value: None .. py:attribute:: value :type: float | None :value: None .. py:function:: load_circuit(source) -> CircuitModel .. py:function:: save_circuit(model: CircuitModel, path) -> pathlib.Path .. py:data:: BranchType .. py:data:: CIRCUIT_SCHEMA :value: 'qcc-circuit/0.1'