rydopt.pulses

class PulseAnsatz(detuning_ansatz=<factory>, phase_ansatz=<factory>, rabi_ansatz=<factory>)[source]

Data class that stores ansatz functions for the laser pulse that couples the qubit state \(|1\rangle\) to the Rydberg state \(|r\rangle\).

RydOpt models the atom-light interaction in the rotating frame, using the rotating wave approximation. The Hamiltonian of the driven two-level ladder system \(|1\rangle \leftrightarrow |r\rangle\) is

\[\begin{split}H_\mathrm{drive}(t)=\begin{pmatrix} 0 & \frac{\Omega(t)}{2} e^{-i\xi(t)} \\ \frac{\Omega(t)}{2} e^{i\xi(t)} & -\Delta(t) \end{pmatrix}.\end{split}\]

For available ansatz functions for the detuning \(\Delta(t)\), phase \(\xi(t)\), and Rabi frequency \(\Omega(t)\) sweeps, see below. The function optimize allows optimizing the parameters of the ansatz functions and duration of the laser pulse to maximize the gate fidelity. Initial parameters can be provided to the function as PulseParams(duration, detuning_params, phase_params, rabi_params).

Example

>>> import rydopt as ro
>>> pulse = ro.pulses.PulseAnsatz(
...     detuning_ansatz=ro.pulses.Const(),
...     phase_ansatz=ro.pulses.SinCrab(2),
... )
Parameters:
  • detuning_ansatz (PulseAnsatzFunction)

  • phase_ansatz (PulseAnsatzFunction)

  • rabi_ansatz (PulseAnsatzFunction)

detuning_ansatz

Detuning sweep \(\Delta(t)\), default is zero.

Type:

PulseAnsatzFunction

phase_ansatz

Phase sweep \(\xi(t)\), default is zero.

Type:

PulseAnsatzFunction

rabi_ansatz

Rabi frequency amplitude sweep \(\Omega(t)\), default is one.

Type:

PulseAnsatzFunction

evaluate_pulse_functions(t, params)[source]

Evaluate the detuning, phase, and the rabi sweeps for fixed parameters at the given times.

Parameters:
  • t (float | Array) – Time samples at which the functions are evaluated

  • params (ParamsFloatLike) – Pulse parameters

Returns:

Tuple (detuning_1, detuning_r, phase, rabi)

Return type:

tuple[Array, Array, Array, Array]

class TwoPhotonPulseAnsatz(lower_transition, upper_transition, decay=0.0)[source]

Data class that stores an effective two-photon pulse ansatz that couples the qubit state \(|1\rangle\) to the Rydberg state \(|r\rangle\) via the intermediate state \(|e\rangle\).

RydOpt models the atom-light interaction in the rotating frame, using the rotating wave approximation. The Hamiltonian of the driven three-level ladder system \(|1\rangle \leftrightarrow |e\rangle \leftrightarrow |r\rangle\) is taken as

\[\begin{split}H_\mathrm{3lvl}(t)= \begin{pmatrix} 0 & \frac{\Omega_\ell(t)}{2}\,e^{-i\xi_\ell(t)} & 0 \\[6pt] \frac{\Omega_\ell(t)}{2}\,e^{i\xi_\ell(t)} & -\Delta_\ell(t) - i \frac{\gamma}{2}& \frac{\Omega_u(t)}{2}\,e^{-i\xi_u(t)} \\[6pt] 0 & \frac{\Omega_u(t)}{2}\,e^{i\xi_u(t)} & -\Delta_\ell(t)-\Delta_u(t) \end{pmatrix},\end{split}\]

where the lower/upper laser couples \(|1\rangle \leftrightarrow |e\rangle\) / \(|e\rangle \leftrightarrow |r\rangle\) with Rabi frequency amplitudes \(\Omega_{\ell/u}(t)\), phases \(\xi_{\ell/u}(t)\), detunings \(\Delta_{\ell/u}(t)\). \(\gamma\) is the decay rate of the intermediate state.

The implementation is restricted to the adiabatic-elimination regime (\(|\Delta_\ell| \gg |\Omega_\ell|, |\Omega_u|, |\delta|\) and \(|\Delta_\ell|^2 \gg |\dot{\Omega}_\ell|, |\dot{\Omega}_u|, |\dot{\delta}|\) with \(\delta = \Delta_\ell+\Delta_u\)), where the system can be treated by an effective two-level Hamiltonian on the subspace \(\{|1\rangle,|r\rangle\}\):

\[\begin{split}H_\mathrm{drive}(t)= \begin{pmatrix} -\Delta_{1,\mathrm{eff}}(t) & \frac{\Omega_\mathrm{eff}(t)}{2} e^{-i\xi_\mathrm{eff}(t)} \\ \frac{\Omega_\mathrm{eff}(t)}{2} e^{i\xi_\mathrm{eff}(t)} & -\Delta_{r,\mathrm{eff}}(t) \end{pmatrix}.\end{split}\]

The effective controls are computed as

\[\begin{split}\Omega_\mathrm{eff}(t)&=\frac{\Omega_\ell(t)\Omega_u(t)}{2(\Delta_\ell(t)+i\gamma/2)}, \\ \xi_\mathrm{eff}(t)&=\xi_\ell(t)+\xi_u(t), \\ \Delta_{1,\mathrm{eff}}(t)&=- \frac{\Omega_\ell(t)^2}{4(\Delta_\ell(t)+i\gamma/2)} \\ \Delta_{r,\mathrm{eff}}(t)&=\Delta_\ell(t)+\Delta_u(t)- \frac{\Omega_u(t)^2}{4(\Delta_\ell(t)+i\gamma/2)}.\end{split}\]

For available ansatz functions for the detuning, phase, and Rabi frequency sweeps, see below. The function optimize allows optimizing the parameters of the ansatz functions and duration of the laser pulse to maximize the gate fidelity. Initial parameters can be provided to the function as PulseParams(duration, detuning_params, phase_params, rabi_params). Each parameter array within the tuple is packed as [*lower_transition_params, *upper_transition_params]. The split positions are inferred from the ansatz parameter counts of lower_transition.

Example

>>> import rydopt as ro
>>> lower = ro.pulses.PulseAnsatz(
...     detuning_ansatz=ro.pulses.Const(),
...     phase_ansatz=ro.pulses.SinCrab(4),
... )
>>> upper = ro.pulses.PulseAnsatz(
...     detuning_ansatz=ro.pulses.Const(),
...     rabi_ansatz=ro.pulses.Const(),
... )
>>> pulse = ro.pulses.TwoPhotonPulseAnsatz(
...     lower_transition=lower,
...     upper_transition=upper,
... )
Parameters:
lower_transition

Ansatz for the lower transition \(|1\rangle \leftrightarrow |e\rangle\).

Type:

PulseAnsatz

upper_transition

Ansatz for the upper transition \(|e\rangle \leftrightarrow |r\rangle\).

Type:

PulseAnsatz

decay

Decay rate of the intermediate state, default is zero.

Type:

float

evaluate_pulse_functions(t, params)[source]

Evaluate the effective two-photon detuning, phase, and the rabi sweeps for fixed parameters at the given times.

Parameters:
  • t (float | Array) – Time samples at which the functions are evaluated

  • params (ParamsFloatLike) – Pulse parameters

Returns:

Tuple (detuning_1, detuning_r, phase, rabi)

Return type:

tuple[Array, Array, Array, Array]

class PulseParams(duration, detuning_params=(), phase_params=(), rabi_params=())[source]

Pulse-parameter container.

The container stores pulse parameters components (duration, detuning_params, phase_params, rabi_params).

Parameters:
  • duration (ParamScalar)

  • detuning_params (npt.ArrayLike)

  • phase_params (npt.ArrayLike)

  • rabi_params (npt.ArrayLike)

type ParamsFloatLike = tuple[float, FloatParamComponent, FloatParamComponent, FloatParamComponent] | FloatParamComponent

Pulse configuration as either PulseParams(duration, detuning_params, phase_params, rabi_params) or a packed parameter array/sequence.

  • duration - Gate duration

  • detuning_params - Parameters for the detuning sweep

  • phase_params - Parameters for the phase sweep

  • rabi_params - Parameters for the Rabi frequency amplitude sweep

type ParamsBoolLike = tuple[bool, BoolParamComponent, BoolParamComponent, BoolParamComponent] | BoolParamComponent

Boolean masks as either PulseParams(fixed_duration, fixed_detuning_params, fixed_phase_params, fixed_rabi_params) or a packed boolean mask array/sequence, marking which pulse parameters are held constant during optimization.

  • fixed_duration - Whether the gate duration is fixed

  • fixed_detuning_params - Boolean mask of fixed detuning parameters

  • fixed_phase_params - Boolean mask of fixed phase parameters

  • fixed_rabi_params - Boolean mask of fixed Rabi frequency amplitude parameters

General Pulse Ansatz Functions

sin_crab(t, duration, ansatz_params)[source]

Sine-only CRAB pulse ansatz.

\[f(t) = \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right)\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(2N\) entries \((A_1, \alpha_1, \dots, A_N, \alpha_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

cos_crab(t, duration, ansatz_params)[source]

Cosine-only CRAB pulse ansatz.

\[f(t) = \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right)\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(2N\) entries \((B_1, \beta_1, \dots, B_N, \beta_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

sin_cos_crab(t, duration, ansatz_params)[source]

Combined sine and cosine CRAB pulse ansatz.

\[\begin{split}f(t) = \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right) \\ \quad + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right)\end{split}\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(4N\) entries \((A_1, \alpha_1, B_1, \beta_1, \dots, A_N, \alpha_N, B_N, \beta_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

cos_sin_crab(t, duration, ansatz_params)[source]

Combined cosine and sine CRAB pulse ansatz.

\[\begin{split}f(t) = \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right) \\ \quad + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right)\end{split}\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(4N\) entries \((B_1, \beta_1, A_1, \alpha_1, \dots, B_N, \beta_N, A_N, \alpha_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

const(t, _duration, ansatz_params)[source]

Constant pulse.

\[f(t) = c_0\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • _duration (float | Array) – Pulse duration \(T\) (unused).

  • ansatz_params (Array) – Array with entry \((c_0)\).

Returns:

Values of \(f(t)\).

Return type:

Array

const_sin_crab(t, duration, ansatz_params)[source]

Constant offset plus sine CRAB pulse ansatz.

\[f(t) = c_0 + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right)\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(2N+1\) entries \((c_0, A_1, \alpha_1, \dots, A_N, \alpha_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

const_cos_crab(t, duration, ansatz_params)[source]

Constant offset plus cosine CRAB pulse ansatz.

\[f(t) = c_0 + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right)\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(2N+1\) entries \((c_0, B_1, \beta_1, \dots, B_N, \beta_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

const_sin_cos_crab(t, duration, ansatz_params)[source]

Constant offset plus combined sine and cosine CRAB pulse ansatz.

\[\begin{split}f(t) = c_0 + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right) \\ \quad + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right)\end{split}\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(4N+1\) entries \((c_0, A_1, \alpha_1, B_1, \beta_1, \dots, A_N, \alpha_N, B_N, \beta_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

const_cos_sin_crab(t, duration, ansatz_params)[source]

Constant offset plus combined cosine and sine CRAB pulse ansatz.

\[\begin{split}f(t) = c_0 + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right) \\ \quad + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right)\end{split}\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(4N+1\) entries \((c_0, B_1, \beta_1, A_1, \alpha_1, \dots, B_N, \beta_N, A_N, \alpha_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

lin_sin_crab(t, duration, ansatz_params)[source]

Straight line plus sine CRAB pulse ansatz.

\[f(t) = c_1 (t - T/2) + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right)\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(2N+1\) entries \((c_1, A_1, \alpha_1, \dots, A_N, \alpha_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

lin_cos_crab(t, duration, ansatz_params)[source]

Straight line plus cosine CRAB pulse ansatz.

\[f(t) = c_1 (t - T/2) + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right)\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(2N+1\) entries \((c_1, B_1, \beta_1, \dots, B_N, \beta_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

lin_sin_cos_crab(t, duration, ansatz_params)[source]

Straight line plus combined sine and cosine CRAB pulse ansatz.

\[\begin{split}f(t) = c_1 (t - T/2) + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right) \\ \quad + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right)\end{split}\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(4N+1\) entries \((c_1, A_1, \alpha_1, B_1, \beta_1, \dots, A_N, \alpha_N, B_N, \beta_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

lin_cos_sin_crab(t, duration, ansatz_params)[source]

Straight line plus combined cosine and sine CRAB pulse ansatz.

\[\begin{split}f(t) = c_1 (t - T/2) + \sum_{n=1}^N \beta_n \cos\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(B_n)\right) (t - T/2) \right) \\ \quad + \sum_{n=1}^N \alpha_n \sin\!\left( \frac{2\pi}{T}\, n\left(1 + \tfrac{1}{2}\tanh(A_n)\right) (t - T/2) \right)\end{split}\]
Parameters:
  • t (float | Array) – Time samples at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with \(4N+1\) entries \((c_1, B_1, \beta_1, A_1, \alpha_1, \dots, B_N, \beta_N, A_N, \alpha_N)\).

Returns:

Values of \(f(t)\).

Return type:

Array

Soft-Box Pulse Ansatz Functions

softbox_hann(t, duration, ansatz_params)[source]

Soft-box pulse ansatz with Hann-shaped edges, also known as Tukey window.

The Hann window on \(\xi \in [0, 1]\) is

\[w(\xi) = a_0 - a_1 \cos(2\pi \xi),\]

with \(a_0 = 0.5\), \(a_1 = 0.5\). The pulse ansatz \(f(t)\) uses the rising and falling halves of this window:

\[\begin{split}f(t) = \begin{cases} 0, & t < 0 \ \text{or}\ t > T, \\[4pt] A\,w\!\left(\dfrac{t}{\alpha T}\right), & 0 \le t < \alpha T / 2, \\[8pt] A, & \alpha T / 2 \le t \le T - \alpha T / 2, \\[8pt] A\,w\!\left( 1 - \dfrac{T - t}{\alpha T} \right), & T - \alpha T / 2 < t \le T. \end{cases}\end{split}\]
Parameters:
  • t (float | Array) – Time samples \(t\) at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with two entries \((A, \alpha)\).

Returns:

Values of \(f(t)\).

Return type:

Array

softbox_blackman(t, duration, ansatz_params)[source]

Soft-box pulse ansatz with Blackman-shaped edges.

The Blackman window on \(\xi \in [0, 1]\) is

\[w(\xi) = a_0 - a_1 \cos(2\pi \xi) + a_2 \cos(4\pi \xi),\]

with \(a_0 = 0.42\), \(a_1 = 0.5\), \(a_2 = 0.08\). The pulse ansatz \(f(t)\) uses the rising and falling halves of this window:

\[\begin{split}f(t) = \begin{cases} 0, & t < 0 \ \text{or}\ t > T, \\[4pt] A\,w\!\left(\dfrac{t}{\alpha T}\right), & 0 \le t < \alpha T / 2, \\[8pt] A, & \alpha T / 2 \le t \le T - \alpha T / 2, \\[8pt] A\,w\!\left( 1 - \dfrac{T - t}{\alpha T} \right), & T - \alpha T / 2 < t \le T. \end{cases}\end{split}\]
Parameters:
  • t (float | Array) – Time samples \(t\) at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with two entries \((A, \alpha)\).

Returns:

Values of \(f(t)\).

Return type:

Array

softbox_nuttall(t, duration, ansatz_params)[source]

Soft-box pulse ansatz with Nuttall-shaped edges.

The Nuttall window on \(\xi \in [0, 1]\) is

\[w(\xi) = a_0 - a_1 \cos(2\pi \xi) + a_2 \cos(4\pi \xi) - a_3 \cos(6\pi \xi),\]

with \(a_0 = 0.355768\), \(a_1 = 0.487396\), \(a_2 = 0.144232\), \(a_3 = 0.012604\). The pulse ansatz \(f(t)\) uses the rising and falling halves of this window:

\[\begin{split}f(t) = \begin{cases} 0, & t < 0 \ \text{or}\ t > T, \\[4pt] A\,w\!\left(\dfrac{t}{\alpha T}\right), & 0 \le t < \alpha T / 2, \\[8pt] A, & \alpha T / 2 \le t \le T - \alpha T / 2, \\[8pt] A\,w\!\left( 1 - \dfrac{T - t}{\alpha T} \right), & T - \alpha T / 2 < t \le T. \end{cases}\end{split}\]
Parameters:
  • t (float | Array) – Time samples \(t\) at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with two entries \((A, \alpha)\).

Returns:

Values of \(f(t)\).

Return type:

Array

softbox_planck(t, duration, ansatz_params)[source]

Planck-taper window.

The Planck-taper on \(\xi \in (0, 1)\) is

\[w(\xi) = \frac{1}{ \exp\!\left( \frac{1}{\xi} - \frac{1}{1 - \xi} \right) + 1 },\]

with \(w(0)=0\) and \(w(1)=1\) by continuity. The pulse ansatz \(f(t)\) uses a rising and a falling Planck taper:

\[\begin{split}f(t) = \begin{cases} 0, & t < 0 \ \text{or}\ t > T, \\[4pt] A\,w\!\left(\dfrac{t}{\alpha T/2}\right), & 0 \le t < \alpha T / 2, \\[8pt] A, & \alpha T / 2 \le t \le T - \alpha T / 2, \\[8pt] A\,w\!\left( \dfrac{T - t}{\alpha T/2} \right), & T - \alpha T / 2 < t \le T. \end{cases}\end{split}\]
Parameters:
  • t (float | Array) – Time samples \(t\) at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with two entries \((A, \alpha)\).

Returns:

Values of \(f(t)\).

Return type:

Array

softbox_fifth_order_smoothstep(t, duration, ansatz_params)[source]

Soft-box pulse ansatz with 5th-order-smoothstep-shaped edges.

The 5th-order smoothstep on \(\xi \in [0, 1]\) is

\[w(\xi) = 6\xi^5 - 15\xi^4 + 10\xi^3,\]

which interpolates smoothly from 0 to 1 with vanishing first and second derivatives at both endpoints. The pulse ansatz \(f(t)\) uses a rising and a falling smoothstep:

\[\begin{split}f(t) = \begin{cases} 0, & t < 0 \ \text{or}\ t > T, \\[4pt] A\,w\!\left(\dfrac{t}{\alpha T/2}\right), & 0 \le t < \alpha T / 2, \\[8pt] A, & \alpha T / 2 \le t \le T - \alpha T / 2, \\[8pt] A\,w\!\left( \dfrac{T - t}{\alpha T/2} \right), & T - \alpha T / 2 < t \le T. \end{cases}\end{split}\]
Parameters:
  • t (float | Array) – Time samples \(t\) at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with two entries \((A, \alpha)\).

Returns:

Values of \(f(t)\).

Return type:

Array

softbox_seventh_order_smoothstep(t, duration, ansatz_params)[source]

Soft-box pulse ansatz with 7th-order-smoothstep-shaped edges.

The 7th-order smoothstep \(S_3\) on \(\xi \in [0, 1]\) is

\[w(\xi) = -20\xi^7 + 70\xi^6 - 84\xi^5 + 35\xi^4,\]

which interpolates smoothly from 0 to 1 with vanishing derivatives up to third order at both endpoints. The pulse ansatz \(f(t)\) uses a rising and a falling smoothstep:

\[\begin{split}f(t) = \begin{cases} 0, & t < 0 \ \text{or}\ t > T, \\[4pt] A\,w\!\left(\dfrac{t}{\alpha T/2}\right), & 0 \le t < \alpha T / 2, \\[8pt] A, & \alpha T / 2 \le t \le T - \alpha T / 2, \\[8pt] A\,w\!\left( \dfrac{T - t}{\alpha T/2} \right), & T - \alpha T / 2 < t \le T. \end{cases}\end{split}\]
Parameters:
  • t (float | Array) – Time samples \(t\) at which \(f(t)\) is evaluated.

  • duration (float | Array) – Pulse duration \(T\).

  • ansatz_params (Array) – Array with two entries \((A, \alpha)\).

Returns:

Values of \(f(t)\).

Return type:

Array