Skip to content
Snippets Groups Projects
Commit 942b1fc6 authored by Stephan Philips's avatar Stephan Philips
Browse files

added examples

parent 38681e52
No related branches found
No related tags found
No related merge requests found
Showing
with 80 additions and 237 deletions
from pulse_templates.utility.plotting import plot_seg
from pulse_templates.demo_pulse_lib.virtual_awg import get_demo_lib
from pulse_templates.utility.oper import add_block, add_ramp
from pulse_templates.utility.plotting import plot_seg
from pulse_templates.coherent_control.single_qubit_gates.standard_set import single_qubit_std_set
from pulse_templates.coherent_control.single_qubit_gates.single_qubit_gates import single_qubit_gate_spec
from pulse_templates.elzerman_pulses.basic_elzerman_pulse import elzerman_read
from pulse_templates.coherent_control.single_qubit_gates.T2_meas import T2_hahn
from pulse_lib.segments.utility.looping import linspace
pulse = get_demo_lib('quad')
INIT = pulse.mk_segment()
MANIP = pulse.mk_segment()
READ = pulse.mk_segment()
# assume 1QD -- elzerman init
t_init = 50e3
gates = ('vP4',)
p_0 = (0, )
add_block(INIT, t_init, gates, p_0)
# T2 hahn
MANIP.vP4 += 20
xpi2 = single_qubit_gate_spec('qubit4_MW', 1.1e8, 1000, MW_power=120, padding=2) #X
xpi = single_qubit_gate_spec('qubit4_MW', 1.1e8, 2000, MW_power=120, padding=2) #X2
ss_set = single_qubit_std_set()
ss_set.X = xpi2
ss_set.X2 = xpi
times = linspace(100, 1e5, 100, axis=0, name='time', unit='ns')
T2_hahn(MANIP, ss_set, times, 1e6)
#
p_read = (0, )
t_read = 100e3
elzerman_read(READ, gates, t_read, p_read, disable_trigger=False)
# run exp()
run_exp([INIT, MANIP, READ], nrep = 100, ..)
from core_tools.data.SQL.connector import set_up_local_and_remote_storage
from core_tools.data.SQL.SQL_synchronization_manager import sync_agent
##############################################
# only in case of remote and local server!!! #
##############################################
set_up_local_and_remote_storage('ipaddr_rem_server', 5432,
'local_usernam', 'local_passwd', 'local_dbname',
'remote_usernam', 'remote_passwd', 'remote_dbname',
'project_name', 'set_up_name', 'sample_name')
db = sync_agent()
\ No newline at end of file
from core_tools.data.SQL.connector import set_up_local_storage, set_up_remote_storage, set_up_local_and_remote_storage
from core_tools.data.gui.data_browser import data_browser
##################################################
# uncomment the option that is applicable to you #
##################################################
# in case you are only using a local server.
# set_up_local_storage('local_usernam', 'local_passwd',
# 'local_dbname', 'project_name', 'set_up_name', 'sample_name')
# in case you are only the remote server.
# set_up_remote_storage('ipaddr_rem_server', 5432,
# 'remote_usernam', 'remote_passwd', 'remote_dbname',
# 'project_name', 'set_up_name', 'sample_name')
# in case you are using both a local and remote server.
# set_up_local_and_remote_storage('ipaddr_rem_server', 5432,
# 'local_usernam', 'local_passwd', 'local_dbname',
# 'remote_usernam', 'remote_passwd', 'remote_dbname',
# 'project_name', 'set_up_name', 'sample_name')
db = data_browser()
\ No newline at end of file
from core_tools.data.SQL.connector import set_up_local_storage,\
set_up_remote_storage, set_up_local_and_remote_storage
##################################################
# uncomment the option that is applicable to you #
##################################################
# in case you are only using a local server.
# set_up_local_storage('local_usernam', 'local_passwd',
# 'local_dbname', 'project_name', 'set_up_name', 'sample_name')
# in case you are only the remote server.
# set_up_remote_storage('ipaddr_rem_server', 5432,
# 'remote_usernam', 'remote_passwd', 'remote_dbname',
# 'project_name', 'set_up_name', 'sample_name')
# in case you are using both a local and remote server.
# set_up_local_and_remote_storage('ipaddr_rem_server', 5432,
# 'local_usernam', 'local_passwd', 'local_dbname',
# 'remote_usernam', 'remote_passwd', 'remote_dbname',
# 'project_name', 'set_up_name', 'sample_name')
# when you want to do sweeps
from core_tools.sweeps.sweeps import do0D, do1D, do2D
ds = do2D(param, start, stop, n_points, delay).run()
# see what is in the dataset
print(ds)
# inspecting data (extract arrays, labels, units):
x_data, y_data, z_data = ds.m1.x(), ds.m1.y(), ds.m1()
x_label, y_label, z_label = ds.m1.x.label, ds.m1.y.label, ds.m1.label
x_unit, y_unit, z_unit = ds.m1.x.unit, ds.m1.y.unit, ds.m1.unit
# when you want to plot a dataset
from core_tools.data.gui.plot_mgr import data_plotter
plot = data_plotter(ds)
# load a dataset by id or uuid
from core_tools.data.ds.data_set import load_by_id, load_by_uuid
ds = load_by_id(101)
File deleted
File deleted
import qcodes as qc
import sample_specific.station as XLD_SiQubit
import os
def init_station():
'''
Initialise the V2 station.
'''
# load config file with the instrument settings
station = qc.Station(config_file = os.path.dirname(XLD_SiQubit.__file__) + '\\instruments.yaml')
station.load_instrument('hardware')
station.load_instrument('AWG1')
station.load_instrument('AWG2')
station.load_instrument('AWG3')
return station
def set_dac_range(my_range='2v bi'):
'''
DO not run this when a sample is connected!
'''
# quicky make sure that the dacs are in the wanted range
station = qc.station.Station.default
dacs = [station.dac_a, station.dac_b, station.dac_c]
for dac in dacs:
for dac_i in range(dac._number_dacs):
if dac._get_span(dac_i) != my_range:
dac._set_span(dac_i, my_range)
\ No newline at end of file
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
'general', (0, 1140)
'AWG2DAC', (1536, 152)
File deleted
'general', (0, 1140)
'AWG2DAC', (1536, 152)
import core_tools.drivers.harware as hw
def boundaries():
gate_boundaries = dict({})
# loose boundaries for tuning. Should not damage the sample.
for i in [1, 2,]:
for c in ['B1', 'B2', ]:
gate_boundaries['SD%d_%s' % (i, c)] = (-1000, 1500)
gate_boundaries['SD%d_P' % (i)] = (0, 1500)
gate_boundaries['B0'] = (-1000, 1200)
for i in [1, 2, 3, 4 ]:
gate_boundaries['P%d' % (i)] = (0, 1500)
gate_boundaries['B%d' % (i)] = (-1000, 1500)
return gate_boundaries
class hardware(hw.harware_parent):
def __init__(self, name):
super().__init__(name, "C:/XLD_code/development_code/sample_specific/station/sample_settings")
self.dac_gate_map = {
# spi 1
'B0': (0, 1), 'P1': (0, 2),
'B1': (0, 3), 'P2': (0, 4),
'B2': (0, 5), 'P3': (0, 6),
'B3': (0, 7), 'P4': (0, 8),
'B4': (0, 9),
}
self.boundaries = boundaries()
virtual_gate_set_1 = hw.virtual_gate('general',["B0", "P1", "B1", "P2", "B2", "P3", "B3", "P4", "B4" ])
self.virtual_gates.append(virtual_gate_set_1)
\ No newline at end of file
instruments:
hardware:
type: sample_specific.station.hardware_quad_dot.hardware
enable_forced_reconnect: true
gates:
type: core_tools.drivers.gates.gates
enable_forced_reconnect: true
AWG1:
type: qcodes_contrib_drivers.drivers.Keysight.SD_common.SD_AWG_Async.SD_AWG_Async
enable_forced_reconnect : True
init:
chassis : 0
slot : 2
channels : 4
triggers : 8
AWG2:
type: qcodes_contrib_drivers.drivers.Keysight.SD_common.SD_AWG_Async.SD_AWG_Async
enable_forced_reconnect : True
init:
chassis : 0
slot : 3
channels : 4
triggers : 8
AWG3:
type: qcodes_contrib_drivers.drivers.Keysight.SD_common.SD_AWG_Async.SD_AWG_Async
enable_forced_reconnect : True
init:
chassis : 0
slot : 4
channels : 4
triggers : 8
dig:
type: core_tools.drivers.M3102A.SD_DIG
enable_forced_reconnect: true
init:
chassis: 0
slot: 5
from pulse_lib.base_pulse import pulselib
from pulse_lib.virtual_channel_constructors import IQ_channel_constructor, virtual_gates_constructor
import numpy as np
def return_pulse_lib(hardware = None, *args):
"""
return pulse library object
Args:
hardware : hardware class (if not present, put None)
*args : AWG instances you want to add (qcodes AWG object)
"""
pulse = pulselib(backend='M3202A')
# add to pulse_lib
for i in range(len(args)):
pulse.add_awgs('AWG{}'.format(i+1),args[i])
# define channels
pulse.define_channel('B0','AWG1', 1)
pulse.define_channel('P1','AWG1', 2)
pulse.define_channel('B1','AWG1', 3)
pulse.define_channel('P2','AWG1', 4)
pulse.define_channel('B2','AWG2', 1)
pulse.define_channel('P3','AWG2', 2)
pulse.define_channel('B3','AWG2', 3)
pulse.define_marker('M1','AWG2', 4)
pulse.define_channel('I_pos','AWG3',1)
pulse.define_channel('I_neg','AWG3',2)
pulse.define_channel('Q_pos','AWG3', 3)
pulse.define_channel('Q_neg','AWG3', 4)
# format : channel name with delay in ns (can be posive/negative)
# pulse.add_channel_delay('I_MW',-60)
# pulse.add_channel_delay('Q_MW',-60)
# pulse.add_channel_delay('M1',-110)
# pulse.add_channel_delay('M2',-25)
# add limits on voltages for DC channel compenstation (if no limit is specified, no compensation is performed).
pulse.add_channel_compenstation_limit('B0', (-1500, 1500))
pulse.add_channel_compenstation_limit('B1', (-1500, 1500))
pulse.add_channel_compenstation_limit('B2', (-1500, 1500))
pulse.add_channel_compenstation_limit('B3', (-1500, 1500))
pulse.add_channel_compenstation_limit('P1', (-1500, 1500))
pulse.add_channel_compenstation_limit('P2', (-1500, 1500))
pulse.add_channel_compenstation_limit('P3', (-1500, 1500))
IQ_chan_set_1 = IQ_channel_constructor(pulse)
# set right association of the real channels with I/Q output.
IQ_chan_set_1.add_IQ_chan("I_pos", "I", image = "+")
IQ_chan_set_1.add_IQ_chan("I_neg", "I", image = "-")
IQ_chan_set_1.add_IQ_chan("Q_pos", "Q", image = "+")
IQ_chan_set_1.add_IQ_chan("Q_neg", "Q", image = "-")
IQ_chan_set_1.add_marker("M1", 0, 2000)
IQ_chan_set_1.set_LO(1e9)
IQ_chan_set_1.add_virtual_IQ_channel('qubit1_MW')
IQ_chan_set_1.add_virtual_IQ_channel('qubit2_MW')
IQ_chan_set_1.add_virtual_IQ_channel('qubit3_MW')
IQ_chan_set_1.add_virtual_IQ_channel('qubit4_MW')
if hardware is not None:
pulse.load_hardware(hardware)
pulse.finish_init()
return pulse
if __name__ == '__main__':
pulse = return_pulse_lib()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment