Skip to content

Commit

Permalink
Use hash for list of generated offset, update test...
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamrow committed May 12, 2020
1 parent 8c8e44e commit 82b7a73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 4 additions & 2 deletions QGL/drivers/APS2Pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ def write_sequence_file(awgData, fileName):
#store offsets and wavefor lib length
#time ampltidue entries are clamped to ADDRESS_UNIT
wf_length = ADDRESS_UNIT if entry.isTimeAmp else entry.length
offsets[entry.label] = ([_[sig] for _ in wfInfo[0][1]],
offsets[str(entry)+"_"+hex(hash(entry))] = ([_[sig] for _ in wfInfo[0][1]],
wf_length)
wf_sigs.discard(sig)

Expand Down Expand Up @@ -1581,7 +1581,9 @@ def __init__(self, instructions, waveforms):
self.height = 1200
self.instructions = instructions
self.waveforms = waveforms
print(self.waveforms)
for wf in self.waveforms:
print(wf, len(wf))
# print(self.waveforms)
self.initUI()
self.plotters = []

Expand Down
13 changes: 5 additions & 8 deletions tests/test_Sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,13 @@ def test_mux_CR(self):
def test_update_in_place(self):
self.set_awg_dir('RabiAmpInPlace')
APS2Pattern.SAVE_WF_OFFSETS = True
# RabiAmp(self.q1, np.linspace(0, 5e-6, 11))
Ramsey(self.q1, np.linspace(0, 5e-6, 11))
# RabiWidth(self.q1, np.linspace(0, 5e-6, 11))
print(self.awg_dir)
with open(os.path.join(self.awg_dir, "Ramsey", "Ramsey-APS2.offsets"), "rb") as FID:
RabiAmp(self.q1, np.linspace(0, 5e-6, 11))
with open(os.path.join(self.awg_dir, "Rabi", "Rabi-APS1.offsets"), "rb") as FID:
offsets = pickle.load(FID)
print(offsets)
pulses = {'MEAS': MEAS(self.q1, frequency=20e6)}
APS2Pattern.update_wf_library(os.path.join(self.awg_dir, "Ramsey", "Ramsey-APS2.aps2"), pulses, offsets)

pulses = {list(offsets.keys())[0]: Utheta(self.q1, amp=0.0, phase=0)}
APS2Pattern.update_wf_library(os.path.join(self.awg_dir, "Rabi", "Rabi-APS1.aps2"), pulses, offsets)
print(os.path.join(self.awg_dir, "Rabi", "Rabi-APS1.aps2"))
APS2Pattern.SAVE_WF_OFFSETS = False


Expand Down

0 comments on commit 82b7a73

Please sign in to comment.