synthesizer package
synthesizer.synthesizer_server module
Provides low-level control of the 4-channel RF synthesizer developed by the JILA shop.
- To do:
Finish implementing communications using sockets
- class synthesizer.synthesizer_server.SynthesizerServer
Bases:
LabradServerProvides low-level control of the 4-channel RF synthesizer developed by the JILA shop.
- __init__()
- static a_to_atw(a)
Converts an amplitude to the format required for programming the synthesizer
- static compile_timestamp(self, channel, address, timestamp, phase_update, ptw, atw, ftw)
Compiles a timestamp into a binary command which can be written to the synthesizer
- Parameters:
channel (int) – The channel to set. Must be between 0 and 3.
address (int) – The address of the timestep
timestamp (int) – The time of the timestamp (in s).
phase_update (int) – Whether to update the phase. 0 to not change phase, 1 to set absolute phase, 2 to increment phase.
phase (int) – The phase (in radians) to set
amplitude (int) – The amplitude (relative to full scale) to set
frequency (int) – The frequency (in Hz) to set
wait_for_trigger (bool) – Whether to wait for a trigger. Defaults to False.
digital_out ([bool]) – A list of 7 booleans, corresponding to whether each channel should be turned on. Defaults to [False]*7, in which case the digital outputs are off.
- Returns:
The messages to send to the synthesizer that represent the timestamp.
- Return type:
List[ByteArray]
- static f_to_ftw(f)
Converts a frequency in Hertz to the format required for programming the synthesizer
- initServer(self)
Called by LabRAD when server is started. Connects to the synthesizer using the socket library.
- name = '%LABRADNODE%_synthesizer'
- static phase_to_ptw(phi)
Converts a phase to the format required for programming the synthesizer
- reset(self)
Resets the synthesizer
- Parameters:
c – The LabRAD context.
reset_outputs – Whether to zero the outputs or just the sequencer
- static t_to_timestamp(t)
Converts a time to the format required for programming the synthesizer
- trigger(self)
Triggers the synthesizer
- Parameters:
c – The LabRAD context.
- write_timestamps(self, c, timestamps, compile=False, verbose=False)
Writes timestamps from a JSON-formatted string. See
write_timestamps()for specification.- Parameters:
c – The LabRAD context. Not used.
timestamps (str) – A JSON-formatted string containing a dictionary (keys: channels, values: sequences) of lists of dictionaries, each of which is a timestamp.
synthesizer.synthesizer_sequences module
Classes and functions for generating sequences for the RF synthesizer
- To do:
Design functions for maintaining phase on frequency switching
Finish implementing SyncPoints
- class synthesizer.synthesizer_sequences.AdjustNextDuration(duration: float)
Bases:
RFBlockAdjusts the duration of the next
Timestamp. Throws an error on compilation if the nextRFBlockis not aTimestampor the adjustment would result in negative duration.- __init__(duration: float) None
- Parameters:
duration (float) – The duration in seconds by which to increment the duration of the next timestamp.
- atomic = True
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.AdjustPrevDuration(duration: float)
Bases:
RFBlockAdjusts the duration of the previous
Timestamp. Throws an error on compilation if the previousRFBlockis not aTimestampor the adjustment would result in negative duration.- __init__(duration: float) None
- Parameters:
duration (float) – The duration in seconds by which to increment the duration of the previous timestamp.
- atomic = True
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.AmplitudeRamp(duration: float, start_amplitude: float | None = None, end_amplitude: float | None = None, phase: float | None = None, frequency: float | None = None, steps: int = 20)
Bases:
RFBlockLinearly ramps the amplitude of the RF tone while maintaining constant frequency and phase.
- __init__(duration: float, start_amplitude: float | None = None, end_amplitude: float | None = None, phase: float | None = None, frequency: float | None = None, steps: int = 20)
- Parameters:
duration (float) – The duration of the ramp in seconds.
start_amplitude (float, optional) – The initial amplitude, relative to full scale. Defaults to None, in which case the amplitude of the previous
RFBlockis used.end_amplitude (float, optional) – The final amplitude, relative to full scale. Defaults to None, in which case
start_amplitudeis used.phase (float, optional) – The phase of the tone in radians. Defaults to None, in which case the previous phase setting is maintained.
frequency (float, optional) – The frequency of the tone in Hertz. Defaults to None, in which case the previous frequency setting is maintained.
steps (int, optional) – The number of amplitude steps to include in the ramp. Must be at least 2. Defaults to 20.
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.AreaPulse(pulse_area: float, amplitude: Optional[float] = None, phase: Optional[float] = None, frequency: Optional[float] = None, centered: bool = False, window: type[RFPulse] = <class 'synthesizer.synthesizer_sequences.RectangularPulse'>, **kwargs)
Bases:
RFPulseClass for generating an RF pulse on a specified
Transition, which must be set by aSetTransitioncommand before the firstAreaPulse(). The pulse timing is calculated to provide the specified pulsearea. See alsoPulse()for a low level function for generating pulses with manually specified frequency, amplitude, and duration.- __init__(pulse_area: float, amplitude: Optional[float] = None, phase: Optional[float] = None, frequency: Optional[float] = None, centered: bool = False, window: type[RFPulse] = <class 'synthesizer.synthesizer_sequences.RectangularPulse'>, **kwargs) None
- Parameters:
pulse_area (float) – The pulse area in radians.
amplitude (float, optional) – The peak amplitude of the pulse, relative to full scale. Defaults to None, in which case the default amplitude for the specified
Transitionis used.phase (float, optional) – The phase of the pulse in radians. Defaults to None, in which case the previous phase setting is maintained.
centered (bool, optional) – Whether to reduce the duration of the preceding and following
Waitcommandsduration/2. Will throw an error during compilation if theWaitcommands are too short or the pulse is not adjacent to at least oneWaitcommand. If there is only one neighboringWaitcommand, its duration is reduced byduration/2. Defaults to False.window (RFPulse, optional) – The shape of the pulse. Defaults to RectangularPulse.
**kwargs – Additional keyword arguments, which are passed to window’s
__init__method
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.BB1(pulse_area: float, amplitude: Optional[float] = None, phase: Optional[float] = None, frequency: Optional[float] = None, centered: bool = False, window: type[RFPulse] = <class 'synthesizer.synthesizer_sequences.RectangularPulse'>, **kwargs)
Bases:
AreaPulseGenerates a BB1 robust composite pulse.
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.BlackmanPulse(duration: float, amplitude: float, phase: float | None = None, frequency: float | None = None, centered: float | None = False, steps: int = 20, exact: bool = False)
Bases:
RFPulseGenerates a pulse with an Blackman window.
- __init__(duration: float, amplitude: float, phase: float | None = None, frequency: float | None = None, centered: float | None = False, steps: int = 20, exact: bool = False) None
Refer to
Pulse()for descriptions of the arguments.- Keyword Arguments:
steps (int, optional) – The number of steps to approximate the pulse. Should be at least 7. Defaults to 20.
exact (bool, optional) – Whether to use exact parameters for the window, as described on Wikipedia. Defaults to False.
- property area: float
Returns the area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude.
- Returns:
The area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude
- Return type:
(float)
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.CORPSE(pulse_area: float, amplitude: Optional[float] = None, phase: Optional[float] = None, frequency: Optional[float] = None, centered: bool = False, window: type[RFPulse] = <class 'synthesizer.synthesizer_sequences.RectangularPulse'>, **kwargs)
Bases:
AreaPulseGenerates a CORPSE robust composite pulse.
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.FrequencyRamp(duration: float, amplitude: float | None = None, phase: float | None = None, start_frequency: float | None = None, end_frequency: float | None = None, steps: int = 20)
Bases:
RFBlockLinearly ramps the frequency of the RF tone while maintaining constant amplitude and phase.
- __init__(duration: float, amplitude: float | None = None, phase: float | None = None, start_frequency: float | None = None, end_frequency: float | None = None, steps: int = 20)
- Parameters:
duration (float) – The duration of the ramp in seconds.
amplitude (float, optional) – The amplitude of the tone relative to full scale. Defaults to None.
phase (float, optional) – The phase of the tone in radians. Defaults to None, in which case the previous phase setting is maintained.
start_frequency (float, optional) – The initial frequency in Hertz. Defaults to None, in which case the previous frequency setting is used.
end_frequency (float, optional) – The final frequency in Hertz. Defaults to None, in which case
start_frequencyis used.steps (int, optional) – The number of frequency steps to include in the ramp. Defaults to 20.
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.GaussianPulse(duration: float, amplitude: float, phase: float | None = None, frequency: float | None = None, centered: bool = False, steps: int = 26, sigt: float = 0.11)
Bases:
RFPulseGenerates a pulse with an approximate confined Gaussian window. See also here for more details.
- __init__(duration: float, amplitude: float, phase: float | None = None, frequency: float | None = None, centered: bool = False, steps: int = 26, sigt: float = 0.11) None
Refer to
Pulse()for descriptions of the arguments.- Keyword Arguments:
steps (int, optional) – The number of steps to approximate the pulse. Should be at least 16. Defaults to 26.
sigt (float, optional) – The RMS time width of the pulse relative to duration. Approximates a cosine window for \(\sigma_{t} \approx 0.18\) and approaches the time-frequency uncertainty limit for \(\sigma_{t} \leq 0.13\). Throws an error if not between 0.08 and 0.20. Defaults to 0.11.
- property area: float
Returns the area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude.
- Returns:
The area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude
- Return type:
(float)
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- synthesizer.synthesizer_sequences.KDD(duration, pulse=None)
Returns a list of pulses and
Waitcommands implementing a KDD decoupling sequence. Refer to this review and this paper for information about the KDD pulse sequence.- Parameters:
duration (float) – The duration of the decoupling sequence in seconds.
pulse (RFPulse, optional) – The pulse to use for the pi pulses in the decoupling sequence. Should normally be generated by
PiPulse()or be a subclass ofRFPulse. The phase of the pulses are overridden in the sequence. Defaults to None, in which case aRectangularPulsewith the default amplitude and frequency for the selectedTransitionis used.
- Returns:
Returns a list of pulses and
Waitcommands implementing a KDD decoupling sequence.- Return type:
list of
RFBlock
- class synthesizer.synthesizer_sequences.PhaseRamp(duration: float, amplitude: float | None = None, start_phase: float | None = None, end_phase: float | None = None, frequency: float | None = None, steps: int = 20)
Bases:
RFBlockLinearly ramps the amplitude of the RF tone while maintaining constant frequency and phase.
- __init__(duration: float, amplitude: float | None = None, start_phase: float | None = None, end_phase: float | None = None, frequency: float | None = None, steps: int = 20)
- Parameters:
duration (float) – The duration of the ramp in seconds.
amplitude (float, optional) – The amplitude of the tone relative to full scale. Defaults to None, in which case the previous ammplitude setting is maintained.
start_phase (float, optional) – The initial phase in radians. Defaults to None, in which case the phase of the previous
RFBlockis used.end_phase (float, optional) – The final phase in radians. Defaults to None, in which case
start_phaseis used.frequency (float, optional) – The frequency of the tone in Hertz. Defaults to None, in which case the previous frequency setting is maintained.
steps (int, optional) – The number of amplitude steps to include in the ramp. Must be at least 2. Defaults to 20.
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- synthesizer.synthesizer_sequences.PiOver2Pulse(amplitude=None, phase=None, centered=False, window=RectangularPulse, **kwargs)
A wrapper for
AreaPulse()with pulse area set to pi/2. Refer toAreaPulse()for full documentation.
- synthesizer.synthesizer_sequences.PiPulse(amplitude=None, phase=None, centered=False, window=RectangularPulse, **kwargs)
A wrapper for
AreaPulse()with pulse area set to pi. Refer toAreaPulse()for full documentation.
- synthesizer.synthesizer_sequences.Pulse(duration, amplitude, phase=None, frequency=None, centered=False, window=RectangularPulse, **kwargs)
Low level function for generating an RF pulse. Provides a unified constructor for all subclasses of
RFPulse. See alsoAreaPulse()for a higher level interface to pulses on a specifiedTransition.- Parameters:
duration (float) – The duration of the pulse in seconds.
amplitude (float) – The peak amplitude of the pulse, relative to full scale.
phase (float, optional) – The phase of the pulse in radians. Defaults to None, in which case the previous phase setting is maintained.
frequency (float, optional) – The frequency of the pulse in Hertz. Defaults to None, in which case the previous frequency setting is maintained.
centered (bool, optional) – Whether to reduce the duration of the preceding and following
Waitcommandsduration/2. Will throw an error during compilation if theWaitcommands are too short or the pulse is not adjacent to at least oneWaitcommand. If there is only one neighboringWaitcommand, its duration is reduced byduration/2. Defaults to False.window (RFPulse, optional) – The shape of the pulse. Defaults to RectangularPulse.
**kwargs – Additional keyword arguments, which are passed to
window’s__init__method
- Returns:
An
RFPulsewith the specified parameters- Return type:
- class synthesizer.synthesizer_sequences.RFBlock
Bases:
objectA base class for elements of a sequence for a synthesizer channel.
- Parameters:
atomic (bool) – Whether the block is handled directly by the compiler (True) or returns a sequence of blocks which need to be compiled (False). Defaults to False.
- atomic = False
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.RFPulse
Bases:
RFBlockA base class for RF pulses.
- property area: float
Returns the area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude.
- Returns:
The area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude
- Return type:
(float)
- static center(center: bool, sequence: List[RFBlock], duration: float)
center(center, sequence, duration):
Helper function for centering a pulse by adjusting the duration of the surrounding
Timestamp. Should be included in theRFBlock.compile()methods of subclasses assequence = generate_some_stuff() return RFPulse.center(self.center, sequence, self.duration)
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- synthesizer.synthesizer_sequences.Ramsey(duration, phase, pulse=None, decoupling=None)
Returns a list of pulses and
Waitcommands implementing a Ramsey interferometry sequence, consisting of a pi/2 pulse with zero phase, aWaitof lengthduration, and a final pi/2 pulse with phasephase. A decoupling sequence can optionally be inserted instead of theWait.- Parameters:
duration (float) – The dark time (in seconds) for the Ramsey sequence.
phase (float, optional) – The phase of the final pulse. Defaults to 0.
pulse (RFPulse, optional) – The pulse to use for the pi/2 pulses in the Ramsey sequence. Should normally be generated by
PiOver2Pulse()or be a subclass ofRFPulse. The phase of the pulses are overridden in the sequence. Defaults to None, in which case aRectangularPulsewith the default amplitude and frequency for the selectedTransitionis used.decoupling (list of
RFBlock, optional) – A decoupling sequence (generated byXY8(), for example) to insert during the dark time. The duration ofWaitcommands is adjusted to make the total length equal toduration. Must only containRFPulseandWaitblocks. Defaults to None.
- Returns:
Returns a list of pulses and
Waitcommands implementing a Ramsey sequence.- Return type:
list of
RFBlock
- class synthesizer.synthesizer_sequences.RectangularPulse(duration: float, amplitude: float, phase: float | None = None, frequency: float | None = None, centered: bool = False)
Bases:
RFPulseGenerates a rectangular pulse.
- __init__(duration: float, amplitude: float, phase: float | None = None, frequency: float | None = None, centered: bool = False) None
Refer to
Pulse()for descriptions of the arguments.
- property area: float
Returns the area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude.
- Returns:
The area of the pulse, relative to a rectangular pulse of the same duration and peak amplitude
- Return type:
(float)
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.SequenceState(amplitude: float = 0, phase: float = 0, frequency: float = 1000000.0, transition: Transition | None = None, time: float = 0, triggers: int = 0, syncpoints: List[SyncPoint] = [], digital_out: List[bool] = [False, False, False, False, False, False, False])
Bases:
objectRecords the state of a synthesizer channel at any point in the sequence. Used by
compile_sequence()and theRFBlock.compile().- __init__(amplitude: float = 0, phase: float = 0, frequency: float = 1000000.0, transition: Transition | None = None, time: float = 0, triggers: int = 0, syncpoints: List[SyncPoint] = [], digital_out: List[bool] = [False, False, False, False, False, False, False]) None
- Parameters:
amplitude (float) – The amplitude of the channel. Defaults to 0.
phase (float) – The phase of the channel. Defaults to 0.
frequency (float) – The frequency of the channel. Defaults to 1E6.
transition (
Transition) – The selected transition, as set bySetTransition. Defaults to None.time (float) – The time since the start or the last trigger. Defaults to 0.
triggers (int) – The number of triggers required so far. Defaults to 0.
syncpoints (list of str) – The ordered list of
SyncPointso far. Defaults to[].digital_out (list of bool) – The state of the digital outputs. Defaults to
[False]*7.
- class synthesizer.synthesizer_sequences.SetTransition(transition: Transition)
Bases:
RFBlockSets the transition to be used for subsequent
AreaPulse()commands.- __init__(transition: Transition) None
- Parameters:
transition (Transition) – The transition to use for the following
AreaPulse()commands.
- atomic = True
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- synthesizer.synthesizer_sequences.SpinEcho(duration, pulse=None)
Returns a list of pulses and
Waitcommands implementing a spin echo decoupling sequence consisting of a duration/2Wait, a pi pulse about thexaxis and anotherduration/2Wait.- Parameters:
duration (float) – The duration of the decoupling sequence in seconds.
pulse (RFPulse, optional) – The pulse to use for the pi pulses in the decoupling sequence. Should normally be generated by
PiPulse()or be a subclass ofRFPulse. The phase of the pulse is overridden in the sequence. Defaults to None, in which case aRectangularPulsewith the default amplitude and frequency for the selectedTransitionis used.
- Returns:
Returns a list of pulses and
Waitcommands implementing a spin echo decoupling sequence.- Return type:
list of
RFBlock
- class synthesizer.synthesizer_sequences.SyncPoint(name: str)
Bases:
RFBlockAllows different channels to be synchronized. If SyncPoints with the same name appear in different channels, an appropriate sequence of
Waitblocks are inserted into the channels for which it would occur earlier such that all channels reach the SyncPoint at the same time.Throws an error upon compilation if multiple SyncPoints with the same name occur in one channel’s sequence or in an order such that they cannot be applied.
- atomic = True
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.Timestamp(duration: float, amplitude: float | None = None, phase: float | None = None, frequency: float | None = None, wait_for_trigger: bool | None = False, digital_out: dict | None = {}, absolute_phase: bool | None = False)
Bases:
RFBlockA single timestamp, at which the amplitude, phase, and frequency of the tone can be set for a specified duration.
- __init__(duration: float, amplitude: float | None = None, phase: float | None = None, frequency: float | None = None, wait_for_trigger: bool | None = False, digital_out: dict | None = {}, absolute_phase: bool | None = False) None
- Parameters:
duration (float) – The duration of the timestamp. If the duration is zero, the parameters override ommited parameters in the next Timestamp.
amplitude (float, optional) – The amplitude of the tone relative to full scale. Defaults to None, in which case the previous amplitude is maintained.
phase (float, optional) – The phase of the tone in radians. Defaults to None, in which case the previous phase is maintained.
frequency (float, optional) – The frequency of the tone in Hertz. Defaults to None, in which case the previous frequency is maintained.
wait_for_trigger (bool, optional) – Whether to wait for a trigger to start the timestamp. Defaults to False.
({int (digital_out) – bool}, optional): A dictionary with keys (integers between 0 and 6) corresponding to the indices of digital outputs to set and boolean values corresponding to the desired state of the output. If a key is not present, the corresponding output is unchanged. Only used for the first channel. Defaults to {}.
absolute_phase (bool, optional) – If true, sets the phase to
phaseradians at the beginning of the timestamp. Otherwise offsets the phase tophaseradians relative to a reference clock. If True,phasemust not be None. Defaults to False.
- atomic = True
- compile(self)
Compiles the block into a list of basic
RFBlockthat can be sent to the synthesizer.- Parameters:
state (
SequenceState, optional) – The state of the channel when the block is to be called. Defaults to None, which can be used for testingcompilefunctions ofRFBlockobjects that do not depend on channel state.- Returns:
The compiled
RFBlock.- Return type:
- class synthesizer.synthesizer_sequences.Transition(frequency: float, amplitudes, Rabi_frequencies=None, default_amplitude: float | None = None, frequency_offset: float = 0)
Bases:
objectDescribes the calibrated frequency and Rabi frequencies for a transition. Used in
SetTransitionto set parameters forAreaPulse().- Rabi_frequency(self, amplitude=None)
Computes the Rabi frequency corresponding to
amplitudeusing interpolation or extrapolation from the values provided byamplitudesandRabi_frequencies.
- __init__(frequency: float, amplitudes, Rabi_frequencies=None, default_amplitude: float | None = None, frequency_offset: float = 0) None
- Parameters:
frequency (float) – The frequency of the transition in Hertz.
amplitudes (dict or list of float) – A list of amplitudes (relative to full scale) for which the Rabi frequencies are calibrated. Linearly interpolates and extrapolates relative to specified amplitudes. Can also take a dictionary with amplitude keys and Rabi frequency values, in which case Rabi_frequencies is ignored.
Rabi_frequencies (list of float, optional) – A list of Rabi frequencies (in Hertz) corresponding to
amplitudes. Must be the same length asamplitudesif lists are used. Defaults to None.default_amplitude (float, optional) – The default amplitude for pulses on the transition. Defaults to None, in which case the first element of amplitudes is used.
frequency_offset (float, optional) – The frequency (in Hertz) of the tone that is mixed with the synthesizer output. The actual output frequency of the synthesizer is
frequency - frequency_offset. Defaults to 0.
- class synthesizer.synthesizer_sequences.Wait(duration: float, wait_for_trigger: bool = False)
Bases:
TimestampWaits for a fixed duration.
- synthesizer.synthesizer_sequences.XY16(duration, pulse=None)
Returns a list of pulses and
Waitcommands implementing an XY16 decoupling sequence. Refer to this review for information about the XY8 pulse sequence.- Parameters:
duration (float) – The duration of the decoupling sequence in seconds.
pulse (RFPulse, optional) – The pulse to use for the pi pulses in the decoupling sequence. Should normally be generated by
PiPulse()or be a subclass ofRFPulse. The phase of the pulses are overridden in the sequence. Defaults to None, in which case aRectangularPulsewith the default amplitude and frequency for the selectedTransitionis used.
- Returns:
Returns a list of pulses and
Waitcommands implementing an XY16 decoupling sequence.- Return type:
list of
RFBlock
- synthesizer.synthesizer_sequences.XY8(duration, pulse=None)
Returns a list of pulses and
Waitcommands implementing an XY8 decoupling sequence. Refer to this review for information about the XY8 pulse sequence.- Parameters:
duration (float) – The duration of the decoupling sequence in seconds.
pulse (RFPulse, optional) – The pulse to use for the pi pulses in the decoupling sequence. Should normally be generated by
PiPulse()or be a subclass ofRFPulse. The phase of the pulses are overridden in the sequence. Defaults to None, in which case aRectangularPulsewith the default amplitude and frequency for the selectedTransitionis used.
- Returns:
Returns a list of pulses and
Waitcommands implementing an XY8 decoupling sequence.- Return type:
list of
RFBlock
- synthesizer.synthesizer_sequences.compile_sequence(sequence)
- Compilation steps:
Compiles instance of
RFBlockwithcompilefunctionsUpdates durations based on
AdjustPrevDurationandAdjustNextDurationConverts timestamps from relative to absolute time
Computes durations of each section of the sequence
Outputs the sequence in a list of serializable dictionaries that can be sent to the synthesizer server.
- Parameters:
sequence (dictionary of lists of
RFBlock) – The sequence to compile. Keys should be channels, values should be list ofRFBlock.output_json (bool) – Outputs a JSON-formatted string of timestamos that can be sent to
synthesizer.synthesizer_serverif True, or a list ofRFBlockif False. Defaults to True.
- Returns
((List[RFBlock] | str), Dict[int : List[float]]): A tuple containing the compiled sequence and a list of lists the durations of the sequences for each channel
- synthesizer.synthesizer_sequences.fromdB(amplitude_dB)
Converts an amplitude ratio from decibels to linear per \(A = 10^{A_{dB}/20}\).
- synthesizer.synthesizer_sequences.plot_sequence(seq)
Plots a sequence using Plotly.
- Parameters:
seq ([RFBlock]) – The sequence to plot
- synthesizer.synthesizer_sequences.send_seq(seq)
- synthesizer.synthesizer_sequences.todB(amplitude_lin)
Converts an amplitude ratio from linear to decibels per \(A_{dB} = 20 \log_{10}(A)\).
- synthesizer.synthesizer_sequences.validate_parameters(duration=None, amplitude=None, phase=None, frequency=None)
Checks that commonly used parameters are within acceptable ranges.
- Parameters:
duration (float, optional) – Duration in seconds. Checks that it’s non-negative. Defaults to None.
amplitude (float, optional) – Amplitude relative to full scale. Checks that it’s between zero and one. Defaults to None.
phase (float, optional) – Phase in radians. Checks that it’s a real number. Defaults to None.
frequency (float, optional) – Frequency in Hertz. Checks that it’s between zero and
MAX_FREQUENCY. Defaults to None.
- Raises:
ValueError – If any of the parameters are not None and outside their valid range.