quchip.control.drive¶
Drive classes and Hamiltonian channel definitions.
Drives model the classical control lines that couple a quantum device to
external fields — microwave charge/phase drives on transmons, real-valued
flux drives on tunable devices, and so on. Each drive owns its local
Hamiltonian contribution: it exposes an operator and a
DriveModulation tag that together
describe how its line signal enters the system Hamiltonian. Signal
transforms (delays, gains, crosstalk) live separately on
ControlEquipment.
Drives are frame-agnostic: they emit a
DriveSignalSpec in ordinary GHz
and never construct engine IR nodes. Stage 2 of the engine is the sole
place where the spec is composed with the resolved rotating frame into a
SignalProgram.
Conventions:
Frequencies are GHz; times are ns.
Operators are returned in the device’s computational basis — embedding into the full chip Hilbert space is the engine’s job.
References
Krantz et al., A quantum engineer’s guide to superconducting qubits, APR 6, 021318 (2019) — microwave control of transmons (Sec. IV).
Koch et al., PRA 76, 042319 (2007) — charge vs flux noise and drives in the transmon regime.
Classes
|
Base class for classical control lines driving a single device. |
|
Microwave charge drive on a transmon-like device. |
|
One Hamiltonian channel exposed by a drive on a target device. |
|
Real-valued flux drive coupling to \(\hat n\). |
|
Control line pumping a modulable coupling's strength δ(t) in GHz. |
|
Microwave phase drive coupling to \(\hat a + \hat a^\dagger\). |
- class quchip.control.drive.DriveChannel(operator, modulation)[source]¶
Bases:
objectOne Hamiltonian channel exposed by a drive on a target device.
A channel pairs a local-basis operator with a
DriveModulationtag that tells the engine how the channel’s coefficient is built from the drive’s line signal. A drive may expose multiple channels if, for example, it contributes both in-phase and quadrature couplings.- Parameters:
operator (Any)
modulation (DriveModulation)
- modulation: DriveModulation¶
- class quchip.control.drive.BaseDrive(target=None, *, label=None, rwa=None)[source]¶
Bases:
RegistrableBase class for classical control lines driving a single device.
Drives own their local Hamiltonian contribution and are auto-labelled from their
_type_prefix(e.g.charge_0,flux_0) unless label is given. Subclasses are auto-registered for serialization via the sharedRegistrablemixin.- Parameters:
target (BaseDevice | None) – Device to attach this drive to. May be connected later via
connect().label (str | None) – Optional explicit label; otherwise auto-generated.
rwa (bool | None) – Per-drive RWA override.
Nonemeans follow the chip-level setting.
Examples
>>> from quchip import DuffingTransmon, ChargeDrive >>> q = DuffingTransmon(freq=5.0, anharmonicity=-0.25, levels=3) >>> drive = ChargeDrive(target=q) >>> drive.device_label == q.label True
- target_kind: ClassVar[str] = 'device'¶
"device"for drives targeting a device (the default),"edge"for drives targeting a coupling (seeParametricDrive).- Type:
Structural dispatch key for equipment/chip/sequence code
- connect(device)[source]¶
Attach (or re-attach) this drive to device.
If the drive was previously attached to another device, it is detached from that device’s
_connected_driveslist so that only the new attachment is visible on the chip.- Parameters:
device (BaseDevice)
- Return type:
None
- property target_label: str | None¶
Label of this drive’s target, or
Noneif unconnected.Device-target drives (
target_kind == "device") aliasdevice_label;ParametricDriveoverrides this to resolve its coupling target instead.
- collapse_operators(device)[source]¶
Lindblad collapse operators contributed by this drive.
Default: none. Override to model drive-induced dissipation (e.g. photon loss on a drive line).
- Parameters:
device (BaseDevice)
- Return type:
- local_channels(device)[source]¶
Return the Hamiltonian channels this drive exposes on device.
A simple single-channel drive declares
_coupling_protocol,_coupling_accessor,_fallback, and_modulation; this method then dispatches generically — the device’s physical coupling operator when it conforms to the Protocol, the structural fallback otherwise. Returned operators are in the device’s local basis (no chip-wide embedding). Drives with a non-standard decomposition override this method instead.- Parameters:
device (BaseDevice)
- Return type:
- physics_notes()[source]¶
Return human-readable declarations of this drive’s approximations.
Returns the shared target/RWA lines plus this drive’s
_coupling_notewhen declared. Subclasses with extra notessuper().physics_notes()and append their own. Aggregated byChip.physics_notes().
- signal_spec(drive_op, device)[source]¶
Build the frame-agnostic signal spec for one scheduled pulse.
- Parameters:
drive_op (DriveOp) – Scheduled pulse with envelope, start time, phase offset, and (for microwave drives) carrier frequency. Typed as
AnybecauseDriveOplives in the engine IR, which drives must not import.device (BaseDevice) – Target device. Unused in the default implementation, kept as an extension hook so subclasses can emit device-aware specs (e.g. flux-tunable drives that query the device’s tuning curve).
- Returns:
Frame-agnostic description of the pulse — envelope, start time, duration, phase offset, and carrier frequency (or
Nonefor baseband drives) — built directly from drive_op, with no frame or IR commitment.- Return type:
Notes
The default implementation produces a
DriveSignalSpecdescribing a phase-rotated, time-shifted, finite-duration envelope. Stage 2 of the engine turns the spec into the rawSignalProgramScale(Shift(Window(env, 0, duration), start), exp(i·phi))before applying the modulation dispatch.
- copy(*, target=None)[source]¶
Return a shallow copy, optionally rebound to a new target.
- Parameters:
target (BaseDevice | None)
- Return type:
- class quchip.control.drive.ChargeDrive(target=None, *, label=None, rwa=None)[source]¶
Bases:
BaseDriveMicrowave charge drive on a transmon-like device.
Contributes the standard charge-coupling Hamiltonian
\[H_d(t) = \epsilon(t)\, i(\hat a - \hat a^\dagger)\]with \(\epsilon(t)\) the (real-projected) mixed signal built by the
SINGLE_TONEdispatch in stage 2. This is the canonical transmon microwave drive (Koch et al., PRA 76, 042319 (2007); Krantz et al., APR 6, 021318 (2019), Eq. 90).Examples
>>> from quchip import DuffingTransmon, ChargeDrive, Gaussian >>> q = DuffingTransmon(freq=5.0, anharmonicity=-0.25, levels=3) >>> drive = ChargeDrive(target=q) >>> channels = drive.local_channels(q) >>> len(channels) == 1 True
- Parameters:
target (BaseDevice | None)
label (str | None)
rwa (bool | None)
- class quchip.control.drive.PhaseDrive(target=None, *, label=None, rwa=None)[source]¶
Bases:
BaseDriveMicrowave phase drive coupling to \(\hat a + \hat a^\dagger\).
Same carrier machinery as
ChargeDrivebut with an in-phase (rather than quadrature) coupling. Useful when modeling phase-noise channels or drives whose physical coupling is already referenced to the field quadrature. See Krantz et al. 2019, Sec. IV.A for the two conventions.- Parameters:
target (BaseDevice | None)
label (str | None)
rwa (bool | None)
- class quchip.control.drive.FluxDrive(target=None, *, label=None, rwa=None)[source]¶
Bases:
BaseDriveReal-valued flux drive coupling to \(\hat n\).
Uses
DIRECT_REAL— no carrier, no RWA — as appropriate for a baseband flux line that modulates the device frequency through its number operator (Koch et al. 2007, Sec. II; Krantz et al. 2019, Sec. V.A on flux tunability).The
rwakwarg is rejected: applying RWA to a baseband drive is ill-defined.Examples
>>> from quchip import DuffingTransmon, FluxDrive >>> q = DuffingTransmon(freq=5.0, anharmonicity=-0.25, levels=3) >>> flux = FluxDrive(target=q) >>> flux.rwa is None True
- Parameters:
target (BaseDevice | None)
label (str | None)
rwa (bool | None)
- class quchip.control.drive.ParametricDrive(coupling, *, label=None, **kwargs)[source]¶
Bases:
BaseDriveControl line pumping a modulable coupling’s strength δ(t) in GHz.
Targets a coupling (object or label string; labels late-bind via
Chip.connect()). The scheduled envelope is the real amplitudeA(t): with an explicitfreqthe pump isδ(t) = A(t)·cos(2π·freq·t - phase); withfreqomitted the pump is baseband,δ(t) = A(t)directly. The pump tone is never RWA-split — the coupling’s RWA policy selects the operator structure via its parametric hook; the tone keeps both sidebands (declared, the solver integrates the fast one).Accepted couplings implement
parametric_interaction(); a static coupling raisesTypeErrornaming the hook.- Parameters:
coupling (BaseCoupling | str) – Modulable coupling to pump, given as the coupling object or its label. A string label late-binds to the coupling instance via
Chip.connect().label (str | None) – Optional explicit label; otherwise auto-generated from
"parametric".kwargs (Any)
- Raises:
TypeError – coupling does not implement
parametric_interaction()(a static coupling), or an unexpected keyword argument is passed.ValueError – An explicit
rwakeyword argument is passed — the RWA policy is fixed by the coupling’s parametric hook, not per-drive.
- target_kind: ClassVar[str] = 'edge'¶
"device"for drives targeting a device (the default),"edge"for drives targeting a coupling (seeParametricDrive).- Type:
Structural dispatch key for equipment/chip/sequence code
- property device_label: None¶
an edge pump has no device target.
Device-keyed paths (drive-noise collection, device-line bookkeeping) treat
Noneas “skip this line”; edge code readstarget_labelinstead.- Type:
Always
None
- connect(coupling)[source]¶
Rebind to coupling (no device-side handshake — couplings hold no drive list).
- Parameters:
coupling (Any)
- Return type:
None