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 seperate 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

ADC

An analog-to-ditigal converter (ADC) with multiple channels

ADCChannel

An atomiq Component

Module Contents

class atomiq.components.electronics.adc.ADC(num_chan, *args, **kwargs)[source]

Bases: atomiq.components.primitives.Component, 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

Parameters:

num_chan (artiq.language.types.TInt32) -- Number of channels the ADC has.

kernel_invariants
num_chan
invalid_return
_build()[source]

Specify here what should be done for this component in the build phase

abstractmethod _measure(target_arr)[source]
Parameters:

target_arr (TArray(TFloat))

Return type:

TArray(TFloat)

measure(samples=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 (artiq.language.types.TInt32) -- number of samples to take and average

  • channel (artiq.language.types.TStr)

Return type:

TArray(TFloat)

class atomiq.components.electronics.adc.ADCChannel(adc_device, channel, *args, **kwargs)[source]

Bases: atomiq.components.primitives.Component, 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.

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 (artiq.language.types.TInt32)

kernel_invariants
adc_device
channel
measure(samples=1, cached=False, channel='')[source]
Parameters:
  • samples (artiq.language.types.TInt32)

  • cached (artiq.language.types.TBool)

  • channel (artiq.language.types.TStr)

Return type:

artiq.language.types.TFloat