# Quantum fidelity simplified formula while both of the density matrices are single qubit states

I have a question while reading the quantum fidelity definition in Wikipedia Fidelity of quantum states, at the end of the Definition section of quantum fidelity formula, it says Explicit expression for qubits. If rho and sigma are both qubit states, the fidelity can be computed as: $$F(\rho, \sigma)=\operatorname{tr}(\rho \sigma)+2 \sqrt{\operatorname{det}(\rho) \operatorname{det}(\sigma)}$$ So I'm really confused about where this formula comes from. I tested several simple examples, it seems that the formula is not suitable to calculate the fidelity between two mixed states while the dimensions of the density matrices are not $$2\times2$$ (e.g. for the case both of the two matrices are diag(0.5,0,0,0.5), the fidelity calculated by this formula is 0.5 not 1.

However, if one of the density matrices is in pure state, it seems the result now is always correct even though the dimensions of the density matrices are bigger than $$2\times2$$.

I'm wondering how to prove this formula and is it always safe to use it while one of the density matrices is in pure state...

The general expression for the fidelity is $$F(\rho,\sigma)=\left(\text{Tr}\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}}\right)^2=(\text{Tr}|\sqrt{\rho\sigma}|)^2.$$ Assume $$\rho$$ and $$\sigma$$ are $$2\times 2$$ matrices. Then $$\sqrt{\rho\sigma}$$ is also a $$2\times 2$$ matrix which we assume to have eigenvalues $$\lambda_1$$ and $$\lambda_2$$. Thus, $$F=(|\lambda_1|+|\lambda_2|)^2=\lambda_1^2+\lambda_2^2+2|\lambda_1\lambda_2|.$$

However, we also have that $$\text{Tr}(\rho\sigma)=\lambda_1^2+\lambda_2^2$$ and $$\text{det}(\rho\sigma)=\lambda_1^2\lambda_2^2,$$ so $$\sqrt{\text{det}(\rho\sigma)}=|\lambda_1\lambda_2|$$. So, that proves the relation specifically for $$2\times 2$$ matrices. As you stated, it generally does not hold for larger matrices.

In the special case of $$\rho$$ being pure, it does hold, but it's far easier simply to calculate $$F=\langle\psi|\sigma|\psi\rangle=\text{Tr}(\rho\sigma)$$.

• Thank you very much!! btw, should the square of the fidelity (the first formula of the answer F=Tr()^2) here be outside the trace (like (Tr())^2)? and another question that I'm not very clear is, is it always necessary to apply the absolute value to the density operator (Tr(|sqrt(sigma*rho)|)^2)? it seems the absolute value of the operator is calculated as: |A|=sqrt(A^(dagger) A ) as shown in the "Fidelity of quantum states" page of Wikipedia. Jun 14, 2019 at 9:47
• Yes, the square is applied to the whole trace (otherwise it would remove the square root in some of the expressions). I would advise leaving the absolute value calculating in there (or replacing it with an equivalent expression). It might be that you can introduce additional properties that let you remove it, but I don't know that you can. Jun 14, 2019 at 9:54
• did you mean to write $|\sqrt\rho\sqrt\sigma|$ rather than $|\sqrt{\rho\sigma}|$ here? The latter it's the standard expression used in this context. These are not obviously equivalent: $|\sqrt{\rho\sigma}|=\sqrt{\sqrt{\sigma\rho}\sqrt{\rho\sigma}}$ but $\sqrt{\sigma\rho}\neq\sqrt\sigma\sqrt\rho$
– glS
Feb 21, 2020 at 19:52

The proof from Jozsa, Richard (1994). Fidelity for the Mixed Quantum States. Journal of Modern Optics, 41(12), 2315–2323. doi:10.1080/09500349414552171

Let $$M = \sqrt \rho \sigma \sqrt\rho$$. It's a positive semidefinite 2x2 matrix, so its eigenvalues are $$\lambda_1, \lambda_2 \geq 0$$. Then we have

$$F(\rho,\sigma) = (tr\sqrt M) ^2= (\sqrt\lambda_1 + \sqrt\lambda_2)^2$$ $$= \lambda_1 + \lambda_2 + 2\sqrt{\lambda_1 \lambda_2} = tr(M) + 2\sqrt{\det M}$$ $$= tr(\rho\sigma) + 2\sqrt{\det{\rho}\det{\sigma}}$$ where the last step uses cyclicity of trace and multiplication of determinants.