atomiq.components.optoelectronics.lightmodulator ================================================ .. py:module:: atomiq.components.optoelectronics.lightmodulator Classes ------- .. autoapisummary:: atomiq.components.optoelectronics.lightmodulator.Shutter atomiq.components.optoelectronics.lightmodulator.LightModulator atomiq.components.optoelectronics.lightmodulator.RFLightModulator atomiq.components.optoelectronics.lightmodulator.AOM Module Contents --------------- .. py:class:: Shutter(switch, invert = False, opening_time = 0, closing_time = 0, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component`, :py:obj:`atomiq.components.primitives.Switchable` Component to switch light on or off depending on a logical signal. This could be a mechanical shutter or a binary only amplitude modulator (e.g. AOM, EOM, Pockels cell etc.). It requires a class:Switchable switch that operates the shutter :param switch: Switch that operates the shutter, e.g. TTL :param invert: invert the logic of on and off :param opening_time: Time in s it takes from the arrival of the TTL until the shutter is fully opened (default 0) :param closing_time: Time in s it takes from the arrival of the TTL until the shutter is completely closed (default 0). Note that if closing_time is > 0 the shutter is already closing before the time at which the off() method is called .. py:attribute:: kernel_invariants .. py:attribute:: switch .. py:attribute:: invert :value: False .. py:attribute:: opening_time :value: 0 .. py:attribute:: closing_time :value: 0 .. py:method:: on() Opens the shutter. The time cursor is moved back in time to accommodate the `opening_time` of the shutter. After executing the `on` (or `off` if inverted) method of the defined switch the time cursor is then forwarded by `opening_time` again. The time cursor advancement is therefore given by the `switch.on()` or `switch.off()` method. .. py:method:: off() Closes the shutter. The time cursor is moved back in time to accommodate the `closing_time` of the shutter. After executing the `off` (or `on` if inverted) method of the defined switch the time cursor is then forwarded by `closing_time` again. The time cursor advancement is therefore given by the `switch.on()` or `switch.off()` method. .. py:class:: LightModulator(*args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component`, :py:obj:`atomiq.components.primitives.Parametrizable` An abstract light modulator for frequency, amplitude, phase, polarisation This class serves as a base class for all kinds of electro-optic devices that can change the properties of light. .. py:method:: set_frequency(frequency) :abstractmethod: Set the frequency by which the light is shifted. :param frequency: Frequency in Hz by which the light is shifted. .. py:method:: get_frequency() :abstractmethod: .. py:method:: set_amplitude(amplitude) :abstractmethod: Set the amplitude of the light after the modulator :param amplitude: Relative amplitude [0 .. 1] of the light after the modulator .. py:method:: set_phase(phase) :abstractmethod: Set the phase shift of the light imposed by the modulator :param phase: Phase shift in radians .. py:method:: set_polarisation(angle) :abstractmethod: Set the polarization rotation imposed by the modulator :param angle: Rotation angle in radians .. py:class:: RFLightModulator(rfsource, freq_limit, amp_limit = (0.0, 1.0), *args, **kwargs) Bases: :py:obj:`LightModulator` A light modulator driven by an RF source This class serves as a base class for devices like AOM, EOM, etc. :param rfsource: The rfsource that drives the modulator :param freq_limit: Tuple (freq_min, freq_max) giving the minimum/maximum RF frequency that the modulator can handle in Hz. :param amp_limit: Tuple (amp_min, amp_max) giving the minimum/maximum RF attenuation that the modulator can do in range [0..1]. .. py:attribute:: kernel_invariants .. py:attribute:: rfsource .. 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/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. 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 :param amplitude_end: end amplitude .. 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. 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. :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) .. 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:: get_frequency_min() .. py:method:: get_frequency_max() .. py:method:: get_frequency() .. py:method:: _check_and_set_frequency(frequency) .. py:method:: set_frequency(frequency) Set the frequency by which the light is shifted. :param frequency: Frequency in Hz by which the light is shifted. .. py:method:: get_amplitude_min() .. py:method:: get_amplitude_max() .. py:method:: get_amplitude() .. py:method:: _check_and_set_amplitude(amplitude) .. py:method:: set_amplitude(amplitude) Set the amplitude of the light after the modulator :param amplitude: Relative amplitude [0 .. 1] of the light after the modulator .. py:method:: get_phase() .. py:method:: set_phase(value) Set the phase shift of the light imposed by the modulator :param phase: Phase shift in radians .. py:method:: on() .. py:method:: off() .. py:class:: AOM(center_freq, freq_limit = None, bandwidth = None, switch = None, switching_delay = 0, passes = 1, order = 1, am_calibration = None, *args, **kwargs) Bases: :py:obj:`RFLightModulator`, :py:obj:`atomiq.components.primitives.Switchable` An acousto-optical modulator to alter amplitude, frequency and phase of the light. A component to represent an AOM to attenuate, switch and frequency-shift light. It is controlled by an :class:`~atomiq.components.electronics.rfsource.RFSource` and a :class:`~atomiq.components.primitives.Switchable` to rapidly switch the light on and off. As such, the AOM works also as a (non-perfect) shutter. :param rfsource: The rf source that drives the AOM :param center_freq: RF center frequency of the AOM in Hz. :param freq_limit: Tuple (freq_min, freq_max) giving the minimum/maximum RF frequency that the AOM can handle in Hz. Either freq_limit xor bandwidth must be given :param bandwidth: RF bandwidth of the AOM around the center frequency in Hz. Either bandwidth xor freq_limit must be given. :param switch: An optional switch to rapidly switch on and off the AOM. If none is given the rfsource is used to switch. :param switching_delay: the switching delay of the AOM, i.e. the time it takes from the arrival of the TTL to having full optical power. (default 0) :param passes: How often does the beam pass the AOM? Singlepass -> 1, Doublepass -> 2 (default 1) :param order: The diffraction order the AOM is aligned to. -2, -1, 1, 2 ... (default 1) :param am_calibration: Calibration of RF power vs output power. Typically an inverse sigmoid. (default none) .. py:attribute:: kernel_invariants .. py:attribute:: center_freq .. py:attribute:: switching_delay :value: 0 .. py:attribute:: passes :value: 1 .. py:attribute:: order :value: 1 .. 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:: get_frequency_min() .. py:method:: get_frequency_max() .. py:method:: get_frequency() .. py:method:: set_frequency(frequency) Set the frequency shift of the light coming out of the AOM .. py:method:: set_detuning(detuning) Set the frequency shift of the light coming out of the AOM relative to the center frequency :param detuning: Detuning from the AOM center frequency in Hz .. py:method:: detune(detuning) Alias for set_detuning() .. py:method:: _amplitude_transform_calibration(amplitude) .. py:method:: _amplitude_transform_identity(amplitude) .. py:method:: set_amplitude(amplitude) Set the amplitude of the light after the modulator :param amplitude: Relative amplitude [0 .. 1] of the light after the modulator .. py:method:: arb(duration, samples_amp = [], 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 `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. :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_det: List of frequency samples relative to the center 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:: 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´. .. note:: The amplitude calibration is only applied at the start and end point of the ramp to reduce calculation overhead. This relies on the calibration being sufficiently linear in the ramp range. :param duration: ramp duration [s] :param frequency_start: initial frequency shift of the light exiting the AOM [Hz] :param frequency_end: final frequency shift of the light exiting the AOM [Hz] :param amplitude_start: initial amplitude :param amplitude_end: end amplitude .. py:method:: on() Turns on the AOM. The time cursor is moved back in time to accommodate the `switching_delay` of the AOM. After executing the `on` method of the defined switch the time cursor is then forwarded by `switching_delay` again. The time cursor advancement is therefore given by the `switch.on()` method. .. py:method:: off() Turns off the AOM. The time cursor is moved back in time to accommodate the `switching_delay` of the AOM. After executing the `off` method of the defined switch the time cursor is then forwarded by `switching_delay` again. The time cursor advancement is therefore given by the `switch.off()` method.