quchip.inverse_design.types¶
Classes
|
Result of a |
|
Starting point, bounds, result, and provenance for one bare parameter. |
|
Per-target record from a |
- class quchip.inverse_design.types.ObservableReport(kind, label, target, initial, final, evaluator, source='legacy')[source]¶
Bases:
objectPer-target record from a
fit_a_dressrun.- Parameters:
- kind¶
Canonical desired-chip kind (
"freq","anharmonicity","cross_kerr","exchange_rate", or"coupling_strength"), or its deprecated compatibility counterpart.- Type:
- label¶
Target locator — a device label for single-device observables, a
(label_a, label_b)tuple for pair observables, or a coupling label for coupling-keyed observables.- Type:
Any
- evaluator¶
"full"if this target was evaluated on the whole chip or"local"if it was evaluated on a one-hop subsystem (seemax_hilbert_diminfit_a_dress()).- Type:
- source¶
"component default"or"explicit"for the desired-chip contract;"legacy"for the deprecated compatibility path.- Type:
- class quchip.inverse_design.types.FitParameterReport(name, initial, final, lower_bound, upper_bound, seed_source, sign_choice=None)[source]¶
Bases:
objectStarting point, bounds, result, and provenance for one bare parameter.
- Parameters:
- class quchip.inverse_design.types.FitADressResult(chip, loss, history, initial_targets, final_targets, initial_params, final_params, solver_info, parameter_reports=())[source]¶
Bases:
objectResult of a
fit_a_dress()optimization run.- Parameters:
- chip¶
Fitted chip: a clone of the desired specification (or compatibility seed) with updated device and coupling parameters. The input chip is never mutated. Exposing
.chipmakes this satisfyChipTransformstructurally, with no inheritance required.- Type:
- history¶
One-dimensional
numpyarray containing the normalized objective at every distinct parameter vector passed to the residual function. The first entry is the seed and the last isloss. With a numerical Jacobian, the intermediate entries include finite-difference probes as well as accepted solver iterates; usenumpy.minimum.accumulate(history)for a monotone best-so-far convergence curve.- Type:
Any
- initial_targets¶
One
ObservableReportper target, evaluated on the optimizer’s initial candidate.- Type:
- final_targets¶
One
ObservableReportper target, evaluated on the fitted chip.- Type:
- initial_params¶
{parameter_name: seed_value}— the starting point passed to the optimizer.
- final_params¶
{parameter_name: fitted_value}— the optimizer output. Parameter names follow"<device>.freq","<device>.anharmonicity", and"<coupling>.<coupling_strength_name>"—"<coupling>.g"forCapacitive,"<coupling>.g_0"forTunableCapacitive,"<coupling>.chi"forCrossKerr.
- parameter_reports¶
One
FitParameterReportper varied bare parameter, including its bounds, starting-point source, and any coupling-sign choice.- Type:
- solver_info¶
scipysolver metadata (method,status,message,nfev,jacobian), plus the identifiability receipt recorded for everyfit_a_dress()call:n_free_parameters(length offinal_params),n_target_residuals(length offinal_targets), andunderdetermined_by_count(Truewhen the former exceeds the latter — a necessary, not sufficient, identifiability condition), final scaled-Jacobian rank, condition number, singular values, and any weak parameter directions. Rank uses normalized residuals in the solver’s scaled parameter coordinates.history_axisnames the sampling axis used byhistory, andn_recorded_evaluationsgives its length.jacobianis"jax"when a JAX-native backend supplies the exact residual Jacobian and"finite-difference"otherwise.
- history: Any¶
- initial_targets: tuple[ObservableReport, ...]¶
- final_targets: tuple[ObservableReport, ...]¶
- parameter_reports: tuple[FitParameterReport, ...] = ()¶
- rebind(seed: BaseDevice | str, /) BaseDevice[source]¶
- rebind(seed: BaseDevice | str, /, *more: BaseDevice | str) tuple[BaseDevice, ...]
Look up the fitted clones matching one or more seed devices.
Use
fit.rebind(qb, tc, cr)to retrieve the fitted clones corresponding to the seed devices.- Parameters:
*seeds (BaseDevice or str) – One or more devices (or their labels) from the seed chip passed to
fit_a_dress(). At least one is required.- Returns:
The matching device(s) on
chip(the fitted clone), in input order. A single positionalseedreturns that device directly; two or more return a tuple.- Return type:
BaseDevice or tuple[BaseDevice, …]
- Raises:
ValueError – No seeds were given.