atomiq.components.electronics.adc ================================= .. py:module:: atomiq.components.electronics.adc .. autoapi-nested-parse:: All analog voltages have to go through an ADC at some point to enter the digital world. Often ADCs appear as multi-channel devices that sample several channels at once. Thus the ADC itself and its channels are represented by seperate classes. The :class:`ADC` class provides a :func:`ADC.measure` function to sample all channels at once while the :class:`ADCChannel` provides a :func:`ADCChannel.measure` method to extract only a single channel from the ADC. Classes ------- .. autoapisummary:: atomiq.components.electronics.adc.ADC atomiq.components.electronics.adc.ADCChannel Module Contents --------------- .. py:class:: ADC(num_chan, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component`, :py:obj:`atomiq.components.primitives.Measurable` An analog-to-ditigal converter (ADC) with multiple channels Many ADCs come with multiple channels that are always sampled together. This class represents such ADCs :param num_chan: Number of channels the ADC has. .. py:attribute:: kernel_invariants .. py:attribute:: num_chan .. py:attribute:: invalid_return .. py:method:: _build() Specify here what should be done for this component in the build phase .. py:method:: _measure(target_arr) :abstractmethod: .. py:method:: measure(samples = 1, channel = '') Measures all channels and returns the mean for a given number of subsequent samples. This method advances the timeline by samples * sampling_time :param samples: number of samples to take and average .. py:class:: ADCChannel(adc_device, channel, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component`, :py:obj:`atomiq.components.primitives.Measurable` An atomiq Component Every component in atomiq inherits from this class. It provides basic functionality for automatic and recursive building and initialization of components (prepare, build, prerun). It also takes care for joining kernel invariants along the inheritance tree. .. Note:: The arguments `parent` and `identifier` are automatically passed to the component object by the atomiq object builder. :param parent: The parent context of the component. Usually this is the experiment that uses the component :param identifier: A unique name to identify the component. :param debug_output: Set whether the component should show debug output. Using this switch rather than the debug kernel logger can allow the compiler to not include the debug commands in the kernel code if the output is not needed. .. py:attribute:: kernel_invariants .. py:attribute:: adc_device .. py:attribute:: channel .. py:method:: measure(samples = 1, cached = False, channel = '')