From c1ccab7d99cbea9c762d1a0166cd51bf313de88c Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Fri, 16 Feb 2024 11:43:11 +0400 Subject: [PATCH 1/2] fix: Remove default debug script file name --- src/qibolab/instruments/qm/controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qibolab/instruments/qm/controller.py b/src/qibolab/instruments/qm/controller.py index 35fb90b56..2267a81ba 100644 --- a/src/qibolab/instruments/qm/controller.py +++ b/src/qibolab/instruments/qm/controller.py @@ -122,7 +122,7 @@ class QMController(Controller): """Smearing used for hardware signal integration.""" calibration_path: Optional[str] = None """Path to the JSON file that contains the mixer calibration.""" - script_file_name: Optional[str] = "qua_script.py" + script_file_name: Optional[str] = None """Name of the file that the QUA program will dumped in that after every execution. From 1affed079857eb1c6c3f28f8b32d5655baee3afa Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:20:47 +0400 Subject: [PATCH 2/2] feat: Integration weights from qubit.kernel --- src/qibolab/instruments/qm/config.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/qibolab/instruments/qm/config.py b/src/qibolab/instruments/qm/config.py index 5021a01e2..4dab43379 100644 --- a/src/qibolab/instruments/qm/config.py +++ b/src/qibolab/instruments/qm/config.py @@ -340,19 +340,27 @@ def register_integration_weights(self, qubit, readout_len): readout_len (int): Duration of the readout pulse in ns. """ angle = 0 + cos, sin = np.cos(angle), np.sin(angle) + if qubit.kernel is None: + convert = lambda x: [(x, readout_len)] + else: + cos = qubit.kernel * cos + sin = qubit.kernel * sin + convert = lambda x: x + self.integration_weights.update( { f"cosine_weights{qubit.name}": { - "cosine": [(np.cos(angle), readout_len)], - "sine": [(-np.sin(angle), readout_len)], + "cosine": convert(cos), + "sine": convert(-sin), }, f"sine_weights{qubit.name}": { - "cosine": [(np.sin(angle), readout_len)], - "sine": [(np.cos(angle), readout_len)], + "cosine": convert(sin), + "sine": convert(cos), }, f"minus_sine_weights{qubit.name}": { - "cosine": [(-np.sin(angle), readout_len)], - "sine": [(-np.cos(angle), readout_len)], + "cosine": convert(-sin), + "sine": convert(-cos), }, } )