Skip to content

Writing the drive Hamiltonian

The Drive is a composition of waveforms defining the drive Hamiltonian.

from qoolqit import Constant, Ramp
from qoolqit import Drive

# Defining two waveforms
wf0 = Constant(0.5, 1.0) >> Ramp(1.0, 0.0, 0.5)
wf1 = Ramp(2.0, -1.0, 1.0) >> Constant(1.0, 1.0)

# Defining the drive
drive = Drive(
    amplitude = wf0,
    detuning = wf1
)

# Expanding the drive through composition
drive = drive >> drive
Amplitude: 
| 0.00  t < 0.50: Constant(t, 1.00)
| 0.50  t < 1.50: Ramp(t, 0.00, 0.50)
| 1.50  t < 3.00: Delay(t)
| 3.00  t < 3.50: Constant(t, 1.00)
| 3.50  t < 4.50: Ramp(t, 0.00, 0.50)
| 4.50  t  6.00: Delay(t)

Detuning: 
| 0.00  t < 2.00: Ramp(t, -1.00, 1.00)
| 2.00  t < 3.00: Constant(t, 1.00)
| 3.00  t < 5.00: Ramp(t, -1.00, 1.00)
| 5.00  t  6.00: Constant(t, 1.00)
drive.draw()
2025-06-26T15:13:23.520933 image/svg+xml Matplotlib v3.10.3, https://matplotlib.org/