quchip.inverse_design.subsystems¶
Explicit local approximation for fitted observables.
With evaluator="local", each target uses its device(s) and their directly
coupled neighbors. The approximation omits more distant devices and their
indirect effects. Hilbert-space limits do not select this approximation
automatically.
Functions
|
Build a reduced |
|
Return the seed device(s) and every directly coupled neighbor. |
- quchip.inverse_design.subsystems.build_local_subsystem(chip, labels)[source]¶
Build a reduced
Chipthat holds only the given device labels.A coupling is kept only if both endpoint labels are in
labels. The reduced chip inherits the basis, frame, RWA, and backend settings from the parent. Keeping all devices clones the full model. A port whose targets are all inlabelsis kept with its field subgraph, viarestrict().- Parameters:
- Returns:
Reduced chip that holds only the kept devices, their mutual couplings, and their ports.
- Return type:
- Raises:
ValueError – A label is not a device of
chip.NotImplementedError – The chip has effective terms, or the network cannot be cut at the subsystem without changing its interactions. This happens when a port targets kept and discarded devices, or when a kept port’s field subgraph or boundary scattering reaches a discarded port. Matrix-form boundary scattering raises unless the subsystem keeps all or none of its planes.
- quchip.inverse_design.subsystems.device_labels_for_local_eval(chip, label)[source]¶
Return the seed device(s) and every directly coupled neighbor.
labelcan be a single device/label or a tuple of device/labels. All entries are normalized throughresolve_label(). The returned tuple is sorted for determinism.- Parameters:
chip (Chip)
label (Any) – A single device/label or a tuple of devices/labels.
- Returns:
Sorted device labels: the seed(s) and every directly coupled neighbor.
- Return type:
Examples
A q0 - q1 - q2 chain keeps the seed and its direct neighbors:
>>> from quchip import Chip, DuffingTransmon, Capacitive >>> from quchip.inverse_design.subsystems import device_labels_for_local_eval >>> qs = [DuffingTransmon(freq=5.0 + 0.1 * i, anharmonicity=-0.3, levels=3, ... label=f"q{i}") for i in range(3)] >>> chip = Chip(devices=qs, couplings=[Capacitive(qs[0], qs[1], g=0.005), ... Capacitive(qs[1], qs[2], g=0.005)]) >>> device_labels_for_local_eval(chip, "q0") ('q0', 'q1') >>> device_labels_for_local_eval(chip, ("q0", "q1")) ('q0', 'q1', 'q2')