-
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: