class qctrlopencontrols.DrivenControl(durations, rabi_rates=None, azimuthal_angles=None, detunings=None, name=None)

A piecewise-constant driven control for a single qubit.


  • durations (np.ndarray) – The durations {δtn}\{\delta t_n\} for each segment, in units of seconds. Every element must be positive. Represented as a 1D array of length NN, where NN
  • rabi_rates (np.ndarray , optional) – The Rabi rates {Ωn}\{\Omega_n\} for each segment, in units of radians per second. Every element must be nonnegative. Represented as a 1D array of length NN, where NN
  • azimuthal_angles (np.ndarray , optional) – The azimuthal angles {ϕn}\{\phi_n\} for each segment. Represented as a 1D array of length NN, where NN
  • detunings (np.ndarray , optional) – The detunings {Δn}\{\Delta_n\} for each segment, in units of radians per second. Represented as a 1D array of length NN, where NN
  • name (string , optional) – An optional string to name the control. Defaults to None.


This class represents a control for a single driven qubit with Hamiltonian:

H(t)=12(Ω(t)eiϕ(t)σ+Ω(t)eiϕ(t)σ+)+12Δ(t)σz, H(t) = \frac{1}{2}\left(\Omega(t) e^{i\phi(t)} \sigma_- + \Omega(t) e^{-i\phi(t)}\sigma_+\right) + \frac{1}{2}\Delta(t)\sigma_z,

where Ω(t)\Omega(t) is the Rabi rate, ϕ(t)\phi(t) is the azimuthal angle (or drive phase), Δ(t)\Delta(t) is the detuning, σ±=(σxiσy)/2\sigma_\pm = (\sigma_x \mp i\sigma_y)/2, and σk\sigma_k

The controls are piecewise-constant, meaning Ω(t)=Ωn\Omega(t)=\Omega_n for tn1t<tnt_{n-1}\leq t<t_n, where t0=0t_0=0 and tn=tn1+δtnt_n=t_{n-1}+\delta t_n (and similarly for ϕ(t)\phi(t) and Δ(t)\Delta(t)

For each segment of the control, the constant Hamiltonian effects unitary time evolution of the form:

Un=exp[iθn2(unσ)], U_n = \exp\left[-i\frac{\theta_n}{2} (\mathbf u_n\cdot\boldsymbol \sigma)\right],

where θn=Ωn2+Δn2δtn\theta_n = \sqrt{\Omega_n^2+\Delta_n^2}\delta t_n, un\mathbf u_n is the unit vector in the direction (Ωncosϕn,Ωnsinϕn,Δn)(\Omega_n\cos\phi_n, \Omega_n\sin\phi_n, \Delta_n), and σ=(σx,σy,σz)\boldsymbol\sigma=(\sigma_x, \sigma_y, \sigma_z). This unitary time evolution corresponds to a rotation of the Bloch sphere of an angle θn\theta_n about the axis un\mathbf u_n


exportReturns a dictionary formatted for plotting using the Q-CTRL Visualizer package.
export_to_filePrepares and saves the driven control in a file.
resampleReturns a new driven control obtained by resampling this control.


amplitude_xReturns the x-amplitude.
amplitude_yReturns the y-amplitude.
anglesReturns the Bloch sphere rotation angles.
directionsReturns the Bloch sphere rotation directions.
durationReturns the total duration of the control.
maximum_detuningReturns the maximum detuning of the control.
maximum_durationReturns the duration of the longest control segment.
maximum_rabi_rateReturns the maximum Rabi rate of the control.
minimum_durationReturns the duration of the shortest control segment.
number_of_segmentsReturns the number of segments.
timesReturns the boundary times of the control segments.

Was this useful?