def transfer_to_triplet_mot(t,freq_ramp_duration,intensity_ramp_duration,hold_time,samplerate, add_marker=True): '''ramp the green mot frequency closer to resonance. The frequency ramp and intensity ramp are currently sequential, there is no offset.''' if add_marker: add_time_marker(t, "LS: Transfer to Triplet MOT", verbose=True) # ramp frequency from 'bicolor_mot_frequency_for_green' to 'mot_frequency_for_loading' t += FPGA_DDS9.ramp( t=t, duration=freq_ramp_duration, channel=int(0b0001), initial_value=('freq', bicolor_mot_frequency_for_green, 'MHz'), final_value=('freq', mot_frequency_for_loading, 'MHz'), number_of_steps=2000, description='end ramp' ) # # Add the PTS time markers for the green fpga trigger.(LEGACY CODE) # # record timestamps for when we shift frequencies of the green using the PTS # tPTS = t; #577ms in Excel Sequences # add_time_marker(tPTS, "PTS: 1st to 2nd") # tPTS += 240*ms; # add_time_marker(tPTS, "PTS: 2nd to 3rd") # tPTS += 20*ms; # add_time_marker(tPTS, "PTS: 3rd to 4th") #Ramp intensity for reducing atom scattering #ramp down green power so we don't blind the camera. t += green.mot.intensity.ramp(t, duration=intensity_ramp_duration, initial=0.3, final=0.12, samplerate=samplerate) #hold the conditions for a little while return freq_ramp_duration+intensity_ramp_duration+hold_time
def mloop_position_atoms_to_optical_lattice(t, duration,samplerate, add_marker=True): #move the MOT center again if add_marker: add_time_marker(t, "LS:ML: Move to Opt. Latt.", verbose=True) simple_mloop_ramp( parameter=x_bias_field, param_name='TRANSFER_x_bias_field', t=t, duration=duration, initial=1.3, final=5.29, samplerate=samplerate ) simple_mloop_ramp( parameter=y_bias_field, param_name='TRANSFER_y_bias_field', t=t, duration=duration, initial=-0.15, final=0.32, samplerate=samplerate ) simple_mloop_ramp( parameter=z_bias_field, param_name='TRANSFER_z_bias_field', t=t, duration=duration, initial=0, final=-0.795, samplerate=samplerate ) # x_bias_field.ramp(t, duration, initial=1.3, final=5.29, samplerate=samplerate) # y_bias_field.ramp(t, duration, initial=-0.15, final=0.32, samplerate=samplerate) # z_bias_field.ramp(t, duration, initial=0, final=-0.795, samplerate=samplerate) return duration
def mloop_load_from_oven_to_optical_lattice(t, add_marker=True, take_picture=True): ''' This is meta-subsequence. It holds all the calls for loading from the oven up until loading into the optical lattice.''' if not add_marker: add_time_marker(t, "Loading Sequence") ms = 1e-3 kHz = 1e3 t0 = t #load the atoms t += mloop_blue_mot(t, duration= blue_mot_duration, take_picture=take_picture, add_marker=add_marker) t += transfer_blue_mot_to_green_mot(t, duration= 40*ms, samplerate=1*kHz, add_marker=add_marker) t += transfer_to_triplet_mot(t, freq_ramp_duration= 80*ms, intensity_ramp_duration=40*ms, hold_time=0*ms, samplerate=1*kHz, add_marker=add_marker) t += mloop_lattice_loading(t, take_picture=take_picture, add_marker=add_marker) t += ramp_magnetic_fields_for_cavity_readout(t, add_marker=add_marker) t += ramp_down_mot(t, add_marker=add_marker) t += wait(200*ms + 140*ms) return t-t0
def position_atoms_to_optical_lattice(t, duration,samplerate, add_marker=True): #move the MOT center again if add_marker: add_time_marker(t, "LS: Move to Opt. Latt.", verbose=True) x_bias_field.ramp(t, duration, initial=1.3, final=5.29, samplerate=samplerate) y_bias_field.ramp(t, duration, initial=-0.15, final=0.32, samplerate=samplerate) z_bias_field.ramp(t, duration, initial=0, final=-0.795, samplerate=samplerate) return duration
def ramp_magnetic_fields_for_cavity_readout(t, add_marker = True): #ramp magnetic fields (for setting atoms on resonance with cavity) if add_marker: add_time_marker(t, "LS: Ramp Bias Fields.") ramp_duration = 30*ms z_bias_field.ramp(t, duration=ramp_duration, initial=-0.795,final=spin_b_field_z,samplerate=10*kHz) y_bias_field.ramp(t, duration=ramp_duration, initial=0.28,final=-1.86,samplerate=10*kHz) x_bias_field.ramp(t, duration=ramp_duration, initial=5.105,final=-0.02,samplerate=10*kHz) return ramp_duration
def transfer_blue_mot_to_green_mot(t,duration, samplerate,add_marker=True): '''Ramp down blue light while moving atoms to green MOT position.''' if add_marker: add_time_marker(t, "LS: Transfer Blue MOT", verbose=True) #ramp down blue blue.mot.intensity.ramp(t, duration, initial=0.3, final=0.05, samplerate=samplerate) #turn off the blue light at end of ramp blue.mot.intensity.turnoff(t+duration, warmup_value=0.28) #move magnetic field zero x_bias_field.ramp(t, duration, initial=-0.608, final=1.3, samplerate=samplerate) y_bias_field.ramp(t, duration, initial=1.374, final=-0.15, samplerate=samplerate) z_bias_field.ramp(t, duration, initial=2.2, final=0, samplerate=samplerate) return duration
def count_photons(self, t, label, duration, add_markers=False): ''' Opens the Shutter to the P7888 Photon Counter but doesn't actually scan the frequency of the green. Useful for counting photons transmitted through the cavity. ''' ms = 1e-3 us = 1e-6 t0 = t shutter_open_time = 5 * ms #make room in the dictionary if this label is used for the first time. self.scan_parameters.setdefault(label, []) #record the parameters in a dictionary inside a list that holds dictionarys. self.scan_parameters[label].append({ "t": t, "duration": duration, "initial_start_trigger": self.number_of_p7888_start_triggers }) #initial laser light management if add_markers: add_time_marker(t - shutter_open_time, f"Cavity Photon Count Prep: {label}") photon_counter_shutter.enable( t - shutter_open_time) #open photon counter shutter tloop = t #update scan time to be right when the photons start getting counted self.scan_parameters[label][-1]['t'] = t #run the photon counter while tloop < t + duration: tloop += self.pulse_p7888_start_trigger(tloop) t = tloop photon_counter_shutter.disable(t) #close photon counter shutter t += shutter_open_time self.save_parameters() #remove the shutter turn off time (shutter_open_time) in case we want to loop. #this will prevent unneccessary shutter pulses return t - t0
def ramp_down_mot(t, add_marker=True): t0 = t us = 1e-6 if add_marker: add_time_marker(t, "LS: Ramp MOT Field") #change green frequency and turn off mot light green.mot.turnoff(t,warmup_value=0.3) FPGA_DDS9.constant(t+10*us, channel=int(0b0001), value=('freq', green_laser_frequency, 'MHz'), description='working green frequency' ) #ramp down mot t+= mot_coil_current.ramp(t, duration=20*ms, initial=9.1, final=9.1*(8/8.5), samplerate= 10*kHz ) t+= mot_coil_current.ramp(t, duration=40*ms, initial=9.1*(8/8.5), final=9.1*(8/8.5)*0.8, samplerate=10*kHz ) t+= mot_coil_current.ramp(t, duration=50*ms, initial=9.1*(8/8.5)*0.8, final=9.1*(8/8.5)*0.8/4, samplerate=10*kHz ) t+= mot_coil_current.ramp(t, duration=35*ms, initial=9.1*(8/8.5)*0.8/4, final=0, samplerate=10*kHz ) return t-t0
def mloop_lattice_loading(t, take_picture,add_marker=True): t0 = t t += mloop_position_atoms_to_optical_lattice(t, duration= 40*ms, samplerate=1*kHz, add_marker=add_marker) #take a picture of the atoms if add_marker: add_time_marker(t, "LS: Green MOT Picture", verbose=True) if take_picture: isometric_cam.expose(t, name='green_mot', frametype='almost_loaded', trigger_duration=20*ms) t += hold_atoms(t, duration= 40*ms,add_marker=add_marker) if add_marker: add_time_marker(t, "LS: Last Stage Cooling") FPGA_DDS9.constant( t, channel=int(0b0001), value=('freq',lattice_loading_frequency,'MHz'), description='last stage cooling during loading' ) t += 60*ms #E.M. Add 60 ms load to see if it fixes loading issues return t - t0
def measure_and_prepare_atoms(t,add_marker = False): t0 = t if not add_marker: add_time_marker(t, "Measure & Pump Atoms") add_time_marker(t, "Read Unpol. Atom #") t += exp_cavity.scan(t, params={'unitary': RF.get_unitary()}, label='atoms_in_cavity') t+= wait(10*ms) add_time_marker(t, "Polarize Atoms") t += spin_polarize_atoms(t) RF.atom_unitary.prepare_atom_unitary(t) t+= wait(20*ms) #read atom number. t += exp_cavity.scan(t, params={'unitary': RF.get_unitary()}, label='atoms_in_cavity') #perform rabi pulse then cavity scan # t += RF.rabi_pulse( # t = t, # rabi_area = pi/2, # phase = 0, # duration = 2.29*ms, # samplerate = 100*kHz # ) t += wait(20*ms) return t-t0
def set_default_values(t=5e-6, add_marker=False): if add_marker: add_time_marker(t, "Set Default Values") #set up mot fields mot_coil_voltage.constant(t, value=8.5) mot_coil_current.constant(t, value=9.1) #set up bias fields x_bias_field.constant(t, value=-0.608) y_bias_field.constant(t, value=1.374) z_bias_field.constant(t, value=2.2) #set up red laser red_cavity_power.constant(t, red_trap_power_default) red_cavity_power_switch.enable(t) #set up blue laser blue_mot_shutter.enable(t) blue_mot_power.constant(t, value=0.28) #set up green laser #mot green_mot_shutter.enable(t) green_mot_power_switch.enable(t) green_mot_power.constant(t, value=0.3) #probe probe_power_switch.enable(t) probe_shutter.disable(t) #frequency green_frequency_fpga_trigger.disable(t) #cooling cooling_pi_power_switch.enable(t) cooling_pi_shutter.enable(t) cooling_pi_power.constant(t, value=10.0) #photon counter photon_counter_shutter.disable(t)
def scan(self, t, label, params={}, add_markers=False): ''' t - scan light across the cavity at time t. label - name of the cavity scan you are performing. params - add any extra parameters you wish to save in the HDF file. add_markers - adds time markers and the beginning of each scan. This function turns on the light for the experimental cavity `shutter_open_time` before the scan time `t`. The label will be used for analysis and grouping parameters together. The label should be identical if you are using it for the same purpose. This makes it easier for the analysis code to partition the shots. ''' ms = 1e-3 us = 1e-6 t0 = t shutter_open_time = 5 * ms #make room in the dictionary if this label is used for the first time. self.scan_parameters.setdefault(label, []) #calculate the parameters from globals duration = empty_cavity_sweep_duration * ms initial_f = empty_cavity_frequency_sweep_initial final_f = empty_cavity_frequency_sweep_initial + empty_cavity_frequency_sweep_range samplerate = empty_cavity_samples / (empty_cavity_sweep_duration * ms) parameters = { "t": t, "duration": duration, "initial_f": initial_f, "final_f": final_f, "samplerate": samplerate, "initial_start_trigger": self.number_of_p7888_start_triggers } for key, value in params.items(): if key in parameters: raise Exception( f"Error: Do not use the key '{key}'. It exists in the parameters to be saved already." ) else: parameters[key] = value #record the parameters in a dictionary inside a list that holds dictionarys. self.scan_parameters[label].append(parameters) #initial laser light management if add_markers: add_time_marker(t - shutter_open_time, f"Cavity Scan Prep: {label}") #set sideband frequency before turning on power green.probe.frequency.constant(t - shutter_open_time, value=initial_f, units='MHz') green.probe.intensity.constant(t, value=empty_cavity_scan_power) photon_counter_shutter.enable( t - shutter_open_time) #open photon counter shutter tloop = t #update scan time to be right when the frequency scans self.scan_parameters[label][-1]['t'] = t #tell labscript to perform the scan with the given parameters. t += green.probe.frequency.ramp(t, duration=duration, initial=initial_f, final=final_f, samplerate=samplerate, units="MHz") #run the photon counter while tloop < t: tloop += self.pulse_p7888_start_trigger(tloop) #turn off lights green.probe.turnoff(t, warmup_value=empty_cavity_scan_power) photon_counter_shutter.disable(t) #close photon counter shutter self.save_parameters() #remove the shutter turn off time (shutter_open_time) in case we want to loop. #this will prevent unneccessary shutter pulses return t - t0
def hold_atoms(t, duration,add_marker=True): if add_marker: add_time_marker(t, "LS:Hold Green MOT", verbose=True) return duration
) start() ai1.acquire('acq2', 0.5, 1.0) static_ao0.constant(3) static_ao1.constant(2) static_do0.go_high() static_do1.go_high() t = 0 ao0.constant(t, 3) t += 1 ai0.acquire('acq1', t, t+1) t += ao0.ramp(t, duration=1, initial=1, final=10, samplerate=5) # do1.go_high(t) add_time_marker(t, 'MOT_LOAD', color=(0,64,0)) t += 1 wait('test_wait', t) t += 1 stop(t) # import os # os.system('hdfview test.h5 > /dev/null')
# Create an AnalogOut child of the DummyIntermediateDevice AnalogOut(name='analog_out', parent_device=intermediate_device, connection='ao0') # Create a DigitalOut child of the DummyIntermediateDevice DigitalOut(name='digital_out', parent_device=intermediate_device, connection='port0/line0') # Begin issuing labscript primitives # A timing variable t is used for convenience # start() elicits the commencement of the shot t = 0 add_time_marker(t, "Start", verbose=True) start() # Wait for 1 second with all devices in their default state t += 1 # Change the state of digital_out, and denote this using a time marker add_time_marker(t, "Toggle digital_out (high)", verbose=True) digital_out.go_high(t) # Wait for 0.5 seconds t += 0.5 # Ramp analog_out from 0.0 V to 1.0 V over 0.25 s with a 1 kS/s sample rate t += analog_out.ramp(t=t, initial=0.0,
# t = t, # rabi_area = pi/2, # phase = 0, # duration = 2.29*ms, # samplerate = 100*kHz # ) t += wait(20*ms) return t-t0 t += measure_and_prepare_atoms(t) #cool atoms if COOLING: add_time_marker(t, "Begin Cooling") for cooling_duration in cooling_duration_loop: if use_cooling_pi: green.cooling_pi.intensity.constant(t, value=cooling_pi_intensity) # green_cooling_pi_monitor.acquire(label='green_cooling_pi_monitor_0', start_time=t,end_time=t+cooling_duration) if use_cooling_sigma: green.cooling_sigma.intensity.constant(t,value=cooling_sigma_intensity) green.cooling_sigma.frequency.constant(t,value=cooling_sigma_frequency, units='kHz') if use_cooling_pump: green.pump.intensity.constant(t,value=cooling_pump_intensity) exp_cavity.count_photons(t, label='cooling_pump_photons', duration=cooling_duration) t += wait(cooling_duration) green.cooling_pi.turnoff(t, warmup_value=10) green.cooling_sigma.turnoff(t, warmup_value=2.5) green.pump.turnoff(t,warmup_value=10) t += wait(101*ms)
from labscript import start, stop, add_time_marker from labscriptlib.ybclock.connection_table import define_connection_table from labscriptlib.ybclock.classes import * if __name__ == '__main__': define_connection_table() define_classes() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() t = 0 t += 1 add_time_marker(t, label='Turn On') blue.mot.intensity.turnon(t, value=3) t += 1 add_time_marker(t, label='Turn Off') blue.mot.intensity.turnoff(t, warmup_value=1) t += 1 add_time_marker(t, label='Ramp') blue.mot.intensity.ramp(t=t, duration=0.5, initial=1, final=2, samplerate=1e3)
def blue_mot(t,duration,add_marker=True,take_picture=False): ''' # Blue MOT Loading Sequence It's very simple simple turn on all the lights and magnetic fields, and let the atoms trap. The Blue MOT is assisted by Green Molasses (Doppler Cooling). ''' #turn on the blue mot us = 1e-6 ms = 1e-3 if add_marker: add_time_marker(t, "LS: Blue MOT", verbose=True) #set bicolor mot frequency for green # set trigger time of FPGA_DDS9 FPGA_DDS9.triggerSet(10*us) green_frequency_fpga_trigger.enable(10*us) # set initial value of the DDS FPGA_DDS9.constant( t=t, channel=int(0b0001), value = ('freq',int(bicolor_mot_frequency_for_green*1000),'kHz'), description='initial value' ) FPGA_DDS9.constant( t=t+10*us, channel=int(0b0001), value=('ampl', 0.5, '1'), description='initial value' ) #turn off extra light sources that can interrupt loading green.cooling_pi.turnoff(t,warmup_value=10) #set voltage limit on mot mot_coil_voltage.constant(t,value=8.5) #set magnetic fields mot_coil_current.constant(t, value=9.1) x_bias_field.constant(t, value=-0.608) y_bias_field.constant(t, value=1.374) z_bias_field.constant(t, value=2.2) #set light power blue.mot.intensity.constant(t, value=0.3) green.mot.intensity.constant(t, value=0.3) #why? Two Color Mot thats why. #the green light serves as extra doppler cooling. if take_picture: ms = 1e-3 trigger_duration = 20*ms #take background picture wide_angle_cam.expose(t, name ='blue_mot', frametype ='bg', trigger_duration =trigger_duration ) # take picture with atoms wide_angle_cam.expose(t+duration-trigger_duration, name ='blue_mot', frametype ='atoms', trigger_duration =trigger_duration ) return duration
D2_Repump_DO.go_low(t) D2_Cooling_DO.go_low(t) D2_Repump_Sh.go_high(t) D2_Cooling_Sh.go_high(t) t += 10e-3 D2_Repump_DO.go_high(t) D2_Cooling_DO.go_high(t) t += 10e-3 # # Snap a dark frame # ls.add_time_marker(t, "Snap dark frame", verbose=True) ScopeTrigger.go_high(t) ScopeTrigger.go_low(t + 1 * ms) MOT_x.expose(t, 'fluorescence', frametype='dark', trigger_duration=MOT_Fl_Exposure) t += 10 * ms t += PrepMOT(t, MOT_y_Bias_Prep=MOT_y_Bias_MOT, MOT_x_z_Bias_Prep=MOT_x_z_Bias_MOT, MOT_x_mz_Bias_Prep=MOT_x_mz_Bias_MOT, MOT_Quad_Prep=MOT_Quad_MOT, D2_Lock_Freq_Prep=D2_Lock_Freq_MOT, D2_Repump_Default_Shift_Prep=D2_Repump_Default_Shift)
# We then initiate an IMAQdxCamera using this RemoteBLACS instance # using mock=True to bypass any attempts to commmunicate with an # actual camera, and generate fake data at the end of the shot IMAQdxCamera( name='camera', parent_device=camera_trigger, connection='trigger', serial_number=0xDEADBEEF, worker=test_remote, mock=True, ) # Begin issuing labscript primitives # A timing variable t is used for convenience # start() elicits the commencement of the shot t = 0 add_time_marker(t, "Start", verbose=True) start() t += 1 add_time_marker(t, "Exposure: 'before' image", verbose=True) camera.expose(t, name='comparison', frametype='before', trigger_duration=0.2) t += 0.5 add_time_marker(t, "Exposure: 'after' image", verbose=True) camera.expose(t, name='comparison', frametype='after', trigger_duration=0.2) t += 0.5 stop(t)
start() set_start_values() t = 10.1 * ms t += load_from_oven_to_optical_lattice(t, add_marker=False) t += ramp_magnetic_fields_for_cavity_readout(t) t += ramp_down_mot(t) t += wait(200 * ms + 140 * ms) #read unpolarized atom number. add_time_marker(t, "Read Unpolarized Atom Number") t += exp_cavity.scan(t, params={'unitary': RF.get_unitary()}, label='atoms_in_cavity') t += wait(10 * ms) add_time_marker(t, "Polarize Atoms") t += spin_polarize_atoms(t) RF.atom_unitary.prepare_atom_unitary(t) t += wait(20 * ms) #read atom number. t += exp_cavity.scan(t,