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

PartitionedSimulationResult(...)

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

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

Bases: object

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

Variables:
  • component_results (sequence of SimulationResult) – Per-component results in partition.components order.

  • partition (object) – Component and device ownership metadata.

  • key_plan (mapping) – Mapping from requested observable keys to component traces.

property components: tuple
property dissipation: bool

Return the shared dissipation choice of this partitioned solve.

property partition: Any
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 in components[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 states and final_state into this order, so they match the joint solve exactly.

expect(key, index=None)[source]

Return one captured expectation trace.

Parameters:
  • key (object or str) – Captured observable key.

  • index (int or None, optional) – Entry of a list-valued observable.

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_final(key, index=None)[source]

Return the final expectation value for an observable.

Parameters:
  • key (object or str) – Captured observable key.

  • index (int or None, optional) – Entry of a list-valued observable.

expect_values(key, index=None)

Return one captured expectation trace.

Parameters:
  • key (object or str) – Captured observable key.

  • index (int or None, optional) – Entry of a list-valued observable.

iq_readout(output, **kwargs)[source]

Build a detector from the component owning an exposed output.

Parameters:
  • output (port object or str) – External output reference plane.

  • **kwargs (Any) – Forwarded to SimulationResult.iq_readout().

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. None selects the final state.

  • basis ({"energy", "solver"}, array_like, or mapping, default="energy") – Captured local measurement basis.

population(device, level=0)[source]

Return occupation of a captured isolated energy level.

Parameters:
  • device (device object or str) – Captured device.

  • level (int, default=0) – Zero-based isolated energy level.

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

See also final_state. Unlike this accessor, final_state intentionally 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()) into device_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.

describe()[source]