quchip.results.partitioned¶
Combined view over per-component solves of a partitioned chip.
Holds the K component SimulationResult objects
and answers observable queries locally. The joint state is materialized only on
explicit request, because rebuilding it costs the full tensor-product space
that the partition avoided.
Classes
Result of one partitioned solve: K component results plus a key plan. |
- class quchip.results.partitioned.PartitionedSimulationResult(component_results, partition, key_plan)[source]¶
Bases:
objectResult of one partitioned solve: K component results plus a key plan.
- Variables:
component_results (sequence of SimulationResult) – Per-component results in
partition.componentsorder.partition (object) – Component and device ownership metadata.
key_plan (mapping) – Mapping from requested observable keys to component traces.
- property frame: Any¶
Return the joint integration frame, with the frame frequency that each component gives its devices.
The mode is the common mode of the components, or
"dict"when they differ. A component that plans its own"auto"frame keeps its plan incomponents[i].frame.
- property device_order: tuple[str, ...]¶
Return the parent chip’s original device-label order.
This is not the concatenation of each component’s labels, which follows connected-component discovery order. That order can interleave differently when the chip’s device order does not already group each component’s members together. The result permutes
statesandfinal_stateinto this order, so they match the joint solve exactly.
- observable_at(t, values, *, method='exact')[source]¶
Select or linearly interpolate observable values on the shared grid.
- Parameters:
t (scalar or array_like) – Query times in ns.
values (array_like) – Saved values with time on the final axis.
method ({"exact", "nearest", "interpolate"}, default="exact") – Time-selection rule.
- expect_values(key, index=None)¶
Return one captured expectation trace.
- measure(*devices, t=None, basis='energy')[source]¶
Measure kept states in local energy bases, without further evolution.
Pass multiple devices for joint outcomes, t for an exact saved time, or basis=’solver’. Write custom local unitary columns in the captured energy basis of the stored integration frame. Give one matrix for one device, or a device mapping. No phase-frame conversion is applied. Samples at different times represent independently terminated experiments.
- Parameters:
*devices (device object or str) – Measured devices. An empty selection measures all devices.
t (scalar, array_like, or None, optional) – Saved time or times in ns.
Noneselects the final state.basis ({"energy", "solver"}, array_like, or mapping, default="energy") – Captured local measurement basis.
- check_truncation(threshold=0.001)[source]¶
Deprecated method form of
quchip.check_truncation().quchip 0.6 removes this method. Call
quchip.check_truncation(result).- Parameters:
threshold (float, default=1e-3) – Maximum accepted boundary population.
- property states: list¶
Reconstruct the joint-state trajectory (ket trajectories only), in
device_order.Component states tensor together in connected-component discovery order, which can interleave differently from the parent chip’s device order. Each reconstructed step is permuted (
permute_state()) intodevice_order, so the result matches a joint solve of the original chip exactly.See also
final_state. Unlike this accessor,final_stateintentionally also accepts density-matrix components, because a tensor product of component density matrices is itself a valid joint state. A per-step list of joint kets is well-defined only when every component stayed pure.
- property final_state: Any¶
Reconstruct the joint final state in
device_order, as a ket if all components stayed pure, else a density matrix.When components disagree, it first promotes every component to a density matrix and then tensors them into a valid joint density matrix. Components tensor together in connected-component discovery order, which can interleave differently from the parent chip’s device order. The result is permuted (
permute_state()) intodevice_order, so it matches a joint solve of the original chip exactly.
- state_at(t, *, method='exact', frame='integration')[source]¶
Reconstruct a joint state at a saved time.
- Parameters:
t (scalar) – Query time in ns.
method ({"exact", "nearest"}, default="exact") – Time-selection rule.
frame ({"integration", "lab"}, default="integration") – Frame of the returned state.