From 77ede74a030a081f783bc002b78eba900b5f2d12 Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:58:50 +0400 Subject: [PATCH] fix: handle integer duration in QM --- src/qibolab/_core/instruments/qm/controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qibolab/_core/instruments/qm/controller.py b/src/qibolab/_core/instruments/qm/controller.py index 805196556..ed06c9531 100644 --- a/src/qibolab/_core/instruments/qm/controller.py +++ b/src/qibolab/_core/instruments/qm/controller.py @@ -331,7 +331,9 @@ def register_pulses(self, configs: dict[str, Config], sequence: PulseSequence): acquisitions (dict): Map from measurement instructions to acquisition objects. """ for id, pulse in sequence: - if hasattr(pulse, "duration") and not pulse.duration.is_integer(): + if hasattr(pulse, "duration") and not ( + isinstance(pulse.duration, int) or pulse.duration.is_integer() + ): raise ValueError( f"Quantum Machines cannot play pulse with duration {pulse.duration}. " "Only integer duration in ns is supported."