Skip to content

Commit

Permalink
prepare_for_inspire has been fixed
Browse files Browse the repository at this point in the history
Now the method is setup-agnostic and works on Megha as well
  • Loading branch information
msamiotis committed Jun 10, 2024
1 parent d0becec commit 4dcebe8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 174 deletions.
45 changes: 41 additions & 4 deletions pycqed/instrument_drivers/meta_instrument/HAL/HAL_ShimMQ.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,49 @@ def prepare_for_timedomain(

# self._prep_td_configure_VSM()

# FIXME: setup dependent
def prepare_for_inspire(self):
for lutman in ['mw_lutman_QNW','mw_lutman_QNE','mw_lutman_QC','mw_lutman_QSW','mw_lutman_QSE']:
self.find_instrument(lutman).set_inspire_lutmap()

# LDC. Trying to ensure readout is digitized, uses optimal weights, and does single shots w/o averaging
self.ro_acq_digitized(True)
self.ro_acq_weight_type('optimal')
#self.ro_acq_averages(1)

for qubit in self.qubits():
QUBIT = self.find_instrument(qubit)
qubit_lutman = self.find_instrument(QUBIT.instr_LutMan_MW())
qubit_lutman.set_default_lutmap()

self.prepare_for_timedomain(qubits=self.qubits())
self.find_instrument(self.instr_MC()).soft_avg(1)

# LDC hack for Quantum Inspire. 2022/07/04
# This hot fix addresses the problem that the UHFs are not dividing by the right number of averages.
# They seem to be normalizing by the number of averages in the PREVIOUS run.
# This way, we set the averages twice. This is the first time.
for readout_instrument in [self.instr_acq_0(),
self.instr_acq_1(),
self.instr_acq_2()]:
if readout_instrument == None:
pass
else:
RO_INSTRUMENT = self.find_instrument(readout_instrument)
RO_INSTRUMENT.qas_0_result_averages(1)

self.find_instrument(self.instr_MC()).soft_avg(1)

# RDC 06-04-2023
# Save the metadata with PrepInspi
from pycqed.measurement import measurement_control
MC = self.find_instrument(self.instr_MC())

name = 'System_snapshot'
MC._set_measurement_name(name)
######################
with measurement_control.h5d.Data(
name=MC._get_measurement_name(), datadir=MC.datadir()
) as MC.data_object:
MC._get_measurement_begintime()
MC._save_instrument_settings(MC.data_object)

return True

##########################################################################
Expand Down
170 changes: 0 additions & 170 deletions pycqed/instrument_drivers/meta_instrument/LutMans/mw_lutman.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,169 +9,6 @@

from pycqed.measurement.waveform_control_CC import waveform as wf

# default_mw_lutmap = {
# 0 : {"name" : "I" , "theta" : 0 , "phi" : 0 , "type" : "ge"},
# 1 : {"name" : "rX180" , "theta" : 180 , "phi" : 0 , "type" : "ge"},
# 2 : {"name" : "rY180" , "theta" : 180 , "phi" : 90, "type" : "ge"},
# 3 : {"name" : "rX90" , "theta" : 90 , "phi" : 0 , "type" : "ge"},
# 4 : {"name" : "rY90" , "theta" : 90 , "phi" : 90, "type" : "ge"},
# 5 : {"name" : "rXm90" , "theta" : -90 , "phi" : 0 , "type" : "ge"},
# 6 : {"name" : "rYm90" , "theta" : -90 , "phi" : 90, "type" : "ge"},
# 7 : {"name" : "rPhi90", "theta" : 90 , "phi" : 0 , "type" : "ge"},
# 8 : {"name" : "spec" , "type" : "spec"} ,
# 9 : {"name" : "rX12" , "theta" : 180 , "phi" : 0 , "type" : "ef"},
# 10 : {"name" : "square", "type" : "square"},
# 11 : {"name" : "rY45" , "theta" : 45 , "phi" : 90, "type" : "ge"},
# 12 : {"name" : "rYm45" , "theta" : -45 , "phi" : 90, "type" : "ge"},
# 13 : {"name" : "rX45" , "theta" : 45 , "phi" : 0 , "type" : "ge"},
# 14 : {"name" : "rXm45" , "theta" : -45 , "phi" : 0 , "type" : "ge"},
# 15 : {"name" : "rX12_90" , "theta" : 90, "phi" : 0 , "type" : "ef"},
# 30 : {"name" : "rPhi180" , "theta" : 180 , "phi" : 0 , "type" : "ge"},
# 52 : {"name" : "phaseCorrPark1" , "type" : "phase"},
# 53 : {"name" : "phaseCorrPark2" , "type" : "phase"},
# 54 : {"name" : "phaseCorrPark3" , "type" : "phase"},
# 55 : {"name" : "phaseCorrPark4" , "type" : "phase"},
# 56 : {"name" : "phaseCorrPark5" , "type" : "phase"},
# 57 : {"name" : "phaseCorrPark6" , "type" : "phase"},
# 58 : {"name" : "phaseCorrPark7" , "type" : "phase"},
# 59 : {"name" : "phaseCorrPark8" , "type" : "phase"},
# 60 : {"name" : "phaseCorrNW" , "type" : "phase"},
# 61 : {"name" : "phaseCorrNE" , "type" : "phase"},
# 62 : {"name" : "phaseCorrSW" , "type" : "phase"},
# 63 : {"name" : "phaseCorrSE" , "type" : "phase"},
# }

# default_mw_lutmap = {
# 0 : {"name" : "I" , "theta" : 0 , "phi" : 0 , "type" : "ge"}, # I for CW compatibility
# 2 : {"name" : "rY180" , "theta" : 180 , "phi" : 90 , "type" : "ge"}, # rY180 for CW compatibility
# 1 : {"name" : "rX180" , "theta" : 180 , "phi" : 0 , "type" : "ge"}, # rX180 for CW compatibility
# 3 : {"name" : "rX90" , "theta" : 90 , "phi" : 0 , "type" : "ge"}, # rX90 for CW compatibility
# 4 : {"name" : "rY90" , "theta" : 90 , "phi" : 90 , "type" : "ge"}, # rY90 for CW compatibility
# 5 : {"name" : "rX270" , "theta" : 270 , "phi" : 0 , "type" : "ge"}, # rXm90 for CW compatibility
# 6 : {"name" : "rY270" , "theta" : 270 , "phi" : 90 , "type" : "ge"}, # rYm90 for CW compatibility
# 7 : {"name" : "rX5" , "theta" : 5.625 , "phi" : 0 , "type" : "ge"},
# 8 : {"name" : "rX11" , "theta" : 11.25 , "phi" : 0 , "type" : "ge"},
# 9 : {"name" : "rX12" , "theta" : 180 , "phi" : 0 , "type" : "ef"}, # rX12 for CW compatibility
# 10 : {"name" : "rX16" , "theta" : 16.875 , "phi" : 0 , "type" : "ge"},
# 11 : {"name" : "rY45" , "theta" : 45 , "phi" : 90 , "type" : "ge"}, # rY45 for CW compatibility
# 12 : {"name" : "rY315" , "theta" : -45 , "phi" : 90 , "type" : "ge"}, # rYm45 for CW compatibility
# 13 : {"name" : "rX45" , "theta" : 45 , "phi" : 0 , "type" : "ge"}, # rX45 for CW compatibility
# 14 : {"name" : "rX315" , "theta" : -45 , "phi" : 0 , "type" : "ge"}, # rXm45 for CW compatibility
# 15 : {"name" : "rX22" , "theta" : 22.5 , "phi" : 0 , "type" : "ge"},
# 16 : {"name" : "rX28" , "theta" : 28.125 , "phi" : 0 , "type" : "ge"},
# 17 : {"name" : "rX33" , "theta" : 33.75 , "phi" : 0 , "type" : "ge"},
# 18 : {"name" : "rX39" , "theta" : 39.375 , "phi" : 0 , "type" : "ge"},
# 19 : {"name" : "rX50" , "theta" : 50.625 , "phi" : 0 , "type" : "ge"},
# 20 : {"name" : "rX56" , "theta" : 56.25 , "phi" : 0 , "type" : "ge"},
# 21 : {"name" : "rX61" , "theta" : 61.875 , "phi" : 0 , "type" : "ge"},
# 22 : {"name" : "rX67" , "theta" : 67.5 , "phi" : 0 , "type" : "ge"},
# 23 : {"name" : "rX73" , "theta" : 73.125 , "phi" : 0 , "type" : "ge"},
# 24 : {"name" : "rX78" , "theta" : 78.75 , "phi" : 0 , "type" : "ge"},
# 25 : {"name" : "rX84" , "theta" : 84.375 , "phi" : 0 , "type" : "ge"},
# 26 : {"name" : "rX95" , "theta" : 95.625 , "phi" : 0 , "type" : "ge"},
# 27 : {"name" : "rX101" , "theta" : 101.25 , "phi" : 0 , "type" : "ge"},
# 28 : {"name" : "rX106" , "theta" : 106.875 , "phi" : 0 , "type" : "ge"},
# 29 : {"name" : "rX112" , "theta" : 112.5 , "phi" : 0 , "type" : "ge"},
# 30 : {"name" : "rX118" , "theta" : 118.125 , "phi" : 0 , "type" : "ge"},
# 31 : {"name" : "rX123" , "theta" : 123.75 , "phi" : 0 , "type" : "ge"},
# 32 : {"name" : "rX129" , "theta" : 129.375 , "phi" : 0 , "type" : "ge"},
# 33 : {"name" : "rX135" , "theta" : 135 , "phi" : 0 , "type" : "ge"},
# 34 : {"name" : "rX140" , "theta" : 140.625 , "phi" : 0 , "type" : "ge"},
# 35 : {"name" : "rX146" , "theta" : 146.25 , "phi" : 0 , "type" : "ge"},
# 36 : {"name" : "rX151" , "theta" : 151.875 , "phi" : 0 , "type" : "ge"},
# 37 : {"name" : "rX157" , "theta" : 157.5 , "phi" : 0 , "type" : "ge"},
# 38 : {"name" : "rX163" , "theta" : 163.125 , "phi" : 0 , "type" : "ge"},
# 39 : {"name" : "rX168" , "theta" : 168.75 , "phi" : 0 , "type" : "ge"},
# 40 : {"name" : "rX174" , "theta" : 174.375 , "phi" : 0 , "type" : "ge"},
# 41 : {"name" : "rX185" , "theta" : -174.375 , "phi" : 0 , "type" : "ge"},
# 42 : {"name" : "rX191" , "theta" : -168.75 , "phi" : 0 , "type" : "ge"},
# 43 : {"name" : "rX196" , "theta" : -163.125 , "phi" : 0 , "type" : "ge"},
# 44 : {"name" : "rX202" , "theta" : -157.5 , "phi" : 0 , "type" : "ge"},
# 45 : {"name" : "rX208" , "theta" : -151.875 , "phi" : 0 , "type" : "ge"},
# 46 : {"name" : "rX213" , "theta" : -146.25 , "phi" : 0 , "type" : "ge"},
# 47 : {"name" : "rX219" , "theta" : -140.625 , "phi" : 0 , "type" : "ge"},
# 48 : {"name" : "rX225" , "theta" : -135 , "phi" : 0 , "type" : "ge"},
# 49 : {"name" : "rX230" , "theta" : -129.375 , "phi" : 0 , "type" : "ge"},
# 50 : {"name" : "rX236" , "theta" : -123.75 , "phi" : 0 , "type" : "ge"},
# 51 : {"name" : "rX241" , "theta" : -118.125 , "phi" : 0 , "type" : "ge"},
# 52 : {"name" : "rX247" , "theta" : -112.5 , "phi" : 0 , "type" : "ge"},
# 53 : {"name" : "rX253" , "theta" : -106.875 , "phi" : 0 , "type" : "ge"},
# 54 : {"name" : "rX258" , "theta" : -101.25 , "phi" : 0 , "type" : "ge"},
# 55 : {"name" : "rX264" , "theta" : -95.625 , "phi" : 0 , "type" : "ge"},
# 56 : {"name" : "rX275" , "theta" : -84.375 , "phi" : 0 , "type" : "ge"},
# 57 : {"name" : "rX281" , "theta" : -78.75 , "phi" : 0 , "type" : "ge"},
# 58 : {"name" : "rX286" , "theta" : -73.125 , "phi" : 0 , "type" : "ge"},
# 59 : {"name" : "rX292" , "theta" : -67.5 , "phi" : 0 , "type" : "ge"},
# 60 : {"name" : "rX298" , "theta" : -61.875 , "phi" : 0 , "type" : "ge"},
# 61 : {"name" : "rX303" , "theta" : -56.25 , "phi" : 0 , "type" : "ge"},
# 62 : {"name" : "rX309" , "theta" : -50.625 , "phi" : 0 , "type" : "ge"},
# 63 : {"name" : "rX320" , "theta" : -39.375 , "phi" : 0 , "type" : "ge"},
# 64 : {"name" : "rX326" , "theta" : -33.75 , "phi" : 0 , "type" : "ge"},
# 65 : {"name" : "rX331" , "theta" : -28.125 , "phi" : 0 , "type" : "ge"},
# 66 : {"name" : "rX337" , "theta" : -22.5 , "phi" : 0 , "type" : "ge"},
# 67 : {"name" : "rX343" , "theta" : -16.875 , "phi" : 0 , "type" : "ge"},
# 68 : {"name" : "rX348" , "theta" : -11.25 , "phi" : 0 , "type" : "ge"},
# 69 : {"name" : "rX354" , "theta" : -5.625 , "phi" : 0 , "type" : "ge"},
# 70 : {"name" : "rY5" , "theta" : 5.625 , "phi" : 90 , "type" : "ge"},
# 71 : {"name" : "rY11" , "theta" : 11.25 , "phi" : 90 , "type" : "ge"},
# 72 : {"name" : "rY16" , "theta" : 16.875 , "phi" : 90 , "type" : "ge"},
# 73 : {"name" : "rY22" , "theta" : 22.5 , "phi" : 90 , "type" : "ge"},
# 74 : {"name" : "rY28" , "theta" : 28.125 , "phi" : 90 , "type" : "ge"},
# 75 : {"name" : "rY33" , "theta" : 33.75 , "phi" : 90 , "type" : "ge"},
# 76 : {"name" : "rY39" , "theta" : 39.375 , "phi" : 90 , "type" : "ge"},
# 77 : {"name" : "rY50" , "theta" : 50.625 , "phi" : 90 , "type" : "ge"},
# 78 : {"name" : "rY56" , "theta" : 56.25 , "phi" : 90 , "type" : "ge"},
# 79 : {"name" : "rY61" , "theta" : 61.875 , "phi" : 90 , "type" : "ge"},
# 80 : {"name" : "rY67" , "theta" : 67.5 , "phi" : 90 , "type" : "ge"},
# 81 : {"name" : "rY73" , "theta" : 73.125 , "phi" : 90 , "type" : "ge"},
# 82 : {"name" : "rY78" , "theta" : 78.75 , "phi" : 90 , "type" : "ge"},
# 83 : {"name" : "rY84" , "theta" : 84.375 , "phi" : 90 , "type" : "ge"},
# 84 : {"name" : "rY95" , "theta" : 95.625 , "phi" : 90 , "type" : "ge"},
# 85 : {"name" : "rY101" , "theta" : 101.25 , "phi" : 90 , "type" : "ge"},
# 86 : {"name" : "rY106" , "theta" : 106.875 , "phi" : 90 , "type" : "ge"},
# 87 : {"name" : "rY112" , "theta" : 112.5 , "phi" : 90 , "type" : "ge"},
# 88 : {"name" : "rY118" , "theta" : 118.125 , "phi" : 90 , "type" : "ge"},
# 89 : {"name" : "rY123" , "theta" : 123.75 , "phi" : 90 , "type" : "ge"},
# 90 : {"name" : "rY129" , "theta" : 129.375 , "phi" : 90 , "type" : "ge"},
# 91 : {"name" : "rY135" , "theta" : 135 , "phi" : 90 , "type" : "ge"},
# 92 : {"name" : "rY140" , "theta" : 140.625 , "phi" : 90 , "type" : "ge"},
# 93 : {"name" : "rY146" , "theta" : 146.25 , "phi" : 90 , "type" : "ge"},
# 94 : {"name" : "rY151" , "theta" : 151.875 , "phi" : 90 , "type" : "ge"},
# 95 : {"name" : "rY157" , "theta" : 157.5 , "phi" : 90 , "type" : "ge"},
# 96 : {"name" : "rY163" , "theta" : 163.125 , "phi" : 90 , "type" : "ge"},
# 97 : {"name" : "rY168" , "theta" : 168.75 , "phi" : 90 , "type" : "ge"},
# 98 : {"name" : "rY174" , "theta" : 174.375 , "phi" : 90 , "type" : "ge"},
# 99 : {"name" : "rY185" , "theta" : -174.375 , "phi" : 90 , "type" : "ge"},
# 100: {"name" : "rY191" , "theta" : -168.75 , "phi" : 90 , "type" : "ge"},
# 101: {"name" : "rY196" , "theta" : -163.125 , "phi" : 90 , "type" : "ge"},
# 102: {"name" : "rY202" , "theta" : -157.5 , "phi" : 90 , "type" : "ge"},
# 103: {"name" : "rY208" , "theta" : -151.875 , "phi" : 90 , "type" : "ge"},
# 104: {"name" : "rY213" , "theta" : -146.25 , "phi" : 90 , "type" : "ge"},
# 105: {"name" : "rY219" , "theta" : -140.625 , "phi" : 90 , "type" : "ge"},
# 106: {"name" : "rY225" , "theta" : -135 , "phi" : 90 , "type" : "ge"},
# 107: {"name" : "rY230" , "theta" : -129.375 , "phi" : 90 , "type" : "ge"},
# 108: {"name" : "rY236" , "theta" : -123.75 , "phi" : 90 , "type" : "ge"},
# 109: {"name" : "rY241" , "theta" : -118.125 , "phi" : 90 , "type" : "ge"},
# 110: {"name" : "rY247" , "theta" : -112.5 , "phi" : 90 , "type" : "ge"},
# 111: {"name" : "rY253" , "theta" : -106.875 , "phi" : 90 , "type" : "ge"},
# 112: {"name" : "rY258" , "theta" : -101.25 , "phi" : 90 , "type" : "ge"},
# 113: {"name" : "rY264" , "theta" : -95.625 , "phi" : 90 , "type" : "ge"},
# 114: {"name" : "rY275" , "theta" : -84.375 , "phi" : 90 , "type" : "ge"},
# 115: {"name" : "rY281" , "theta" : -78.75 , "phi" : 90 , "type" : "ge"},
# 116: {"name" : "rY286" , "theta" : -73.125 , "phi" : 90 , "type" : "ge"},
# 117: {"name" : "rY292" , "theta" : -67.5 , "phi" : 90 , "type" : "ge"},
# 118: {"name" : "rY298" , "theta" : -61.875 , "phi" : 90 , "type" : "ge"},
# 119: {"name" : "rY303" , "theta" : -56.25 , "phi" : 90 , "type" : "ge"},
# 120: {"name" : "rY309" , "theta" : -50.625 , "phi" : 90 , "type" : "ge"},
# 121: {"name" : "rY320" , "theta" : -39.375 , "phi" : 90 , "type" : "ge"},
# 122: {"name" : "rY326" , "theta" : -33.75 , "phi" : 90 , "type" : "ge"},
# 123: {"name" : "rY331" , "theta" : -28.125 , "phi" : 90 , "type" : "ge"},
# 124: {"name" : "rY337" , "theta" : -22.5 , "phi" : 90 , "type" : "ge"},
# 125: {"name" : "rY343" , "theta" : -16.875 , "phi" : 90 , "type" : "ge"},
# 126: {"name" : "rY348" , "theta" : -11.25 , "phi" : 90 , "type" : "ge"},
# 127: {"name" : "rY354" , "theta" : -5.625 , "phi" : 90 , "type" : "ge"}
# }

default_mw_lutmap = {
0 : {"name": "i" , "theta": 0 , "phi" : 0 , "type" : "ge"},
1 : {"name": "rx180" , "theta": 180 , "phi" : 0, "type" : "ge"},
Expand Down Expand Up @@ -299,13 +136,6 @@

valid_types = {'ge', 'ef', 'spec', 'raw-drag', 'ef-raw', 'square', 'phase'}

# for key, value in enumerate(range(15, 59)):
# print(r'{} : {{"name": "rx{:.0f}", "theta": {:.3f} , "phi" : 0 , "type" : "ge"}},'.format(value, __get_nearest_rotation(np.round(np.arange(0,360,6.666)), (key+4)*6.666), (key+4)*6.666))

# for key, value in enumerate(range(70, 128)):
# print(r'{} : {{"name": "ry{:.0f}", "theta": {:.3f} , "phi" : 90 , "type" : "ge"}},'.format(value, __get_nearest_rotation(np.round(np.arange(0,360,6.666)), key*6.666), key*6.666))


def mw_lutmap_is_valid(lutmap: dict) -> bool:
"""
Test if lutmap obeys schema.
Expand Down

0 comments on commit 4dcebe8

Please sign in to comment.