atomiq.components.coil ====================== .. py:module:: atomiq.components.coil Classes ------- .. autoapisummary:: atomiq.components.coil.Coil atomiq.components.coil.CoilPair Module Contents --------------- .. py:class:: Coil(current_source, calibration, switch = None, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component`, :py:obj:`atomiq.components.primitives.Parametrizable`, :py:obj:`atomiq.components.primitives.Switchable` A single coil driven by a current source. It is characterized by a calibration that returns the B field for a given current through the coil. :param current_source: The current source that drives the coil :param calibration: The conversion between current in the coil and magnetic field at the point of interest. :param switch: An optional switch to switch on and off the current in the coil. If none is given and the current source is switchable, the current source is used for switching. If no switch is given and the current source is not switchable, an error is raised. .. py:attribute:: kernel_invariants .. py:attribute:: current_source .. py:attribute:: calibration .. py:method:: set_field(field) Set the `current_source` attached to the coil by using the given `calibration` to translate between `field` and current. :param field: Magnetic field to be set in units as dictated by the `calibration` .. py:method:: on() Use the `switch` (or `current_source`, see :class:`Coil`) to turn on the coil. .. py:method:: off() Use the `switch` (or `current_source`, see :class:`Coil`) to turn off the coil. .. py:class:: CoilPair(current_source_coil1, current_source_coil2, calibration_field, calibration_gradient, switch = None, helmholtz_config = 1, default_field = 0.0, default_gradient = 0.0, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component`, :py:obj:`atomiq.components.primitives.Parametrizable`, :py:obj:`atomiq.components.primitives.Switchable` A pair of identical coils driven by a common or two individual current sources. It is assumed that the pair of coils is placed symmetrically around the region of interest. It is characterized by a calibration (field_calibration) for the returns the B field for a given current through the coil and a calibration of the field gradient :param current_source_coil1: The current source for the first coil. :param current_source_coil2: The current source for the second coil. If the second coil is tied to the same current source as the first coil, specify the same current source here. Use the `helmholtz_config` parameter to specifiy the b-field orientation of the second coil. :param field_calibration: Calibration that gives the B field as a function of the current at the position of interest if the coilpair is in Helmholtz configuration :param gradient_calibration: Calibration that gives the B field gradient as a function of the current difference between the coils at the position of interest if the coilpair is in anti-Helmholtz configuration :param switch: Switch that switches the coil pair on and off. If none is given the current source is used to switch the coils (if it supports switching). (default None) :param helmholtz_config: if set to 1, same polarity of current in both coils creates a Helmholtz field. If set to -1 same polarity of current in both coils creates an anti-Helmholtz field. (default 1) :param default_field: Field to initialize the coil pair with (defaul 0) :param default_gradient: Gradient to initialize the coil pair with (default 0) .. py:attribute:: kernel_invariants .. py:attribute:: current_source_coil1 .. py:attribute:: current_source_coil2 .. py:attribute:: single_source .. py:attribute:: helmholtz_config :value: 1 .. py:attribute:: calibration_field .. py:attribute:: calibration_gradient .. py:attribute:: field :value: 0.0 .. py:attribute:: gradient :value: 0.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_currents() .. py:method:: set_field(field, update = True) Set the field of the coil pair at the position if interest. :param field: Field to be set in the units of the calibration `field_calibration` :param update: immediately apply the change to the hardware .. py:method:: set_gradient(gradient, update = True) Set the field gradient of the coil pair at the position of interest. :param gradient: Field gradient to be set in the units of the calibration `field_calibration` :param update: immediately apply the change to the hardware .. py:method:: ramp_field_and_gradient(duration, field_end, gradient_end, field_start = float('nan'), gradient_start = float('nan'), ramp_timestep = 0.001) Ramp the field and gradient thereof created by a pair of coils. Note that this only works as expected with two independent current sources. This method advances the timeline by `duration`. :param duration: duration of the ramp :param field_end: final field at the end of the ramp :param gradient_end: final gradient at the end of the ramp :param field_start: starting field of the ramp. Current field is used if not given. :param gradient_start: starting gradient of the ramp. Current gradient is used if not given. :param ramp_timestep: sampling interval of the ramp .. py:method:: ramp_field(duration, field_end, field_start = float('nan'), ramp_timestep = 0.001) Ramp the field created by pair of coils. This method advances the timeline by `duration`. :param duration: duration of the ramp :param field_end: final field at the end of the ramp :param field_start: starting field of the ramp. Current field is used if not given. :param ramp_timestep: sampling interval of the ramp .. py:method:: ramp_gradient(duration, gradient_end, gradient_start = float('nan'), ramp_timestep = 0.001) Ramp the gradient created by pair of coils. This method advances the timeline by `duration`. :param duration: duration of the ramp :param gradient_end: final gradient at the end of the ramp :param gradient_start: starting gradient of the ramp. Current gradient is used if not given. :param ramp_timestep: sampling interval of the ramp .. py:method:: on() .. py:method:: off() .. py:method:: _switch_on_via_currentsource() .. py:method:: _switch_off_via_currentsource()