atomiq.components.sinara.suservo ================================ .. py:module:: atomiq.components.sinara.suservo Classes ------- .. autoapisummary:: atomiq.components.sinara.suservo.SUServo atomiq.components.sinara.suservo.SUServoChannel atomiq.components.sinara.suservo.SUServoADCChannel atomiq.components.sinara.suservo.SUServoModulatedLaser Module Contents --------------- .. py:class:: SUServo(suservo_device, start_loop = True, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.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 :param suservo_device: The artiq SUServo device from your device_db, e.g. @suservo0. :param start_loop: Sets if the servo loop should be started at the prerun stage. .. py:attribute:: kernel_invariants .. py:attribute:: suservo_device .. py:attribute:: servo_on :value: False .. py:attribute:: start_loop :value: True .. py:method:: _prerun() Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts. .. py:method:: set_servomode(enabled) .. py:method:: get_adc_value(channel) .. py:method:: set_adc_gain(channel, gain = 0) .. py:attribute:: experiment .. py:attribute:: identifier .. py:attribute:: debug_output :value: False .. py:attribute:: core .. py:attribute:: _kernel_invariants .. py:attribute:: _prepare_done :value: False .. py:attribute:: _build_done :value: False .. py:attribute:: _hooks_done :value: [] .. py:method:: _recursive_prepare() .. py:method:: _prepare() Specify here what should be done for this component in the prepare phase .. py:method:: _recursive_build() .. py:method:: _build() Specify here what should be done for this component in the build phase .. py:method:: _do_prerun() .. py:method:: required_components(ancestors=[]) .. py:attribute:: children :value: [] .. py:attribute:: __in_build :value: True .. py:method:: register_child(child) .. py:method:: call_child_method(method, *args, **kwargs) Calls the named method for each child, if it exists for that child, in the order of registration. :param method: Name of the method to call :type method: str :param args: Tuple of positional arguments to pass to all children :param kwargs: Dict of keyword arguments to pass to all children .. py:method:: 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 :meth:`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). .. py:method:: get_argument(key, processor, group=None, tooltip=None) Retrieves and returns the value of an argument. This function should only be called from ``build``. :param key: Name of the argument. :param processor: A description of how to process the argument, such as instances of :mod:`~artiq.language.environment.BooleanValue` and :mod:`~artiq.language.environment.NumberValue`. :param group: An optional string that defines what group the argument belongs to, for user interface purposes. :param tooltip: An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface. .. py:method:: 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. .. py:method:: interactive(title='') Request arguments from the user interactively. This context manager returns a namespace object on which the method :meth:`~artiq.language.environment.HasEnvironment.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 :exc:`~artiq.language.environment.CancelledArgsError`. .. py:method:: get_device_db() Returns the full contents of the device database. .. py:method:: get_device(key) Creates and returns a device driver. .. py:method:: 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. .. py:method:: 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. :param unit: A string representing the unit of the value. :param 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. :param 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. :param broadcast: the data is sent in real-time to the master, which dispatches it. :param persist: the master should store the data on-disk. Implies broadcast. :param archive: the data is saved into the local storage of the current run (archived as a HDF5 file). .. py:method:: 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). .. py:method:: 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. .. py:method:: get_dataset(key, default=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. :param archive: Set to ``False`` to prevent archival together with the run's results. Default is ``True``. .. py:method:: get_dataset_metadata(key, default=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 :meth:`set_dataset` for documentation of metadata items. .. py:method:: setattr_dataset(key, default=NoDefault, archive=True) Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same. .. py:method:: set_default_scheduling(priority=None, pipeline_name=None, flush=None) Sets the default scheduling options. This function should only be called from ``build``. .. py:class:: SUServoChannel(suservo, suservo_channel, default_attenuation=19.0, default_profile=0, servo_divider = 10.0, *args, **kwargs) Bases: :py:obj:`atomiq.components.electronics.rfsource.RFSource`, :py:obj:`atomiq.components.primitives.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 :param suservo: The atomiq SUServo component this channel belongs to :param suservo_channel: The artiq SUServo channel from your device_db, e.g. @suservo0_ch2. :param default_profile: Which of the 32 profiles of the SUServo should be used? (default 0) :param servo_divider: Todo: Why do we need this? (default 10.0) .. py:attribute:: kernel_invariants .. py:attribute:: suservo .. py:attribute:: suservo_channel .. py:attribute:: profile :value: 0 .. py:attribute:: attenuation :value: 19.0 .. py:attribute:: servo_on :value: False .. py:attribute:: servo_divider :value: 10.0 .. py:attribute:: next_on .. py:attribute:: next_off .. py:method:: _prerun() Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts. .. py:method:: set(frequency = float('nan'), amplitude = float('nan'), phase = 0.0, profile = -1) Set the frequency and amplitude of the DDS channel Frequency/amplitude are set to the last known value if ``nan`` is passed (default). :param frequency: Frequency in Hz (``nan`` to use previous value) :param amplitude: 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) :param phase: Phase in rad to be set (default 0.0) :param profile: DDS Profile (``-1`` to keep current profile) .. py:method:: set_att(attenuation) Set the hardware attenuation for this urukul channel via cpld. :param attenuation: channel attenuation (0. to 31.0 in 0.5 increments) [dB] .. py:method:: _set_frequency(frequency) .. py:method:: set_amplitude(amplitude) Set the amplitude of the DDS output :param amplitude: If servomode is off, this is the DDS amplitude (0..1). If servomode is on, this is the target voltage on the photodiode. .. py:method:: _set_amplitude(amplitude) .. py:method:: _set_phase(phase) .. py:method:: on() Turn on the RF output via the fast switch .. py:method:: off() Turn off the RF output via the fast switch .. py:method:: set_servomode(enabled) 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. :param enabled: Whether the servomode should be enabled .. py:method:: _ramp(duration, frequency_start, frequency_end, amplitude_start, amplitude_end, ramp_timestep = 0.0002) At some point, we want to replace this by code that uses the digital ramp generator (DRG) on the AD9910 because this allows for much faster ramps .. py:attribute:: amplitude :value: 0.0 .. py:attribute:: frequency :value: 100000000.0 .. py:attribute:: phase :value: 0.0 .. py:attribute:: default_ramp_steps :value: 30 .. py:attribute:: blind :value: False .. py:method:: _prerun_blind() .. py:method:: set_frequency(frequency) .. py:method:: _check_frequency(frequency) .. py:method:: get_frequency() .. py:method:: _check_amplitude(amplitude) .. py:method:: get_amplitude() .. py:method:: set_phase(phase) .. py:method:: get_phase() .. py:method:: ramp(duration, frequency_start = float('nan'), frequency_end = float('nan'), amplitude_start = float('nan'), amplitude_end = float('nan'), ramp_timestep = float('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´ :param duration: ramp duration [s] :param frequency_start: initial frequency [Hz] :param frequency_end: end frequency [Hz] :param amplitude_start: initial amplitude [0..1] :param amplitude_end: end amplitude [0..1] :param ramp_timesteps: time between steps in the ramp [s] :param ramp_steps: number of steps the whole ramp should have. This takes precedence over `ramp_timesteps` .. py:method:: _arb(duration, samples_amp, samples_freq, samples_phase, repetitions = 1, prepare_only = False, run_prepared = False, transform_amp=identity_float, transform_freq=identity_float, transform_phase=identity_float) .. py:method:: arb(duration, samples_amp = [], samples_freq = [], samples_phase = [], repetitions = 1, prepare_only = False, run_prepared = False, transform_amp=identity_float, transform_freq=identity_float, transform_phase=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 :code:`prepapre_only = True` when the arb should be prepared and with :code:`run_prepared = True` when the prepared arb should be played. In both calls the other parameters have to be passed. :param samples_amp: List of amplitude samples. If this list is empty (default), the amplitude is not modified. :param samples_freq: List of frequency samples. If this list is empty (default), the frequency is not modified. :param samples_phase: List of phase samples. If this list is empty (default), the phase is not modified. :param duration: The time in which the whole sequence of samples should be played back [s]. :param repetitions: Number of times the sequence of all samples should be played. (default 1) :param prepare_only: Only write the sequence to RAM, don't play it. :param run_prepared: Play arb sequence previously prepared with :code:`prepare_only`. :param transform_amp: Function to transform amplitude samples, must take a single argument of type :type:`TFloat` and return a single :type:`TFloat`. :param transform_freq: Function to transform frequency samples (see :code:`transform_amp`). :param transform_phase: Function to transform phase samples (see :code:`transform_amp`). .. py:attribute:: experiment .. py:attribute:: identifier .. py:attribute:: debug_output :value: False .. py:attribute:: core .. py:attribute:: _kernel_invariants .. py:attribute:: _prepare_done :value: False .. py:attribute:: _build_done :value: False .. py:attribute:: _hooks_done :value: [] .. py:method:: _recursive_prepare() .. py:method:: _prepare() Specify here what should be done for this component in the prepare phase .. py:method:: _recursive_build() .. py:method:: _build() Specify here what should be done for this component in the build phase .. py:method:: _do_prerun() .. py:method:: required_components(ancestors=[]) .. py:attribute:: children :value: [] .. py:attribute:: __in_build :value: True .. py:method:: register_child(child) .. py:method:: call_child_method(method, *args, **kwargs) Calls the named method for each child, if it exists for that child, in the order of registration. :param method: Name of the method to call :type method: str :param args: Tuple of positional arguments to pass to all children :param kwargs: Dict of keyword arguments to pass to all children .. py:method:: 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 :meth:`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). .. py:method:: get_argument(key, processor, group=None, tooltip=None) Retrieves and returns the value of an argument. This function should only be called from ``build``. :param key: Name of the argument. :param processor: A description of how to process the argument, such as instances of :mod:`~artiq.language.environment.BooleanValue` and :mod:`~artiq.language.environment.NumberValue`. :param group: An optional string that defines what group the argument belongs to, for user interface purposes. :param tooltip: An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface. .. py:method:: 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. .. py:method:: interactive(title='') Request arguments from the user interactively. This context manager returns a namespace object on which the method :meth:`~artiq.language.environment.HasEnvironment.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 :exc:`~artiq.language.environment.CancelledArgsError`. .. py:method:: get_device_db() Returns the full contents of the device database. .. py:method:: get_device(key) Creates and returns a device driver. .. py:method:: 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. .. py:method:: 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. :param unit: A string representing the unit of the value. :param 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. :param 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. :param broadcast: the data is sent in real-time to the master, which dispatches it. :param persist: the master should store the data on-disk. Implies broadcast. :param archive: the data is saved into the local storage of the current run (archived as a HDF5 file). .. py:method:: 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). .. py:method:: 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. .. py:method:: get_dataset(key, default=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. :param archive: Set to ``False`` to prevent archival together with the run's results. Default is ``True``. .. py:method:: get_dataset_metadata(key, default=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 :meth:`set_dataset` for documentation of metadata items. .. py:method:: setattr_dataset(key, default=NoDefault, archive=True) Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same. .. py:method:: set_default_scheduling(priority=None, pipeline_name=None, flush=None) Sets the default scheduling options. This function should only be called from ``build``. .. py:method:: set_parameter(value, channel = None) .. py:method:: is_on(channel = None) :abstractmethod: .. py:method:: toggle(channel = None) .. py:method:: pulse(pulsetime, channel = '') .. py:class:: SUServoADCChannel(suservo, default_gain = 0, *args, **kwargs) Bases: :py:obj:`atomiq.components.electronics.adc.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 differently but I don't see how. :param suservo: The SUServo component that this channel belongs to :param default_gain: The default gain in machine units (0: 1, ..., 3: 1000) to set for this channel on startup .. py:attribute:: kernel_invariants .. py:attribute:: suservo .. py:attribute:: gain :value: 0 .. py:method:: _prerun() Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts. .. py:method:: set_gain(gain = 0) Set the gain for the ADC channel in SUServo configuration :param gain: Gain in machine units (0: 1, ..., 3: 1000) .. py:method:: measure(samples = 1, cached = False) .. py:attribute:: adc_device .. py:attribute:: channel .. py:attribute:: experiment .. py:attribute:: identifier .. py:attribute:: debug_output :value: False .. py:attribute:: core .. py:attribute:: _kernel_invariants .. py:attribute:: _prepare_done :value: False .. py:attribute:: _build_done :value: False .. py:attribute:: _hooks_done :value: [] .. py:method:: _recursive_prepare() .. py:method:: _prepare() Specify here what should be done for this component in the prepare phase .. py:method:: _recursive_build() .. py:method:: _build() Specify here what should be done for this component in the build phase .. py:method:: _do_prerun() .. py:method:: required_components(ancestors=[]) .. py:attribute:: children :value: [] .. py:attribute:: __in_build :value: True .. py:method:: register_child(child) .. py:method:: call_child_method(method, *args, **kwargs) Calls the named method for each child, if it exists for that child, in the order of registration. :param method: Name of the method to call :type method: str :param args: Tuple of positional arguments to pass to all children :param kwargs: Dict of keyword arguments to pass to all children .. py:method:: 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 :meth:`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). .. py:method:: get_argument(key, processor, group=None, tooltip=None) Retrieves and returns the value of an argument. This function should only be called from ``build``. :param key: Name of the argument. :param processor: A description of how to process the argument, such as instances of :mod:`~artiq.language.environment.BooleanValue` and :mod:`~artiq.language.environment.NumberValue`. :param group: An optional string that defines what group the argument belongs to, for user interface purposes. :param tooltip: An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface. .. py:method:: 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. .. py:method:: interactive(title='') Request arguments from the user interactively. This context manager returns a namespace object on which the method :meth:`~artiq.language.environment.HasEnvironment.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 :exc:`~artiq.language.environment.CancelledArgsError`. .. py:method:: get_device_db() Returns the full contents of the device database. .. py:method:: get_device(key) Creates and returns a device driver. .. py:method:: 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. .. py:method:: 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. :param unit: A string representing the unit of the value. :param 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. :param 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. :param broadcast: the data is sent in real-time to the master, which dispatches it. :param persist: the master should store the data on-disk. Implies broadcast. :param archive: the data is saved into the local storage of the current run (archived as a HDF5 file). .. py:method:: 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). .. py:method:: 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. .. py:method:: get_dataset(key, default=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. :param archive: Set to ``False`` to prevent archival together with the run's results. Default is ``True``. .. py:method:: get_dataset_metadata(key, default=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 :meth:`set_dataset` for documentation of metadata items. .. py:method:: setattr_dataset(key, default=NoDefault, archive=True) Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same. .. py:method:: set_default_scheduling(priority=None, pipeline_name=None, flush=None) Sets the default scheduling options. This function should only be called from ``build``. .. py:method:: measurement_channels() .. py:class:: SUServoModulatedLaser(default_kp, default_ki = 0.0, default_ki_limit = 0.0, *args, **kwargs) Bases: :py:obj:`atomiq.components.laser.ContinuouslyStabilizedModulatedLaser` A Laser with intensity stabilization realized by the SUServo The SUServo realizes a PI servo controller in hardware with an update time interval of 1.3us, leading to a maximum analog bandwidth 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 :func:`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. :param 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. :param 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. :param default_kp: default proportional (P-) part for the SUServo loop. Values should be negative. :param default_ki: default integral (I-) part for the SUServo loop. Values should be negative. (default 0.0) :param default_ki_limit: default limit for I-part of the SUServo loop. 0.0 means unlimited. (default 0.0) .. py:attribute:: kernel_invariants .. py:attribute:: default_kp .. py:attribute:: default_ki :value: 0.0 .. py:attribute:: default_ki_limit :value: 0.0 .. py:attribute:: suservo_channel .. py:method:: _prerun() Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts. .. py:method:: set_servo_parameter(adc_channel, kp, ki, ki_limit, delay = 0.0) Set servo loop parameters. :param kp: proportional (P-) part for the SUServo loop. Values should be negative. :param ki: integral (I-) part for the SUServo loop. Values should be negative. :param ki_limit: limit for I-part of the SUServo loop. 0.0 means unlimited. :param delay: delay between switching on the laser an the servo loop becoming active (default: 0.0) .. py:method:: _stabilize(enable) .. py:method:: _transform_power_dummy(power) .. py:method:: _transform_power_calibration(power) .. py:method:: _amplitude_from_power(power) .. py:attribute:: _docstring_overwrites .. py:attribute:: stabilized :value: True .. py:attribute:: photodiode .. py:method:: get_power() .. py:method:: stabilize(enable) .. py:attribute:: modulator .. py:attribute:: laser_source .. py:attribute:: fm_device :value: 'mod' .. py:attribute:: am_device :value: 'mod' .. py:attribute:: src_transmission :value: 1.0 .. py:method:: get_amplitude() .. py:method:: set_amplitude(amplitude) .. py:method:: get_frequency() .. py:method:: set_frequency(frequency) Set the absolute frequency of the light after modulation :param frequency: Absolute frequency of the light after modulation in Hz .. py:method:: _set_frequency_through_modulator(frequency) .. py:method:: _set_frequency_through_source(frequency) .. py:method:: ramp(duration, frequency_start = float('nan'), frequency_end = float('nan'), detuning_start = float('nan'), detuning_end = float('nan'), amplitude_start = float('nan'), amplitude_end = float('nan'), power_start = float('nan'), power_end = float('nan'), ramp_timestep = float('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´ :param duration: ramp duration [s] :param frequency_start: initial frequency [Hz] :param frequency_end: end frequency [Hz] :param detuning_start: initial detuning [Hz] :param detuning_start: final detuning [Hz] :param amplitude_start: initial amplitude :param amplitude_end: end amplitude :param power_start: initial power [W] :param power_end: final power [W] .. py:method:: arb(duration, samples_amp = [], samples_power = [], samples_freq = [], samples_det = [], samples_phase = [], repetitions = 1, prepare_only = False, run_prepared = False, transform_amp=identity_float, transform_freq=identity_float, transform_phase=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. :param samples_amp: List of amplitude samples. If this list is empty (default), the amplitude is not modified. :param samples_power: List of power samples. If this list is empty (default), the amplitude is not modified. This overwrites `samples_amp`. :param samples_freq: List of frequency samples. If this list is empty (default), the frequency is not modified. :param samples_det: List of frequency samples relative to the zero frequency. If this list is empty (default), the frequency is not modified. This overwrites `samples_frequency` :param samples_phase: List of phase samples. If this list is empty (default), the phase is not modified. :param duration: The time in which the whole sequence of samples should be played back [s]. :param repetitions: Number of times the sequence of all samples should be played. (default 1) .. py:method:: set_power(power) Set the absolute power of the light after modulation :param power: Absolute power of the light after modulation in W .. py:attribute:: switch .. py:method:: on() .. py:method:: off() .. py:attribute:: zero_freq .. py:method:: _set_frequency_dummy(frequency) .. py:method:: 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` :param detuning: Detuning in Hz .. py:method:: detune(frequency) Alias for :meth:`set_detuning` .. py:attribute:: _frequency .. py:attribute:: _power :value: 0.001 .. py:attribute:: experiment .. py:attribute:: identifier .. py:attribute:: debug_output :value: False .. py:attribute:: core .. py:attribute:: _kernel_invariants .. py:attribute:: _prepare_done :value: False .. py:attribute:: _build_done :value: False .. py:attribute:: _hooks_done :value: [] .. py:method:: _recursive_prepare() .. py:method:: _prepare() Specify here what should be done for this component in the prepare phase .. py:method:: _recursive_build() .. py:method:: _build() Specify here what should be done for this component in the build phase .. py:method:: _do_prerun() .. py:method:: required_components(ancestors=[]) .. py:attribute:: children :value: [] .. py:attribute:: __in_build :value: True .. py:method:: register_child(child) .. py:method:: call_child_method(method, *args, **kwargs) Calls the named method for each child, if it exists for that child, in the order of registration. :param method: Name of the method to call :type method: str :param args: Tuple of positional arguments to pass to all children :param kwargs: Dict of keyword arguments to pass to all children .. py:method:: 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 :meth:`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). .. py:method:: get_argument(key, processor, group=None, tooltip=None) Retrieves and returns the value of an argument. This function should only be called from ``build``. :param key: Name of the argument. :param processor: A description of how to process the argument, such as instances of :mod:`~artiq.language.environment.BooleanValue` and :mod:`~artiq.language.environment.NumberValue`. :param group: An optional string that defines what group the argument belongs to, for user interface purposes. :param tooltip: An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface. .. py:method:: 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. .. py:method:: interactive(title='') Request arguments from the user interactively. This context manager returns a namespace object on which the method :meth:`~artiq.language.environment.HasEnvironment.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 :exc:`~artiq.language.environment.CancelledArgsError`. .. py:method:: get_device_db() Returns the full contents of the device database. .. py:method:: get_device(key) Creates and returns a device driver. .. py:method:: 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. .. py:method:: 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. :param unit: A string representing the unit of the value. :param 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. :param 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. :param broadcast: the data is sent in real-time to the master, which dispatches it. :param persist: the master should store the data on-disk. Implies broadcast. :param archive: the data is saved into the local storage of the current run (archived as a HDF5 file). .. py:method:: 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). .. py:method:: 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. .. py:method:: get_dataset(key, default=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. :param archive: Set to ``False`` to prevent archival together with the run's results. Default is ``True``. .. py:method:: get_dataset_metadata(key, default=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 :meth:`set_dataset` for documentation of metadata items. .. py:method:: setattr_dataset(key, default=NoDefault, archive=True) Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same. .. py:method:: set_default_scheduling(priority=None, pipeline_name=None, flush=None) Sets the default scheduling options. This function should only be called from ``build``. .. py:method:: is_on(channel = None) :abstractmethod: .. py:method:: toggle(channel = None) .. py:method:: pulse(pulsetime, channel = '') .. py:method:: set_parameter(value, channel = None) .. py:method:: measure(channel = '') :abstractmethod: .. py:method:: measurement_channels()