atomiq.components.coil module¶
- class atomiq.components.coil.Coil(current_source, calibration, switch=None, *args, **kwargs)[source]¶
Bases:
Component
,Parametrizable
,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.
- Parameters:
current_source (CurrentSource) -- The current source that drives the coil
calibration (Calibration) -- The conversion between current in the coil and magnetic field at the point of interest.
switch (Switchable) -- 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.
A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)
- kernel_invariants = {'calibration', 'current_source', 'switch'}¶
- class atomiq.components.coil.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)[source]¶
Bases:
Component
,Parametrizable
,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
- Parameters:
current_source_coil1 (CurrentSource) -- The current source for the first coil.
current_source_coil2 (CurrentSource) -- 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.
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
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
switch (Switchable) -- 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)
helmholtz_config (TInt32) -- 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)
default_field (TFloat) -- Field to initialize the coil pair with (defaul 0)
default_gradient (TFloat) -- Gradient to initialize the coil pair with (default 0)
calibration_field (Calibration)
calibration_gradient (Calibration)
A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)
- kernel_invariants = {'calibration_field', 'calibration_gradient', 'current_source_coil1', 'current_source_coil2', 'helmholtz_config', 'single_source', 'switch'}¶
- set_field(field, update=True)[source]¶
Set the field of the coil pair at the position if interest
- Parameters:
field (artiq.compiler.types.TMono('float', OrderedDict())) -- Field to be set in the units of the calibration field_calibration
update (artiq.compiler.types.TMono('bool', OrderedDict())) -- immediately apply the change to the hardware
- set_gradient(gradient, update=True)[source]¶
Set the field gradient of the coil pair at the position of interest
- Parameters:
gradient (artiq.compiler.types.TMono('float', OrderedDict())) -- Field gradient to be set in the units of the calibration field_calibration
update (artiq.compiler.types.TMono('bool', OrderedDict())) -- immediately apply the change to the hardware
- ramp_field_and_gradient(duration, field_end, gradient_end, field_start=nan, gradient_start=nan, ramp_timestep=0.001)[source]¶
ramp the field and gradient thereof created by a pair of coils
Note that this only works as expected with two independent currentsources.
This method advances the timeline by duration.
- Parameters:
duration (artiq.compiler.types.TMono('float', OrderedDict())) -- duration of the ramp
field_end (artiq.compiler.types.TMono('float', OrderedDict())) -- final field at the end of the ramp
gradient_end (artiq.compiler.types.TMono('float', OrderedDict())) -- final gradient at the end of the ramp
field_start (artiq.compiler.types.TMono('float', OrderedDict())) -- starting field of the ramp. Current field is used if not given.
gradient_start (artiq.compiler.types.TMono('float', OrderedDict())) -- starting gradient of the ramp. Current gradient is used if not given.
ramp_timestep (artiq.compiler.types.TMono('float', OrderedDict())) -- sampling interval of the ramp
- ramp_field(duration, field_end, field_start=nan, ramp_timestep=0.001)[source]¶
ramp the field created by pair of coils
This method advances the timeline by duration.
- Parameters:
duration (artiq.compiler.types.TMono('float', OrderedDict())) -- duration of the ramp
field_end (artiq.compiler.types.TMono('float', OrderedDict())) -- final field at the end of the ramp
field_start (artiq.compiler.types.TMono('float', OrderedDict())) -- starting field of the ramp. Current field is used if not given.
ramp_timestep (artiq.compiler.types.TMono('float', OrderedDict())) -- sampling interval of the ramp
- ramp_gradient(duration, gradient_end, gradient_start=nan, ramp_timestep=0.001)[source]¶
ramp the gradient created by pair of coils
This method advances the timeline by duration.
- Parameters:
duration (artiq.compiler.types.TMono('float', OrderedDict())) -- duration of the ramp
gradient_end (artiq.compiler.types.TMono('float', OrderedDict())) -- final gradient at the end of the ramp
gradient_start (artiq.compiler.types.TMono('float', OrderedDict())) -- starting gradient of the ramp. Current gradient is used if not given.
ramp_timestep (artiq.compiler.types.TMono('float', OrderedDict())) -- sampling interval of the ramp