WaveformConstructor#
This package helps on constructing the waveforms for the AWG.
Documentation: https://waveformconstructor.pages.dev/
Installation#
One can install the package via setuptools:
python setup.py install
To install the package in develop mode instead, use:
python setup.py develop
Usage#
Initialize default values#
It is recommended to change the default values to the parameters you used in the experiment before constructing any waveform.
The default values are stored in the dataclass WaveformConstructor.default.DefaultValues.
Example:
import WaveformConstructor
from scipy.constants import *
# Change the carrier frequency in the wavefrom construction to 200 MHz
WaveformConstructor.DefaultValues.carrier_freq = 200 * mega
One can also modify the default values before installation.
Examples#
Ramsey Spectroscopy#
import WaveformConstructor
from scipy.constants import *
import matplotlib.pyplot as plt
half_pi_time = 2.5 * micro # half pi time of the flopping.
amplitude = 1.0
frequency = WaveformConstructor.DefaultValues.carrier_freq + 1 * kilo # frequency of
phase = 0
ramsey_duration = 1 * 10 * micro # wait time of the Ramsey spectroscopy
waveform_series = WaveformConstructor.WaveformSeries(
[half_pi_time, ramsey_duration, half_pi_time],
[
WaveformConstructor.CarrierFlopping(amplitude, phase, frequency),
WaveformConstructor.Zero(),
WaveformConstructor.CarrierFlopping(amplitude, phase, frequency)
]
)
print("total time of the waveform:", waveform_series.total_time)
# Evaluate the waveform
t, v = waveform_series.waveform(sampling_rate=int(625 * mega))
# Visualize the waveform
plt.plot(t, v)
plt.xlabel("time")
plt.ylabel("voltage")
plt.show()