New ZSync trigger behavior¶
Status until L1 23.02¶
The PQSC can send messages with a fixed size of 16 bits. The purpose of
the message is not carried with the data itself, and the sequencer must
know a priori which kind of message it is. A message always generates a
trigger in the sequencer that can be waited for with the instruction
waitZSyncTrigger
. The payload of the message can be acquired in the
sequencer with the instruction getFeedback
(or alternatively
getZSyncData
), or a conditional playback can be executed with the
instruction executeTableEntry
(or alternatively playWaveZSync
).
The PQSC sends two kind of messages. Start triggers are used to synchronize the execution of the sequencers across instruments. Each sequencer should wait for it at the beginning of the sequence, and its data payload is not used.
Feedback data is used to perform conditional operations depending on
their payload. This operation can be timed in two ways. The recommended
one is to specify the time of execution with respect to the last start
trigger as a second parameter of getFeedback
or executeTableEntry
.
Such time can be deduced by looking at the RTLogger, or by using the
timing model provided by the package zhinst-utils
. This is called
time-based feedback. Another method is to wait for the trigger
associated with the feedback data and only then perform the conditional
action. This is called trigger-based feedback. This method, while
simpler on the surface, doesn’t give the user explicit information about
the timing, nor does it guarantee a stable feedback time across
experiments. Moreover, it is prone to errors when multiple feedback
events are generated.
Example¶
Time-based feedback sequence¶
A sample sequence using time-based feedback. The constant
FEEDBACK_DELAY
holds the feedback delay in sequencer clock cycles. It
has to be provided by the user using the timing model.
while(true) {
//Wait for a start trigger
waitZSyncTrigger();
//Play a conditional pulse, only when feedback is received
executeTableEntry(ZSYNC_DATA_PQSC_REGISTER, FEEDBACK_DELAY);
}
Trigger-based feedback sequence¶
When trigger-based feedback is used, a trigger is used to detect the arrival of the feedback message
while(true) {
//Wait for a start trigger
waitZSyncTrigger();
//Wait for the feedback trigger
waitZSyncTrigger();
//Play a conditional pulse
executeTableEntry(ZSYNC_DATA_PQSC_REGISTER);
}
New behavior since L1 23.06¶
The start triggers and the feedback data are now two semantically
different messages sent over ZSync. The command waitZSyncTrigger
will
now only wait for start triggers. If a feedback message is received
while the sequencer is waiting for a start trigger, it will continue to
wait. This avoids the issue of the sequencer getting confused and
starting a new portion of the sequence at the wrong point in time.
Similarly, a new start trigger doesn’t clear the last message received.
As a side effect, it is no longer possible to use the trigger-based feedback. All the sequences using such a method must be migrated to time-based feedback to keep working.
The instructions getZSyncData
and playWaveZSync
are deprecated. The
more generic instructions getFeedback
and executeTableEntry
should
be used instead with the same arguments respectively.