Skip to content
Snippets Groups Projects
Commit daee2dd9 authored by Sander Snoo's avatar Sander Snoo
Browse files

Added sequencer.recompile to quickly update an existing sequence when the...

Added sequencer.recompile to quickly update an existing sequence when the virtual gate matrix has changed
parent fe219d84
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,14 @@ class sequencer():
self._create_metadata()
logger.debug('Done pre-compile')
def recompile(self):
''' Recompiles the sequence applying new virtual matrix, attenuation, and delays.
Note: No changes should be made on the segments. Only pulse-lib settings may be changed.
'''
for seg_container in self.sequence:
seg_container.exit_rendering_mode()
seg_container.enter_rendering_mode()
def _calculate_max_dig_delay(self):
'''
Returns the maximum configured delay from AWG channel to digitizer channel.
......@@ -834,4 +842,4 @@ if __name__ == '__main__':
# print(seq.labels)
# print(seq.units)
# print(seq.setpoints)
seq.upload([0])
\ No newline at end of file
seq.upload([0])
from pulse_lib.tests.configurations.test_configuration import context
import pulse_lib.segments.utility.looping as lp
import matplotlib.pyplot as pt
#%%
def test1():
pulse = context.init_pulselib(n_gates=2, virtual_gates=True)
pulse = context.init_pulselib(n_gates=2, n_sensors=1, virtual_gates=True)
pulse.add_channel_attenuation('P1', 0.1)
pulse.add_channel_attenuation('P2', 0.1)
......@@ -24,16 +24,24 @@ def test1():
s.vP1.add_ramp_ss(60, 90, 20, 40)
s.vP1.add_ramp_ss(70, 80, 0, -40)
s.reset_time()
s.SD1.acquire(0, 100, wait=True)
# s.wait(100000)
sequence = pulse.mk_sequence([s])
# sequence.n_rep = 10000
sequence.n_rep = None
context.add_hw_schedule(sequence)
m_param = sequence.get_measurement_param()
context.plot_awgs(sequence, ylim=(-0.2,1.100), xlim=(0, 100))
context.run('virtual_gates', sequence, m_param, close_sequence=False)
context.virtual_matrix[1,0] = 0.2
sequence.recompile()
context.plot_awgs(sequence, ylim=(-0.2,1.100), xlim=(0, 100))
return context.run('virtual_gates2', sequence, m_param)
# return context.run('hres1', sequence)
#%%
......
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