quchip.chip.partition

Exact subsystem partitioning into connected components of a chip’s independence graph.

Two device labels share a component when any structural object couples them. Such an object is a coupling edge, a non-separable bath whose target set contains both, classical drive crosstalk between their lines, or the captured maps of one effective contribution, which can mix the devices they act on. All decisions use only labels and object presence, never parameter values, which can be JAX tracers.

When observables are split across components, the user’s own indices pass through unchanged, and any injected factor is appended after them. A scalar local value colliding with one or more factors is re-indexed to 0, with each factor appended after it in encounter order.

The independence graph only recognizes line-mixing as Crosstalk entries. It does not see a user-authored SignalTransform that mixes drive lines in another way. Such mixing must be expressed as Crosstalk so the affected devices land in one component.

Functions

connected_components(labels, edges)

Union-find components, each in labels order, ordered by first member.

independence_edges(chip[, resolved])

Label pairs that must share one solve.

partition_chip(chip, *[, resolved, ...])

Split a chip into independent sub-chips along its independence graph.

split_drive_ops(part, chip, drive_ops)

Route drive ops to their owning component (edge targets through an endpoint).

split_e_ops(part, e_ops)

Group local observables and cross-component factors before assigning indices.

split_state_mapping(part, mapping)

Distribute a device-keyed state mapping over components.

Classes

CrossEop(a, b)

A cross-component correlator: its two local factors, multiplied at recombine time.

LocalEop(component, key[, index])

Where one user e_ops key landed: component, component-dict key, optional list index.

PartitionComponent(labels, chip)

One independent block: its device labels (chip order) and its solve-ready sub-chip.

PartitionResult(components, chip_order[, notes])

Connected components of a chip's independence graph, as solve-ready sub-chips.

quchip.chip.partition.independence_edges(chip, resolved=None)[source]

Label pairs that must share one solve.

A clique over N labels is emitted as an (N-1)-edge star, giving identical connected components with fewer edges.

quchip.chip.partition.connected_components(labels, edges)[source]

Union-find components, each in labels order, ordered by first member.

class quchip.chip.partition.PartitionComponent(labels, chip)[source]

Bases: object

One independent block: its device labels (chip order) and its solve-ready sub-chip.

labels: tuple[str, ...]
chip: Chip
class quchip.chip.partition.PartitionResult(components, chip_order, notes=())[source]

Bases: object

Connected components of a chip’s independence graph, as solve-ready sub-chips.

chip_order is the parent chip’s original device-label order (its chip.devices order). It is not the concatenation of the components labels, which follows connected-component discovery order. The two can interleave differently when the chip’s device order does not already group each component’s members together. Anything that reconstructs a joint state from the per-component pieces (for example PartitionedSimulationResult) must permute into chip_order to match the joint solve.

components: tuple[PartitionComponent, ...]
chip_order: tuple[str, ...]
notes: tuple[str, ...] = ()
property is_trivial: bool
owner_of(device)[source]
quchip.chip.partition.partition_chip(chip, *, resolved=None, extra_supports=(), clone_trivial=True)[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. Public results contain independent models even with one component.

class quchip.chip.partition.LocalEop(component, key, index=None)[source]

Bases: object

Where one user e_ops key landed: component, component-dict key, optional list index.

component: int
key: Any
index: int | None = None
class quchip.chip.partition.CrossEop(a, b)[source]

Bases: object

A cross-component correlator: its two local factors, multiplied at recombine time.

a: LocalEop
b: LocalEop
quchip.chip.partition.split_drive_ops(part, chip, drive_ops)[source]

Route drive ops to their owning component (edge targets through an endpoint).

quchip.chip.partition.split_e_ops(part, e_ops)[source]

Group local observables and cross-component factors before assigning indices.

quchip.chip.partition.split_state_mapping(part, mapping)[source]

Distribute a device-keyed state mapping over components.