Loading .gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ ENV/ # IDE settings *.sublime-* .vscode # System files *.DS_Store Loading docs/api_reference.rst +6 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,12 @@ base .. automodule:: quantify.scheduler.controlstack.components.base :members: zhinst ~~~~~~ .. automodule:: quantify.scheduler.controlstack.components.zhinst :members: miscellaneous ------------- Loading quantify/scheduler/backends/types/zhinst.py +2 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class Output(DataClassJsonMixin): modulation : The modulation settings. local_oscillator : The LocalOscillator settings. The LocalOscillator name. gain1 : The output1 IQ modulation gain (value between -1 and + 1). default is 0. gain2 : Loading @@ -59,7 +59,7 @@ class Output(DataClassJsonMixin): clock: str mode: enums.SignalModeType modulation: common.Modulation local_oscillator: common.LocalOscillator local_oscillator: str gain1: int = 0 gain2: int = 0 line_trigger_delay: float = -1 Loading quantify/scheduler/backends/zhinst/helpers.py +57 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ from typing import Any, Dict, List, Union from zhinst.qcodes import base from zhinst import qcodes from quantify.scheduler.helpers import time logger = logging.getLogger() Loading Loading @@ -100,7 +100,7 @@ def set_awg_value( The awg to configure. node : The node path. vector : value : The new node vector value. """ logger.debug(node) Loading @@ -109,6 +109,61 @@ def set_awg_value( awgs[awg_index]._awg._module.set(node, value) def set_and_compile_awg_seqc( instrument: base.ZIBaseInstrument, awg_index: int, node: str, value: str, ): """ Uploads and compiles the AWG sequencer program. Parameters ---------- instrument : The instrument. awg_index : The awg to configure. node : The node path. value : The seqc program. """ set_awg_value(instrument, awg_index, node, value) awgs = [instrument.awg] if not hasattr(instrument, "awgs") else instrument.awgs awg = awgs[awg_index] awg_module = awg._awg._module status: int = -1 while status == -1: time.sleep(0.1) status = awg_module.get_int("compiler/status") if status == 1: status_str = awg_module.get_string("compiler/statusstring") raise Exception(f"Upload failed: \n{status_str}") if status == 2: status_str = awg_module.get_string("compiler/statusstring") raise Warning(f"Compiled with warning: \n{status_str}") if status == 0: print("Compilation successful") tik = time.get_time() progress: float = awg_module.get_double("progress") status: int = awg_module.get_int("/elf/status") while (progress < 1.0) and (status != 1): time.sleep(0.1) if time.get_time() - tik >= 100: # 100s timeout raise Exception("Program upload timed out!") progress: float = awg_module.get_double("progress") status: int = awg_module.get_int("/elf/status") sequencer_status = "ELF file uploaded" if status == 0 else "FAILED!!" print(f"{awg.name}: Sequencer status: {sequencer_status}") def set_wave_vector( instrument: base.ZIBaseInstrument, awg_index: int, Loading quantify/scheduler/backends/zhinst/seqc_il_generator.py +7 −3 Original line number Diff line number Diff line Loading @@ -660,7 +660,7 @@ def add_wait( def add_play_wave( seqc_gen: SeqcILGenerator, variable: str, *variable: str, device_type: zhinst.DeviceType, comment: str = "", ) -> int: Loading @@ -682,7 +682,7 @@ def add_play_wave( """ n_assembly_instructions = SEQC_INSTR_CLOCKS[device_type][SeqcInstructions.PLAY_WAVE] seqc_gen.emit_play_wave( variable, *variable, comment=f"\t// {comment} n_instr={n_assembly_instructions}", ) return n_assembly_instructions Loading Loading @@ -816,6 +816,7 @@ def add_seqc_info(seqc_gen: SeqcILGenerator, seqc_info: SeqcInfo): def add_csv_waveform_variables( seqc_gen: SeqcILGenerator, device_serial: str, awg_index: int, commandtable_map: Dict[int, int], ): """ Loading @@ -826,9 +827,12 @@ def add_csv_waveform_variables( ---------- seqc_gen : device_serial : awg_index : commandtable_map : """ for waveform_index in commandtable_map.values(): # Declare new placeholder and assign wave index name: str = f"w{waveform_index:d}" seqc_gen.declare_wave(name, f"{device_serial}_wave{waveform_index:d}") seqc_gen.declare_wave( name, f"{device_serial}_awg{awg_index}_wave{waveform_index:d}" ) Loading
.gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ ENV/ # IDE settings *.sublime-* .vscode # System files *.DS_Store Loading
docs/api_reference.rst +6 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,12 @@ base .. automodule:: quantify.scheduler.controlstack.components.base :members: zhinst ~~~~~~ .. automodule:: quantify.scheduler.controlstack.components.zhinst :members: miscellaneous ------------- Loading
quantify/scheduler/backends/types/zhinst.py +2 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class Output(DataClassJsonMixin): modulation : The modulation settings. local_oscillator : The LocalOscillator settings. The LocalOscillator name. gain1 : The output1 IQ modulation gain (value between -1 and + 1). default is 0. gain2 : Loading @@ -59,7 +59,7 @@ class Output(DataClassJsonMixin): clock: str mode: enums.SignalModeType modulation: common.Modulation local_oscillator: common.LocalOscillator local_oscillator: str gain1: int = 0 gain2: int = 0 line_trigger_delay: float = -1 Loading
quantify/scheduler/backends/zhinst/helpers.py +57 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ from typing import Any, Dict, List, Union from zhinst.qcodes import base from zhinst import qcodes from quantify.scheduler.helpers import time logger = logging.getLogger() Loading Loading @@ -100,7 +100,7 @@ def set_awg_value( The awg to configure. node : The node path. vector : value : The new node vector value. """ logger.debug(node) Loading @@ -109,6 +109,61 @@ def set_awg_value( awgs[awg_index]._awg._module.set(node, value) def set_and_compile_awg_seqc( instrument: base.ZIBaseInstrument, awg_index: int, node: str, value: str, ): """ Uploads and compiles the AWG sequencer program. Parameters ---------- instrument : The instrument. awg_index : The awg to configure. node : The node path. value : The seqc program. """ set_awg_value(instrument, awg_index, node, value) awgs = [instrument.awg] if not hasattr(instrument, "awgs") else instrument.awgs awg = awgs[awg_index] awg_module = awg._awg._module status: int = -1 while status == -1: time.sleep(0.1) status = awg_module.get_int("compiler/status") if status == 1: status_str = awg_module.get_string("compiler/statusstring") raise Exception(f"Upload failed: \n{status_str}") if status == 2: status_str = awg_module.get_string("compiler/statusstring") raise Warning(f"Compiled with warning: \n{status_str}") if status == 0: print("Compilation successful") tik = time.get_time() progress: float = awg_module.get_double("progress") status: int = awg_module.get_int("/elf/status") while (progress < 1.0) and (status != 1): time.sleep(0.1) if time.get_time() - tik >= 100: # 100s timeout raise Exception("Program upload timed out!") progress: float = awg_module.get_double("progress") status: int = awg_module.get_int("/elf/status") sequencer_status = "ELF file uploaded" if status == 0 else "FAILED!!" print(f"{awg.name}: Sequencer status: {sequencer_status}") def set_wave_vector( instrument: base.ZIBaseInstrument, awg_index: int, Loading
quantify/scheduler/backends/zhinst/seqc_il_generator.py +7 −3 Original line number Diff line number Diff line Loading @@ -660,7 +660,7 @@ def add_wait( def add_play_wave( seqc_gen: SeqcILGenerator, variable: str, *variable: str, device_type: zhinst.DeviceType, comment: str = "", ) -> int: Loading @@ -682,7 +682,7 @@ def add_play_wave( """ n_assembly_instructions = SEQC_INSTR_CLOCKS[device_type][SeqcInstructions.PLAY_WAVE] seqc_gen.emit_play_wave( variable, *variable, comment=f"\t// {comment} n_instr={n_assembly_instructions}", ) return n_assembly_instructions Loading Loading @@ -816,6 +816,7 @@ def add_seqc_info(seqc_gen: SeqcILGenerator, seqc_info: SeqcInfo): def add_csv_waveform_variables( seqc_gen: SeqcILGenerator, device_serial: str, awg_index: int, commandtable_map: Dict[int, int], ): """ Loading @@ -826,9 +827,12 @@ def add_csv_waveform_variables( ---------- seqc_gen : device_serial : awg_index : commandtable_map : """ for waveform_index in commandtable_map.values(): # Declare new placeholder and assign wave index name: str = f"w{waveform_index:d}" seqc_gen.declare_wave(name, f"{device_serial}_wave{waveform_index:d}") seqc_gen.declare_wave( name, f"{device_serial}_awg{awg_index}_wave{waveform_index:d}" )