Phase and Frame in QUA¶
This page will discuss the concepts of frame and phase, how they affect the OPX's output, and the API that
relates to them, namely, the reset_frame()
and reset_phase()
commands.
Every time we use the play()
command on a specific element, the output pulse will have a total phase calculated from two
separate contributions:
- The global phase associated with the rotating frame of the element, based on its intermediate frequency (IF) and time passed from the beginning of the sequence \(t\), \(\phi_G = \omega_{IF}\cdot t\).
- The frame phase, \(\phi_F\), which is the phase within the rotating frame. By default, \(\phi_F=0\) but we can control it using the command
frame_rotation_2pi()
(It is also possible to useframe_rotation()
, but not recommended).
Global Phase¶
Unless we actively change the global phase, \(\phi_G\), pulses from different elements with the same
intermediate frequency, will be phase matched with the same global phase. This is true, both if the
intermediate frequency was defined in the configuration, or was updated during the sequence, using
update_frequency()
.
There are a few ways in which the global phase associated with an element can be changed. Using the command
reset_phase()
we effectively define a constant phase \(\tilde{\phi} = \tilde{\omega}_{IF}\cdot \tilde{t}\),
where \(\tilde{\omega}_{IF}\) is the intermediate frequency of the element, and \(\tilde{t}\) is the time
in which the command reset_phase()
was applied. From that point forward the phase \(\tilde{\phi}\)
is subtracted from the global phase of the element.
Note
This means that the global phase after the reset_phase()
command will be \(\phi_G = \omega_{IF}\cdot t-\tilde{\omega}_{IF}\cdot \tilde{t}\),
where \(\tilde{\omega}_{IF}\) and \(\tilde{t}\) are defined according to the last reset_phase()
command used in the sequence.
It is not possible to set \(\tilde{t}\) back to zero after the reset_phase()
command is used.
Another command that will change the global phase is
update_frequency()
. When using the flag
keep_phase=True
, the phase of the pulse will be continuous through the frequency change, as can be seen in figure 1 indicated by the first dashed black line. The phase continuity results in a change to the global phase, \(\phi_G\). This change, however, is not tracked similarly to the phase change caused by reset_phase()
, so if we update to the frequency with the flag keep_phase=False
afterward, the global phase will be reevaluated from the beginning of the sequence (or the last phase reset), as can be seen in figure 1 indicated by the second
dashed black line.
Note
Phase behavior of update_frequency
By default keep_phase=False
, in this case the phase of the signal \(\omega_{IF}t\) after the frequency has
been updated will change according to the rule:
where \(\omega_1\), \(\omega_2\) are the frequencies before and after the transition, \(\Delta t\) is the sampling rate and \(\rightarrow\) signifies a transition from the sample \(t_0\) to the next.
To maintain a continuous phase through the transition, use keep_phase=True
. This will update the phase according to the rule:
Frame Phase¶
The frame phase is constant in relation to the element's global phase, i.e., the phase in the rotating frame.
At the beginning of a sequence, the frame phase is defined as \(\phi_F=0\), and using the commands frame_rotation()
and frame_rotation_2pi()
, we can control \(\phi_F\). The frame phase is separate from the global phase and is
not affected by the element's intermediate frequency. Using the command reset_frame()
we set the frame phase
back to zero, \(\phi_F=0\).
Note
Resetting the global phase will not reset the frame phase. So if we want to reset the total phase of an element
to zero, we need to use both reset_phase()
and reset_frame()
.
Fig. 2: Simulation of the OPX+ output showing, a frame_rotation_2pi(0.5, element) - first dashed line, a reset_frame(element) - second dashed line, and reset_phase(element) - third dashed line. The blue signal is the reference signal, and all operations are performed on the orange signal.
Further Examples¶
QUA code examples illustrating these concepts can be found in our GitHub Repository