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

PartitionedSimulationResult(...)

Result of one partitioned solve: K component results + a key plan.

class quchip.results.partitioned.PartitionedSimulationResult(component_results, partition, key_plan)[source]

Bases: object

Result of one partitioned solve: K component results + a key plan.

Parameters:
  • component_results (list)

  • partition (Any)

  • key_plan (dict)

property components: tuple
property partition: Any
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 states and final_state are permuted into so they match the joint solve exactly.

expect(key, index=None)[source]
Parameters:
  • key (Any)

  • index (int | None)

Return type:

Any

expect_final(key, index=None)[source]
Parameters:
  • key (Any)

  • index (int | None)

Return type:

Any

expect_values(key, index=None)
Parameters:
  • key (Any)

  • index (int | None)

Return type:

Any

population(device, level=0)[source]
Parameters:
Return type:

Any

population_array(device, level=0)[source]
Parameters:
Return type:

Any

check_truncation(threshold=0.001)[source]

Run each component’s truncation check and merge the per-device results.

Mirrors check_truncation()’s return shape (a dict keyed by device label) for duck-typing parity between a joint and a partitioned result.

Parameters:

threshold (float)

Return type:

dict[str, float]

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()) into device_order so 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()) into device_order so it matches a joint solve of the original chip exactly.

describe()[source]
Return type:

str