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:
  • tp (float) – pulse length
  • BW (float) – pulse bandwidth
  • beta (float) – truncation factor
  • resolution (float) – pulse resolution
Returns:

tuple containing:

t (numpy.ndarray): Time axes

pulse (numpy.ndarray): Pulse shape

Return type:

tuple

chirp(tp, BW, resolution=1e-09)

Complex chirp pulse

\[e^{i 2 \pi (k/2) (t - t_p/2)^2}\]
Parameters:
  • tp (float) – Pulse length
  • BW (float) – Bandwidth of pulse
Returns:

tuple containing:

t (numpy.ndarray): Time axis

pulse (numpy.ndarray): Pulse shape

Return type:

tuple

gaussian_pulse(tp, sigmas, resolution=1e-09)

Gaussian pulse

\[e^{- \frac{1}{2} \left( \frac{t - t_p/2}{\sigma} \right)^2}\]
Parameters:
  • tp (float) – Pulse length
  • sigmas (float) – Number of standard deviations where pulse is truncated
Returns:

tuple containing:

t (numpy.ndarray): Time axis

pulse (numpy.ndarray): Pulse shape

Return type:

tuple

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:
  • tp (float) – Pulse length
  • f (float) – Frequency of plane wave
Returns:

tuple containing:

t (numpy.ndarray): Time axis

pulse (numpy.ndarray): Pulse shape

Return type:

tuple

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:
  • tp (float) – Pulse length
  • n (float) – Total sinc lobes, must be odd for full sinc

n is number of sinc lobes, should be odd for full sinc

Returns:tuple containing:
t (numpy.ndarray): Time axis

pulse (numpy.ndarray): Pulse shape

Return type:tuple
sq_pulse(tp, t_length=0.0, resolution=1e-09)

Square pulse

Parameters:
  • tp (float) – Pulse length
  • t_length (float) – Total length of time axis
Returns:

tuple containing:

t (numpy.ndarray): Time axis

pulse (numpy.ndarray): Pulse shape

Return type:

tuple

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:
  • tp (float) – Pulse length
  • N (float) – exponential
Returns:

tuple containing:

t (numpy.ndarray): Time axis

pulse (numpy.ndarray): Pulse shape

Return type:

tuple