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 never
materialized unless explicitly requested — rebuilding it costs the full
tensor-product space the partition avoided.
Classes
Result of one partitioned solve: K component results + a key plan. |
- class quchip.results.partitioned.PartitionedSimulationResult(component_results, partition, key_plan)[source]¶
Bases:
objectResult of one partitioned solve: K component results + a key plan.
- 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 and can interleave differently whenever the chip’s device order doesn’t already group each component’s members together) — it is the order
statesandfinal_stateare permuted into so they match the joint solve exactly.
- check_truncation(threshold=0.001)[source]¶
Run each component’s truncation check and merge the per-device results.
Mirrors
check_truncation()’s return shape (adictkeyed by device label) for duck-typing parity between a joint and a partitioned result.
- 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 own device order; each reconstructed step is permuted (
permute_state()) intodevice_orderso the result matches a joint solve of the original chip exactly.See also
final_state, which — unlike this accessor — intentionally also accepts density-matrix components: a tensor product of component density matrices is itself a valid joint state, whereas a per-step list of joint kets is only well-defined when every component stayed pure.
- property final_state: Any¶
Reconstruct the joint final state, in
device_order— a ket if every component stayed pure, otherwise a density matrix.When components disagree, every component is first promoted to a density matrix (
_promote_to_common_state_kind()) before tensoring, giving a valid joint density matrix. Components tensor together in connected-component discovery order, which can interleave differently from the parent chip’s own device order; the result is permuted (permute_state()) intodevice_orderso it matches a joint solve of the original chip exactly.