quchip.control.equipment¶
Control-equipment container: drive lines and signal chain.
Signal transforms are owned here, not by individual drives.
Classes
|
Ordered drive lines plus a sequence of signal-chain transforms. |
|
Dense crosstalk transform and matrix view in control-line order. |
- class quchip.control.equipment.CrosstalkMatrix(labels, beta, theta, delay)[source]¶
Bases:
SignalTransformDense crosstalk transform and matrix view in control-line order.
- labels¶
Drive labels in wiring order (the order drives appear in
ControlEquipment.lines). Row / columnicorresponds tolabels[i].
- beta¶
[n, n]amplitude matrix.beta[i, j]is the leakage amplitude from sourcelabels[j]onto victimlabels[i](column = source, row = victim). Diagonals represent self-coupling and are conventionally1.0.- Type:
Any
- theta¶
[n, n]phase matrix (radians), same indexing asbeta.- Type:
Any
- delay¶
[n, n]delay matrix (ns), same indexing asbeta.- Type:
Any
Notes
Every off-diagonal edge reads the same input signal map, so reciprocal entries form one linear mixing stage without recursively leaking one another’s output. Matrix entries flow directly into the signal-program IR (
PolarScale/Shift), preserving end-to-end JAX traceability.- apply(signals)[source]¶
Apply all directed leakage edges to one shared input snapshot.
- Parameters:
signals (dict[tuple[str, int], SignalNode])
- Return type:
dict[tuple[str, int], SignalNode]
- without_line(line)[source]¶
Return this transform without line, or
Nonewhen it must be dropped.- Parameters:
line (str)
- Return type:
CrosstalkMatrix | None
- classmethod from_dict(d)[source]¶
Reconstruct from
to_dict()output.On the registry root, dispatch to the concrete subclass named by
data["type"](forwarding*args/**kwargs). On a concrete subclass, defer to_from_dict_payload(). Concrete subclasses that carry payload override this method directly.- Parameters:
- Return type:
- class quchip.control.equipment.ControlEquipment(lines, *, signal_chain=None)[source]¶
Bases:
objectOrdered drive lines plus a sequence of signal-chain transforms.
Drives produce raw line signals; the equipment pipes them through
signal_chainin order before the engine assembles Hamiltonian terms.- Parameters:
signal_chain (list[SignalTransform] | None)
- property signal_chain: list[SignalTransform]¶
Signal-chain transforms (defensive copy).
- apply_signal_chain(signals)[source]¶
Apply every signal-chain transform to signals, in order.
Each transform receives the previous transform’s output, so transforms compose sequentially: reordering
signal_chainchanges the result (e.g. aDelayapplied before aGainsees the undelayed signal).- Parameters:
signals (SignalMap) –
{(drive_label, drive_index): SignalProgram}map of raw line signals.drive_indexdistinguishes multiple ops on the same drive line and is assigned by the engine when it enumerates the chip’s scheduled drive ops.- Returns:
Transformed signal map. May contain keys absent from signals: a
Crosstalktransform, for example, adds an entry under the victim drive’s label for every source entry it leaks from.- Return type:
SignalMap
- crosstalk_matrix()[source]¶
Return a dense matrix view of the
Crosstalktransforms.The matrix uses wiring order (
self.lines) as the stable axis ordering. Column index = source drive, row index = victim drive. Diagonal entries arebeta=1,theta=0,delay=0by convention (self-coupling). Off-diagonal entries aggregate everyCrosstalktransform present in the signal chain; lines with no corresponding transform contribute zeros.Non-
Crosstalktransforms (Gain,Delay) are ignored here; this is strictly a view of the crosstalk edges.- Returns:
labels(wiring order),beta,theta,delayas[n, n]arrays. Arrays usejax.numpywhen any stored entry is a JAX tracer or array, otherwisenumpy.- Return type:
- set_crosstalk_matrix(beta, theta=None, delay=None, *, labels=None)[source]¶
Rehydrate the crosstalk edges from dense matrices.
Removes every crosstalk transform currently in the signal chain and replaces them with one
CrosstalkMatrix. Other signal-chain transforms (Gain,Delay, and user-defined subclasses) are preserved in order.- Parameters:
beta (Any) –
[n, n]amplitude matrix.beta[i, j]is emitted as the leakage amplitude from sourcelabels[j]onto victimlabels[i]. Diagonal entries are ignored (self-coupling belongs to the drive itself, not to a crosstalk edge).theta (Any, optional) –
[n, n]phase matrix (radians). Defaults to zeros.delay (Any, optional) –
[n, n]delay matrix (ns). Defaults to zeros.labels (tuple[str, ...] | list[str] | None, optional) – Axis ordering. Defaults to wiring order (
self.lines). Must matchbeta.shape[0].
- Return type:
None
Notes
Traced JAX entries flow unchanged into
CrosstalkMatrixand therefore into the signal-program IR. No concretization occurs.
- copy(device_map, coupling_map=None)[source]¶
Return a structural copy with drive lines rebound to device_map / coupling_map.
Edge lines (
target_kind == "edge") rebind via coupling_map, keyed by coupling label; device lines rebind via device_map as before.
- classmethod from_dict(d, dev_map, coupling_map=None)[source]¶
Reconstruct from
to_dict()output, rebinding drives via dev_map / coupling_map.Each line’s
target_labelis resolved against dev_map first, then coupling_map — device and coupling labels are disjoint by Chip construction, so at most one map holds the label.