# Experimental Quantum Message Authentication with Single Qubit Unitary Operation
## 2 Quantum Message Authentication Protocol
### Verification Phase
Figure 2 shows the swap test in the circuit, and the result of inputting  
\[\left|\left.m_{i}\right\rangle_{u}=R_{y}(m_{i})\right|\varphi\right\rangle_{u }^{(i)} \tag{6}\]  
and  
\[\left|\left.m_{i}^{\prime}\right\rangle_{d}=R_{y}\big{(}m_{i}^{\prime}\big{)} \right|\varphi\right\rangle_{d}^{(i)} \tag{7}\]  
in the second and third lines of the circuit is expressed as follows:  
(8)  
If \(\left|\left.m_{i}\right\rangle_{u}\) and \(\left|\left.m_{i}^{\prime}\right\rangle_{d}\) agree, the above equation becomes \(\left|\left.0\right\rangle_{ancilla}\right[\frac{1}{\sqrt{2}}\left(\left|\left. m_{i}\right\rangle_{u}\right|\left.m_{i}^{\prime}\right\rangle_{d}+\left|\left.m_{i}^{ \prime}\right\rangle_{u}\left|\left.m_{i}\right\rangle_{d}\right)\right]\), which makes the measurement outcome of the ancilla state to always be \(\left|\left.0\right\rangle\). However, if \(\left|\left.m_{i}\right\rangle_{u}\right.\right.\right.\) and \(\left|\left.m_{i}^{\prime}\right\rangle_{d}\) do not agree, the measurement outcome becomes \(\left|\left.0\right\rangle\right\rangle\) with a probability \(\left(1+\varepsilon^{2}\right)/2\) or becomes \(\left|\left.1\right\rangle\right\rangle\) with a probability \(\left(1+\varepsilon^{2}\right)/2\), where \(\varepsilon=\left|\left.d\right\langle m_{i}^{\prime}\right|\left.m_{i}\right\rangle _{u}\right|\) and \(0\leq\varepsilon\leq 1\). Therefore, if the swap test result of the measurement is \(\left|\left.1\right\rangle\), we know that \(\left|\left.m_{i}\right\rangle_{u}\right.\) and \(\left|\left.m_{i}^{\prime}\right\rangle_{d}\right.\) are different. If the result is \(\left|\left.1\right\rangle\right.\), we cannot guarantee that \(\left|\left.m_{i}\right\rangle_{u}\right.\) and \(\left|\left.m_{i}^{\prime}\right\rangle_{d}\right.\) are the same. The parameter \(\varepsilon\) is determined by the arbitrary quantum state components \(\left|\left.m_{i}\right\rangle_{u}\) of Equation (6) and \(\left|\left.m_{i}^{\prime}\right\rangle_{d}\right.\) of Equation (7). If the two rotation angles \(m_{i}\) and \(m_{i}^{\prime}\) are the same, i.e., \(m_{i}=m_{i}^{\prime}\), then the value of parameter \(\varepsilon\) is \(1\). On the other hand, if the difference between \(m_{i}\) and \(m_{i}^{\prime}\) is \(180^{\circ}\), i.e., \(m_{i}=m_{i}^{\prime}\pm 180^{\circ}\), then the parameter \(\varepsilon\) is \(0\). As a result, according to rotation angles \(m_{i}\) and \(m_{i}^{\prime}\), the parameter \(\varepsilon\) has a value between \(0\) and \(1\), \(0\leq\varepsilon\leq 1\). Further, the probability of failure in the verification phase is the total error probability \(P_{e}\) for \(N\) qubits as follows:  
\[P_{e}\leq\otimes_{i=1}^{N}\left[\left(1+\left|{}_{d}\langle{m_{i}^{\prime}}|{ m_{i}}\right\rangle_{u}\right|^{2}\right)/2\right] \tag{9}\]  
Therefore, it is expected that the swap test will work well even though the quantum state sequence is finite. Hence, the probability of failure in the verification phase becomes lower, approaching \(P_{e}\) as the size of the quantum state sequence \(N\) becomes considerably larger [42; 45]. For an arbitrary \(\left|\left.m_{i}\right\rangle_{u}\), a random choice for \(\left|\left.m_{i}^{\prime}\right\rangle_{d}\) on the \(R_{y}(m_{i}^{\prime})\right.\)--rotation circle, the average of \(\varepsilon^{2}\) is \(1/2\). In this case, the upper bound of the total error probability \(P_{e}\) is \((3/4)^{N}\). If the size of the quantum state sequence is \(15\), then the upper bound of the total error probability \(P_{e}\) is only approximately \(1.3\%\). Therefore, it is expected that the swap test will work well even though the quantum state sequence is finite. Figure 2: Circuit of the quantum swap test. “SWAP” indicates a swap gate, and \(U_{H}\) represents a Hadamard gate. “MS” represents quantum measurement, and the single lines and the double line represent the quantum channel and classical channel, respectively.