def test_parsing_raw_capture(): parse_equals( "DECLARE iqs REAL[200000]\n" 'RAW-CAPTURE 0 "ro_rx" 0.001 iqs', Declare("iqs", "REAL", 200000), RawCapture(Frame([Qubit(0)], "ro_rx"), 0.001, MemoryReference("iqs")), ) parse_equals( "DECLARE iqs REAL[200000]\n" 'NONBLOCKING RAW-CAPTURE 0 "ro_rx" 0.001 iqs', Declare("iqs", "REAL", 200000), RawCapture(Frame([Qubit(0)], "ro_rx"), 0.001, MemoryReference("iqs"), nonblocking=True), )
def RAW_CAPTURE( frame: Frame, duration: float, memory_region: MemoryReferenceDesignator, nonblocking: bool = False, ) -> RawCapture: """ Produce a RAW-CAPTURE instruction. :param frame: The frame on which to capture raw values. :param duration: The duration of the capture, in seconds. :param memory_region: The classical memory region to store the resulting raw values. :param nonblocking: A flag indicating whether the capture is NONBLOCKING. :returns: A RawCapture instance. """ memory_region = unpack_classical_reg(memory_region) return RawCapture(frame, duration, memory_region, nonblocking)
def raw_capture(self, nonblocking, frame, expression, addr): c = RawCapture(frame, expression, addr, nonblocking=nonblocking) return c