atomiq.components.electronics.adc¶
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 separate classes. The ADC class provides a ADC.measure() function to sample all channels at once
while the ADCChannel provides a ADCChannel.measure() method to extract only a single channel from the
ADC.
Classes¶
An analog-to-ditigal converter (ADC) with multiple channels |
|
An atomiq Component |
Module Contents¶
- class atomiq.components.electronics.adc.ADC(num_chan, *args, **kwargs)[source]¶
Bases:
atomiq.components.primitives.Component,atomiq.components.primitives.MeasurableAn analog-to-ditigal converter (ADC) with multiple channels
Many ADCs come with multiple channels that are always sampled together. This class represents such ADCs
- Parameters:
num_chan (numpy.int32) -- Number of channels the ADC has.
- kernel_invariants¶
- _shape_changing_arguments = ('num_chan',)¶
Names of the constructor arguments whose value (not only their type) changes the shape of the component, i.e. change the types and signatures of class members. The component factory gives objects of the same shape a shared class (and thus a shared compiler specialization). Arguments listed here are compared by value. Definitions along the inheritance hierarchy are merged.
- num_chan¶
- invalid_return¶
- abstractmethod _measure(target_arr)[source]¶
- Parameters:
target_arr (TArray(TFloat))
- Return type:
TArray(TFloat)
- measure(samples=np.int32(1), channel='')[source]¶
Measures all channels and returns the mean for a given number of subsequent samples.
This method advances the timeline by samples * sampling_time
- Parameters:
samples (numpy.int32) -- number of samples to take and average
channel (str)
- Return type:
TArray(TFloat)
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- children = []¶
- __in_build = True¶
- channels: list[str]¶
- measurement_channels()¶
- class atomiq.components.electronics.adc.ADCChannel(adc_device, channel, *args, **kwargs)[source]¶
Bases:
atomiq.components.primitives.Component,atomiq.components.primitives.MeasurableAn 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.
- Parameters:
parent -- The parent context of the component. Usually this is the experiment that uses the component
identifier -- A unique name to identify the component.
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.
adc_device (ADC)
channel (numpy.int32)
- kernel_invariants¶
- adc_device¶
- channel¶
- measure(samples=np.int32(1), cached=False, channel='')[source]¶
- Parameters:
samples (numpy.int32)
cached (bool)
channel (str)
- Return type:
float
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- children = []¶
- __in_build = True¶
- channels: list[str]¶
- measurement_channels()¶