LINQ-Based Feedback#
Every Q1 sequencer is equipped with an extensive, low-latency feedback system, allowing real-time sharing of information between Q1 sequencers within a Qblox Cluster.
This capability is essential for performing advanced quantum operations. A few examples are:
Repeat-until-success
Conditional-branching of the Q1 core program
Conditional-playback
Real-time qubit calibrations
PID controllers for qubit stabilization
LINQ allows a source sequencer to transmit payloads (thresholded bits (TB), IQ samples, time-tags, TTL counts, and immediates and registers) to one or many receiver sequencers in real-time.
Data Routing#
Every piece of data sent by a sequencer is addressed with a specific id (an 8-bit immediate value in Q1ASM). This id
serves multiple purposes:
Routing control: The
idvalue determines the routing modeIDs 1–15 are reserved for self-cast, which returns data exclusively to the originating sequencer.
IDs 16–255 can be set up for either intra-cast or multicast routing (see Routing Configuration section for detailed information).
Selective receiving: On the receiver side, the
ids are used to filter queue entries:The command
fb_pop_data I, Rretrieves data associated with the specificidprovided in the first argument,I. Note that this command discards all data in the queue that precedes the target data. The targeted value is then stored in registerR(see Figure 2 below).The command
fb_pull_data R0, R1performs a standard FIFO retrieval. It fetches the next available data in the queue, storing the value inR1and its correspondingidinR0(see Figure 3 below).
Disabling Sharing: Setting the
idto0disables sharing of the respective data type for the next acquisition. This allows users to dynamically enable or disable the sharing of specific data types without changing the sequencer’s program structure.
Routing Configuration#
The routing configuration determines which sequencers receive the data based on the id of the data packet. This allows
for flexible communication patterns between sequencers without risking overflowing the feedback queue with irrelevant
data.
Figure 1: Click on the Routing type to highlight the Routes.
The sequencer can be configured to transmit data using three different default routes, set by the sequencers’ configuration:
Self-cast: The data is sent only to the originating sequencer.
Intra-cast: The data is sent locally to the selected sequencers within the module.
Multi-cast: The data is sent to the selected sequencers via CMM route, this allows communication between sequencers across modules.
See also
Data latency depends on the routing path (multicast, intra-cast, or self-cast), as well as the data type and size. For more information on data latency, see the latencies section.
The default routing configuration for id 1–15 is self-cast, meaning that any data sent with these ids will only be
received by the source sequencer. By default, self-cast routing is enabled, meaning data automatically streams back to
the originating sequencer without any additional configuration. Conversely, intra-cast and multi-cast routing are
disabled by default; any data assigned ids 16–255 will be discarded. To enable intra-cast or multi-cast routing, you
must configure your routing settings before sharing the data.
Which sequencers listen to a particular id in multicast/intracast routing can be configured with the
Cluster.set_cmm_route() and QRM.set_local_route() methods, respectively. For convenience, broadcast to all
sequencers can be enabled with Cluster.set_broadcast(). The route for all ids can be reset to selfcast only with
the Cluster.clear_router() and QRM.clear_router() method at the Cluster/Module level, respectively. Finally,
the current configuration can be obtained with QRM.get_router_config(). See the links to the API documentation for
more details. A small overview is given in the table below.
Command |
Description |
|---|---|
|
Reset all routing to factory defaults. |
|
Intra-cast: route |
|
Multi-cast: route |
|
Broadcast: route |
|
Reset a module’s router configuration to factory defaults. |
|
Get the router configuration for the respective module. |
Example
# 1. Broadcast data with id 16 to all sequencers in all modules
cluster.set_broadcast(16)
# 2. Multi-cast data with id 17 to all sequencers in module5 and sequencer0 in module3
cluster.set_cmm_route(17, [module5, module3.sequencer0])
# 3. Intra-cast data with id 19 to only sequencer1 and sequencer4 in module4
module4.set_local_route(19, [module4.sequencer1, module4.sequencer4])
# Reset all routers in the cluster to factory defaults
cluster.clear_router()
# Reset only the router for module3 to factory defaults
module3.clear_router()
Receiving Data#
Data arrives at the receiving Q1 core in a dedicated feedback queue. This queue has a fixed capacity of 32 entries, each with a 32-bit data width.
There are two main ways to retrieve data from the feedback queue:
Selectively pop the data with a specific
idusingfb_pop_data id:I8, data:RPulling the data in FIFO order using
fb_pull_data id:R, data:R
The Q1ASM command to pop the data from the feedback queue is
fb_pop_data id:I8, data:R
The fb_pop_data is a Q1 core command and not a real-time instruction, thus takes 4 ns as Q1
execution time. It is important to note that the id operand is an immediate, thus needs to be user-specified.
In the video below, we see the behavior of the fb_pop_data command, where user specifies id 7. The Q1 core discards
the entries in the feedback queue until it finds the entry with id 7, then moves the attributed data into the
specified register.
When the user wants to pull the data in FIFO order without specifying the id, the fb_pull_data command is used
instead. This command allows users to retrieve data from the feedback queue in the order they were received.
The video below shows the behavior of the fb_pull_data command, where the Q1 core moves the id and data of the first
entry in the feedback queue into the specified registers, in the case below to R0 and R1.
Since the command fb_pull_data updates two Q1 registers, the Q1 execution time of this command is 8 ns.
Note
Here, we assume that the LINQ data is already in the sequencer queue before calling fb_pop_data or fb_pull_data.
If you execute fb_pull_data id:R, data:R when the queue is empty, or fb_pop_data id:I8, data:R
when no entry with the requested id is present, the Q1 core will wait until there is an entry in the feedback queue to pop.
At the same time, if the RT core tries to pop a real-time instruction from the RT queue and the RT queue is empty,
the sequencer will stop and raise an SEQUENCE_PROCESSOR_RT_EXEC_COMMAND_UNDERFLOW error.
See the following section for how to avoid this error when data arrival time is unknown.
The recommended way to send and receive LINQ data is to take the Q1 to Q1 latencies into account, and ensure that the RT queue of the receiving sequencer will not run out while the Q1 core of the receiving sequencer waits for the feedback queue to be filled. This is true for data types with deterministic arrival times—such as TB, IQ values, Q1 registers/immediates, TTL counts, and high-resolution time deltas.
However, there are some situations in which one does not know when the LINQ data will arrive. In these cases, it is
possible to disable the SEQUENCE_PROCESSOR_RT_EXEC_COMMAND_UNDERFLOW error temporarily by using 0 as the duration
argument to a real-time instruction before using fb_pop_data or fb_pull_data.
Note
duration = 0 is a special value that suspends the underflow guard; it is an exception to the general 4 ns minimum
described in the sequencer documentation.
If the RT core pops a real-time instruction with 0 duration (e.g. wait 0), it will execute the real-time instruction
and 4 ns later try to pop and execute the next RT instruction in the queue. If there is no instruction in the RT queue,
the RT core will wait until one arrives, pop and execute it.
When the RT core pops a real-time instruction with a duration that is not 0, then the
SEQUENCE_PROCESSOR_RT_EXEC_COMMAND_UNDERFLOW error is enabled again.
Example
Selectively popping the data with id 16:
wait 0 # wait indefinitely
fb_pop_data 16, R1 # pop data with `id` 16 as soon as it arrives into register `R1`
Popping first data in FIFO order:
wait 0 # wait indefinitely
fb_pull_data R0, R1 # pull data as soon as it arrives, put id into R0 and data into R1
Important
Using wait 0 before fb_pop_data or fb_pull_data forces synchronization between the Q1 core and the RT core.
This means that synchronization of the sequencer depends on the Q1 execution time before the next real time instruction, including that real time instruction itself.
Latencies of LINQ-based Feedback Data Types#
The latency of LINQ-based feedback is defined as the time required for data to travel from the source sequencer to the feedback queue of the receiving sequencer. The latency depends on the routing path, the data type being transmitted, size of the data, and the sequencer type
In the table below, we summarize the latencies of different LINQ-based data types based on the routing path. The value in this table reflects the time of travel for a specific data type from the originating Q1 sequencer to the destination Q1 sequencer, excluding the input/output path.
Sequencer Type |
Data type |
Multi-cast (ns) |
Intra-cast (ns) |
Self-cast (ns) |
|---|---|---|---|---|
Readout |
Thresholded Bits |
472 |
250 |
160 |
IQ Values |
492 |
270 |
164 |
|
Time-tag |
High-resolution time tags |
1260 |
1000 |
910 |
Time delta |
1260 |
1000 |
910 |
|
TTL counts |
480 |
236 |
146 |
|
Low-latency time-tags |
480 |
236 |
146 |
|
All |
Q1 registers / immediates |
380 |
150 |
60 |
For a complete round trip latency that includes the input path of the specific module to the output path to a different module, use the interactive table below.
Table 1: Interactive table to calculate input-output latencies.
Note
The QTM has a negative input latency of -66 ns. This is because the acquisition window on the QTM starts
after the acquire_timetags command is issued, which shifts the entire time grid relative to when the
command is scheduled. As a result, the effective input latency appears negative when referenced to the
Q1 instruction timeline.