# Simulation of Fidelity in Entanglement-Based Networks with Repeater Chains
## 3 Entanglement Generation and Distribution
### Purification  
Purification is a quantum processing task wherein auxiliary quantum states are used to improve the fidelity of a noisy entangled state, boosting its quality. This can be achieved in multiple forms, so we explain here only one, the DEJMPS purification mechanism [5], as a representative. Assume a two-qubit state in a node that belongs to the ensemble \(\{(\lambda_{1},|\phi^{+}\rangle),(\lambda_{2},|\psi^{+}\rangle),(\lambda_{3}, |\phi^{-}\rangle),(\lambda_{4},|\psi^{-}\rangle)\}\). Its density matrix is  
\[\rho=\lambda_{1}\Phi^{+}+\lambda_{2}\Psi^{+}+\lambda_{3}\Phi^{-}+\lambda_{4} \Psi^{-}, \tag{1}\]  
where \(\Phi^{+}=|\phi^{+}\rangle\langle\phi^{+}|\), and similarly for the other Bell states, which is trivially diagonal in the Bell state basis. The fidelity is  
\[F(\Phi^{+},\rho)=\big{\langle}\phi^{+}\big{|}\rho\big{|}\phi^{+}\big{\rangle}= \lambda_{1}. \tag{2}\]  
Let us now suppose that [PERSON] (\(A\)) and [PERSON] (\(B\)) share two copies of the entangled pair (1), \(\{A_{0},B_{0}\}\) and \(\{A_{1},B_{1}\}\). Firstly, they both need to decide which entangled pair they want to keep in memory, i.e., which of these is distilled. Without loss of generality, suppose that they keep \(\{A_{0},B_{0}\}\). Now, \(A\) and \(B\) perform a \(R_{x}\) rotation gate on each of the qubits, [PERSON] applies \(R_{x}(\pi/2)\) and [PERSON] \(R_{x}(-\pi/2)\), where  
\[R_{x}(\theta)=\begin{pmatrix}\cos\begin{pmatrix}\theta\\ 2\end{pmatrix}&-i\sin\begin{pmatrix}\theta\\ 2\end{pmatrix}\\ -i\sin\begin{pmatrix}\theta\\ 2\end{pmatrix}&\cos\begin{pmatrix}\theta\\ 2\end{pmatrix}.\end{pmatrix} \tag{3}\]  
In the third step, a \(CNOT\) gate with qubits \((A_{0},B_{0})\) as the control and the other as the target is executed, and a measurement is applied to the target qubits. The measurement results \(m_{A},m_{B}\) are shared, and if they are equal (00 or 11), the purification is successful and the communication is resumed. Otherwise, both pairs are discarded. The output state \(\rho_{out}\) is of the form (1), but with a higher value of \(\lambda_{1}\) (i.e., fidelity), in fact, with  
\[F^{\prime}=\frac{\lambda_{1}^{2}+\lambda_{4}^{2}}{(\lambda_{1}+\lambda_{4})^{ 2}+(\lambda_{2}+\lambda_{3})^{2}}. \tag{4}\]  
The purification process is probabilistic, succeeding with probability \((\lambda_{1}+\lambda_{4})^{2}+(\lambda_{2}+\lambda_{3})^{2}\). It is easy to check that \(F^{\prime}>F\) for \(\lambda_{1}>1/2\).  
In this paper, we will assume that the qubit that is sent is subject to depolarizing noise, so (1) is changed to the following  
\[\rho=\bigg{(}1-\frac{3p}{4}\bigg{)}\big{|}\phi^{+}\big{\rangle}\big{\langle} \phi^{+}\big{|}+\frac{p}{4}\big{|}\psi^{+}\big{\rangle}\big{\langle}\psi^{+} \big{|}+\frac{p}{4}\big{|}\phi^{-}\big{\rangle}\big{\langle}\phi^{-}\big{|}+ \frac{p}{4}\big{|}\psi^{-}\big{\rangle}\big{\langle}\psi^{-}\big{|}. \tag{5}\]  
The condition \(\lambda_{1}>\lambda_{2}>\lambda_{3}>\lambda_{4}\) is trivially fulfilled \(\forall p<1\), and \(\lambda_{1}>1/2\) is sustained for \(p<2/3\), where \(p\) is the depolarizing probability of the Pauli channel.