quchip.chip.partition¶
Exact subsystem partitioning — connected components of a chip’s independence graph.
Two device labels share a component when any structural object couples them: a coupling edge, a non-separable bath whose target set contains both, or classical drive crosstalk between lines targeting them. All decisions are made from labels and object presence — never from parameter values, which may be JAX tracers.
When splitting observables via split_e_ops: every user key is resolved and
validated up front (duplicate resolved keys and malformed correlator values
both raise), then grouped per (component, label) before anything is emitted,
so collisions never depend on dict iteration order. A user key whose value is
already a list keeps index=None in its LocalEop — the wrapper passes the
user’s own indices through unchanged, and any injected factor is appended
after them. A scalar local value that collides with one or more factors gets
re-indexed to 0, with each factor appended after it in encounter order. The
key plan built here is always keyed by the resolved label (or label pair),
matching how PartitionedSimulationResult() normalizes lookups — never
by the raw user key, which may be an object rather than its label.
The independence graph only recognizes line-mixing as Crosstalk entries:
a user-authored SignalTransform that mixes
drive lines any other way is invisible to it and must be expressed as
Crosstalk for the corresponding devices to land in one component.
Functions
|
Union-find components, each in |
|
Label pairs that must share one solve. |
|
Split a chip into independent sub-chips along its independence graph. |
|
Route drive ops to their owning component (edge targets via an endpoint). |
|
Distribute dict-form e_ops over components; cross-component correlators become factor pairs. |
|
Distribute a device-keyed state mapping over components. |
Classes
|
A cross-component correlator: its two local factors, multiplied at recombine time. |
|
Where one user e_ops key landed: component, component-dict key, optional list index. |
|
One independent block: its device labels (chip order) and its solve-ready sub-chip. |
|
Connected components of a chip's independence graph, as solve-ready sub-chips. |
- quchip.chip.partition.independence_edges(chip)[source]¶
Label pairs that must share one solve.
A clique over N labels is emitted as an (N-1)-edge star — identical connected components, fewer edges.
- quchip.chip.partition.connected_components(labels, edges)[source]¶
Union-find components, each in
labelsorder, ordered by first member.
- class quchip.chip.partition.PartitionComponent(labels, chip)[source]¶
Bases:
objectOne independent block: its device labels (chip order) and its solve-ready sub-chip.
- class quchip.chip.partition.PartitionResult(components, chip_order, notes=())[source]¶
Bases:
objectConnected components of a chip’s independence graph, as solve-ready sub-chips.
chip_orderis the parent chip’s original device-label order (itschip.devicesorder) — not the concatenation ofcomponents’ labels, which follows connected-component discovery order instead and can interleave differently whenever a chip’s device order doesn’t already group each component’s members together. Anything that reconstructs a joint state from the per-component pieces (e.g.PartitionedSimulationResult) must permute intochip_orderto match the joint solve.- Parameters:
- components: tuple[PartitionComponent, ...]¶
- quchip.chip.partition.partition_chip(chip)[source]¶
Split a chip into independent sub-chips along its independence graph.
Exact: the joint solve of the original chip factorizes as the tensor product of the component solves. With one component, the original chip is returned uncloned inside a trivial result.
- Parameters:
chip (Chip)
- Return type:
- class quchip.chip.partition.LocalEop(component, key, index=None)[source]¶
Bases:
objectWhere one user e_ops key landed: component, component-dict key, optional list index.
- class quchip.chip.partition.CrossEop(a, b)[source]¶
Bases:
objectA cross-component correlator: its two local factors, multiplied at recombine time.
- quchip.chip.partition.split_drive_ops(part, chip, drive_ops)[source]¶
Route drive ops to their owning component (edge targets via an endpoint).
- Parameters:
part (PartitionResult)
chip (Chip)
drive_ops (list)
- Return type:
- quchip.chip.partition.split_e_ops(part, e_ops)[source]¶
Distribute dict-form e_ops over components; cross-component correlators become factor pairs.
Order-independent by construction: every key is resolved and validated in one pass (PASS 0), grouped per (component, label) in a second pass (PASS 1), and only then emitted (PASS 2) — so no fixup pass over already-built plan entries is ever needed, and dict iteration order cannot change the result.