From dc322a5388703e68d2b779a00c3c1b8b63405646 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 16 Aug 2024 08:06:30 +0000 Subject: [PATCH 01/35] Changed handle waveform name into handle weight inside `_append_to_weights_of_bus` --- src/qililab/qprogram/qblox_compiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qililab/qprogram/qblox_compiler.py b/src/qililab/qprogram/qblox_compiler.py index 07dcf6e9e..cdfc1b78a 100644 --- a/src/qililab/qprogram/qblox_compiler.py +++ b/src/qililab/qprogram/qblox_compiler.py @@ -250,7 +250,7 @@ def handle_waveform(waveform: Waveform | None, default_length: int = 0): return index_I, index_Q, length_I def _append_to_weights_of_bus(self, bus: str, weights: IQPair): - def handle_waveform(waveform: Waveform): + def handle_weight(waveform: Waveform): _hash = QbloxCompiler._hash_waveform(waveform) if _hash in self._buses[bus].weight_to_index: @@ -268,8 +268,8 @@ def handle_waveform(waveform: Waveform): self._buses[bus].weight_to_index[_hash] = index return index, length - index_I, length_I = handle_waveform(weights.I) - index_Q, _ = handle_waveform(weights.Q) + index_I, length_I = handle_weight(weights.I) + index_Q, _ = handle_weight(weights.Q) return index_I, index_Q, length_I def _handle_parallel(self, element: Parallel): From 9ab6d93f7d231a17c0a82059fddde3b5e6547b12 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 16 Aug 2024 15:10:14 +0000 Subject: [PATCH 02/35] added distorsion application in platform for qblox --- src/qililab/platform/platform.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index ba33f94ce..86abebe5d 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -690,6 +690,12 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals ) buses = {bus_alias: self._get_bus_by_alias(alias=bus_alias) for bus_alias in sequences} + for bus_alias, bus in buses.items(): + if bus.distortions: + for distrortion in bus.distortions: + for waveforms in sequences[bus_alias]._waveforms._waveforms: + sequences[bus_alias]._waveforms.modify(waveforms.name, distrortion.apply(waveforms.data)) + if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: for bus_alias in sequences: From 54ee04d48830522564dfbbf0438e18e795d368e1 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Tue, 20 Aug 2024 09:11:32 +0000 Subject: [PATCH 03/35] Added changelog --- docs/releases/changelog-dev.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/releases/changelog-dev.md b/docs/releases/changelog-dev.md index f4b8ac0ee..1b384595f 100644 --- a/docs/releases/changelog-dev.md +++ b/docs/releases/changelog-dev.md @@ -135,6 +135,35 @@ [#747](https://github.com/qilimanjaro-tech/qililab/pull/747) +- Added pulse distorsions in `execute_qprogram` for QBlox in a similar methodology to the distorsions implemented in pulse circuits. The runcard needs to contain the same structure for distorsions as the runcards for circuits and the code will modify the waveforms after compilation (inside `platform.execute_qprogram`). + + Example (for Qblox) + + ``` + buses: + - alias: readout + ... + distortions: + - name: exponential + tau_exponential: 1. + amp: 1. + sampling_rate: 1. # Optional. Defaults to 1 + norm_factor: 1. # Optional. Defaults to 1 + auto_norm: True # Optional. Defaults to True + - name: bias_tee + tau_bias_tee: 11000 + sampling_rate: 1. # Optional. Defaults to 1 + norm_factor: 1. # Optional. Defaults to 1 + auto_norm: True # Optional. Defaults to True + - name: lfilter + a: [] + b: [] + norm_factor: 1. # Optional. Defaults to 1 + auto_norm: True # Optional. Defaults to True + ``` + + [#779](https://github.com/qilimanjaro-tech/qililab/pull/779) + ### Breaking changes - Big code refactor for the `calibration` module/directory, where all `comparisons`, `check_parameters`, `check_data()`, From f53ae3edc1a7b7395f1ebb0932a7a16e97988cb3 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Tue, 20 Aug 2024 10:29:43 +0000 Subject: [PATCH 04/35] solved quality errors and added tests --- src/qililab/platform/platform.py | 4 ++-- tests/data.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index 86abebe5d..5789c2566 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -693,8 +693,8 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals for bus_alias, bus in buses.items(): if bus.distortions: for distrortion in bus.distortions: - for waveforms in sequences[bus_alias]._waveforms._waveforms: - sequences[bus_alias]._waveforms.modify(waveforms.name, distrortion.apply(waveforms.data)) + for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access + sequences[bus_alias]._waveforms.modify(waveforms.name, distrortion.apply(waveforms.data)) # pylint: disable=protected-access if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: diff --git a/tests/data.py b/tests/data.py index ed4eea599..aaae47672 100644 --- a/tests/data.py +++ b/tests/data.py @@ -704,7 +704,13 @@ class Galadriel: RUNCARD.INSTRUMENTS: [InstrumentName.QBLOX_QCM.value, "rs_0"], }, "port": "drive_q0", - RUNCARD.DISTORTIONS: [], + RUNCARD.DISTORTIONS: [ + { + "name": "lfilter", + "a": [1.0], + "b": [1.0], + } + ], RUNCARD.DELAY: 0, }, { From 6f1a0000b56f6e7e57c16593bd8874748ddacebf Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Tue, 20 Aug 2024 15:45:08 +0000 Subject: [PATCH 05/35] Fixed tests --- requirements.txt | 2 +- src/qililab/platform/platform.py | 4 +++- tests/data.py | 8 +------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4cf9181b1..4a2308fe3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ qcodes_contrib_drivers==0.18.0 PyVISA-py==0.7.1 tqdm==4.64.1 urllib3==1.26.12 -qpysequence==0.10.1 +qpysequence==0.10.2 lmfit==1.1.0 rustworkx==0.12.1 h5py==3.9.0 diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index 5789c2566..86f62581c 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -694,7 +694,9 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals if bus.distortions: for distrortion in bus.distortions: for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access - sequences[bus_alias]._waveforms.modify(waveforms.name, distrortion.apply(waveforms.data)) # pylint: disable=protected-access + sequences[bus_alias]._waveforms.modify( + waveforms.name, distrortion.apply(waveforms.data) + ) # pylint: disable=protected-access if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: diff --git a/tests/data.py b/tests/data.py index aaae47672..b0478ca48 100644 --- a/tests/data.py +++ b/tests/data.py @@ -704,13 +704,7 @@ class Galadriel: RUNCARD.INSTRUMENTS: [InstrumentName.QBLOX_QCM.value, "rs_0"], }, "port": "drive_q0", - RUNCARD.DISTORTIONS: [ - { - "name": "lfilter", - "a": [1.0], - "b": [1.0], - } - ], + RUNCARD.DISTORTIONS: [{"name": "lfilter", "a": [1.0], "b": [1.0], "norm_factor": 1.0}], RUNCARD.DELAY: 0, }, { From 22e3948d0be16ad5dbad0d3503aa639951f3fcce Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Tue, 20 Aug 2024 15:49:03 +0000 Subject: [PATCH 06/35] moved pylint exception --- src/qililab/platform/platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index 86f62581c..a2d08362c 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -694,9 +694,9 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals if bus.distortions: for distrortion in bus.distortions: for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access - sequences[bus_alias]._waveforms.modify( + sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access waveforms.name, distrortion.apply(waveforms.data) - ) # pylint: disable=protected-access + ) if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: From 3081c9c9c72fea6ac53e1f1f453cec4071e40b3b Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Tue, 20 Aug 2024 15:54:04 +0000 Subject: [PATCH 07/35] qpysequence --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4a2308fe3..a74fea4a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ qcodes_contrib_drivers==0.18.0 PyVISA-py==0.7.1 tqdm==4.64.1 urllib3==1.26.12 -qpysequence==0.10.2 +qpysequence>=0.10.2 lmfit==1.1.0 rustworkx==0.12.1 h5py==3.9.0 From e343c7e05b575faa2d2fc99e082e2d37593c5115 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Tue, 20 Aug 2024 16:13:17 +0000 Subject: [PATCH 08/35] added missing data --- tests/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data.py b/tests/data.py index b0478ca48..6602d9450 100644 --- a/tests/data.py +++ b/tests/data.py @@ -704,7 +704,7 @@ class Galadriel: RUNCARD.INSTRUMENTS: [InstrumentName.QBLOX_QCM.value, "rs_0"], }, "port": "drive_q0", - RUNCARD.DISTORTIONS: [{"name": "lfilter", "a": [1.0], "b": [1.0], "norm_factor": 1.0}], + RUNCARD.DISTORTIONS: [{"name": "lfilter", "a": [1.0], 'auto_norm': True, "b": [1.0], "norm_factor": 1.0}], RUNCARD.DELAY: 0, }, { From 7011aee650b148846fb94c7c033cfa3ebc56256b Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Wed, 21 Aug 2024 07:11:42 +0000 Subject: [PATCH 09/35] BLACK --- tests/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data.py b/tests/data.py index 6602d9450..c4d60fd3e 100644 --- a/tests/data.py +++ b/tests/data.py @@ -704,7 +704,7 @@ class Galadriel: RUNCARD.INSTRUMENTS: [InstrumentName.QBLOX_QCM.value, "rs_0"], }, "port": "drive_q0", - RUNCARD.DISTORTIONS: [{"name": "lfilter", "a": [1.0], 'auto_norm': True, "b": [1.0], "norm_factor": 1.0}], + RUNCARD.DISTORTIONS: [{"name": "lfilter", "a": [1.0], "auto_norm": True, "b": [1.0], "norm_factor": 1.0}], RUNCARD.DELAY: 0, }, { From 17c2a0eccae09c288347045542994f3e21bde171 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Wed, 21 Aug 2024 09:12:36 +0000 Subject: [PATCH 10/35] new qpysequence release --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a74fea4a5..1bae0a8be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ qcodes_contrib_drivers==0.18.0 PyVISA-py==0.7.1 tqdm==4.64.1 urllib3==1.26.12 -qpysequence>=0.10.2 +qpysequence==0.10.3 lmfit==1.1.0 rustworkx==0.12.1 h5py==3.9.0 From 968be400634a98f72f2f7fd4ce204ce2b9dd1e6f Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Wed, 21 Aug 2024 13:47:06 +0000 Subject: [PATCH 11/35] added requested tests --- src/qililab/platform/platform.py | 2 -- tests/data.py | 4 +++- tests/platform/test_platform.py | 24 +++++++++++++++++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index c7586616a..f06306077 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -762,7 +762,6 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals markers=markers, ) buses = {bus_alias: self._get_bus_by_alias(alias=bus_alias) for bus_alias in sequences} - for bus_alias, bus in buses.items(): if bus.distortions: for distrortion in bus.distortions: @@ -770,7 +769,6 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access waveforms.name, distrortion.apply(waveforms.data) ) - if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: for bus_alias in sequences: diff --git a/tests/data.py b/tests/data.py index 63677a742..6b6e4c8f6 100644 --- a/tests/data.py +++ b/tests/data.py @@ -713,7 +713,9 @@ class Galadriel: RUNCARD.INSTRUMENTS: [InstrumentName.QBLOX_QCM.value, "rs_0"], }, "port": "drive_q0", - RUNCARD.DISTORTIONS: [{"name": "lfilter", "a": [1.0], "auto_norm": True, "b": [1.0], "norm_factor": 1.0}], + RUNCARD.DISTORTIONS: [ + {"name": "lfilter", "a": [1.,0.,1.], "auto_norm": True, "b": [0.5, 0.5], "norm_factor": 1.0} + ], RUNCARD.DELAY: 0, }, { diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 65ea9ed70..e9c78b47c 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -11,7 +11,7 @@ import pytest from qibo import gates from qibo.models import Circuit -from qpysequence import Sequence +from qpysequence import Sequence, Waveforms from ruamel.yaml import YAML from qililab import Arbitrary, save_platform @@ -432,6 +432,28 @@ def test_execute_qprogram_with_qblox(self, platform: Platform): # assure only one debug was called assert patched_open.call_count == 1 + def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): + drive_wf = Square(amplitude=1.0, duration=4) + qprogram = QProgram() + qprogram.play(bus="drive_line_q0_bus", waveform=drive_wf) + qprogram.play(bus="drive_line_q1_bus", waveform=drive_wf) + + test_waveforms = Waveforms() + test_waveforms.add(array=np.array([0.5, 1.0, 0.5, 0.0]), index=0) + test_waveforms.add(array=drive_wf.envelope(), index=1) + + qblox_compiler = QbloxCompiler() + sequences, _ = qblox_compiler.compile(qprogram=qprogram) + buses = {bus_alias: platform._get_bus_by_alias(alias=bus_alias) for bus_alias in sequences} + for bus_alias, bus in buses.items(): + if bus.distortions: + for distrortion in bus.distortions: + for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access + sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access + waveforms.name, distrortion.apply(waveforms.data) + ) + assert test_waveforms == sequences[bus_alias]._waveforms + def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform ): # pylint: disable=too-many-locals From ba8714f8b53790627323f2cc24ef6f42321a41f5 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Wed, 21 Aug 2024 14:21:25 +0000 Subject: [PATCH 12/35] Black --- tests/data.py | 2 +- tests/platform/test_platform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data.py b/tests/data.py index 6b6e4c8f6..59c6bce0f 100644 --- a/tests/data.py +++ b/tests/data.py @@ -714,7 +714,7 @@ class Galadriel: }, "port": "drive_q0", RUNCARD.DISTORTIONS: [ - {"name": "lfilter", "a": [1.,0.,1.], "auto_norm": True, "b": [0.5, 0.5], "norm_factor": 1.0} + {"name": "lfilter", "a": [1.0, 0.0, 1.0], "auto_norm": True, "b": [0.5, 0.5], "norm_factor": 1.0} ], RUNCARD.DELAY: 0, }, diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index e9c78b47c..36617b0b9 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -24,7 +24,7 @@ from qililab.instruments.quantum_machines import QuantumMachinesCluster from qililab.platform import Bus, Buses, Platform from qililab.pulse import Drag, Pulse, PulseEvent, PulseSchedule, Rectangular -from qililab.qprogram import QProgram +from qililab.qprogram import QbloxCompiler, QProgram from qililab.result.qblox_results import QbloxResult from qililab.result.qprogram.quantum_machines_measurement_result import QuantumMachinesMeasurementResult from qililab.settings import Runcard From 24379d5e3700004b8d1833a309505ea89ae5ad4e Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Wed, 21 Aug 2024 14:58:09 +0000 Subject: [PATCH 13/35] fixed tests --- tests/platform/test_platform.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index b9b9f5e36..4e6b213b0 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -502,9 +502,13 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): qprogram.play(bus="drive_line_q0_bus", waveform=drive_wf) qprogram.play(bus="drive_line_q1_bus", waveform=drive_wf) - test_waveforms = Waveforms() - test_waveforms.add(array=np.array([0.5, 1.0, 0.5, 0.0]), index=0) - test_waveforms.add(array=drive_wf.envelope(), index=1) + test_waveforms_q0 = Waveforms() + test_waveforms_q0.add(array=np.array([0.5, 1.0, 0.5, 0.0]), index=0) + test_waveforms_q0.add(array=np.array([0.0, 0.0, 0.0, 0.0]), index=1) + + test_waveforms_q1 = Waveforms() + test_waveforms_q1.add(array=drive_wf.envelope(), index=0) + test_waveforms_q1.add(array=np.array([0.0, 0.0, 0.0, 0.0]), index=1) qblox_compiler = QbloxCompiler() sequences, _ = qblox_compiler.compile(qprogram=qprogram) @@ -516,7 +520,8 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access waveforms.name, distrortion.apply(waveforms.data) ) - assert test_waveforms == sequences[bus_alias]._waveforms + assert test_waveforms_q0 == sequences["drive_line_q0_bus"]._waveforms + assert test_waveforms_q1 == sequences["drive_line_q1_bus"]._waveforms def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform From 10db912a235ae6e0f7bae7a6e10a8818150d772b Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Wed, 21 Aug 2024 15:05:17 +0000 Subject: [PATCH 14/35] removed array for list --- tests/platform/test_platform.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 4e6b213b0..acabf15fb 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -503,12 +503,12 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): qprogram.play(bus="drive_line_q1_bus", waveform=drive_wf) test_waveforms_q0 = Waveforms() - test_waveforms_q0.add(array=np.array([0.5, 1.0, 0.5, 0.0]), index=0) - test_waveforms_q0.add(array=np.array([0.0, 0.0, 0.0, 0.0]), index=1) + test_waveforms_q0.add(array=[0.5, 1.0, 0.5, 0.0], index=0) + test_waveforms_q0.add(array=[0.0, 0.0, 0.0, 0.0], index=1) test_waveforms_q1 = Waveforms() test_waveforms_q1.add(array=drive_wf.envelope(), index=0) - test_waveforms_q1.add(array=np.array([0.0, 0.0, 0.0, 0.0]), index=1) + test_waveforms_q1.add(array=[0.0, 0.0, 0.0, 0.0], index=1) qblox_compiler = QbloxCompiler() sequences, _ = qblox_compiler.compile(qprogram=qprogram) From 4064b949a33352b3f13c612341db4d33e58a895d Mon Sep 17 00:00:00 2001 From: jordivallsq <151619025+jordivallsq@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:26:50 +0200 Subject: [PATCH 15/35] Update requirements.txt UPDATED QPYSEQUENCE --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d754bb612..3f210fb62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ qcodes_contrib_drivers==0.18.0 PyVISA-py==0.7.1 tqdm==4.64.1 urllib3==1.26.12 -qpysequence==0.10.3 +qpysequence==0.10.4 lmfit==1.1.0 rustworkx==0.12.1 h5py==3.9.0 From f0b39ab5cfdf853af4305a5ef4f438ddf18be0a7 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 6 Sep 2024 15:16:00 +0000 Subject: [PATCH 16/35] tests --- tests/platform/test_platform.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 3330ac591..cd0617323 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -656,12 +656,12 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): qprogram.play(bus="drive_line_q1_bus", waveform=drive_wf) test_waveforms_q0 = Waveforms() - test_waveforms_q0.add(array=[0.5, 1.0, 0.5, 0.0], index=0) - test_waveforms_q0.add(array=[0.0, 0.0, 0.0, 0.0], index=1) + test_waveforms_q0.add(array=np.array([0.5, 1.0, 0.5, 0.0]).tolist(), index=0) + test_waveforms_q0.add(array=np.array([0.0, 0.0, 0.0, 0.0]).tolist(), index=1) test_waveforms_q1 = Waveforms() test_waveforms_q1.add(array=drive_wf.envelope(), index=0) - test_waveforms_q1.add(array=[0.0, 0.0, 0.0, 0.0], index=1) + test_waveforms_q1.add(array=np.array([0.0, 0.0, 0.0, 0.0]).tolist(), index=1) qblox_compiler = QbloxCompiler() sequences, _ = qblox_compiler.compile(qprogram=qprogram) From 9bfb77e0893cc1b6b7ded6ddec16d51204046416 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 6 Sep 2024 15:25:55 +0000 Subject: [PATCH 17/35] added todict to the _waveforms --- tests/platform/test_platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index cd0617323..11521d60e 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -673,8 +673,8 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access waveforms.name, distrortion.apply(waveforms.data) ) - assert test_waveforms_q0 == sequences["drive_line_q0_bus"]._waveforms - assert test_waveforms_q1 == sequences["drive_line_q1_bus"]._waveforms + assert test_waveforms_q0 == sequences["drive_line_q0_bus"]._waveforms.to_dict() + assert test_waveforms_q1 == sequences["drive_line_q1_bus"]._waveforms.to_dict() def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform From c5297cfa5f92198c06b2336f903267372f7e295c Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 6 Sep 2024 15:36:31 +0000 Subject: [PATCH 18/35] all waveformsto dict --- tests/platform/test_platform.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 11521d60e..bb3cdce2f 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -656,12 +656,12 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): qprogram.play(bus="drive_line_q1_bus", waveform=drive_wf) test_waveforms_q0 = Waveforms() - test_waveforms_q0.add(array=np.array([0.5, 1.0, 0.5, 0.0]).tolist(), index=0) - test_waveforms_q0.add(array=np.array([0.0, 0.0, 0.0, 0.0]).tolist(), index=1) + test_waveforms_q0.add(array=[0.5, 1.0, 0.5, 0.0], index=0) + test_waveforms_q0.add(array=[0.0, 0.0, 0.0, 0.0], index=1) test_waveforms_q1 = Waveforms() test_waveforms_q1.add(array=drive_wf.envelope(), index=0) - test_waveforms_q1.add(array=np.array([0.0, 0.0, 0.0, 0.0]).tolist(), index=1) + test_waveforms_q1.add(array=[0.0, 0.0, 0.0, 0.0], index=1) qblox_compiler = QbloxCompiler() sequences, _ = qblox_compiler.compile(qprogram=qprogram) @@ -673,8 +673,8 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access waveforms.name, distrortion.apply(waveforms.data) ) - assert test_waveforms_q0 == sequences["drive_line_q0_bus"]._waveforms.to_dict() - assert test_waveforms_q1 == sequences["drive_line_q1_bus"]._waveforms.to_dict() + assert test_waveforms_q0.to_dict() == sequences["drive_line_q0_bus"]._waveforms.to_dict() + assert test_waveforms_q1.to_dict() == sequences["drive_line_q1_bus"]._waveforms.to_dict() def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform From adf420b31988ec893e457f01d2e19cd4791e2259 Mon Sep 17 00:00:00 2001 From: jordivallsq <151619025+jordivallsq@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:52:23 +0200 Subject: [PATCH 19/35] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3f210fb62..5b0669131 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ urllib3==1.26.12 qpysequence==0.10.4 lmfit==1.1.0 rustworkx==0.12.1 -h5py==3.9.0 +h5py==3.11.0 papermill==2.4.0 qm-qua==1.2.0 qualang-tools==0.17.6 From 4a2aabb178e5a9313566de4ba12ee50d0db789b1 Mon Sep 17 00:00:00 2001 From: jordivallsq <151619025+jordivallsq@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:55:40 +0200 Subject: [PATCH 20/35] Update requirements.txt --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5b0669131..6b4f8673e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,8 +7,6 @@ PyVISA-py==0.7.1 tqdm==4.64.1 urllib3==1.26.12 qpysequence==0.10.4 -lmfit==1.1.0 -rustworkx==0.12.1 h5py==3.11.0 papermill==2.4.0 qm-qua==1.2.0 From e9599b3fb7964d1a8695a335f93f9cacd99507b2 Mon Sep 17 00:00:00 2001 From: jordivallsq <151619025+jordivallsq@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:09:08 +0200 Subject: [PATCH 21/35] Update changelog-dev.md --- docs/releases/changelog-dev.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docs/releases/changelog-dev.md b/docs/releases/changelog-dev.md index 29f5fbc07..0b63a9c29 100644 --- a/docs/releases/changelog-dev.md +++ b/docs/releases/changelog-dev.md @@ -4,17 +4,6 @@ ### Improvements -- Improve Crosstalk matrix `from_buses` method so it can be a dictionary of buses and crosstalks coefficients. - \[#784\]https://github.com/qilimanjaro-tech/qililab/pull/784 - -- Now platform.get_parameter works for QM without the need of connecting to the machine. - -- Added the option to get the time of flight and smearing information from the QM cluster - [#751](https://github.com/qilimanjaro-tech/qililab/pull/751) - -- Improved the algorithm determining which markers should be ON during execution of circuits and qprograms. Now, all markers are OFF by default, and only the markers associated with the `outputs` setting of QCM-RF and QRM-RF sequencers are turned on. - [#747](https://github.com/qilimanjaro-tech/qililab/pull/747) - - Added pulse distorsions in `execute_qprogram` for QBlox in a similar methodology to the distorsions implemented in pulse circuits. The runcard needs to contain the same structure for distorsions as the runcards for circuits and the code will modify the waveforms after compilation (inside `platform.execute_qprogram`). Example (for Qblox) @@ -44,12 +33,6 @@ [#779](https://github.com/qilimanjaro-tech/qililab/pull/779) -- Automatic method to implement the correct `upsampling_mode` when the output mode is selected as `amplified` (fluxes), the `upsampling_mode` is automatically defined as `pulse`. In this mode, the upsampling is optimized to produce cleaner step responses. - [#783](https://github.com/qilimanjaro-tech/qililab/pull/783) - -- Automatic method for `execute_qprogram` in quantum machines to restart the measurement in case the `StreamProcessingDataLossError` is risen by `qua-qm`, the new feature allows to try again the measurement a number of times equal to the value of `dataloss_tries` (default of three). We can define this value at `execute_qprogram(..., dataloss_tries = N)` and will only do its intended job in case of working with QM. - [#788](https://github.com/qilimanjaro-tech/qililab/pull/788) - ### Breaking changes ### Deprecations / Removals From 624ede95880053d1a5bf1e0d84e00bc356ab64be Mon Sep 17 00:00:00 2001 From: jordivallsq <151619025+jordivallsq@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:03:19 +0200 Subject: [PATCH 22/35] Update src/qililab/platform/platform.py Co-authored-by: Vyron Vasileiadis --- src/qililab/platform/platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index 0c402a82a..854981aba 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -862,7 +862,7 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals buses = {bus_alias: self._get_bus_by_alias(alias=bus_alias) for bus_alias in sequences} for bus_alias, bus in buses.items(): if bus.distortions: - for distrortion in bus.distortions: + for distortion in bus.distortions: for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access waveforms.name, distrortion.apply(waveforms.data) From d9c9c22b7eb36f3d223b7fba9cf8620e9ecb40f5 Mon Sep 17 00:00:00 2001 From: jordivallsq <151619025+jordivallsq@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:03:43 +0200 Subject: [PATCH 23/35] Apply suggestions from code review Co-authored-by: Vyron Vasileiadis --- src/qililab/platform/platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index 854981aba..67d4f5d62 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -863,9 +863,9 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals for bus_alias, bus in buses.items(): if bus.distortions: for distortion in bus.distortions: - for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access + for waveform in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access - waveforms.name, distrortion.apply(waveforms.data) + waveform.name, distrortion.apply(waveform.data) ) if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: From f11074d2b115e24fc4733b622c3744519496e028 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 09:46:12 +0000 Subject: [PATCH 24/35] TYPO --- src/qililab/platform/platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qililab/platform/platform.py b/src/qililab/platform/platform.py index 67d4f5d62..38ae14283 100644 --- a/src/qililab/platform/platform.py +++ b/src/qililab/platform/platform.py @@ -865,7 +865,7 @@ def _execute_qprogram_with_qblox( # pylint: disable=too-many-locals for distortion in bus.distortions: for waveform in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access - waveform.name, distrortion.apply(waveform.data) + waveform.name, distortion.apply(waveform.data) ) if debug: with open("debug_qblox_execution.txt", "w", encoding="utf-8") as sourceFile: From b8708bc8a9c887e25f534c0725de7c05c493a8b9 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 14:31:36 +0000 Subject: [PATCH 25/35] modified tests --- tests/platform/test_platform.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 781428db4..e4a0924dd 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -659,28 +659,16 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): drive_wf = Square(amplitude=1.0, duration=4) qprogram = QProgram() qprogram.play(bus="drive_line_q0_bus", waveform=drive_wf) - qprogram.play(bus="drive_line_q1_bus", waveform=drive_wf) test_waveforms_q0 = Waveforms() test_waveforms_q0.add(array=[0.5, 1.0, 0.5, 0.0], index=0) test_waveforms_q0.add(array=[0.0, 0.0, 0.0, 0.0], index=1) - test_waveforms_q1 = Waveforms() - test_waveforms_q1.add(array=drive_wf.envelope(), index=0) - test_waveforms_q1.add(array=[0.0, 0.0, 0.0, 0.0], index=1) - - qblox_compiler = QbloxCompiler() - sequences, _ = qblox_compiler.compile(qprogram=qprogram) - buses = {bus_alias: platform._get_bus_by_alias(alias=bus_alias) for bus_alias in sequences} - for bus_alias, bus in buses.items(): - if bus.distortions: - for distrortion in bus.distortions: - for waveforms in sequences[bus_alias]._waveforms._waveforms: # pylint: disable=protected-access - sequences[bus_alias]._waveforms.modify( # pylint: disable=protected-access - waveforms.name, distrortion.apply(waveforms.data) - ) - assert test_waveforms_q0.to_dict() == sequences["drive_line_q0_bus"]._waveforms.to_dict() - assert test_waveforms_q1.to_dict() == sequences["drive_line_q1_bus"]._waveforms.to_dict() + with ( + patch.object(Bus, "upload_qpysequence") as upload, + ): + _ = platform.execute_qprogram(qprogram=qprogram) + assert test_waveforms_q0.to_dict() == upload.call_args_list[0] def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform From 30c326aa94dace079241cf8cfde50c30a54cde45 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 14:38:47 +0000 Subject: [PATCH 26/35] tests --- tests/platform/test_platform.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index e4a0924dd..fd764488f 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -665,7 +665,12 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): test_waveforms_q0.add(array=[0.0, 0.0, 0.0, 0.0], index=1) with ( + patch("builtins.open") as patched_open, patch.object(Bus, "upload_qpysequence") as upload, + patch.object(Bus, "run") as run, + patch.object(Bus, "acquire_qprogram_results") as acquire_qprogram_results, + patch.object(QbloxModule, "sync_by_port") as sync_port, + patch.object(QbloxModule, "desync_by_port") as desync_port, ): _ = platform.execute_qprogram(qprogram=qprogram) assert test_waveforms_q0.to_dict() == upload.call_args_list[0] From af10b8b66ae9254071416af82b075c03a14d049d Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:08:56 +0000 Subject: [PATCH 27/35] tests --- tests/platform/test_platform.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index fd764488f..fd459e95b 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -667,13 +667,10 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): with ( patch("builtins.open") as patched_open, patch.object(Bus, "upload_qpysequence") as upload, - patch.object(Bus, "run") as run, - patch.object(Bus, "acquire_qprogram_results") as acquire_qprogram_results, - patch.object(QbloxModule, "sync_by_port") as sync_port, - patch.object(QbloxModule, "desync_by_port") as desync_port, ): _ = platform.execute_qprogram(qprogram=qprogram) - assert test_waveforms_q0.to_dict() == upload.call_args_list[0] + assert test_waveforms_q0.to_dict() == upload.call_args_list[0].args._waveforms.to_dict() + assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform From df3874f68cb2f1503269f517947d3fdabbe31d3a Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:23:21 +0000 Subject: [PATCH 28/35] tests --- tests/platform/test_platform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index fd459e95b..2acd81660 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -667,9 +667,11 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): with ( patch("builtins.open") as patched_open, patch.object(Bus, "upload_qpysequence") as upload, + patch.object(Bus, "run") as run, ): _ = platform.execute_qprogram(qprogram=qprogram) assert test_waveforms_q0.to_dict() == upload.call_args_list[0].args._waveforms.to_dict() + assert run.call_count == 1 assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From 30439c410003f901531579df483e025fd415b6ba Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:29:52 +0000 Subject: [PATCH 29/35] tests --- tests/platform/test_platform.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 2acd81660..0c0ca17b1 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -667,11 +667,13 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): with ( patch("builtins.open") as patched_open, patch.object(Bus, "upload_qpysequence") as upload, - patch.object(Bus, "run") as run, + patch.object(Bus, "run"), + patch.object(Bus, "acquire_qprogram_results"), + patch.object(QbloxModule, "sync_by_port"), + patch.object(QbloxModule, "desync_by_port"), ): _ = platform.execute_qprogram(qprogram=qprogram) assert test_waveforms_q0.to_dict() == upload.call_args_list[0].args._waveforms.to_dict() - assert run.call_count == 1 assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From 93b72421c1343d743cf0e41645d5d5af959134e0 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:35:09 +0000 Subject: [PATCH 30/35] test --- tests/platform/test_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 0c0ca17b1..8138860a5 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -673,7 +673,7 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): patch.object(QbloxModule, "desync_by_port"), ): _ = platform.execute_qprogram(qprogram=qprogram) - assert test_waveforms_q0.to_dict() == upload.call_args_list[0].args._waveforms.to_dict() + assert test_waveforms_q0.to_dict() == upload.call_args_list[0].args#._waveforms.to_dict() assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From c131e252a697b857d9b2d289d4b32417f1bc4bd0 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:40:35 +0000 Subject: [PATCH 31/35] tests --- tests/platform/test_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 8138860a5..ab344670c 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -673,7 +673,7 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): patch.object(QbloxModule, "desync_by_port"), ): _ = platform.execute_qprogram(qprogram=qprogram) - assert test_waveforms_q0.to_dict() == upload.call_args_list[0].args#._waveforms.to_dict() + assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs #._waveforms.to_dict() assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From 24710dc234c38ac7a75647d065ff93e55309ec35 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:45:44 +0000 Subject: [PATCH 32/35] tests --- tests/platform/test_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index ab344670c..0c837ea3f 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -673,7 +673,7 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): patch.object(QbloxModule, "desync_by_port"), ): _ = platform.execute_qprogram(qprogram=qprogram) - assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs #._waveforms.to_dict() + assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs['qpysequence']._waveforms.to_dict() assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From c46fce63a87f2f1ce6161e5dfd65f47ef3f0ad85 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:46:14 +0000 Subject: [PATCH 33/35] tests --- tests/platform/test_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 0c837ea3f..bd724e7fc 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -673,7 +673,7 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): patch.object(QbloxModule, "desync_by_port"), ): _ = platform.execute_qprogram(qprogram=qprogram) - assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs['qpysequence']._waveforms.to_dict() + assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs['qpysequence']#._waveforms.to_dict() assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From bb52ffba7410dd9b8ef7c24a911b1536f25cd269 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:51:52 +0000 Subject: [PATCH 34/35] TESTS --- tests/platform/test_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index bd724e7fc..24c308cf9 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -673,7 +673,7 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): patch.object(QbloxModule, "desync_by_port"), ): _ = platform.execute_qprogram(qprogram=qprogram) - assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs['qpysequence']#._waveforms.to_dict() + assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs["qpysequence"]._waveforms.to_dict() assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( From 58876163aa6719278ac6e9eefe806585341d3066 Mon Sep 17 00:00:00 2001 From: "jordi.valls@qilimanjaro.tech" Date: Fri, 20 Sep 2024 15:57:43 +0000 Subject: [PATCH 35/35] fixed assertion --- tests/platform/test_platform.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/platform/test_platform.py b/tests/platform/test_platform.py index 24c308cf9..5ee95ca38 100644 --- a/tests/platform/test_platform.py +++ b/tests/platform/test_platform.py @@ -27,7 +27,7 @@ from qililab.instruments.quantum_machines import QuantumMachinesCluster from qililab.platform import Bus, Buses, Platform from qililab.pulse import Drag, Pulse, PulseEvent, PulseSchedule, Rectangular -from qililab.qprogram import Calibration, Domain, Experiment, QbloxCompiler, QProgram +from qililab.qprogram import Calibration, Domain, Experiment, QProgram from qililab.result.qblox_results import QbloxResult from qililab.result.qprogram.qprogram_results import QProgramResults from qililab.result.qprogram.quantum_machines_measurement_result import QuantumMachinesMeasurementResult @@ -665,7 +665,7 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): test_waveforms_q0.add(array=[0.0, 0.0, 0.0, 0.0], index=1) with ( - patch("builtins.open") as patched_open, + patch("builtins.open"), patch.object(Bus, "upload_qpysequence") as upload, patch.object(Bus, "run"), patch.object(Bus, "acquire_qprogram_results"), @@ -674,7 +674,6 @@ def test_execute_qprogram_with_qblox_distortions(self, platform: Platform): ): _ = platform.execute_qprogram(qprogram=qprogram) assert test_waveforms_q0.to_dict() == upload.call_args_list[0].kwargs["qpysequence"]._waveforms.to_dict() - assert patched_open.call_count == 1 def test_execute_qprogram_with_quantum_machines( self, platform_quantum_machines: Platform