atomiq.components.dummies module¶
Dummies¶
This module gathers differnt dummy components that mimic hardware but do nothing. They are mainly used for debugging atomiq
- class atomiq.components.dummies.DummyADC(return_value, *args, **kwargs)[source]¶
Bases:
ADC
A Measurable has one or more channels at which data can be measured
- Parameters:
return_value (TFloat)
- kernel_invariants = {'return_value'}¶
- 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
- Parameters:
samples (TInt32) -- number of samples to take and average
channel (TStr)
- Return type:
TArray(TFloat)
- measurement_channels()¶
- class atomiq.components.dummies.DummyRFSource(default_frequency=100000000.0, default_amplitude=0.0, default_phase=0.0, freq_limit=(0.0, inf), amp_limit=(0.0, 1.0), blind=False, default_ramp_steps=30, *args, **kwargs)[source]¶
Bases:
RFSource
A dummy RFSource used for debugging
A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)
- Parameters:
default_frequency (TFloat)
default_amplitude (TFloat)
default_phase (TFloat)
freq_limit (tuple)
amp_limit (tuple)
blind (TBool)
default_ramp_steps (TInt32)
- arb(duration, samples_amp=[], samples_freq=[], samples_phase=[], repetitions=1, prepare_only=False, run_prepared=False, transform_amp=<function identity_float>, transform_freq=<function identity_float>, transform_phase=<function identity_float>)¶
Play Arbitrary Samples from a List
This method allows to set the output amplitude, frequency an phase according to the values specified in respective lists. The whole sequence is played in the specified duration. The pattern store in the sample list can also be repeated.
Tip
We supports a scheme to prepare the arb function before it is actually used. If that is needed, run this function with
prepapre_only = True
when the arb should be prepared and withrun_prepared = True
when the prepared arb should be played. In both calls the other parameters have to be passed.- Parameters:
samples_amp (TList(TFloat)) -- List of amplitude samples. If this list is empty (default), the amplitude is not modified.
samples_freq (TList(TFloat)) -- List of frequency samples. If this list is empty (default), the frequency is not modified.
samples_phase (TList(TFloat)) -- List of phase samples. If this list is empty (default), the phase is not modified.
duration (TFloat) -- The time in which the whole sequence of samples should be played back [s].
repetitions (TInt32) -- Number of times the sequence of all samples should be played. (default 1)
prepare_only (TBool) -- Only write the sequence to RAM, don't play it.
run_prepared (TBool) -- Play arb sequence previously prepared with
prepare_only
.transform_amp -- Function to transform amplitude samples, must take a single argument of type
TFloat
and return a singleTFloat
.transform_freq -- Function to transform frequency samples (see
transform_amp
).transform_phase -- Function to transform phase samples (see
transform_amp
).
- get_amplitude()¶
- Return type:
artiq.language.types.TFloat
- get_frequency()¶
- Return type:
artiq.language.types.TFloat
- get_phase()¶
- Return type:
artiq.language.types.TFloat
- kernel_invariants = {'amp_max', 'amp_min', 'default_ramp_steps', 'freq_max', 'freq_min'}¶
- ramp(duration, frequency_start=nan, frequency_end=nan, amplitude_start=nan, amplitude_end=nan, ramp_timestep=nan, ramp_steps=-1)¶
Ramp frequency and amplitude over a given duration. Parameters default to
-1
ornan
to indicate no change. If the start frequency/amplitude is set tonan
, the ramp starts from the last frequency/amplitude which was set. This method advances the timeline by ´duration´- Parameters:
duration (artiq.language.types.TFloat) -- ramp duration [s]
frequency_start (artiq.language.types.TFloat) -- initial frequency [Hz]
frequency_end (artiq.language.types.TFloat) -- end frequency [Hz]
amplitude_start (artiq.language.types.TFloat) -- initial amplitude [0..1]
amplitude_end (artiq.language.types.TFloat) -- end amplitude [0..1]
ramp_timesteps -- time between steps in the ramp [s]
ramp_steps (artiq.language.types.TInt32) -- number of steps the whole ramp should have. This takes precedence over ramp_timesteps
ramp_timestep (artiq.language.types.TFloat)
- set(frequency=nan, amplitude=nan, phase=0.0)¶
Set the frequency and amplitude of the DDS channel
Frequency/amplitude are set to the last known value if
float("nan")
is passed (default).- Parameters:
frequency (artiq.language.types.TFloat) -- Frequency in Hz (
nan
to use previous value)amplitude (artiq.language.types.TFloat) -- Amplitude (
nan
to use previous value)phase (artiq.language.types.TFloat) -- Phase in rad (default 0.0)
- set_amplitude(amplitude)¶
- set_frequency(frequency)¶
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- set_phase(phase)¶
- class atomiq.components.dummies.DummyDAC(*args, **kwargs)[source]¶
Bases:
DAC
A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)
- set_channel_voltage(channel, voltage)[source]¶
- Parameters:
channel (artiq.language.types.TInt32)
voltage (artiq.language.types.TFloat)
- kernel_invariants = {'num_chan'}¶
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- class atomiq.components.dummies.DummyActor(*args, **kwargs)[source]¶
Bases:
Component
,Parametrizable
A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- class atomiq.components.dummies.DummyMonitor(dummy_actor, *args, **kwargs)[source]¶
Bases:
Component
,Measurable
A Measurable has one or more channels at which data can be measured
- Parameters:
dummy_actor (DummyActor)
- measure(channel='')¶
- Parameters:
channel (artiq.language.types.TStr)
- Return type:
artiq.language.types.TFloat
- measurement_channels()¶
- class atomiq.components.dummies.DummySwitch(channels, *args, **kwargs)[source]¶
Bases:
Component
,Switchable
A Switchable has one or more channel(s) that can be switched on or off
- is_on(channel='')[source]¶
- Parameters:
channel (artiq.language.types.TStr)
- Return type:
artiq.language.types.TBool
- pulse(pulsetime, channel='')¶
- Parameters:
pulsetime (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- toggle(channel=None)¶
- Parameters:
channel (artiq.language.types.TStr)