atomiq.components.sinara.suservo module

class atomiq.components.sinara.suservo.SUServo(suservo_device, start_loop=True, *args, **kwargs)[source]

Bases: Component

Representation for the SUServo gateware

On init, the servo loop in the SUServo is stared automatically. If this is not wanted configure the :param:start_loop

Parameters:
  • suservo_device -- The artiq SUServo device from your device_db, e.g. @suservo0.

  • start_loop (TBool) -- Sets if the servo loop should be started at the prerun stage.

kernel_invariants = {'start_loop', 'suservo_device'}
set_servomode(enabled)[source]
Parameters:

enabled (artiq.compiler.types.TMono('bool', OrderedDict()))

get_adc_value(channel)[source]
Parameters:

channel (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

Return type:

artiq.compiler.types.TMono('float', OrderedDict())

set_adc_gain(channel, gain=0)[source]
Parameters:
  • channel (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

  • gain (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

append_to_dataset(key, value)

Append a value to a dataset.

The target dataset must be a list (i.e. support append()), and must have previously been set from this experiment.

The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.

build()

Should be implemented by the user to request arguments.

Other initialization steps such as requesting devices may also be performed here.

There are two situations where the requested devices are replaced by DummyDevice() and arguments are set to their defaults (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

Datasets are read-only in this method.

Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).

call_child_method(method, *args, **kwargs)

Calls the named method for each child, if it exists for that child, in the order of registration.

Parameters:
  • method (str) -- Name of the method to call

  • args -- Tuple of positional arguments to pass to all children

  • kwargs -- Dict of keyword arguments to pass to all children

get_argument(key, processor, group=None, tooltip=None)

Retrieves and returns the value of an argument.

This function should only be called from build.

Parameters:
  • key -- Name of the argument.

  • processor -- A description of how to process the argument, such as instances of BooleanValue and NumberValue.

  • group -- An optional string that defines what group the argument belongs to, for user interface purposes.

  • tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.

get_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Returns the contents of a dataset.

The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.

If the dataset does not exist, returns the default value. If no default is provided, raises KeyError.

By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.

Parameters:

archive -- Set to False to prevent archival together with the run's results. Default is True.

get_dataset_metadata(key, default=<class 'artiq.language.environment.NoDefault'>)

Returns the metadata of a dataset.

Returns dictionary with items describing the dataset, including the units, scale and precision.

This function is used to get additional information for displaying the dataset.

See set_dataset() for documentation of metadata items.

get_device(key)

Creates and returns a device driver.

get_device_db()

Returns the full contents of the device database.

interactive(title='')

Request arguments from the user interactively.

This context manager returns a namespace object on which the method setattr_argument() should be called, with the usual semantics.

When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.

If the interactive arguments request is cancelled, raises CancelledArgsError.

mutate_dataset(key, index, value)

Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)

If the dataset was created in broadcast mode, the modification is immediately transmitted.

If the index is a tuple of integers, it is interpreted as slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted as slice(*sub_tuple) (multi-dimensional slicing).

register_child(child)
set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)

Sets the contents and handling modes of a dataset.

Datasets must be scalars (bool, int, float or NumPy scalar) or NumPy arrays.

Parameters:
  • unit -- A string representing the unit of the value.

  • scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.

  • precision -- The maximum number of digits to print after the decimal point. Set precision=None to print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.

  • broadcast -- the data is sent in real-time to the master, which dispatches it.

  • persist -- the master should store the data on-disk. Implies broadcast.

  • archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).

set_default_scheduling(priority=None, pipeline_name=None, flush=None)

Sets the default scheduling options.

This function should only be called from build.

setattr_argument(key, processor=None, group=None, tooltip=None)

Sets an argument as attribute. The names of the argument and of the attribute are the same.

The key is added to the instance's kernel invariants.

setattr_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.

setattr_device(key)

Sets a device driver as attribute. The names of the device driver and of the attribute are the same.

The key is added to the instance's kernel invariants.

class atomiq.components.sinara.suservo.SUServoChannel(suservo, suservo_channel, default_attenuation=19.0, default_profile=0, servo_divider=10.0, *args, **kwargs)[source]

Bases: RFSource, Switchable

A Urukul DDS channel in SUServo configuration as RF Source

If not in servo mode, this can be used just like a normal :class:UrukulChannel

Parameters:
  • suservo (SUServo) -- The atomiq SUServo component this channel belongs to

  • suservo_channel -- The artiq SUServo channel from your device_db, e.g. @suservo0_ch2.

  • default_profile -- Which of the 32 profiles of the SUServo should be used? (default 0)

  • servo_divider (TFloat) -- Todo: Why do we need this? (default 10.0)

A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)

kernel_invariants = {'cpld', 'suservo', 'suservo_channel'}
set(frequency=nan, amplitude=nan, phase=0.0, profile=-1)[source]

Set the frequency and amplitude of the DDS channel

Frequency/amplitude are set to the last known value if nan is passed (default).

Parameters:
  • frequency (artiq.compiler.types.TMono('float', OrderedDict())) -- Frequency in Hz (nan to use previous value)

  • amplitude (artiq.compiler.types.TMono('float', OrderedDict())) -- If servomode is off, this is the DDS amplitude (0..1). If servomode is on, this is the target voltage on the photodiode. (nan to use previous value)

  • phase (artiq.compiler.types.TMono('float', OrderedDict())) -- Phase in rad to be set (default 0.0)

  • profile (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- DDS Profile (-1 to keep current profile)

set_att(attenuation)[source]

Set the hardware attenuation for this urukul channel via cpld.

Parameters:

attenuation (artiq.compiler.types.TMono('float', OrderedDict())) -- channel attenuation (0. to 31.0 in 0.5 increments) [dB]

set_amplitude(amplitude)[source]

Set the amplitude of the DDS output

Parameters:

amplitude -- If servomode is off, this is the DDS amplitude (0..1). If servomode is on, this is the target voltage on the photodiode.

on()[source]

Turn on the RF output via the fast switch

off()[source]

Turn off the RF output via the fast switch

set_servomode(enabled)[source]

Switch servo mode of the SUServo on or off

The servo loop in the SUServo gateware (running on the Kasli) can only be switched on globally for all channels. However, we can decide for each channel if the output of the servo loop should be given to the DDS. This function switches the the updating for this channel.

Parameters:

enabled (artiq.compiler.types.TMono('bool', OrderedDict())) -- Whether the servomode should be enabled

append_to_dataset(key, value)

Append a value to a dataset.

The target dataset must be a list (i.e. support append()), and must have previously been set from this experiment.

The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.

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.

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 with run_only = True when the prepared arb should be played. In both calls the other parameters have to be passed.

Parameters:
  • samples_amp (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of amplitude samples. If this list is empty (default), the amplitude is not modified.

  • samples_freq (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of frequency samples. If this list is empty (default), the frequency is not modified.

  • samples_phase (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of phase samples. If this list is empty (default), the phase is not modified.

  • duration (artiq.compiler.types.TMono('float', OrderedDict())) -- The time in which the whole sequence of samples should be played back [s].

  • repetitions (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Number of times the sequence of all samples should be played. (default 1)

  • prepare_only (artiq.compiler.types.TMono('bool', OrderedDict()))

  • run_prepared (artiq.compiler.types.TMono('bool', OrderedDict()))

build()

Should be implemented by the user to request arguments.

Other initialization steps such as requesting devices may also be performed here.

There are two situations where the requested devices are replaced by DummyDevice() and arguments are set to their defaults (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

Datasets are read-only in this method.

Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).

call_child_method(method, *args, **kwargs)

Calls the named method for each child, if it exists for that child, in the order of registration.

Parameters:
  • method (str) -- Name of the method to call

  • args -- Tuple of positional arguments to pass to all children

  • kwargs -- Dict of keyword arguments to pass to all children

get_amplitude()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

get_argument(key, processor, group=None, tooltip=None)

Retrieves and returns the value of an argument.

This function should only be called from build.

Parameters:
  • key -- Name of the argument.

  • processor -- A description of how to process the argument, such as instances of BooleanValue and NumberValue.

  • group -- An optional string that defines what group the argument belongs to, for user interface purposes.

  • tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.

get_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Returns the contents of a dataset.

The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.

If the dataset does not exist, returns the default value. If no default is provided, raises KeyError.

By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.

Parameters:

archive -- Set to False to prevent archival together with the run's results. Default is True.

get_dataset_metadata(key, default=<class 'artiq.language.environment.NoDefault'>)

Returns the metadata of a dataset.

Returns dictionary with items describing the dataset, including the units, scale and precision.

This function is used to get additional information for displaying the dataset.

See set_dataset() for documentation of metadata items.

get_device(key)

Creates and returns a device driver.

get_device_db()

Returns the full contents of the device database.

get_frequency()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

get_phase()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

interactive(title='')

Request arguments from the user interactively.

This context manager returns a namespace object on which the method setattr_argument() should be called, with the usual semantics.

When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.

If the interactive arguments request is cancelled, raises CancelledArgsError.

is_on(channel=None)
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))

mutate_dataset(key, index, value)

Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)

If the dataset was created in broadcast mode, the modification is immediately transmitted.

If the index is a tuple of integers, it is interpreted as slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted as slice(*sub_tuple) (multi-dimensional slicing).

pulse(pulsetime, channel='')
Parameters:
  • pulsetime (artiq.compiler.types.TMono('float', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

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 or nan to indicate no change. If the start frequency/amplitude is set to nan, the ramp starts from the last frequency/amplitude which was set. This method advances the timeline by ´duration´

Parameters:
  • duration (artiq.compiler.types.TMono('float', OrderedDict())) -- ramp duration [s]

  • frequency_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial frequency [Hz]

  • frequency_end (artiq.compiler.types.TMono('float', OrderedDict())) -- end frequency [Hz]

  • amplitude_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial amplitude [0..1]

  • amplitude_end (artiq.compiler.types.TMono('float', OrderedDict())) -- end amplitude [0..1]

  • ramp_timesteps -- time between steps in the ramp [s]

  • ramp_steps (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- number of steps the whole ramp should have. This takes precedence over ramp_timesteps

  • ramp_timestep (artiq.compiler.types.TMono('float', OrderedDict()))

register_child(child)
set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)

Sets the contents and handling modes of a dataset.

Datasets must be scalars (bool, int, float or NumPy scalar) or NumPy arrays.

Parameters:
  • unit -- A string representing the unit of the value.

  • scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.

  • precision -- The maximum number of digits to print after the decimal point. Set precision=None to print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.

  • broadcast -- the data is sent in real-time to the master, which dispatches it.

  • persist -- the master should store the data on-disk. Implies broadcast.

  • archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).

set_default_scheduling(priority=None, pipeline_name=None, flush=None)

Sets the default scheduling options.

This function should only be called from build.

set_frequency(frequency)
set_parameter(value, channel=None)
Parameters:
  • value (artiq.compiler.types.TMono('float', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

set_phase(phase)
setattr_argument(key, processor=None, group=None, tooltip=None)

Sets an argument as attribute. The names of the argument and of the attribute are the same.

The key is added to the instance's kernel invariants.

setattr_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.

setattr_device(key)

Sets a device driver as attribute. The names of the device driver and of the attribute are the same.

The key is added to the instance's kernel invariants.

toggle(channel=None)
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))

class atomiq.components.sinara.suservo.SUServoADCChannel(suservo, default_gain=0, *args, **kwargs)[source]

Bases: ADCChannel

Analog Input of a Sampler in an SUServo configuration

ATTENTION: When default_gain is !=1 is given, this might cause problems in closed loop mode. It seems SUServo internally uses gain=1. Maybe it can be set differntly but I don't see how.

Parameters:
  • suservo (SUServo) -- The SUServo component that this channel belongs to

  • default_gain (TInt32) -- The default gain in machine units (0: 1, ..., 3: 1000) to set for this channel on startup

A single channel of a (possibly multichannel) ADC

Parameters:
  • adc_device -- The ADC the channel belongs to

  • channel -- The number of the channel

  • suservo (SUServo)

  • default_gain (TInt32)

kernel_invariants = {'suservo'}
set_gain(gain=0)[source]

Set the gain for the ADC channel in SUServo configuration

Parameters:

gain (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Gain in machine units (0: 1, ..., 3: 1000)

measure(samples=1, cached=False)[source]
Parameters:
  • samples (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

  • cached (artiq.compiler.types.TMono('bool', OrderedDict()))

Return type:

artiq.compiler.types.TMono('float', OrderedDict())

append_to_dataset(key, value)

Append a value to a dataset.

The target dataset must be a list (i.e. support append()), and must have previously been set from this experiment.

The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.

build()

Should be implemented by the user to request arguments.

Other initialization steps such as requesting devices may also be performed here.

There are two situations where the requested devices are replaced by DummyDevice() and arguments are set to their defaults (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

Datasets are read-only in this method.

Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).

call_child_method(method, *args, **kwargs)

Calls the named method for each child, if it exists for that child, in the order of registration.

Parameters:
  • method (str) -- Name of the method to call

  • args -- Tuple of positional arguments to pass to all children

  • kwargs -- Dict of keyword arguments to pass to all children

get_argument(key, processor, group=None, tooltip=None)

Retrieves and returns the value of an argument.

This function should only be called from build.

Parameters:
  • key -- Name of the argument.

  • processor -- A description of how to process the argument, such as instances of BooleanValue and NumberValue.

  • group -- An optional string that defines what group the argument belongs to, for user interface purposes.

  • tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.

get_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Returns the contents of a dataset.

The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.

If the dataset does not exist, returns the default value. If no default is provided, raises KeyError.

By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.

Parameters:

archive -- Set to False to prevent archival together with the run's results. Default is True.

get_dataset_metadata(key, default=<class 'artiq.language.environment.NoDefault'>)

Returns the metadata of a dataset.

Returns dictionary with items describing the dataset, including the units, scale and precision.

This function is used to get additional information for displaying the dataset.

See set_dataset() for documentation of metadata items.

get_device(key)

Creates and returns a device driver.

get_device_db()

Returns the full contents of the device database.

interactive(title='')

Request arguments from the user interactively.

This context manager returns a namespace object on which the method setattr_argument() should be called, with the usual semantics.

When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.

If the interactive arguments request is cancelled, raises CancelledArgsError.

measurement_channels()
mutate_dataset(key, index, value)

Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)

If the dataset was created in broadcast mode, the modification is immediately transmitted.

If the index is a tuple of integers, it is interpreted as slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted as slice(*sub_tuple) (multi-dimensional slicing).

register_child(child)
set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)

Sets the contents and handling modes of a dataset.

Datasets must be scalars (bool, int, float or NumPy scalar) or NumPy arrays.

Parameters:
  • unit -- A string representing the unit of the value.

  • scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.

  • precision -- The maximum number of digits to print after the decimal point. Set precision=None to print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.

  • broadcast -- the data is sent in real-time to the master, which dispatches it.

  • persist -- the master should store the data on-disk. Implies broadcast.

  • archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).

set_default_scheduling(priority=None, pipeline_name=None, flush=None)

Sets the default scheduling options.

This function should only be called from build.

setattr_argument(key, processor=None, group=None, tooltip=None)

Sets an argument as attribute. The names of the argument and of the attribute are the same.

The key is added to the instance's kernel invariants.

setattr_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.

setattr_device(key)

Sets a device driver as attribute. The names of the device driver and of the attribute are the same.

The key is added to the instance's kernel invariants.

class atomiq.components.sinara.suservo.SUServoModulatedLaser(default_kp, default_ki=0.0, default_ki_limit=0.0, *args, **kwargs)[source]

Bases: ContinuouslyStabilizedModulatedLaser

A Laser with intensity stabilization realized by the SUServo

The SUServo realizes a PI servo controller in hardware with an update time inteval of 1.3us, leading to a maximum analog bandwith of >500kHz. To achieve this a Sampler (8 analog in) is bundled in the gateware with two Urukuls (2 x 4 DDS channels).

With this class, the SUServo can be used in open loop as well as in closed loop mode. Use the stabilize() function to switch between open and closed loop mode. When switching from closed to open loop, the last output power on the DDS channel will be hold.

Parameters:
  • modulator -- The modulator (most likely an AOM) that is driven by the SUServo. The Modulator given here must be of a class derived from :class:RFLightModulator and the rfsource of the modulator must be of the class :class:SUServoChannel.

  • photodiode -- The photodiode monitoring the laser. The photodiode must be of a class derived from :class:AnalogPhotodiode and the photodiode's :param:adc_channel must be of the class :class:SUServoADCChannel.

  • default_kp (TFloat) -- default proportional (P-) part for the SUServo loop. Values should be negative.

  • default_ki (TFloat) -- default integral (I-) part for the SUServo loop. Values should be negative. (default 0.0)

  • default_ki_limit (TFloat) -- default limit for I-part of the SUServo loop. 0.0 means unlimited. (default 0.0)

A Switchable has one or more channel(s) that can be switched on or off

kernel_invariants = {'default_ki', 'default_ki_limit', 'default_kp', 'suservo_channel'}
set_servo_parameter(adc_channel, kp, ki, ki_limit, delay=0.0)[source]

Set servo loop parameters.

Parameters:
  • kp (artiq.compiler.types.TMono('float', OrderedDict())) -- proportional (P-) part for the SUServo loop. Values should be negative.

  • ki (artiq.compiler.types.TMono('float', OrderedDict())) -- integral (I-) part for the SUServo loop. Values should be negative.

  • ki_limit (artiq.compiler.types.TMono('float', OrderedDict())) -- limit for I-part of the SUServo loop. 0.0 means unlimited.

  • delay (artiq.compiler.types.TMono('float', OrderedDict())) -- delay between switching on the laser an the servo loop becoming active (default: 0.0)

set_power(power)[source]

Set the output power of the laser

If the SUServo is in open loop mode, this sets the amplitude of the DDS channel. If the SUServo is in closed loop mode, it sets the photodiode value the servo loop should target. If the photodiode is calibrated the power argument should be given in the calibrated units.

Parameters:

power (artiq.compiler.types.TMono('float', OrderedDict())) -- the power the laser should be set/stabilized to. In open loop mode it takes the DDS amplitude (0..1). In closed loop mode it takes the target value on the photodiode for the servo loop. If the photodiode is calibrated the power should be given in the calibrated units (e.g. mW).

append_to_dataset(key, value)

Append a value to a dataset.

The target dataset must be a list (i.e. support append()), and must have previously been set from this experiment.

The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.

arb(duration, samples_amp=[], samples_power=[], samples_freq=[], samples_det=[], 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.

We supports a scheme to prepare the arb function before it is actually used. If that is needed, run this function with prepare_only = True when the arb should be prepared and with run_only = True when the prepared arb should be played. In both calls the other parameters have to be passed.

Parameters:
  • samples_amp (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of amplitude samples. If this list is empty (default), the amplitude is not modified.

  • samples_power (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of power samples. If this list is empty (default), the amplitude is not modified. This overwrites samples_amp.

  • samples_freq (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of frequency samples. If this list is empty (default), the frequency is not modified.

  • samples_det (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of frequency samples relative to the zero frequency. If this list is empty (default), the frequency is not modified. This overwrites samples_frequency

  • samples_phase (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of phase samples. If this list is empty (default), the phase is not modified.

  • duration (artiq.compiler.types.TMono('float', OrderedDict())) -- The time in which the whole sequence of samples should be played back [s].

  • repetitions (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Number of times the sequence of all samples should be played. (default 1)

  • prepare_only (artiq.compiler.types.TMono('bool', OrderedDict()))

  • run_prepared (artiq.compiler.types.TMono('bool', OrderedDict()))

build()

Should be implemented by the user to request arguments.

Other initialization steps such as requesting devices may also be performed here.

There are two situations where the requested devices are replaced by DummyDevice() and arguments are set to their defaults (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

Datasets are read-only in this method.

Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).

call_child_method(method, *args, **kwargs)

Calls the named method for each child, if it exists for that child, in the order of registration.

Parameters:
  • method (str) -- Name of the method to call

  • args -- Tuple of positional arguments to pass to all children

  • kwargs -- Dict of keyword arguments to pass to all children

detune(frequency)

Alias for set_detuning()

Parameters:

frequency (artiq.compiler.types.TMono('float', OrderedDict()))

get_argument(key, processor, group=None, tooltip=None)

Retrieves and returns the value of an argument.

This function should only be called from build.

Parameters:
  • key -- Name of the argument.

  • processor -- A description of how to process the argument, such as instances of BooleanValue and NumberValue.

  • group -- An optional string that defines what group the argument belongs to, for user interface purposes.

  • tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.

get_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Returns the contents of a dataset.

The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.

If the dataset does not exist, returns the default value. If no default is provided, raises KeyError.

By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.

Parameters:

archive -- Set to False to prevent archival together with the run's results. Default is True.

get_dataset_metadata(key, default=<class 'artiq.language.environment.NoDefault'>)

Returns the metadata of a dataset.

Returns dictionary with items describing the dataset, including the units, scale and precision.

This function is used to get additional information for displaying the dataset.

See set_dataset() for documentation of metadata items.

get_device(key)

Creates and returns a device driver.

get_device_db()

Returns the full contents of the device database.

get_frequency()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

get_power()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

interactive(title='')

Request arguments from the user interactively.

This context manager returns a namespace object on which the method setattr_argument() should be called, with the usual semantics.

When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.

If the interactive arguments request is cancelled, raises CancelledArgsError.

is_on(channel=None)
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))

measure(channel='')
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))

Return type:

artiq.compiler.types.TMono('float', OrderedDict())

measurement_channels()
mutate_dataset(key, index, value)

Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)

If the dataset was created in broadcast mode, the modification is immediately transmitted.

If the index is a tuple of integers, it is interpreted as slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted as slice(*sub_tuple) (multi-dimensional slicing).

off()
on()
pulse(pulsetime, channel='')
Parameters:
  • pulsetime (artiq.compiler.types.TMono('float', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

ramp(duration, frequency_start=nan, frequency_end=nan, detuning_start=nan, detuning_end=nan, amplitude_start=nan, amplitude_end=nan, power_start=nan, power_end=nan, ramp_timestep=nan, ramp_steps=-1)

Ramp frequency and/or power/amplitude over a given duration.

Parameters default to -1 or nan to indicate no change. If no starting value is given, the ramp starts from the last frequency/amplitude which was set.

Either power or amplitude can be given to ramp the intensity of the laser. If power is given, it overwrites the value for the amplitude

This method advances the timeline by ´duration´

Parameters:
  • duration (artiq.compiler.types.TMono('float', OrderedDict())) -- ramp duration [s]

  • frequency_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial frequency [Hz]

  • frequency_end (artiq.compiler.types.TMono('float', OrderedDict())) -- end frequency [Hz]

  • detuning_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial detuning [Hz]

  • detuning_start -- final detuning [Hz]

  • amplitude_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial amplitude

  • amplitude_end (artiq.compiler.types.TMono('float', OrderedDict())) -- end amplitude

  • power_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial power [W]

  • power_end (artiq.compiler.types.TMono('float', OrderedDict())) -- final power [W]

  • detuning_end (artiq.compiler.types.TMono('float', OrderedDict()))

  • ramp_timestep (artiq.compiler.types.TMono('float', OrderedDict()))

  • ramp_steps (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])))

register_child(child)
set_amplitude(amplitude)
Parameters:

amplitude (artiq.compiler.types.TMono('float', OrderedDict()))

set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)

Sets the contents and handling modes of a dataset.

Datasets must be scalars (bool, int, float or NumPy scalar) or NumPy arrays.

Parameters:
  • unit -- A string representing the unit of the value.

  • scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.

  • precision -- The maximum number of digits to print after the decimal point. Set precision=None to print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.

  • broadcast -- the data is sent in real-time to the master, which dispatches it.

  • persist -- the master should store the data on-disk. Implies broadcast.

  • archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).

set_default_scheduling(priority=None, pipeline_name=None, flush=None)

Sets the default scheduling options.

This function should only be called from build.

set_detuning(detuning)

Set the detuning of the light from the frequency defined by zero_freq

Note

If you are using a modulator (e.g. AOM) the center frequency is not taken into account. If you want to set the detuning from the center frequency of the modulator use self.modulator.set_detuning

Parameters:

detuning (artiq.compiler.types.TMono('float', OrderedDict())) -- Detuning in Hz

set_frequency(frequency)

Set the absolute frequency of the light after modulation

Parameters:

frequency (artiq.compiler.types.TMono('float', OrderedDict())) -- Absolute frequency of the light after modulation in Hz

set_parameter(value, channel=None)
Parameters:
  • value (artiq.compiler.types.TMono('float', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

setattr_argument(key, processor=None, group=None, tooltip=None)

Sets an argument as attribute. The names of the argument and of the attribute are the same.

The key is added to the instance's kernel invariants.

setattr_dataset(key, default=<class 'artiq.language.environment.NoDefault'>, archive=True)

Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.

setattr_device(key)

Sets a device driver as attribute. The names of the device driver and of the attribute are the same.

The key is added to the instance's kernel invariants.

stabilize(enable)
Parameters:

enable (artiq.compiler.types.TMono('bool', OrderedDict()))

toggle(channel=None)
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))