# Fidelity of quantum states

In quantum mechanics, notably in quantum information theory, fidelity is a measure of the "closeness" of two quantum states. It expresses the probability that one state will pass a test to identify as the other. The fidelity is not a metric on the space of density matrices, but it can be used to define the Bures metric on this space.

Given two density operators $\rho$ and $\sigma$ , the fidelity is generally defined as the quantity $F(\rho ,\sigma )=\left[\operatorname {tr} {\sqrt {{\sqrt {\rho }}\sigma {\sqrt {\rho }}}}\right]^{2}$ . In the special case where $\rho$ and $\sigma$ represent pure quantum states, namely, $\rho =|\psi _{\rho }\rangle \!\langle \psi _{\rho }|$ and $\sigma =|\psi _{\sigma }\rangle \!\langle \psi _{\sigma }|$ , the definition reduces to the squared overlap between the states: $F(\rho ,\sigma )=|\langle \psi _{\rho }|\psi _{\sigma }\rangle |^{2}$ . While not obvious from the general definition, the fidelity is symmetric: $F(\rho ,\sigma )=F(\sigma ,\rho )$ .

## Motivation

Given two random variables $X,Y$  with values $(1,...,n)$  (categorical random variables) and probabilities $p=(p_{1},p_{2},\ldots ,p_{n})$  and $q=(q_{1},q_{2},\ldots ,q_{n})$ , the fidelity of $X$  and $Y$  is defined to be the quantity

$F(X,Y)=\left(\sum _{i}{\sqrt {p_{i}q_{i}}}\right)^{2}$ .

The fidelity deals with the marginal distribution of the random variables. It says nothing about the joint distribution of those variables. In other words, the fidelity F(X,Y) is the square of the inner product of $({\sqrt {p_{1}}},\ldots ,{\sqrt {p_{n}}})$  and $({\sqrt {q_{1}}},\ldots ,{\sqrt {q_{n}}})$  viewed as vectors in Euclidean space. Notice that F(X,Y) = 1 if and only if p = q. In general, $0\leq F(X,Y)\leq 1$ . The measure $\sum _{i}{\sqrt {p_{i}q_{i}}}$  is known as the Bhattacharyya coefficient.

Given a classical measure of the distinguishability of two probability distributions, one can motivate a measure of distinguishability of two quantum states as follows. If an experimenter is attempting to determine whether a quantum state is either of two possibilities $\rho$  or $\sigma$ , the most general possible measurement they can make on the state is a POVM, which is described by a set of Hermitian positive semidefinite operators $\{F_{i}\}$ . If the state given to the experimenter is $\rho$ , they will witness outcome $i$  with probability $p_{i}=\operatorname {tr} (\rho F_{i})$ , and likewise with probability $q_{i}=\operatorname {tr} (\sigma F_{i})$  for $\sigma$ . Their ability to distinguish between the quantum states $\rho$  and $\sigma$  is then equivalent to their ability to distinguish between the classical probability distributions $p$  and $q$ . Naturally, the experimenter will choose the best POVM he can find, so this motivates defining the quantum fidelity as the squared Bhattacharyya coefficient when extremized over all possible POVMs $\{F_{i}\}$ :

$F(\rho ,\sigma )=\min _{\{F_{i}\}}F(X,Y)=\min _{\{F_{i}\}}\left(\sum _{i}{\sqrt {\operatorname {tr} (\rho F_{i})\operatorname {tr} (\sigma F_{i})}}\right)^{2}.$

It was shown by Fuchs and Caves that this manifestly symmetric definition is equivalent to the simple asymmetric formula given in the next section.

## Definition

Given two density matrices ρ and σ, the fidelity is defined by 

$F(\rho ,\sigma )=\left(\operatorname {tr} {\sqrt {{\sqrt {\rho }}\sigma {\sqrt {\rho }}}}\right)^{2},$

where, for a positive semidefinite matrix $M$ , ${\sqrt {M}}$  denotes its unique positive square root, as given by the spectral theorem. The Euclidean inner product from the classical definition is replaced by the Hilbert–Schmidt inner product.

Some of the important properties of the quantum state fidelity are:

• Symmetry. $F(\rho ,\sigma )=F(\sigma ,\rho )$ .
• Bounded values. For any $\rho$  and $\sigma$ , $0\leq F(\rho ,\sigma )\leq 1$ , and $F(\rho ,\rho )=1$ .
• Consistency with fidelity between probability distributions. If $\rho$  and $\sigma$  commute, the definition simplifies to
$F(\rho ,\sigma )=\left[\operatorname {tr} {\sqrt {\rho \sigma }}\right]^{2}=\left(\sum _{k}{\sqrt {p_{k}q_{k}}}\right)^{2}=F({\boldsymbol {p}},{\boldsymbol {q}}),$

where $p_{k},q_{k}$  are the eigenvalues of $\rho ,\sigma$ , respectively. To see this, remember that if $[\rho ,\sigma ]=0$  then they can be diagonalized in the same basis:
$\rho =\sum _{i}p_{i}|i\rangle \langle i|{\text{ and }}\sigma =\sum _{i}q_{i}|i\rangle \langle i|,$

so that $\operatorname {tr} {\sqrt {\rho \sigma }}=\operatorname {tr} \left(\sum _{k}{\sqrt {p_{k}q_{k}}}|i\rangle \!\langle i|\right)=\sum _{k}{\sqrt {p_{k}q_{k}}}.$
• Simplified expressions for pure states. If $\rho$  is pure, $\rho =|\psi _{\rho }\rangle \!\langle \psi _{\rho }|$ , then $F(\rho ,\sigma )=\langle \psi _{\rho }|\sigma |\psi _{\rho }\rangle$ . This follows from
$F(\rho ,\sigma )=\left(\operatorname {tr} {\sqrt {|\psi _{\rho }\rangle \langle \psi _{\rho }|\sigma |\psi _{\rho }\rangle \langle \psi _{\rho }|}}\right)^{2}=\langle \psi _{\rho }|\sigma |\psi _{\rho }\rangle \left(\operatorname {tr} {\sqrt {|\psi _{\rho }\rangle \langle \psi _{\rho }|}}\right)^{2}=\langle \psi _{\rho }|\sigma |\psi _{\rho }\rangle .$

If both $\rho$  and $\sigma$  are pure, $\rho =|\psi _{\rho }\rangle \!\langle \psi _{\rho }|$  and $\sigma =|\psi _{\sigma }\rangle \!\langle \psi _{\sigma }|$ , then $F(\rho ,\sigma )=|\langle \psi _{\rho }|\psi _{\sigma }\rangle |^{2}$ . This follows immediately from the above expression for $\rho$  pure.
• Equivalent expression.

An equivalent expression for the fidelity may be written, using the trace norm

$F(\rho ,\sigma )=\lVert {\sqrt {\rho }}{\sqrt {\sigma }}\rVert _{\operatorname {tr} }^{2}={\Big (}\operatorname {tr} |{\sqrt {\rho }}{\sqrt {\sigma }}|{\Big )}^{2},$

where the absolute value of an operator is here defined as $|A|\equiv {\sqrt {A^{\dagger }A}}$ .

• 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 {\det(\rho )\det(\sigma )}}.$

Qubit state means that $\rho$  and $\sigma$  are represented by two-dimensional matrices. This result follows noticing that $M={\sqrt {\rho }}\sigma {\sqrt {\rho }}$  is a positive semidefinite operator, hence $\operatorname {tr} {\sqrt {M}}={\sqrt {\lambda _{1}}}+{\sqrt {\lambda _{2}}}$ , where $\lambda _{1}$  and $\lambda _{2}$  are the (nonnegative) eigenvalues of $M$ . If $\rho$  (or $\sigma$ ) is pure, this result is simplified further to $F(\rho ,\sigma )=\operatorname {tr} (\rho \sigma )$  since $\mathrm {Det} (\rho )=0$  for pure states.

### Alternative definition

Some authors use an alternative definition $F':={\sqrt {F}}$  and call this quantity fidelity. The definition of $F$  however is more common. To avoid confusion, $F'$  could be called "square root fidelity". In any case it is advisable to clarify the adopted definition whenever the fidelity is employed.

## Other properties

### Unitary invariance

Direct calculation shows that the fidelity is preserved by unitary evolution, i.e.

$\;F(\rho ,\sigma )=F(U\rho \;U^{*},U\sigma U^{*})$

for any unitary operator $U$ .

### Uhlmann's theorem

We saw that for two pure states, their fidelity coincides with the overlap. Uhlmann's theorem generalizes this statement to mixed states, in terms of their purifications:

Theorem Let ρ and σ be density matrices acting on Cn. Let ρ12 be the unique positive square root of ρ and

$|\psi _{\rho }\rangle =\sum _{i=1}^{n}(\rho ^{{1}/{2}}|e_{i}\rangle )\otimes |e_{i}\rangle \in \mathbb {C} ^{n}\otimes \mathbb {C} ^{n}$

be a purification of ρ (therefore $\textstyle \{|e_{i}\rangle \}$  is an orthonormal basis), then the following equality holds:

$F(\rho ,\sigma )=\max _{|\psi _{\sigma }\rangle }|\langle \psi _{\rho }|\psi _{\sigma }\rangle |^{2}$

where $|\psi _{\sigma }\rangle$  is a purification of σ. Therefore, in general, the fidelity is the maximum overlap between purifications.

#### Sketch of proof

A simple proof can be sketched as follows. Let $\textstyle |\Omega \rangle$  denote the vector

$|\Omega \rangle =\sum _{i=1}^{n}|e_{i}\rangle \otimes |e_{i}\rangle$

and σ12 be the unique positive square root of σ. We see that, due to the unitary freedom in square root factorizations and choosing orthonormal bases, an arbitrary purification of σ is of the form

$|\psi _{\sigma }\rangle =(\sigma ^{{1}/{2}}V_{1}\otimes V_{2})|\Omega \rangle$

where Vi's are unitary operators. Now we directly calculate

$|\langle \psi _{\rho }|\psi _{\sigma }\rangle |^{2}=|\langle \Omega |(\rho ^{{1}/{2}}\otimes I)(\sigma ^{{1}/{2}}V_{1}\otimes V_{2})|\Omega \rangle |^{2}=|\operatorname {tr} (\rho ^{{1}/{2}}\sigma ^{{1}/{2}}V_{1}V_{2}^{T})|^{2}.$

But in general, for any square matrix A and unitary U, it is true that |tr(AU)| ≤ tr((A*A)12). Furthermore, equality is achieved if U* is the unitary operator in the polar decomposition of A. From this follows directly Uhlmann's theorem.

#### Proof with explicit decompositions

We will here provide an alternative, explicit way to prove Uhlmann's theorem.

Let $|\psi _{\rho }\rangle$  and $|\psi _{\sigma }\rangle$  be purifications of $\rho$  and $\sigma$ , respectively. To start, let us show that $|\langle \psi _{\rho }|\psi _{\sigma }\rangle |\leq \operatorname {tr} |{\sqrt {\rho }}{\sqrt {\sigma }}|$ .

The general form of the purifications of the states is:

{\begin{aligned}|\psi _{\rho }\rangle &=\sum _{k}{\sqrt {\lambda _{k}}}|\lambda _{k}\rangle \otimes |u_{k}\rangle ,\\|\psi _{\sigma }\rangle &=\sum _{k}{\sqrt {\mu _{k}}}|\mu _{k}\rangle \otimes |v_{k}\rangle ,\end{aligned}}

were $|\lambda _{k}\rangle ,|\mu _{k}\rangle$  are the eigenvectors of $\rho ,\ \sigma$ , and $\{u_{k}\}_{k},\{v_{k}\}_{k}$  are arbitrary orthonormal bases. The overlap between the purifications is
$\langle \psi _{\rho }|\psi _{\sigma }\rangle =\sum _{jk}{\sqrt {\lambda _{j}\mu _{k}}}\langle \lambda _{j}|\mu _{k}\rangle \,\langle u_{j}|v_{k}\rangle =\operatorname {tr} \left({\sqrt {\rho }}{\sqrt {\sigma }}U\right),$

where the unitary matrix $U$  is defined as
$U=\left(\sum _{k}|\mu _{k}\rangle \!\langle u_{k}|\right)\,\left(\sum _{j}|v_{j}\rangle \!\langle \lambda _{j}|\right).$

The conclusion is now reached via using the inequality $|\operatorname {tr} (AU)|\leq \operatorname {tr} ({\sqrt {A^{\dagger }A}})\equiv \operatorname {tr} |A|$ :
$|\langle \psi _{\rho }|\psi _{\sigma }\rangle |=|\operatorname {tr} ({\sqrt {\rho }}{\sqrt {\sigma }}U)|\leq \operatorname {tr} |{\sqrt {\rho }}{\sqrt {\sigma }}|.$

Note that this inequality is the triangle inequality applied to the singular values of the matrix. Indeed, for a generic matrix $A\equiv \sum _{j}s_{j}(A)|a_{j}\rangle \!\langle b_{j}|$ and unitary $U=\sum _{j}|b_{j}\rangle \!\langle w_{j}|$ , we have
{\begin{aligned}|\operatorname {tr} (AU)|&=\left|\operatorname {tr} \left(\sum _{j}s_{j}(A)|a_{j}\rangle \!\langle b_{j}|\,\,\sum _{k}|b_{k}\rangle \!\langle w_{k}|\right)\right|\\&=\left|\sum _{j}s_{j}(A)\langle w_{j}|a_{j}\rangle \right|\\&\leq \sum _{j}s_{j}(A)\,|\langle w_{j}|a_{j}\rangle |\\&\leq \sum _{j}s_{j}(A)\\&=\operatorname {tr} |A|,\end{aligned}}

where $s_{j}(A)\geq 0$  are the (always real and non-negative) singular values of $A$ , as in the singular value decomposition. The inequality is saturated and becomes an equality when $\langle w_{j}|a_{j}\rangle =1$ , that is, when $U=\sum _{k}|b_{k}\rangle \!\langle a_{k}|,$  and thus $AU={\sqrt {AA^{\dagger }}}\equiv |A|$ . The above shows that $|\langle \psi _{\rho }|\psi _{\sigma }\rangle |=\operatorname {tr} |{\sqrt {\rho }}{\sqrt {\sigma }}|$  when the purifications $|\psi _{\rho }\rangle$  and $|\psi _{\sigma }\rangle$  are such that ${\sqrt {\rho }}{\sqrt {\sigma }}U=|{\sqrt {\rho }}{\sqrt {\sigma }}|$ . Because this choice is possible regardless of the states, we can finally conclude that
$\operatorname {tr} |{\sqrt {\rho }}{\sqrt {\sigma }}|=\max |\langle \psi _{\rho }|\psi _{\sigma }\rangle |.$

#### Consequences

Some immediate consequences of Uhlmann's theorem are

• Fidelity is symmetric in its arguments, i.e. F (ρ,σ) = F (σ,ρ). Note that this is not obvious from the original definition.
• F (ρ,σ) lies in [0,1], by the Cauchy–Schwarz inequality.
• F (ρ,σ) = 1 if and only if ρ = σ, since Ψρ = Ψσ implies ρ = σ.

So we can see that fidelity behaves almost like a metric. This can be formalized and made useful by defining

$\cos ^{2}\theta _{\rho \sigma }=F(\rho ,\sigma )\,$

As the angle between the states $\rho$  and $\sigma$ . It follows from the above properties that $\theta _{\rho \sigma }$  is non-negative, symmetric in its inputs, and is equal to zero if and only if $\rho =\sigma$ . Furthermore, it can be proved that it obeys the triangle inequality, so this angle is a metric on the state space: the Fubini–Study metric.

### Relationship with the fidelity between the corresponding probability distributions

Let $\{E_{k}\}_{k}$  be an arbitrary positive operator-valued measure (POVM); that is, a set of operators $E_{k}$  satisfying $\sum _{k}E_{k}=I$ , $E_{j}E_{k}=\delta _{jk}E_{j}$ , and $E_{k}^{2}=E_{k}$ . Then, for any pair of states $\rho$  and $\sigma$ , we have

${\sqrt {F(\rho ,\sigma )}}\leq \sum _{k}{\sqrt {\operatorname {tr} (E_{k}\rho )}}{\sqrt {\operatorname {tr} (E_{k}\sigma )}}\equiv \sum _{k}{\sqrt {p_{k}q_{k}}},$

where in the last step we denoted with $p_{k},q_{k}$  the probability distributions obtained by measuring $\rho ,\ \sigma$  with the POVM $\{E_{k}\}_{k}$ .

This shows that the square root of the fidelity between two quantum states is upper bounded by the Bhattacharyya coefficient between the corresponding probability distributions in any possible POVM. Indeed, it is more generally true that

$F(\rho ,\sigma )=\min _{\{E_{k}\}}F({\boldsymbol {p}},{\boldsymbol {q}}),$

where $F({\boldsymbol {p}},{\boldsymbol {q}})\equiv \left(\sum _{k}{\sqrt {p_{k}q_{k}}}\right)^{2}$ , and the minimum is taken over all possible POVMs.

#### Proof of inequality

As was previously shown, the square root of the fidelity can be written as ${\sqrt {F(\rho ,\sigma )}}=\operatorname {tr} |{\sqrt {\rho }}{\sqrt {\sigma }}|,$ which is equivalent to the existence of a unitary operator $U$  such that

${\sqrt {F(\rho ,\sigma )}}=\operatorname {tr} ({\sqrt {\rho }}{\sqrt {\sigma }}U).$

Remembering that $\sum _{k}E_{k}=I$  holds true for any POVM, we can then write
${\sqrt {F(\rho ,\sigma )}}=\operatorname {tr} ({\sqrt {\rho }}{\sqrt {\sigma }}U)=\sum _{k}\operatorname {tr} ({\sqrt {\rho }}E_{k}E_{k}{\sqrt {\sigma }}U)\leq \sum _{k}{\sqrt {\operatorname {tr} (E_{k}\rho )\operatorname {tr} (E_{k}\sigma )}},$

where in the last step we used Cauchy-Schwarz inequality as in $|\operatorname {tr} (A^{\dagger }B)|^{2}\leq \operatorname {tr} (A^{\dagger }A)\operatorname {tr} (B^{\dagger }B)$ .

### Behavior under quantum operations

The fidelity between two states can be shown to never decrease when a non-selective quantum operation ${\mathcal {E}}$  is applied to the states:

$F({\mathcal {E}}(\rho ),{\mathcal {E}}(\sigma ))\geq F(\rho ,\sigma ),$

for any trace-preserving completely positive map ${\mathcal {E}}$ .

### Relationship to trace distance

We can define the trace distance between two matrices A and B in terms of the trace norm by

$D(A,B)={\frac {1}{2}}\|A-B\|_{\rm {tr}}\,.$

When A and B are both density operators, this is a quantum generalization of the statistical distance. This is relevant because the trace distance provides upper and lower bounds on the fidelity as quantified by the Fuchs–van de Graaf inequalities,

$1-{\sqrt {F(\rho ,\sigma )}}\leq D(\rho ,\sigma )\leq {\sqrt {1-F(\rho ,\sigma )}}\,.$

Often the trace distance is easier to calculate or bound than the fidelity, so these relationships are quite useful. In the case that at least one of the states is a pure state Ψ, the lower bound can be tightened.

$1-F(\psi ,\rho )\leq D(\psi ,\rho )\,.$