Chronos-Q RFSOC Driver
Chronos-Q RFSOC Driver Documentation
PulseGenerator Class Reference

Waveform data generator. More...

Collaboration diagram for PulseGenerator:
Collaboration graph

Public Member Functions

def plot_sequence (self)
 Plots the pulse information for the configured DAC Channels. More...
 
def register_envelope (self, int envelope_id, Union[Envelope, np.ndarray] envelope)
 Register a custom envelope for the pulse generator. More...
 
def register_frequency (self, frequency, frequency_id)
 Registers the desired frequency for waveform data generation. More...
 
def register_pulse (self, float start_time_nanoseconds, float duration_nanoseconds, float amplitude, int frequency_id, float phase, int channel, int envelope_id=EnvelopeType.Rectangular, SignalType type=SignalType.Sine, float relative_sigma=0.0, float beta=0.0)
 Register pulse information for desired DAC Channel. More...
 
def synthesis (self, List[DACChannel] dac_channels)
 Generate/synthesize the waveform data. More...
 
def update_pulse (self, int channel, ChronosQPulse pulse, **kwargs)
 Update a pulse object configuration. More...
 

Public Attributes

 dac_interval
 Interval between DAC sampling. More...
 
 dac_sr
 DAC Sampling rate. More...
 
 envelope_map
 Envelope types for pulse generation. More...
 
 fpga_sr
 FPGA sampling rate. More...
 
 sr_ratio
 Ratio of DAC and FPGA sampling rates. More...
 

Detailed Description

Implements the functionality to set up and generate waveform data to be uploaded to ChronosQ. The class requires external python packages for its implementation:

  • matplotlib
  • numpy

Member Function Documentation

◆ plot_sequence()

plot_sequence (   self)

Plots the pulse information for the configured DAC Channels showing the pulse duration and their start times.

◆ register_envelope()

register_envelope (   self,
int  envelope_id,
Union[Envelope, np.ndarray]  envelope 
)

Configures and registers a custom pulse envelope type to be used during waveform data generation.

Precondition
This function shall only be called if the PulseGenerator object used is initialized for custom envelope type (i.e. PulseGenerator::init is called with use_external_envelopes = True).
Parameters
[in]envelope_idAssigned an ID to the custom envelope.
[in]envelopeEnvelope information in either static.Envelope or numpy's ndarray.
Returns
None

◆ register_frequency()

register_frequency (   self,
  frequency,
  frequency_id 
)

Registers the given frequency and assigned it an ID.
The ID will be used when generating pulses later when calling PulseGenerator.register_pulse.

Parameters
[in]frequencyFrequency information in Hz
[in]frequency_idAssigned ID to the given frequency
Returns
None

◆ register_pulse()

register_pulse (   self,
float  start_time_nanoseconds,
float  duration_nanoseconds,
float  amplitude,
int  frequency_id,
float  phase,
int  channel,
int   envelope_id = EnvelopeType.Rectangular,
SignalType   type = SignalType.Sine,
float   relative_sigma = 0.0,
float   beta = 0.0 
)

Configures and registers the pulse information for the desired DAC channel. The information will be used later to generate the desired waveform data to be uploaded to ChronosQ RFSOC.
This function can be called multiple times to generate complex pulses for a single DAC channel.

Precondition
This function can only be called after:
  1. Desired pulse frequency was registered via PulseGenerator.register_frequency .
  2. If a custom pulse envelope is to be used, a custom pulse envelope also needs to be registered via PulseGenerator.register_envelope .
Parameters
[in]start_time_nanosecondsStart time of the pulse in nanoseconds.
[in]duration_nanosecondsDuration of the pulse in nanoseconds.
[in]amplitudeAmplitude of the pulse in the range of -1 to 1 (inclusive).
The value will be remapped automatically to DAC's specifications.
[in]frequency_idID of the frequency to be used for this pulse.
This ID shall be a valid ID previously registered via earlier calls to PulseGenerator.register_frequency.
[in]phasePhase information (in radians) of the generated waveform.
[in]channelDAC Channel ID associated with the registered pulse.
[in]envelope_idEnvelope type for the generated pulse.
Valid envelope types are as defined in static.EnvelopeType or any additional envelope type registered via previous PulseGenerator.register_envelope calls.
[in]typeSignal type for the pulse as defined below:
Value Signal Type
static.SignalType.Sine Sine wave (Default)
static.SignalType.Square Square wave
static.SignalType.DC_Offset DC offset wave
[in]relative_sigma(Optional) Relative sigma parameter used to define how the Gaussian pulse is scaled in relative to the pulse duration.
This attribute is currently applicable to static.EnvelopeType.Gaussian and static.EnvelopeType.DRAG envelope types.
[in]beta(Optional) Used as correction amplitude used to reduce leakage to higher energy states.
This attribute is only used for static.EnvelopeType.DRAG envelope type.
See also
static.EnvelopeType and static.SignalType
Returns
None
Here is the call graph for this function:

◆ synthesis()

synthesis (   self,
List[DACChannel dac_channels 
)

Generates/synthesizes the wave form data from the frequency and pulse configuration information.
This function shall be called once all the DAC channels' pulse configurations are completed.

Precondition
Frequency and pulse configurations shall need to be done for all the desired DAC channels before calling this function (i.e. The functions below):
  1. PulseGenerator.register_frequency
  2. PulseGenerator.register_pulse
  3. PulseGenerator.register_envelope if custom envelope shall be used
Parameters
[in]dac_channelsA list of DAC channels of type DACChannel
Returns
A dictionary containing generated waveform data and playback end address for the DAC channels with the channel ID as the key.
Eg. {
"6": [<waveform data for channel 6>, <End address info for channel 6>],
"15": [<waveform data for channel 15>, <End address info for channel 15>]
}

◆ update_pulse()

update_pulse (   self,
int  channel,
ChronosQPulse  pulse,
**  kwargs 
)

Updates the configuration of a previously defined pulse object.

Parameters
[in]channelChannel id that the pulse object is associated with.
[in]pulseReference to a pulse object of type static.ChronosQPulse to be updated.
[in]kwargsKeyword based arguments of the pulse configuration to be modified.
Valid values are:
Argument Description
start Start time of the pulse in nanoseconds.
duration Duration of the pulse in nanoseconds.
amplitude Amplitude of the pulse in the range of -1 to 1 (inclusive)
frequency_id ID of the frequency previously registered.
envelope_id Envelope type for the generated pulse.
phase Phase information (in radians) of the generated waveform.
signal_type Signal type for the pulse.
relative_sigma Sigma parameter for gaussian or DRAG envelope(s) generation
beta Beta parameter for DRAG envelope(s) generation
Here is the caller graph for this function:

Member Data Documentation

◆ dac_interval

dac_interval

The interval (in nanoseconds) between DAC sampling process.

◆ dac_sr

dac_sr

The ChronosQ DAC sampling rate in Hz.

◆ envelope_map

envelope_map

Dictionary containing either the supported envelope static.EnvelopeType or custom envelope type.

◆ fpga_sr

fpga_sr

ChronosQ FPGA sampling rate in Hz.

◆ sr_ratio

sr_ratio

The ratio of the DAC and FPGA sampling rates. Used during pulse configuration process.