-
Notifications
You must be signed in to change notification settings - Fork 10
Using_pulse_sequence
Beside outputting fixed frequency RF signal, the main functionality of the Pulser is to generate a pulse sequence to do experiment in atomic physics. Usually, experiment in atomic physics consists of a sequence of some switching of laser light by modulation of RF signal driving the AOMs and/or controlling mechanical shutters. The sequence is repeated many times to build-up enough statistics in the data acquired from the experiment. So in this tutorial, we will see how we can program pulse sequences to the Pulser.
We show here a simple example that allows us to program a pulse sequence to the system and run it. I show here a python script that does exactly that. We will then go through line-by-line later.
from labrad.units import WithUnit
from treedict import TreeDict
import labrad
cxn = labrad.connect()
p = cxn.pulser
p.new_sequence()
p.add_ttl_pulse('ttl_0', WithUnit(0, 'ms'), WithUnit(100, 'ms'))
p.add_ttl_pulse('ttl_0', WithUnit(200, 'ms'), WithUnit(100, 'ms'))
p.program_sequence()
p.start_number(1)
p.wait_sequence_done()
p.stop_sequence()First few lines are some standard packages importation. The first import line of code is
p.new_sequence()which defines a new sequence of the pulser.
Next we add to the pulse sequence a few TTL timing. The syntax is "channel_name, start_time and duration of the pulse." So
p.add_ttl_pulse('ttl_0', WithUnit(0, 'ms'), WithUnit(100, 'ms'))will add a 100 ms-long TTL pulse that starts at t = 0 ms for TTL channel named 'ttl_0'. The naming of the channel can be changed in the hardwareConfiguration.py file.
Once you have added as many TTL pulses as you want, we then "program" the pulse sequence to the FPGA. This is the step where actual data transfer happens between the computer and the FPGA. We do this by executing
p.program_sequence()Once the pulse sequence data is transferred to the FPGA, we can tell it to repeat the sequence as many times as we want. In this case, we only want to run the sequence once. So the number in the argument is '1'.
p.start_number(1)Some sequences will take quite some time to complete. During this time, it's best not to do anything to the Pulser system. So this command
p.wait_sequence_done()will wait until the pulse sequence is done (including the number of times we asked it to run). Then the last step is to 'shut down' by executing
p.stop_sequence()Using only TTL pulses in your experiment might not be as flexible enough, especially is your setup has a few acousto-optical modulators (AOMs). In this case, it makes more sense to just control the RF signal driving the AOMs directly.
To add DDS pulses into the pulse sequence, after you add the TTL pulses (but before the p.program_sequence() line), you have to define a list of DDS pulses like this:
DDS = [('DDS_0', start_time, duration, frequency, amplitude, phase, frequency_ramp_rate, amplitude_ramp_rate),
('DDS_1', start_time, duration, frequency, amplitude, phase, frequency_ramp_rate, amplitude_ramp_rate),
]Each argument is pretty self-explanatory. Make sure that they all have appropriate units. So, for example,
start_time = WithUnit(0.1,'ms')
duration = WithUnit(100.0, 'ms')
frequency = WithUnit(120.1, 'MHz')
amplitude = WithUnit(-20.0, 'dBm')
phase = WithUnit(0.0, 'deg')Now, for the frequency_ramp_rate and amplitude_ramp_rate arguments, the correct units are something like MHz/s or dBm/s. But due to some difficulty in implement these unit, we instead use units per ms instead. So
frequency_ramp_rate = WithUnit(0.3, 'MHz')will do a frequency ramp of the rate of 0.3 MHz per 1 millisecond. And
amplitude_ramp_rate = WithUnit(1.0, 'dBm')will ramp the amplitude (linear in dB scale) at the rate of 1.0 dBm per 1 millisecond.
One import thing to remember is that you have to make sure yourself that you finish ramping within the duration of your DDS pulse. We will look into more details about frequency and amplitude ramping later.
Once you have defined the list of the DDS pulse in the variable DDS, then we have to program to the pulse by doing
p.add_dds_pulses(DDS)and then we can do the normal p.program_sequence() as usual.