importloggingimportnumpyasnpfrompydanticimportFieldfromqibolab._core.componentsimportChannel,Configfromqibolab._core.execution_parametersimport(AcquisitionType,AveragingMode,ExecutionParameters,)fromqibolab._core.identifierimportChannelIdfromqibolab._core.pulsesimportAcquisitionfromqibolab._core.sequenceimportPulseSequencefromqibolab._core.sweeperimportParallelSweepersfromqibolab._core.unrollingimportBoundsfrom.abstractimportControllerfrom.oscillatorimportLocalOscillatorlog=logging.getLogger(__name__)SAMPLING_RATE=1BOUNDS=Bounds(waveforms=1,readout=1,instructions=1)__all__=["DummyLocalOscillator","DummyInstrument"]classDummyDevice:"""Dummy device that does nothing but follows the QCoDeS interface. Used by :class:`qibolab.instruments.dummy.DummyLocalOscillator`. """defset(self,name,value):"""Set device property."""defget(self,name):"""Get device property."""return0defon(self):"""Turn device on."""defoff(self):"""Turn device on."""defclose(self):"""Close connection with device."""
[docs]classDummyLocalOscillator(LocalOscillator):"""Dummy local oscillator instrument. Useful for testing the interface defined in :class:`qibolab.instruments.oscillator.LocalOscillator`. """
[docs]classDummyInstrument(Controller):"""Dummy instrument that returns random voltage values. Useful for testing code without requiring access to hardware. Args: name (str): name of the instrument. address (int): address to connect to the instrument. Not used since the instrument is dummy, it only exists to keep the same interface with other instruments. """address:strbounds:str="dummy/bounds"channels:dict[ChannelId,Channel]=Field(default_factory=dict)@propertydefsampling_rate(self)->int:returnSAMPLING_RATE
[docs]defconnect(self):log.info("Connecting to dummy instrument.")