def make5014pulsar(awg): pulsar = ps.Pulsar() pulsar.AWG = awg #set max volatage of the markers. marker1highs = [2, 2, 2, 2] marker2highs = [2, 2, 2, 2] #init the 4 channels of the AWG. for i in range(4): # Note that these are default parameters and should be kept so. # the channel offset is set in the AWG itself. For now the amplitude is # hardcoded. You can set it by hand but this will make the value in the # sequencer different. pulsar.define_channel(id='ch{}'.format(i + 1), name='ch{}'.format(i + 1), type='analog', high=1, low=-1, offset=0.0, delay=0, active=True) pulsar.define_channel(id='ch{}_marker1'.format(i + 1), name='ch{}_marker1'.format(i + 1), type='marker', high=marker1highs[i], low=0, offset=0., delay=0, active=True) pulsar.define_channel(id='ch{}_marker2'.format(i + 1), name='ch{}_marker2'.format(i + 1), type='marker', high=marker2highs[i], low=0, offset=0., delay=0, active=True) pulsar.AWG_sequence_cfg = { 'SAMPLING_RATE': 1e9, 'CLOCK_SOURCE': 1, # Internal | External 'REFERENCE_SOURCE': 1, # Internal | External 'EXTERNAL_REFERENCE_TYPE': 1, # Fixed | Variable 'REFERENCE_CLOCK_FREQUENCY_SELECTION': 1, # 10 MHz | 20 MHz | 100 MHz 'TRIGGER_SOURCE': 1, # External | Internal 'TRIGGER_INPUT_IMPEDANCE': 1, # 50 ohm | 1 kohm 'TRIGGER_INPUT_SLOPE': 1, # Positive | Negative 'TRIGGER_INPUT_POLARITY': 1, # Positive | Negative 'TRIGGER_INPUT_THRESHOLD': 0.6, # V 'EVENT_INPUT_IMPEDANCE': 2, # 50 ohm | 1 kohm 'EVENT_INPUT_POLARITY': 1, # Positive | Negative 'EVENT_INPUT_THRESHOLD': 1.4, # V 'JUMP_TIMING': 1, # Sync | Async 'RUN_MODE': 4, # Continuous | Triggered | Gated | Sequence 'RUN_STATE': 0, # On | Off } return pulsar
def test_with_single_AWG(self): self.station = qc.Station() self.station.sequencer_config = default_sequencer_config.copy() sqs.station = self.station self.AWG = VirtualAWG5014("AWG") #self.AWG = tek.Tektronix_AWG5014( # name='AWG', timeout=20, # address='TCPIP0::192.168.1.15::inst0::INSTR', server_name=None) self.station.add_component(self.AWG) self.station.pulsar = ps.Pulsar('Pulsar1', default_AWG=self.AWG.name) for i in range(4): self.station.pulsar.define_channel(id='ch{}'.format(i + 1), name='ch{}'.format(i + 1)) self.station.pulsar.define_channel(id='ch{}_m1'.format(i + 1), name='ch{}_marker1'.format(i + 1)) self.station.pulsar.define_channel(id='ch{}_m2'.format(i + 1), name='ch{}_marker2'.format(i + 1)) self.station.pulsar.set('ch{}_amp'.format(i + 1), 1.0) self.station.pulsar.set('ch{}_marker1_amp'.format(i + 1), 2.0) self.station.pulsar.set('ch{}_marker2_amp'.format(i + 1), 2.0) self.pulse_pars = default_pulse_pars.copy() self.RO_pars = default_RO_pars.copy() sqs.Rabi_seq([0.3, 0.6], self.pulse_pars, self.RO_pars) pwfs = self.AWG.file['p_wfs'] self.assertGreater(2, abs(max(pwfs['2-pulse-elt_0_ch1']) - 10286)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_0_ch1']) - 6384)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_0_ch2']) - 10211)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_0_ch2']) - 6171)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_0_ch3']) - 24575)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_0_ch3']) - 8191)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_0_ch4']) - 40959)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_0_ch4']) - 8191)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_1_ch1']) - 12382)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_1_ch1']) - 4578)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_1_ch2']) - 12231)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_1_ch2']) - 4151)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_1_ch3']) - 24575)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_1_ch3']) - 8191)) self.assertGreater(2, abs(max(pwfs['2-pulse-elt_1_ch4']) - 40959)) self.assertGreater(2, abs(min(pwfs['2-pulse-elt_1_ch4']) - 8191))
def init_ttrace(station, awgclock=10e6): pulsar_objects = [] set_awg_trace(station.awg, awgclock) for ii, a in enumerate(station.awg._awgs): print('init_ttrace: creating Pulsar %d: awg name %s' % (ii, a.name)) a.clock_freq.set(awgclock) p = ps.Pulsar(name=qtt.measurements.scans.instrumentName('Pulsar%d' % ii), default_AWG=a.name) define_awg5014_channels(p, marker1highs=2.6) _ = p.clock(list(p.channels.keys())[0]) p._clock_prequeried(True) # if not set the interface is _very_ slow setattr(station, 'pulsar%d' % ii, p) pulsar_objects += [p] return pulsar_objects
def test_with_multiple_AWGs(self): self.station = qc.Station() sqs.station = self.station self.station.sequencer_config = default_sequencer_config.copy() self.AWG1 = VirtualAWG5014("AWG1") self.AWG2 = VirtualAWG5014("AWG2") self.station.add_component(self.AWG1) self.station.add_component(self.AWG2) self.station.pulsar = ps.Pulsar('Pulsar2') for i in range(1, 3): for j in range(1, 5): self.station.pulsar.define_channel(id='ch{}'.format(j), name='AWG{}_ch{}'.format( i, j), AWG='AWG{}'.format(i)) self.station.pulsar.define_channel( id='ch{}_m1'.format(j), name='AWG{}_ch{}_marker1'.format(i, j), AWG='AWG{}'.format(i)) self.station.pulsar.define_channel( id='ch{}_m2'.format(j), name='AWG{}_ch{}_marker2'.format(i, j), AWG='AWG{}'.format(i)) self.station.pulsar.set('AWG{}_ch{}_amp'.format(i, j), 1.0) self.station.pulsar.set('AWG{}_ch{}_marker1_amp'.format(i, j), 2.0) self.station.pulsar.set('AWG{}_ch{}_marker2_amp'.format(i, j), 2.0) self.pulse_pars = default_pulse_pars.copy() self.RO_pars = default_RO_pars.copy() self.pulse_pars['I_channel'] = 'AWG1_ch1' self.pulse_pars['Q_channel'] = 'AWG2_ch2' self.RO_pars['RO_pulse_marker_channel'] = 'AWG1_ch3_marker1' self.RO_pars['acq_marker_channel'] = 'AWG2_ch4_marker2' sqs.Rabi_seq([0.3, 0.6], self.pulse_pars, self.RO_pars) pwfs1 = self.AWG1.file['p_wfs'] self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_0_ch1']) - 10286)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_0_ch1']) - 6384)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_0_ch2']) - 8191)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_0_ch2']) - 8191)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_0_ch3']) - 24575)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_0_ch3']) - 8191)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_0_ch4']) - 8191)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_0_ch4']) - 8191)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_1_ch1']) - 12382)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_1_ch1']) - 4578)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_1_ch2']) - 8191)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_1_ch2']) - 8191)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_1_ch3']) - 24575)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_1_ch3']) - 8191)) self.assertGreater(2, abs(max(pwfs1['2-pulse-elt_1_ch4']) - 8191)) self.assertGreater(2, abs(min(pwfs1['2-pulse-elt_1_ch4']) - 8191)) pwfs2 = self.AWG2.file['p_wfs'] self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_0_ch1']) - 8191)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_0_ch1']) - 8191)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_0_ch2']) - 10211)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_0_ch2']) - 6171)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_0_ch3']) - 8191)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_0_ch3']) - 8191)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_0_ch4']) - 40959)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_0_ch4']) - 8191)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_1_ch1']) - 8191)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_1_ch1']) - 8191)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_1_ch2']) - 12231)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_1_ch2']) - 4151)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_1_ch3']) - 8191)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_1_ch3']) - 8191)) self.assertGreater(2, abs(max(pwfs2['2-pulse-elt_1_ch4']) - 40959)) self.assertGreater(2, abs(min(pwfs2['2-pulse-elt_1_ch4']) - 8191))
server_name=None) station.add_component(HS) # VNA # VNA = ZNB20.ZNB20(name='VNA', address='TCPIP0::192.168.0.55', server_name=None) # # station.add_component(VNA) MC = mc.MeasurementControl('MC') MC.station = station station.MC = MC station.add_component(MC) # The AWG sequencer station.pulsar = ps.Pulsar() station.pulsar.AWG = station.components['AWG'] for i in range(2): # Note that these are default parameters and should be kept so. # the channel offset is set in the AWG itself. For now the amplitude is # hardcoded. You can set it by hand but this will make the value in the # sequencer different. station.pulsar.define_channel(id='ch{}'.format(i+1), name='ch{}'.format(i+1), type='analog', # max safe IQ voltage high=1., low=-1., offset=0.0, delay=0, active=True) station.pulsar.define_channel(id='ch{}_marker1'.format(i+1), name='ch{}_marker1'.format(i+1), type='marker', high=2.0, low=0, offset=0.,
def test_with_single_AWG(self): self.station = qc.Station() self.station.sequencer_config = default_sequencer_config.copy() sqs.station = self.station self.AWG = VirtualAWG5014("AWG") #self.AWG = tek.Tektronix_AWG5014( # name='AWG', timeout=20, # address='TCPIP0::192.168.1.15::inst0::INSTR', server_name=None) self.station.add_component(self.AWG) self.station.pulsar = ps.Pulsar('Pulsar1', default_AWG=self.AWG.name) for i in range(4): self.station.pulsar.define_channel(id='ch{}'.format(i + 1), name='ch{}'.format(i + 1), type='analog', high=1., low=-1., offset=0.0, delay=0, active=True) self.station.pulsar.define_channel(id='ch{}_marker1'.format(i + 1), name='ch{}_marker1'.format(i + 1), type='marker', high=2, low=0, offset=0., delay=0, active=True) self.station.pulsar.define_channel(id='ch{}_marker2'.format(i + 1), name='ch{}_marker2'.format(i + 1), type='marker', high=2, low=0, offset=0., delay=0, active=True) self.pulse_pars = default_pulse_pars.copy() self.RO_pars = default_RO_pars.copy() sqs.Rabi_seq([0.3, 0.6], self.pulse_pars, self.RO_pars) pwfs = self.AWG.file['p_wfs'] self.assertEqual(max(pwfs['2-pulse-elt_0_ch1']), 10286) self.assertEqual(min(pwfs['2-pulse-elt_0_ch1']), 6384) self.assertEqual(max(pwfs['2-pulse-elt_0_ch2']), 10211) self.assertEqual(min(pwfs['2-pulse-elt_0_ch2']), 6171) self.assertEqual(max(pwfs['2-pulse-elt_0_ch3']), 24575) self.assertEqual(min(pwfs['2-pulse-elt_0_ch3']), 8191) self.assertEqual(max(pwfs['2-pulse-elt_0_ch4']), 40959) self.assertEqual(min(pwfs['2-pulse-elt_0_ch4']), 8191) self.assertEqual(max(pwfs['2-pulse-elt_1_ch1']), 12382) self.assertEqual(min(pwfs['2-pulse-elt_1_ch1']), 4578) self.assertEqual(max(pwfs['2-pulse-elt_1_ch2']), 12231) self.assertEqual(min(pwfs['2-pulse-elt_1_ch2']), 4151) self.assertEqual(max(pwfs['2-pulse-elt_1_ch3']), 24575) self.assertEqual(min(pwfs['2-pulse-elt_1_ch3']), 8191) self.assertEqual(max(pwfs['2-pulse-elt_1_ch4']), 40959) self.assertEqual(min(pwfs['2-pulse-elt_1_ch4']), 8191)
def test_with_multiple_AWGs(self): self.station = qc.Station() sqs.station = self.station self.station.sequencer_config = default_sequencer_config.copy() self.AWG1 = VirtualAWG5014("AWG1") self.AWG2 = VirtualAWG5014("AWG2") self.station.add_component(self.AWG1) self.station.add_component(self.AWG2) self.station.pulsar = ps.Pulsar('Pulsar2') for i in range(1, 3): for j in range(1, 5): self.station.pulsar.define_channel(id='ch{}'.format(j), name='AWG{} ch{}'.format( i, j), type='analog', high=1., low=-1., offset=0.0, delay=0, active=True, AWG='AWG{}'.format(i)) self.station.pulsar.define_channel( id='ch{}_marker1'.format(j), name='AWG{} ch{}_marker1'.format(i, j), type='marker', high=2, low=0, offset=0., delay=0, active=True, AWG='AWG{}'.format(i)) self.station.pulsar.define_channel( id='ch{}_marker2'.format(j), name='AWG{} ch{}_marker2'.format(i, j), type='marker', high=2, low=0, offset=0., delay=0, active=True, AWG='AWG{}'.format(i)) self.pulse_pars = default_pulse_pars.copy() self.RO_pars = default_RO_pars.copy() self.pulse_pars['I_channel'] = 'AWG1 ch1' self.pulse_pars['Q_channel'] = 'AWG2 ch2' self.RO_pars['RO_pulse_marker_channel'] = 'AWG1 ch3_marker1' self.RO_pars['acq_marker_channel'] = 'AWG2 ch4_marker2' sqs.Rabi_seq([0.3, 0.6], self.pulse_pars, self.RO_pars) pwfs1 = self.AWG1.file['p_wfs'] self.assertEqual(max(pwfs1['2-pulse-elt_0_ch1']), 10286) self.assertEqual(min(pwfs1['2-pulse-elt_0_ch1']), 6384) self.assertEqual(max(pwfs1['2-pulse-elt_0_ch2']), 8191) self.assertEqual(min(pwfs1['2-pulse-elt_0_ch2']), 8191) self.assertEqual(max(pwfs1['2-pulse-elt_0_ch3']), 24575) self.assertEqual(min(pwfs1['2-pulse-elt_0_ch3']), 8191) self.assertEqual(max(pwfs1['2-pulse-elt_0_ch4']), 8191) self.assertEqual(min(pwfs1['2-pulse-elt_0_ch4']), 8191) self.assertEqual(max(pwfs1['2-pulse-elt_1_ch1']), 12382) self.assertEqual(min(pwfs1['2-pulse-elt_1_ch1']), 4578) self.assertEqual(max(pwfs1['2-pulse-elt_1_ch2']), 8191) self.assertEqual(min(pwfs1['2-pulse-elt_1_ch2']), 8191) self.assertEqual(max(pwfs1['2-pulse-elt_1_ch3']), 24575) self.assertEqual(min(pwfs1['2-pulse-elt_1_ch3']), 8191) self.assertEqual(max(pwfs1['2-pulse-elt_1_ch4']), 8191) self.assertEqual(min(pwfs1['2-pulse-elt_1_ch4']), 8191) pwfs2 = self.AWG2.file['p_wfs'] self.assertEqual(max(pwfs2['2-pulse-elt_0_ch1']), 8191) self.assertEqual(min(pwfs2['2-pulse-elt_0_ch1']), 8191) self.assertEqual(max(pwfs2['2-pulse-elt_0_ch2']), 10211) self.assertEqual(min(pwfs2['2-pulse-elt_0_ch2']), 6171) self.assertEqual(max(pwfs2['2-pulse-elt_0_ch3']), 8191) self.assertEqual(min(pwfs2['2-pulse-elt_0_ch3']), 8191) self.assertEqual(max(pwfs2['2-pulse-elt_0_ch4']), 40959) self.assertEqual(min(pwfs2['2-pulse-elt_0_ch4']), 8191) self.assertEqual(max(pwfs2['2-pulse-elt_1_ch1']), 8191) self.assertEqual(min(pwfs2['2-pulse-elt_1_ch1']), 8191) self.assertEqual(max(pwfs2['2-pulse-elt_1_ch2']), 12231) self.assertEqual(min(pwfs2['2-pulse-elt_1_ch2']), 4151) self.assertEqual(max(pwfs2['2-pulse-elt_1_ch3']), 8191) self.assertEqual(min(pwfs2['2-pulse-elt_1_ch3']), 8191) self.assertEqual(max(pwfs2['2-pulse-elt_1_ch4']), 40959) self.assertEqual(min(pwfs2['2-pulse-elt_1_ch4']), 8191)