Skip to content

Results are limited to the current section : Qoolqit

qoolqit.drive

Classes:

  • DetuningMapModulator

    A weighted detuning for the Detuning Map Modulator (DMM).

  • Drive

    The drive Hamiltonian acting over a duration.

DetuningMapModulator(waveform: Waveform, weights: dict[Any, float]) dataclass

Section titled “ DetuningMapModulator(waveform: Waveform, weights: dict[Any, float]) dataclass ”

A weighted detuning for the Detuning Map Modulator (DMM).

Parameters:

(Waveform) –

The waveform for this detuning. Must be negative for all times.

(dict[Any, float]) –

A dictionary associating detuning weights to qubits. Each weight must be in [0, 1], where 0 means that the waveform is ignored for this qubit and 1 means that the waveform is fully applied to this qubit.

See https://docs.pasqal.com/pulser/tutorials/dmm/ (external) for details on DMM.

Drive(*, amplitude: Waveform, detuning: Waveform | None = None, dmm: DetuningMapModulator | None = None, phase: float = 0.0)

Section titled “ Drive(*, amplitude: Waveform, detuning: Waveform | None = None, dmm: DetuningMapModulator | None = None, phase: float = 0.0) ”

The drive Hamiltonian acting over a duration.

The Drive specifies the control parameters for the time-dependent drive Hamiltonian in the Rydberg model (see https://docs.pasqal.com/qoolqit/get_started/qoolqit_model/ (external) for details),

H_drive(t) = Σᵢ [Ω(t)/2 (cos φ(t) σˣᵢ - sin φ(t) σʸᵢ)] - Σᵢ [δ(t) + εᵢ Δ(t)] nᵢ

representing: - Amplitude Ω(t): Controls the Rabi frequency that drives qubits. - Detuning δ(t): Controls the energy offset of the Rydberg state. - dmm εᵢ, Δ(t): Detuning Map Modulator (DMM) for additional qubit-specific detunings. - Phase φ: Global phase applied to the amplitude term.

Parameters:

(Waveform) –

Time-dependent amplitude waveform Ω(t) representing the Rabi frequency. Controls the strength of the coupling between ground and Rydberg states. Must be positive for all times.

(Waveform | None, default:None) –

Time-dependent detuning waveform δ(t) representing the energy offset of the Rydberg state relative to resonance. If None, defaults to zero detuning (Delay waveform) for the duration of the amplitude.

(DetuningMapModulator | None, default:None) –

DetuningMapModulator instance for additional negative detuning waveform Δ(t) ≤ 0 applied to individual qubits as specified by its weights attribute εᵢ.

(float, default:0.0) –

Global phase φ applied to the amplitude term in the Hamiltonian. Defaults to 0.0 (no phase).

Raises:

  • TypeError

    If amplitude or detuning are not Waveform instances.

  • ValueError

    If the amplitude waveform has negative values.

Note
Example

Attributes:

  • amplitude (Waveform) –

    The amplitude waveform in the drive.

  • detuning (Waveform) –

    The detuning waveform in the drive.

  • dmm (DetuningMapModulator | None) –

    Detuning Map Modulator (DMM) applied to individual qubits.

  • phase (float) –

    The phase value in the drive.

Source code in qoolqit/drive.py
def __init__(
self,
*,
amplitude: Waveform,
detuning: Waveform | None = None,
dmm: DetuningMapModulator | None = None,
phase: float = 0.0,
) -> None:
"""Initialize a Drive.
The Drive specifies the control parameters for the time-dependent drive Hamiltonian
in the Rydberg model
(see https://docs.pasqal.com/qoolqit/get_started/qoolqit_model/ for details),
H_drive(t) = Σᵢ [Ω(t)/2 (cos φ(t) σˣᵢ - sin φ(t) σʸᵢ)] - Σᵢ [δ(t) + εᵢ Δ(t)] nᵢ
representing:
- Amplitude Ω(t): Controls the Rabi frequency that drives qubits.
- Detuning δ(t): Controls the energy offset of the Rydberg state.
- dmm εᵢ, Δ(t): Detuning Map Modulator (DMM) for additional qubit-specific detunings.
- Phase φ: Global phase applied to the amplitude term.
Args:
amplitude: Time-dependent amplitude waveform Ω(t) representing the Rabi frequency.
Controls the strength of the coupling between ground and Rydberg states.
Must be positive for all times.
detuning: Time-dependent detuning waveform δ(t) representing the energy offset
of the Rydberg state relative to resonance. If None, defaults to zero
detuning (Delay waveform) for the duration of the amplitude.
dmm: DetuningMapModulator instance for additional negative detuning waveform Δ(t) ≤ 0
applied to individual qubits as specified by its `weights` attribute εᵢ.
phase: Global phase φ applied to the amplitude term in the Hamiltonian.
Defaults to 0.0 (no phase).
Raises:
TypeError: If amplitude or detuning are not Waveform instances.
ValueError: If the amplitude waveform has negative values.
Note:
- All arguments must be passed as keyword arguments.
- If amplitude and detuning have different durations, the shorter one is
automatically extended with a Delay to match the longer duration.
- DetuningMapModulator waveform must be negative for all times
(≤ 0) as it represents energy shifts below the resonance.
Example:
>>> from qoolqit import Drive
>>> from qoolqit.waveforms import Constant, Ramp
>>>
>>> # Simple constant drive
>>> drive = Drive(amplitude=Constant(10.0, 1.5))
>>>
>>> # Drive with time-varying amplitude and detuning
>>> amp = Ramp(5.0, 0.0, 2.0)
>>> det = Constant(5.0, -1.0)
>>> drive = Drive(amplitude=amp, detuning=det, phase=0.5)
"""
for arg in [amplitude, detuning]:
if arg is not None and not isinstance(arg, Waveform):
raise TypeError("'amplitude' and 'detuning' must be of type Waveform.")
if amplitude.min() < 0.0:
raise ValueError("'amplitude' must be positive.")
self._amplitude = amplitude
self._detuning = detuning if detuning is not None else Delay(amplitude.duration)
self._amplitude_orig = self._amplitude
self._detuning_orig = self._detuning
# adjust amplitude and detuning waveforms to match the duration
if self._amplitude.duration > self._detuning.duration:
extra_duration = self._amplitude.duration - self._detuning.duration
self._detuning = CompositeWaveform(self._detuning, Delay(extra_duration))
elif self._detuning.duration > self._amplitude.duration:
extra_duration = self._detuning.duration - self._amplitude.duration
self._amplitude = CompositeWaveform(self._amplitude, Delay(extra_duration))
self._duration = self._amplitude.duration
if dmm is not None and not isinstance(dmm, DetuningMapModulator):
raise TypeError("'dmm' must be of type DetuningMapModulator.")
self._dmm = dmm
self._phase = phase

The amplitude waveform in the drive.

The detuning waveform in the drive.

dmm: DetuningMapModulator | None property

Section titled “ dmm: DetuningMapModulator | None property ”

Detuning Map Modulator (DMM) applied to individual qubits.

The phase value in the drive.