from sqdtoolz.Experiment import Experiment from sqdtoolz.HAL.DDG import * from sqdtoolz.HAL.ACQ import * from sqdtoolz.TimingConfiguration import * new_exp = Experiment(instr_config_file="tests\\BenchTest.yaml", save_dir="", name="test") #Can be done in YAML # instr_ddg = DDG_DG645('ddg_real') # new_exp.add_instrument(instr_ddg) #Ideally, the length and polarity are set to default values in the drivers via the YAML file - i.e. just set TrigPulseDelay ddg_module = DDG(new_exp._station.load_pulser()) ddg_module.get_trigger_output('AB').TrigPulseLength = 50e-9 ddg_module.get_trigger_output('AB').TrigPolarity = 1 ddg_module.get_trigger_output('AB').TrigPulseDelay = 10e-9 ddg_module.get_trigger_output('CD').TrigPulseLength = 100e-9 ddg_module.get_trigger_output('CD').TrigPulseDelay = 50e-9 ddg_module.get_trigger_output('CD').TrigPolarity = 1 ddg_module.get_trigger_output('EF').TrigPulseLength = 400e-9 ddg_module.get_trigger_output('EF').TrigPulseDelay = 250e-9 ddg_module.get_trigger_output('EF').TrigPolarity = 0 acq_module = ACQ(new_exp._station.load_fpgaACQ()) acq_module.NumSamples = 50 acq_module.NumSegments = 1 # acq_module.SampleRate = 1e9 # acq_module.TriggerEdge = 0 acq_module.set_trigger_source(ddg_module, 'AB')
save_dir="mySaves\\") #Note the following: # - Using a 1.25GHz clock source to split and driven into the EXT CLK IN inputs of both Agilent AWGs # - SYNC CLK OUT on Master goes into SYNC CLK IN on Slave # - Using M4 on master to trigger the slave AWG via Trigger 4 (could simply do this by just routing the clock lines to both AWGs...) # - The DDG output triggers the first master AWG # - Also using an external 10MHz reference on the AWG... #Sample Clock freq_module = GENmwSource(new_lab._station.load_SGS100A().get_output('RFOUT')) freq_module.Output = True #Ideally, the length and polarity are set to default values in the drivers via the YAML file - i.e. just set TrigPulseDelay instr_ddg = new_lab._station.load_pulser() ddg_module = DDG(instr_ddg) ddg_module.get_trigger_output('AB').TrigPulseLength = 500e-9 ddg_module.get_trigger_output('AB').TrigPolarity = 1 ddg_module.get_trigger_output('AB').TrigPulseDelay = 0e-9 instr_ddg.trigger_rate(100e3) mod_freq_qubit = WM_SinusoidalIQ("QubitFreqMod", 100e6) instr_Agi1 = new_lab._station.load_Agi1() awg_wfm_q = WaveformAWG("Waveform 1", [(instr_Agi1, 'ch1'), (instr_Agi1, 'ch2')], 1.25e9) awg_wfm_q.add_waveform_segment( WFS_Gaussian("init", mod_freq_qubit, 512e-9, 0.5)) awg_wfm_q.add_waveform_segment(WFS_Constant("zero1", None, 512e-9, 0.25)) awg_wfm_q.add_waveform_segment( WFS_Gaussian("init2", mod_freq_qubit, 512e-9, 0.5))
from sqdtoolz.Experiments.Experimental.ExperimentRabi import ExperimentRabi import numpy as np new_lab = Laboratory(instr_config_file="", save_dir="mySaves\\") #Can be done in YAML instr_ddg = DummyDDG('ddg') new_lab.add_instrument(instr_ddg) instr_acq = DummyACQ('acq') new_lab.add_instrument(instr_acq) instr_awg = DummyAWG('awg_test_instr') new_lab.add_instrument(instr_awg) instr_fsrc = DummyGENmwSrc('freq_src_instr') new_lab.add_instrument(instr_fsrc) ddg_module = DDG('DDG', new_lab, 'ddg') awg_wfm_q = WaveformAWG("Waveform 2", new_lab, [('awg_test_instr', 'CH3'), ('awg_test_instr', 'CH4')], 1e9) acq_module = ACQ('ACQ', new_lab, 'acq') freq_src_module = GENmwSource('MWS', new_lab, 'freq_src_instr', 'CH1') mod_freq_qubit = WM_SinusoidalIQ("QubitFreqMod", 100e6) # #Setup Parameters # param_cav_freq = new_lab.add_variable_property('Cavity Frequency', freq_src_module, 'Frequency') param_rab_freq = new_lab.add_variable('Rabi Frequency')
from sqdtoolz.Variable import * from sqdtoolz.Experiments.Experimental.ExperimentCavitySpectroscopy import * new_lab = Laboratory(instr_config_file="", save_dir="mySaves\\") #Can be done in YAML instr_ddg = DummyDDG('ddg') new_lab.add_instrument(instr_ddg) instr_acq = DummyACQ('acq') new_lab.add_instrument(instr_acq) instr_awg = DummyAWG('awg_test_instr') new_lab.add_instrument(instr_awg) instr_fsrc = DummyGENmwSrc('freq_src_instr') new_lab.add_instrument(instr_fsrc) ddg_module = DDG(instr_ddg) awg_wfm_q = WaveformAWG("Waveform 2 CH", [(instr_awg, 'CH3'), (instr_awg, 'CH4')], 1e9) acq_module = ACQ(instr_acq) freq_src_module = GENmwSource(instr_fsrc.get_output('CH1')) param_cav_freq = new_lab.add_variable_property('Cavity Frequency', freq_src_module, 'Frequency') #Setup the trigger and instrument relations ddg_module.set_trigger_output_params('A', 0.0, 50e-9) acq_module.set_trigger_source(awg_wfm_q.get_output_channel(0).marker(0)) awg_wfm_q.set_trigger_source_all(ddg_module.get_trigger_output('A')) acq_module.SampleRate = 1e9 acq_module.NumSamples = 100 #Cement the parameters into the experiment configuration
from sqdtoolz.Drivers.dummyAWG import * from sqdtoolz.ExperimentConfiguration import * from sqdtoolz.Variable import * new_lab = Laboratory(instr_config_file="", save_dir="mySaves\\") #Can be done in YAML instr_ddg = DummyDDG('ddg') new_lab.add_instrument(instr_ddg) instr_acq = DummyACQ('acq') new_lab.add_instrument(instr_acq) instr_awg = DummyAWG('awg_test_instr') new_lab.add_instrument(instr_awg) #Ideally, the length and polarity are set to default values in the drivers via the YAML file - i.e. just set TrigPulseDelay ddg_module = DDG(instr_ddg) ddg_module.set_trigger_output_params('A', 50e-9) ddg_module.get_trigger_output('B').TrigPulseLength = 100e-9 ddg_module.get_trigger_output('B').TrigPulseDelay = 50e-9 ddg_module.get_trigger_output('B').TrigPolarity = 1 ddg_module.get_trigger_output('C').TrigPulseLength = 400e-9 ddg_module.get_trigger_output('C').TrigPulseDelay = 250e-9 ddg_module.get_trigger_output('C').TrigPolarity = 0 temp_config = ddg_module._get_current_config() ddg_module.get_trigger_output('C').TrigPolarity = 1 ddg_module._set_current_config(temp_config, instr_ddg) acq_module = ACQ(instr_acq) acq_module.NumSamples = 50 acq_module.SampleRate = 1e9
import numpy as np import time new_lab = Laboratory('UnitTests\\UTestExperimentConfiguration.yaml', 'test_save_dir/') new_lab.load_instrument('virACQ') new_lab.load_instrument('virDDG') new_lab.load_instrument('virAWG') new_lab.load_instrument('virMWS') #Initialise test-modules hal_acq = ACQ("dum_acq", new_lab, 'virACQ') hal_ddg = DDG( "ddg", new_lab, 'virDDG', ) awg_wfm = WaveformAWG("Wfm1", new_lab, [('virAWG', 'CH1'), ('virAWG', 'CH2')], 1e9) awg_wfm2 = WaveformAWG("Wfm2", new_lab, [('virAWG', 'CH3'), ('virAWG', 'CH4')], 1e9) hal_mw = GENmwSource("MW-Src", new_lab, 'virMWS', 'CH1') ExperimentConfiguration('testConf', new_lab, 1.0, ['ddg'], 'dum_acq') # VariableInternal('myFreq', new_lab) VariableInternal('testAmpl', new_lab) new_lab.group_open("test_group") for m in range(3, 6):
from sqdtoolz.Experiment import Experiment from sqdtoolz.HAL.DDG import* from sqdtoolz.HAL.GENmwSource import* from sqdtoolz.ExperimentConfiguration import* from sqdtoolz.Laboratory import* new_lab = Laboratory(instr_config_file = "tests\\WFSynthHDProV2_Test.yaml", save_dir = "mySaves\\") #Ideally, the length and polarity are set to default values in the drivers via the YAML file - i.e. just set TrigPulseDelay ddg_module = DDG(new_lab._station.load_pulser()) ddg_module.get_trigger_output('AB').TrigPulseLength = 500e-9 ddg_module.get_trigger_output('AB').TrigPolarity = 1 ddg_module.get_trigger_output('AB').TrigPulseDelay = 10e-9 new_lab._station.load_pulser().trigger_rate(500e3) instr_freq = new_lab._station.load_MWS_Windfreak() freq_module = GENmwSource(instr_freq.get_output('RFoutA')) freq_module2 = GENmwSource(instr_freq.get_output('RFoutB')) freq_module.Power = 0 freq_module.Output = True freq_module.Frequency = 4e9 freq_module.Mode = 'Continuous' freq_module2.Power = 0 freq_module2.Output = True freq_module2.Frequency = 7e9 freq_module2.Mode = 'Continuous' input('press <ENTER> to continue')
#Note the following: # - Using a 1.25GHz clock source to split and driven into the EXT CLK IN inputs of both Agilent AWGs # - SYNC CLK OUT on Master goes into SYNC CLK IN on Slave # - Using M4 on master to trigger the slave AWG via Trigger 4 (could simply do this by just routing the clock lines to both AWGs...) # - The DDG output triggers the first master AWG # - Also using an external 10MHz reference on the AWG... #Sample Clock new_lab.load_instrument('SGS100A') freq_module = GENmwSource('MW_sample_clock', new_lab, 'SGS100A', 'RFOUT') freq_module.Output = True #Ideally, the length and polarity are set to default values in the drivers via the YAML file - i.e. just set TrigPulseDelay new_lab.load_instrument('pulser') ddg_module = DDG('ddg', new_lab, 'pulser') ddg_module.get_trigger_output('AB').TrigPulseLength = 500e-9 ddg_module.get_trigger_output('AB').TrigPolarity = 1 ddg_module.get_trigger_output('AB').TrigPulseDelay = 0e-9 ddg_module.RepetitionTime = 2.5e-6 mod_freq_qubit = WFMT_ModulationIQ("QubitFreqMod", new_lab, 100e6) new_lab.load_instrument('Agi1') awg_wfm_q = WaveformAWG("Waveform 1", new_lab, [('Agi1', 'ch1'), ('Agi1', 'ch2')], 1.25e9) awg_wfm_q.add_waveform_segment(WFS_Constant("SEQ", None, 512e-9, 0.0)) awg_wfm_q.add_waveform_segment( WFS_Constant("init", mod_freq_qubit.apply(), 512e-9, 0.5)) awg_wfm_q.add_waveform_segment(WFS_Constant("zero1", None, 512e-9, 0.25)) awg_wfm_q.add_waveform_segment(
save_dir="mySaves\\") #Note the following: # - Using a 1.25GHz clock source to split and driven into the EXT CLK IN inputs of both Agilent AWGs # - SYNC CLK OUT on Master goes into SYNC CLK IN on Slave # - Using M4 on master to trigger the slave AWG via Trigger 4 (could simply do this by just routing the clock lines to both AWGs...) # - The DDG output triggers the first master AWG # - Also using an external 10MHz reference on the AWG... #Sample Clock # freq_module = GENmwSource(new_lab._station.load_SGS100A().get_output('RFOUT')) # freq_module.Output = True #Ideally, the length and polarity are set to default values in the drivers via the YAML file - i.e. just set TrigPulseDelay instr_ddg = new_lab.load_instrument('pulser') DDG("DDG", new_lab, 'pulser') new_lab.HAL('DDG').get_trigger_output('AB').TrigPulseLength = 750e-9 new_lab.HAL('DDG').get_trigger_output('AB').TrigPolarity = 1 new_lab.HAL('DDG').get_trigger_output('AB').TrigPulseDelay = 0e-9 new_lab.HAL('DDG').RepetitionTime = 1 / 100e3 WFMT_ModulationIQ('QubitFreqMod', new_lab, 100e6) instr_Agi1 = new_lab.load_instrument('Agi1') awg_wfm_q = WaveformAWG("Waveform 1", new_lab, [('Agi1', 'ch1'), ('Agi1', 'ch2')], 1.25e9) read_segs = [] awg_wfm_q.add_waveform_segment(WFS_Constant("SEQPAD", None, 102.4e-9, 0.0)) for m in range(3): awg_wfm_q.add_waveform_segment( WFS_Gaussian(f"init{m}",