# Practical Real-Time Phase Drift Compensation Scheme for Quantum Communication Systems
## 2 Methods  
In a practical phase coding four-state style quantum communication system [4; 20], four phases \(0,\frac{\pi}{2},\pi,\frac{3\pi}{2}\) should be randomly encoded at [PERSON] and [PERSON]'s interferometers, respectively. Considering that most of the commercial phase modulators are based on lithium niobate (\(LiNbO_{3}\)), which has quite stable half-wave voltage and good modulation linearity under a certain modulation bandwidth [24; 25], we assume a linear relationship between the driving voltage and the modulated phase. Additionally, the half-wave voltages at the phase modulators in [PERSON] and [PERSON]'s interferometers are assumed to be constant and denoted as \(V_{\pi Ac}\) and \(V_{\pi Ac}\), respectively. Therefore, the driving voltages of the four phases can be obtained as  
\[\left\{ \begin{array}{l}V_{\frac{\pi}{2}A(B)}=V_{0A(B)}+\frac{1}{2}V_{\pi A(B )c}\\ V_{\pi A(B)}=V_{0A(B)}+V_{\pi A(B)c}\\ V_{\frac{3\pi}{2}A(B)}=V_{0A(B)}+\frac{3}{2}V_{\pi A(B)c}\end{array} \right., \tag{1}\]  
where \(V_{0A(B)},V_{\frac{\pi}{2}A(B)},V_{\pi A(B)},V_{\frac{3\pi}{2}A(B)}\) are the driving voltages of \(0,\frac{\pi}{2},\pi,\frac{3\pi}{2}\) at [PERSON]'s ([PERSON]'s) side, respectively. In addition, \(V_{0A(B)}\) can be considered as the reference voltage for the modulation voltages at [PERSON]'s ([PERSON]'s) phase modulator. From Equation (1), we can easily determine that the phase difference between Alice and Bob can be compensated by an additional driving voltage of \(V=V_{0A}-V_{0B}\) on the phase modulator. Here, we take the asymmetric Faraday-Sagnac-Michelson interferometer (FSMI)-based quantum communication system [20] for example, and for convenience, we consider the case of interference peak in our analysis, as the non-interference peaks can be filtered out by gated-mode single-photon detector. According to the analysis in Ref. [26], the two outputs of the interferometer at Bob can be described as  
\[ \begin{split} P_{\text{1 out}}&=P_{d}+\eta(1-v\cos \Delta\varphi),\\ P_{\text{2 out}}&=P_{d}+\eta(1+v\cos\Delta\varphi), \end{split}  \tag{2}\]  
where \(P_{d}\) is the dark count probability of the single photon detector (SPD), \(\eta\) is the quantum efficiency of the photon, which satisfies \(\eta\ll 1\), \(v\) is the interference fringe visibility of the interferometers, and \(\Delta\varphi\) is the phase difference between Alice and Bob. With different phase coding definitions of bit 0 and 1 at the two communication parties, the QBER can be given by  
\[e=\frac{P_{\rm{Iout}}}{P_{\rm{Iout}}+P_{\rm{2 out}}}=\frac{P_{d}+\eta(1-v\cos\Delta \varphi)}{2(P_{d}+\eta)} \tag{3}\]  
or  
\[e=\frac{P_{\rm{2 out}}}{P_{\rm{Iout}}+P_{\rm{2 out}}}=\frac{P_{d}+\eta(1+v\cos \Delta\varphi)}{2(P_{d}+\eta)}. \tag{4}\]  
It can be clearly seen that the formulas are symmetric and equivalent, so we just consider the first case for example. For simplicity, we define \(e_{0}\) as the QBER when \(\Delta\varphi=0\):  
\[e_{0}=e(\Delta\varphi=0)=\frac{P_{d}+\eta(1-v)}{2(P_{d}+\eta)}, \tag{5}\]  
and Equation (3) can be adjusted to be  
\[\cos\Delta\varphi =\frac{(1-2e)(P_{d}+\eta)}{\eta v} \tag{6}\] \[=\frac{(1-2e)(P_{d}+\eta)}{\eta(1-\frac{2e_{0}(P_{d}+\eta)-P_{d}} {\eta})}\.\] \[=\frac{1-2e}{1-2e_{0}}\]  
Further more, the incremental driving voltage that is needed for compensation can be calculated by  
\[\Delta V_{i}=\frac{V_{\pi}}{\pi}\Delta\varphi_{i} \tag{7}\] \[=\pm\frac{V_{\pi}}{\pi}\arccos\frac{1-2e_{i}}{1-2e_{0}}\,\]  
where the subscript i means the parameter of the i-th round of transmission, and after considering the boundary conditions, \(e_{i}\) should satisfy with  
\[e_{i}=\left\{ \begin{array}{cc}e_{0},&0\leq e_{i}\leq e_{0}\\ e_{i},&e_{0}<e_{i}<0.5\\ 0.5,&0.5\leq e_{i}\leq 1\end{array} \right.. \tag{8}\]  
From Equation (7), we can observe that, apart from the value of the driving voltage difference, the direction of voltage adjustment should be considered as well.