Operations in QUA can be triggered by an external trigger in the form of a rising voltage received in the OPX trigger port on the back panel. The trigger can be used to control the timing of events in the program from an external source.
The usage in QUA is via the
wait_for_trigger() function. Basic usage of this feature is performed as follows:
For example, if we want to play a pulse on
qe1 after a trigger input, we can write:
We can also specify a constant pulse to be played while the element is waiting for trigger.
The pulse 'wait_pulse' will be played continuously until the arrival of the trigger signal.
The external trigger port is sampled at a frequency of 250 MHz. Therefore, the temporal resolution is 4 ns.
Triggering Multiple Elements¶
When we want to trigger multiple elements in the same controller, (i.e., same trigger signal), we can simply write multiple
wait_for_trigger() commands. For example:
Alternatively, and in case we don't want to play a wait pulse, we can use the
align() command. For example:
In the example above, the three play commends will be executed together after the trigger.
Note that any of the three elements can be placed in the
If we want to pause the entire program until the trigger arrives, we can place an empty align.
The program will be paused at this point until the trigger signal arrives.
Trigger in Multiple OPX's¶
In a system with \(N\) OPX's, there are essentially \(N\) trigger ports that can accommodate \(N\) separate trigger signals. However, each trigger signal can only trigger elements that are configured in the same OPX, i.e., where the elements has it's inputs. If we want a trigger signal to trigger elements in multiple controllers we can either use the align method. Alternatively, a digital output of one OPX can be used to trigger another OPX by directly connecting it to the other's trigger port.