quchip.inverse_design.observables¶
Target-spec construction for fit_a_dress.
The fit takes two independent target channels from the user
(coupling_targets, observable_targets) and merges them with
each device’s current freq/anharmonicity — which act as
default anchors — into a single flat tuple of TargetSpec
records. Explicit observable targets always override same-(kind,
label) device defaults; couplings contribute a target only when
listed in coupling_targets.
Functions
|
Merge device defaults, coupling targets, and explicit observables. |
|
Infer whether a coupling's strength is targeted as |
Classes
|
A single optimization target. |
- class quchip.inverse_design.observables.TargetSpec(kind, label, target)[source]¶
Bases:
objectA single optimization target.
- label¶
Device label,
(label_a, label_b)tuple, or coupling label that locates this target on the chip.- Type:
Any
- quchip.inverse_design.observables.infer_coupling_mode(coupling, override=None)[source]¶
Infer whether a coupling’s strength is targeted as
"g","chi", or"zz".When both devices are computational, the user almost always cares about the static
zz; a qubit-resonator pair is instead best anchored by the dispersivechi; everything else is fit through the bare coupling strength. An explicitoverrideshort circuits the heuristic — including to"chi"on a pair that would not otherwise infer it;build_target_specs()validates that a"chi"target always has exactly one computational endpoint, whichever path selected it.
- quchip.inverse_design.observables.build_target_specs(chip, coupling_targets, observable_targets=None)[source]¶
Merge device defaults, coupling targets, and explicit observables.
The returned ordering is:
For every device, the dressed 0→1 transition frequency (
chip.freq(device)) is anchored. Computational devices also anchor on the dressed anharmonicity (chip.dressed_anharmonicity(device)). Anchoring the dressed observable rather than the bare device attribute makes the defaults model-agnostic — Duffing, charge-basis transmon, and fluxonium all expose a dressed 0→1 spacing, even when the bare parametrization is wholly different (nofreqoranharmonicityattribute).One coupling target per entry in
coupling_targets, with mode resolved viainfer_coupling_mode()(override if a string mode is supplied, heuristic otherwise).Every explicit entry from
observable_targets.
An explicit
(kind, label)inobservable_targetssuppresses the same-(kind, label)default from steps 1 and 2, so the user never ends up with duplicate anchors for the same quantity.- Returns:
Merged specs in the order documented above.
- Return type:
tuple[TargetSpec, …]
- Raises:
ValueError – A coupling target mode is not one of
"chi","zz","g"; or any"chi"target in the merged result — from an auto device-implied default, acoupling_targetsentry, or an explicitobservable_targetsentry — does not resolve to a coupling with exactly one computational endpoint (see_validate_chi_target()).- Parameters: