quchip.chip.transformations.result¶
Result and typing layer for quchip.chip.transformations.
ChipTransform is the structural protocol that every transformation result satisfies.
EliminationResult is eliminate()’s return
type. LazyEffectiveParams is the deferred-chi dict in which the result stores its
per-survivor entries. Reduction maps capture numerical coordinates independently of the source
chip.
Classes
|
Structural protocol for any transformation result that yields a chip. |
|
Store a reduced chip, its numerical maps and scientific diagnostics. |
Expose deferred values together with ordinary diagnostic entries. |
|
|
A captured subspace map in the source and target lab-frame solver bases. |
- class quchip.chip.transformations.result.ChipTransform(*args, **kwargs)[source]¶
Bases:
ProtocolStructural protocol for any transformation result that yields a chip.
- class quchip.chip.transformations.result.ReductionMap(source_labels, source_dims, target_labels, target_dims, _backend, _embedding)[source]¶
Bases:
objectA captured subspace map in the source and target lab-frame solver bases.
Inputs are full numerical operators, kets or density matrices, including backend-native objects. Outputs use the captured backend and dimensions. Projection does not renormalize, so the norm or trace it loses is the weight outside the retained subspace. Lifting keeps norm and trace.
Exact mode maps use the retained Löwdin embedding. Edge maps use the full pair eigenbasis rotation. SW maps exponentiate the first-order generator. Their interpretation is perturbative, but the map is isometric. Jumps follow that map. The SW Hamiltonian keeps its separately stated second-order truncation.
- Parameters:
source_labels (tuple[str, ...]) – Device labels defining the source and retained tensor-product orders.
target_labels (tuple[str, ...]) – Device labels defining the source and retained tensor-product orders.
source_dims (tuple[int, ...]) – Hilbert-space dimensions aligned with the corresponding labels.
target_dims (tuple[int, ...]) – Hilbert-space dimensions aligned with the corresponding labels.
- project_operator(operator)[source]¶
Restrict a source operator to the retained subspace.
- Parameters:
operator (array-like or backend operator) – Full source-space operator.
- class quchip.chip.transformations.result.EliminationResult(chip, effective_params, validity, notes=<factory>, mapping=None, _element_pathways=None)[source]¶
Bases:
objectStore a reduced chip, its numerical maps and scientific diagnostics.
- Variables:
chip (Chip) – Reduced model with complete retained Hamiltonian corrections and transformed removed-component channels in
effective_terms. Survivor noise remains separately owned. The source is not mutated.effective_params (dict[str, Any]) –
Per-survivor
lamb_shift,freq_after,chi(GHz), andpurcell_rate,kappa(1/ns). The Purcell rate summarizes the first downward transition, summed over the removed device’s channels.kappais its isolated 1-to-0 rate. These diagnostics do not replace the retained jumps.chiis the full conditional mode-frequency difference, twice the sigma-Z half-pull convention. It is zero for a bus that touches multiple survivors. Otherwise, it is evaluated from the captured source spectrum on demand and cached only when concrete.For two touching survivors,
exchangeholds one dict withj_eff,dJ_domega_c,between,coupling,zzandpathways. For more survivors it is keyed by survivor pairs.couplingnames the emitted mediated edge.j_effanddJ_domega_care in the units of that edge. Its real strength carries the representable part of the mediated exchange; the retained correction keeps the remainder. The flux-retargeting derivative remains second-order even with exact reduction.zzis available for the exact route andpathwaysfor SW.pathwayslists(occupation, amount)pairs: each occupation is an intermediate bare product state of the source chip in its device order, and the amounts in GHz sum to the second-order part of the exchange element.pathways()attributes any other retained element.An effective-terms target reports
freq_after,lamb_shift,anharmonicity(with three or more levels) andcross_kerrfor each device that the terms act on.cross_kerris a mapping from each other such device to the full-pull shiftE11 - E10 - E01 + E00(GHz). All values come from the exactly diagonalized isolated terms.validity (dict[str, Any]) – Per-coupling
g_over_delta,is_validandmin_block_gap.g_over_deltadivides the resolved exchange element between the coupled devices by their bare detuning. The validity flag usesg_over_delta < 0.1and remains a native boolean under JAX tracing. It is a perturbative diagnostic. The exact effective-terms route has no such diagnostic and leaves this mapping empty. A one-pass section on a shared feedline addskappa_over_deltaandis_validunder its label.kappa_over_deltaestimates the dispersive field-error scale at incoming kept-port frequencies beyond the section. Dressed shifts can exceed this scale.is_validuseskappa_over_delta < 0.1as a diagnostic, not an accuracy guarantee. A kept coupled response addsself_energy_over_widthandis_validunder"<mode>_response". For each kept target of the other ports, the value divides the self-energy of the return path through the omitted pole, at the target’s frequency, by the target’s amplitude damping. The entry reports the largest value, andis_validusesself_energy_over_width < 0.1. Both areNonewhen the reduced chip has no vacuum one-excitation model, for example with a thermal bath. The exact route of a device adds"<mode>_labeling": thelabelsmapping gives each diagnostic label’s occupation its largest dressedweight, itsrunner_upand itsmargintothreshold0.5 + 1e-6. The entry also gives the smallestmargin, thegram_min_eigenvalueof the kept overlap matrix, and the orthonormalizationresidualwith itsresidual_margintoresidual_threshold1e-9(PHYSICS.md §10.4). A failed check raisesEliminationErrorinstead.notes (list[str]) – Approximation order, omitted physics and control retargeting.
mapping (ReductionMap | None) – Captured
ReductionMapin lab-frame solver coordinates, orNonewhen a transformation supplies no map.Exchange (Diagnostic mappings accept device/coupling objects or labels.)
reduction; (pair keys accept either order. Scalar summaries describe the)
calculations. (the retained matrices determine the model's)
- mapping: ReductionMap | None = None¶
- pathways(final, initial=None)[source]¶
Attribute one element of the retained Hamiltonian to virtual states.
The element is
⟨final|H|initial⟩between bare product states of the reduced chip, given as level mappings such as{"qa": 1}. Omitted devices are in their ground state, andinitialdefaults tofinal, the diagonal element. Each pathway pairs an intermediate bare product state of the source chip, as an occupation tuple in its device order, with its contribution in GHz (PHYSICS.md §10.3). The contributions sum to the second-order part of the element. Under tracing, every intermediate state is listed, with exact zeros.- Parameters:
- Raises:
ValueError – For a result without a perturbative generator, such as
method="exact", or for a state outside the retained space.
- class quchip.chip.transformations.result.LazyEffectiveParams[source]¶
Bases:
dictExpose deferred values together with ordinary diagnostic entries.
DeferredValue entries evaluate captured inputs and cache concrete results. Reading a value under JAX tracing leaves the stored evaluator intact. Representation does not trigger deferred calculations.