From 5a1cadf236919d723228254738b4dfc09415d1b7 Mon Sep 17 00:00:00 2001 From: Simon Humpohl Date: Fri, 1 Sep 2023 12:49:51 +0200 Subject: [PATCH] Add stub of deca dac program builder --- qupulse/program/decadac.py | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 qupulse/program/decadac.py diff --git a/qupulse/program/decadac.py b/qupulse/program/decadac.py new file mode 100644 index 00000000..f298fdc3 --- /dev/null +++ b/qupulse/program/decadac.py @@ -0,0 +1,51 @@ +from dataclasses import dataclass +from typing import Mapping, Optional, Sequence, ContextManager, Iterable + +from qupulse import ChannelID, MeasurementWindow +from qupulse.parameter_scope import Scope +from qupulse.program import ProgramBuilder, HardwareTime, HardwareVoltage, Waveform, RepetitionCount, TimeType + + +@dataclass +class DecaDACASCIIProgram: + script: str + duration: TimeType + + +class DecaDACASCIIBuilder: + def __init__(self): + pass + + def inner_scope(self, scope: Scope) -> Scope: + """This function is necessary to inject program builder specific parameter implementations into the build + process.""" + raise NotImplementedError('TODO') + + def hold_voltage(self, duration: HardwareTime, voltages: Mapping[ChannelID, HardwareVoltage]): + raise NotImplementedError('TODO') + + def play_arbitrary_waveform(self, waveform: Waveform): + raise NotImplementedError('Not implemented yet (postponed)') + + def measure(self, measurements: Optional[Sequence[MeasurementWindow]]): + """Ignores measurements""" + pass + + def with_repetition(self, repetition_count: RepetitionCount, + measurements: Optional[Sequence[MeasurementWindow]] = None) -> Iterable['ProgramBuilder']: + raise NotImplementedError('TODO') + + def with_sequence(self, + measurements: Optional[Sequence[MeasurementWindow]] = None) -> ContextManager['ProgramBuilder']: + raise NotImplementedError('TODO') + + def new_subprogram(self, global_transformation: 'Transformation' = None) -> ContextManager['ProgramBuilder']: + raise NotImplementedError('Not implemented yet (postponed)') + + def with_iteration(self, index_name: str, rng: range, + measurements: Optional[Sequence[MeasurementWindow]] = None) -> Iterable['ProgramBuilder']: + raise NotImplementedError('TODO') + + def to_program(self) -> Optional[DecaDACASCIIProgram]: + """Further addition of new elements might fail after finalizing the program.""" + raise NotImplementedError('TODO')