quchip.control.batch

Batch / sweep-axis machinery for QuantumSequence.

This module owns everything about turning a scheduled sequence into a batched solve request: the sweepable BatchAxis / ZippedBatchAxis descriptors, the per-entry handles (PulseHandle, DelayHandle) that create them, the axis expansion into per-point overrides, and the list-like ProblemBatch view over the resulting SolveBatch.

QuantumSequence (in sequence.py) is the scheduler; it delegates its vary / zip / build_batch surface here. The split keeps the scheduler focused on timing semantics and the sweep bookkeeping isolated.

All sweep axes stay JAX-traceable: pulse parameters, delays, and envelope fields flow into SolveProblem without Python-side concretization.

Classes

BatchAxis(owner, target_kind, field, values, ...)

One batchable axis over a scheduled entry or sequence-level field.

DelayHandle(sequence, entry_index)

Reference to a scheduled delay entry.

ProblemBatch(batch, params, shape, axes)

List-like view of a batched solve request with sweep bookkeeping.

PulseHandle(sequence, entry_index)

Reference to one scheduled pulse entry.

ZippedBatchAxis(axes)

Multiple BatchAxis objects swept pairwise as one dimension.

class quchip.control.batch.BatchAxis(owner, target_kind, field, values, name, entry_index=None, entry=None)[source]

Bases: object

One batchable axis over a scheduled entry or sequence-level field.

Created by PulseHandle.vary(), DelayHandle.vary(), or QuantumSequence.vary(), and consumed by QuantumSequence.build_batch().

Parameters:
owner: QuantumSequence
target_kind: str
field: str
values: Any
name: str
entry_index: int | None = None
entry: Any = None

The scheduled entry object this axis references (None for sequence-level axes). build_batch validates it against the sequence by identity, so an axis silently pointing at the wrong entry after the sequence was modified is impossible.

property size: int
class quchip.control.batch.ZippedBatchAxis(axes)[source]

Bases: object

Multiple BatchAxis objects swept pairwise as one dimension.

Parameters:

axes (tuple[BatchAxis, ...])

axes: tuple[BatchAxis, ...]
property size: int
class quchip.control.batch.ProblemBatch(batch, params, shape, axes)[source]

Bases: Sequence[SolveProblem]

List-like view of a batched solve request with sweep bookkeeping.

Wraps a SolveBatch (the structural source of truth); per-element SolveProblem views are materialised on demand.

Parameters:
batch
params
shape
axes
params_at(point)[source]

Return the sweep parameter dictionary at the given grid coordinate.

Parameters:

point (int | tuple[int, ...])

Return type:

dict[str, Any]

class quchip.control.batch.PulseHandle(sequence, entry_index)[source]

Bases: _BaseEntryHandle

Reference to one scheduled pulse entry.

Sweepable fields: freq, phase, start_time, and any public envelope attribute (e.g. amplitude, duration, sigmas).

Parameters:
class quchip.control.batch.DelayHandle(sequence, entry_index)[source]

Bases: _BaseEntryHandle

Reference to a scheduled delay entry. Only duration is sweepable.

Parameters: