awg Module¶
The awg module contains functions for generating arbitrarily shaped pulses. The pulses can then be saved as a pulse shape file .shp which can be imported by Xepr software.
Functions¶
-
adiabatic(tp, BW, beta, resolution=1e-09)¶ Make Adiabatic Pulse Shape based on Hyperbolic Secant pulse
\[\text{sech} \left( \beta (t - \frac{t_p}{2}) \right) ^{1+i(\pi BW / \beta)}\]Parameters: Returns: tuple containing:
t (numpy.ndarray): Time axes
pulse (numpy.ndarray): Pulse shape
Return type:
-
chirp(tp, BW, resolution=1e-09)¶ Complex chirp pulse
\[e^{i 2 \pi (k/2) (t - t_p/2)^2}\]Parameters: Returns: tuple containing:
t (numpy.ndarray): Time axis
pulse (numpy.ndarray): Pulse shape
Return type:
-
gaussian_pulse(tp, sigmas, resolution=1e-09)¶ Gaussian pulse
\[e^{- \frac{1}{2} \left( \frac{t - t_p/2}{\sigma} \right)^2}\]Parameters: Returns: tuple containing:
t (numpy.ndarray): Time axis
pulse (numpy.ndarray): Pulse shape
Return type:
-
load_shape(filename)¶ Load a pulse shape from csv file
Parameters: filename (str) – Path to file Returns: Array of pulse shape Return type: numpy.ndarray
-
plane_wave(tp, f, resolution=1e-09)¶ Complex plane wave pulse shape
\[e^{i 2 \pi f \left( t - \frac{t_p}{2} \right) }\]Parameters: Returns: tuple containing:
t (numpy.ndarray): Time axis
pulse (numpy.ndarray): Pulse shape
Return type:
-
save_shape(pulse_shape, filename)¶ Save a numpy array as csv format compatible with Xepr
Parameters: - pulse_shape (numpy.ndarray) – Array of pulse shape
- filename (str) – Filename to save pulse shape
-
sinc(tp, n, resolution=1e-09)¶ Sinc pulse
\[ \begin{align}\begin{aligned}\frac{\sin \left( \frac{\pi}{2} (n + 1) x \right) }{x}\\x = \frac{t-\frac{t_p}{2}}{\frac{t_p}{2}}\end{aligned}\end{align} \]Parameters: n is number of sinc lobes, should be odd for full sinc
Returns: tuple containing: t (numpy.ndarray): Time axispulse (numpy.ndarray): Pulse shape
Return type: tuple
-
sq_pulse(tp, t_length=0.0, resolution=1e-09)¶ Square pulse
Parameters: Returns: tuple containing:
t (numpy.ndarray): Time axis
pulse (numpy.ndarray): Pulse shape
Return type:
-
wurst(tp, N, resolution=1e-09)¶ Real value WURST envelope pulse shape
\[1 - \text{abs} \left( \cos \left( \frac{\pi}{t_p} (t - \frac{t_p}{2}) + \frac{\pi}{2} \right) \right) ^N\]Parameters: Returns: tuple containing:
t (numpy.ndarray): Time axis
pulse (numpy.ndarray): Pulse shape
Return type: