Skip to content

Flexible feedback processing

Feedback in the QCCS is realized by low-latency messages sent between different parties. Regardless of their origin, a sequencer can act on such messages, either by branching or with a conditional pulse play. The first is done by the instructions getFeedback followed by branching instructions such as if, while the latter by the instruction executeTableEntry. For the lowest latency, a conditional play should be preferred.

In most feedback-based experiments, each sequencer of an instrument (e.g. SG Channel 1 of an SHFQC or AWG3 of an HDAWG) only acts on a fraction of the feedback word. To process the feedback word, each sequencer has mask and shift operations available to it, which reduces the feedback word to the required subset of information. An offset could be added; the purpose is to execute a feedback action from a subset of the command table. Multiple feedback sources, as described below, are available for both feedback instructions and must be specified as first argument. Each source has its dedicated feedback processing chain.

The parameters for processing can now be changed dynamically in realtime between feedback operations, while previously they were static through the entire execution of a sequence.

Format of feedback messages

  • ZSync : 16 bit messages. The format is given by the source unit. Please refer to the PQSC user manual.
  • Internal : 32 bit messages, composed of 16 contiguous couples of bits. Each couple represents one integration unit of the QA channel. If the 16W option is not present, only the first eight are available. When Multistate Discrimination (MSD) is enabled, each couple gives the state of the respective qudit in both bits. Without MSD only the lowest bit in each couple is used.

Status until L1 24.04

There are multiple processing sources are available as follows:

Source Constant Processing Description
ZSync ZSYNC_DATA_RAW Nothing, feedback word as-is Returns the data received from ZSync as-is without processing
  ZSYNC_DATA_PQSC_REGISTER ((word >> shift) & mask) + offset Gets last readout register forwarded by the PQSC with processing
  ZSYNC_DATA_PQSC_DECODER ((word >> shift) & mask) + offset Gets last output of the decoder received from the PQSC with processing
Internal QA_DATA_RAW Nothing, feedback word as-is Returns the data received from the QA channel as is without processing. Can be used only with getFeedback
  QA_DATA_PROCESSED ((word >> shift) & mask) + offset Returns the processed data received from the QA channel. When used with getFeedback, the offset is omitted.

The processing of non-RAW sources can be controlled by the values set in the following nodes, located in the awg branch of the considered channel.

Source constant Controls Limits
ZSYNC_DATA_PQSC_REGISTER shift = zsync/register/shift 0 - 15
  mask = zsync/register/mask 0 - 0xFFFF
  offset = zsync/register/offset 0 - 4095
ZSYNC_DATA_PQSC_DECODER shift = zsync/decoder/shift 0 - 7
  mask = zsync/decoder/mask 0 - 0xFF
  offset = zsync/decoder/offset 0 - 4095
QA_DATA_PROCESSED shift = intfeedback/direct/shift 0 - 32
  mask = intfeedback/direct/mask 0 - 0xFFFFFFFF
  offset = intfeedback/direct/offset 0 - 4095

Example

Active qubit reset

To perform active qubit reset, the command table of the SG channel that controls the target qubit would programmed with these two entries:

Index Waveform playZero Oscillator Comment
0 None WFM_LEN None No action
1 wfm_pi None 0 Pi-pulse

The oscillator 0 should be set to the the e-g transition frequency.

If the feedback is routed through the PQSC, and assuming that RESULT_INDEX holds the index of the result specified in the register forwarding unit, the feedback control nodes would be programmed as follows:

shfqc.sgchannels[SG_CHANNEL].awg.zsync.register.shift(RESULT_INDEX * 2)
shfqc.sgchannels[SG_CHANNEL].awg.zsync.register.mask(0b1)
shfqc.sgchannels[SG_CHANNEL].awg.zsync.register.offset(0)

and the seqc would look like this

waitZSyncTrigger();
playZero(feedback_latency_pz);
executeTableEntry(ZSYNC_DATA_PQSC_REGISTER, feedback_latency);

If feedback is done with the internal feedback unit, and assuming that INT_UNIT holds the index of the QA integration unit that reads the target qubit, the feedback control nodes would be programmed as follows:

shfqc.sgchannels[SG_CHANNEL].awg.intfeedback.direct.shift(INT_UNIT * 2)
shfqc.sgchannels[SG_CHANNEL].awg.intfeedback.direct.mask(0b1)
shfqc.sgchannels[SG_CHANNEL].awg.intfeedback.direct.offset(0)

and the seqc would look like this

waitZSyncTrigger();
playZero(feedback_latency_pz);
executeTableEntry(QA_DATA_PROCESSED, feedback_latency);

New behavior since L1 24.07

The configuration of the feedback processing has been changed from nodes to a dedicated seqc instruction: configureFeedbackProcessing. In this way the processing parameters can be changed dynamically during the sequence, so different feedback actions can be performed sequentially with the same feedback input. For ZSync feedback, the feedback process chain is not tied anymore to a specific feedback processing unit (register forwarding or decoder). Therefore, the source selectors have been renamed to be more generic.

The processing sources are available as follows:

Source Constant Processing Description
ZSync ZSYNC_DATA_RAW Nothing, feedback word as-is Returns the data received from ZSync as-is without processing
  ZSYNC_DATA_PROCESSED_A ((word >> shift) & (2**length - 1)) + offset Returns last feedback received from ZSync with processing
  ZSYNC_DATA_PROCESSED_B ((word >> shift) & (2**length - 1)) + offset Returns last feedback received from ZSync with processing
Internal QA_DATA_RAW Nothing, feedback word as-is Returns the data received from the QA channel as is without processing. Can be used only with getFeedback
  QA_DATA_PROCESSED ((word >> shift) & (2**length - 1)) + offset Returns the processed data received from the QA channel.

ZSYNC_DATA_PROCESSED_A and ZSYNC_DATA_PROCESSED_B offer identical capabilities on the ZSync feedback source, but they can be configured differently.

The processing of non-RAW sources can be controlled by the command configureFeedbackProcessing as follows:

void configureFeedbackProcessing(FB_PATH, SHIFT, LENGTH, OFFSET)

  • FB_PATH specify the feedback path whose parameters should be changed. It can be ZSYNC_DATA_PROCESSED_A, ZSYNC_DATA_PROCESSED_B or QA_DATA_PROCESSED.
  • SHIFT Specify how many bits the feedback word should be right shifted. It can be between 0 and 15 for ZSync paths and between 0 and 31 for the internal path.
  • LENGTH sets the length of the trimming of the feedback message after the shift. It’s implemented as binary masking with a mask equal to 2**LENGTH - 1, or in other words, a mask with LENGTH ones. For example, to reduce a message to a single bit it should be set to 1, to reduce a message to two bits it should be set to 2 and so on. It can be between 1 and 16. If the feedback is processed with executeTableEntry, only values up to 12 are meaningful.
  • OFFSET sets the additive offset applied after shift and length trimming. It can be between 0 and 4095.

The instruction is blocking and requires a minimal waveform length of 48 to be gap-free.

If the feedback processing is not configured, the feedback message will be passed as-is; ZSYNC_DATA_PROCESSED_A or ZSYNC_DATA_PROCESSED_B will behave identically as ZSYNC_DATA_RAW. Same for QA_DATA_PROCESSED and QA_DATA_RAW.

The constants ZSYNC_DATA_PQSC_REGISTER and ZSYNC_DATA_PQSC_DECODER are kept for limited backwards compatibility, but they are deprecated. They now behave identically to ZSYNC_DATA_PROCESSED_A and ZSYNC_DATA_PROCESSED_B respectively.

The control of parameters with nodes is not available anymore.

Example

Active qubit reset

To implement the same sequence as with the older version, the following seqc can be used for ZSync feedback

configureFeedbackProcessing(ZSYNC_DATA_PROCESSED_A, RESULT_INDEX * 2, 1, 0);
waitZSyncTrigger();
playZero(feedback_latency_pz);
executeTableEntry(ZSYNC_DATA_PROCESSED_A, feedback_latency);

For internal feedback, ZSYNC_DATA_PROCESSED_A should be replaced with QA_DATA_PROCESSED.

In both case, no feedback processing node setting is required anymore.

Active qutrit reset

To perform active qubit reset, the command table of the SG channel that controls the target qubit would programmed with these entries:

Index Waveform playZero Oscillator Comment
0 None WFM_LEN None No action
1 wfm_pi_eg None 0 Pi-pulse e-g
2 wfm_pi_fe None 1 Pi-pulse f-e

The oscillator 0 should be set to the the e-g transition frequency, while oscillator 1 with the f-e frequency.

The sequence should be as follow

configureFeedbackProcessing(ZSYNC_DATA_PROCESSED_A, RESULT_INDEX * 2, 2, 0);
waitZSyncTrigger();
playZero(feedback_latency_pz);
executeTableEntry(ZSYNC_DATA_PROCESSED_A, feedback_latency);
configureFeedbackProcessing(ZSYNC_DATA_PROCESSED_A, RESULT_INDEX + 1, 1, 0);
executeTableEntry(ZSYNC_DATA_PROCESSED_A);

In the first conditional playback, the entire two-bit feedback word is used, so any entry of the command table entry can be used, depending on the starting condition. During the playback, the feedback processing is reconfigured, so that in the second playback, an e-g pulse is played only if the starting state was f.