From a6a115e49ce82cc28e10adc8e4cd68f0e8637527 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 23 Aug 2024 16:42:01 +0200 Subject: [PATCH] feat: Add readout constructor from probe pulse --- src/qibolab/pulses/pulse.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qibolab/pulses/pulse.py b/src/qibolab/pulses/pulse.py index f95ee52d5..2b03b3e58 100644 --- a/src/qibolab/pulses/pulse.py +++ b/src/qibolab/pulses/pulse.py @@ -117,6 +117,14 @@ class Readout(_PulseLike): acquisition: Acquisition probe: Pulse + @classmethod + def from_probe(cls, probe: Pulse): + """Create a whole readout operation from its probe pulse. + + The acquisition is made to match the same probe duration. + """ + return cls(acquisition=Acquisition(duration=probe.duration), probe=probe) + @property def duration(self) -> float: """Duration in ns."""