Skip to main content
IBM Quantum Platform

Fidelity

In this part of the lesson, we'll discuss the fidelity between quantum states, which is a measure of their similarity — or how much they "overlap."

Given two quantum state vectors, the fidelity between the pure states associated with these quantum state vectors equals the absolute value of the inner product between the quantum state vectors. This provides a basic way to measure their similarity: the result is a value between 00 and 1,1, with larger values indicating greater similarity. In particular, the value is zero for orthogonal states (by definition), while the value is 11 for states equivalent up to a global phase.

Intuitively speaking, the fidelity can be seen as an extension of this basic measure of similarity, from quantum state vectors to density matrices.


Definition of fidelity

It's fitting to begin with a definition of fidelity. At first glance, the definition that follows might look unusual or mysterious, and perhaps not easy to work with. The function it defines, however, turns out to have many interesting properties and multiple alternative formulations, making it much nicer to work with than it may initially appear.

Definition. Let ρ\rho and σ\sigma be density matrices representing quantum states of the same system. The fidelity between ρ\rho and σ\sigma is defined as

F(ρ,σ)=Trρσρ.\operatorname{F}(\rho,\sigma) = \operatorname{Tr}\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}}.

Remark. Although this is a common definition, it is also common that the fidelity is defined as the square of the quantity defined here, which is then referred to as the root-fidelity. Neither definition is right or wrong — it's essentially a matter of preference. Nevertheless, one must always be careful to understand or clarify which definition is being used.

To make sense of the formula in the definition, notice first that ρσρ\sqrt{\rho} \sigma \sqrt{\rho} is a positive semidefinite matrix:

ρσρ=MM\sqrt{\rho} \sigma \sqrt{\rho} = M^{\dagger} M

for M=σρ.M = \sqrt{\sigma}\sqrt{\rho}. Like all positive semidefinite matrices, this positive semidefinite matrix has a unique positive semidefinite square root, the trace of which is the fidelity.

For every square matrix M,M, the eigenvalues of the two positive semidefinite matrices MMM^{\dagger} M and MMM M^{\dagger} are always the same, and hence the same is true for the square roots of these matrices. Choosing M=σρM = \sqrt{\sigma}\sqrt{\rho} and using the fact that the trace of a square matrix is the sum of its eigenvalues, we find that

F(ρ,σ)=Trρσρ=TrMM=TrMM=Trσρσ=F(σ,ρ).\begin{aligned} \operatorname{F}(\rho,\sigma) & = \operatorname{Tr}\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}}\\ & = \operatorname{Tr}\sqrt{M^{\dagger} M} = \operatorname{Tr}\sqrt{M M^{\dagger}}\\ & = \operatorname{Tr}\sqrt{\sqrt{\sigma} \rho \sqrt{\sigma}}\\ & = \operatorname{F}(\sigma,\rho). \end{aligned}

So, although it is not immediate from the definition, the fidelity is symmetric in its two arguments.

Fidelity in terms of the trace norm

An equivalent way to express the fidelity is by this formula:

F(ρ,σ)=σρ1.\operatorname{F}(\rho,\sigma) = \bigl\|\sqrt{\sigma}\sqrt{\rho}\bigr\|_1.

Here we see the trace norm, which we encountered in the previous lesson in the context of state discrimination. The trace norm of a (not necessarily square) matrix MM can be defined as

M1=TrMM,\| M \|_1 = \operatorname{Tr}\sqrt{M^{\dagger} M},

and by applying this definition to the matrix σρ\sqrt{\sigma}\sqrt{\rho} we obtain the formula in the definition.

An alternative way to express the trace norm of a (square) matrix MM is through this formula.

M1=maxUunitaryTr(MU).\| M \|_1 = \max_{U\:\text{unitary}} \bigl\vert \operatorname{Tr}(M U) \bigr\vert.

Here the maximum is over all unitary matrices UU having the same number of rows and columns as M.M. Applying this formula in the situation at hand reveals another expression of the fidelity.

F(ρ,σ)=maxUunitaryTr(σρU)\operatorname{F}(\rho,\sigma) = \max_{U\:\text{unitary}} \bigl\vert\operatorname{Tr}\bigl( \sqrt{\sigma}\sqrt{\rho}\, U\bigr) \bigr\vert

Fidelity for pure states

One last point on the definition of fidelity is that every pure state is (as a density matrix) equal to its own square root, which allows the formula for the fidelity to be simplified considerably when one or both of the states is pure. In particular, if one of the two states is pure we have the following formula.

F(ϕϕ,σ)=ϕσϕ\operatorname{F}\bigl( \vert\phi\rangle\langle\phi\vert, \sigma \bigr) = \sqrt{\langle \phi\vert \sigma \vert \phi \rangle}

If both states are pure, the formula simplifies to the absolute value of the inner product of the corresponding quantum state vectors, as was mentioned at the start of the section.

F(ϕϕ,ψψ)=ϕψ\operatorname{F}\bigl( \vert\phi\rangle\langle\phi\vert, \vert\psi\rangle\langle\psi\vert \bigr) = \bigl\vert \langle \phi\vert \psi \rangle \bigr\vert

Basic properties of fidelity

The fidelity has many remarkable properties and several alternative formulations. Here are just a few basic properties listed without proofs.

  1. For any two density matrices ρ\rho and σ\sigma having the same size, the fidelity F(ρ,σ)\operatorname{F}(\rho,\sigma) lies between zero and one: 0F(ρ,σ)1.0\leq \operatorname{F}(\rho,\sigma) \leq 1. It is the case that F(ρ,σ)=0\operatorname{F}(\rho,\sigma)=0 if and only if ρ\rho and σ\sigma have orthogonal images (so they can be discriminated without error), and F(ρ,σ)=1\operatorname{F}(\rho,\sigma)=1 if and only if ρ=σ.\rho = \sigma.
  2. The fidelity is multiplicative, meaning that the fidelity between two product states is equal to the product of the individual fidelities: F(ρ1ρm,σ1σm)=F(ρ1,σ1)F(ρm,σm).\operatorname{F}(\rho_1\otimes\cdots\otimes\rho_m,\sigma_1\otimes\cdots\otimes\sigma_m) = \operatorname{F}(\rho_1,\sigma_1)\cdots \operatorname{F}(\rho_m,\sigma_m).
  3. The fidelity between states is nondecreasing under the action of any channel. That is, if ρ\rho and σ\sigma are density matrices and Φ\Phi is a channel that can take these two states as input, then it is necessarily the case that F(ρ,σ)F(Φ(ρ),Φ(σ)).\operatorname{F}(\rho,\sigma) \leq \operatorname{F}(\Phi(\rho),\Phi(\sigma)).
  4. The Fuchs-van de Graaf inequalities establish a close (though not exact) relationship between fidelity and trace distance: for any two states ρ\rho and σ\sigma we have 112ρσ1F(ρ,σ)114ρσ12.1 - \frac{1}{2}\|\rho - \sigma\|_1 \leq \operatorname{F}(\rho,\sigma) \leq \sqrt{1 - \frac{1}{4}\|\rho - \sigma\|_1^2}.

The final property can be expressed in the form of a figure:

A plot relating trace distance and fidelity

Specifically, for any choice of states ρ\rho and σ\sigma of the same system, the horizontal line that crosses the yy-axis at F(ρ,σ)\operatorname{F}(\rho,\sigma) and the vertical line that crosses the xx-axis at 12ρσ1\frac{1}{2}\|\rho-\sigma\|_1 must intersect within the gray region bordered below by the line y=1xy = 1-x and above by the unit circle. The most interesting region of this figure from a practical viewpoint is the upper left-hand corner of the gray region: if the fidelity between two states is close to one, then their trace distance is close to zero, and vice versa.


Gentle measurement lemma

Next we'll take a look at a simple but important fact, known as the gentle measurement lemma, which connects fidelity to non-destructive measurements. It's a very useful lemma that comes up from time to time, and it's also noteworthy because the seemingly clunky definition for the fidelity actually makes the lemma very easy to prove.

The set-up is as follows. Let X\mathsf{X} be a system in a state ρ\rho and let {P0,,Pm1}\{P_0,\ldots,P_{m-1}\} be a collection of positive semidefinite matrices representing a general measurement of X.\mathsf{X}. Suppose further that if this measurement is performed on the system X\mathsf{X} while it's in the state ρ,\rho, one of the outcomes is highly likely. To be concrete, let's assume that the likely measurement outcome is 0,0, and specifically let's assume that

Tr(P0ρ)>1ε\operatorname{Tr}(P_0 \rho) > 1 - \varepsilon

for a small positive real number ε>0.\varepsilon > 0.

What the gentle measurement lemma states is that, under these assumptions, the non-destructive measurement obtained from {P0,,Pm1}\{P_0,\ldots,P_{m-1}\} through Naimark's theorem causes only a small disturbance to ρ\rho in case the likely measurement outcome 00 is observed.

More specifically, the lemma states that the fidelity-squared between ρ\rho and the state we obtain from the non-destructive measurement, conditioned on the outcome being 0,0, is greater than 1ε.1-\varepsilon.

F(ρ,P0ρP0Tr(P0ρ))2>1ε.\operatorname{F}\Biggl(\rho,\frac{\sqrt{P_0}\rho\sqrt{P_0}}{\operatorname{Tr}(P_0\rho)}\Biggr)^2 > 1-\varepsilon.

We'll need a basic fact about measurements to prove this. The measurement matrices P0,,Pm1P_0, \ldots, P_{m-1} are positive semidefinite and sum to the identity, which allows us to conclude that all of the eigenvalues of P0P_0 are real numbers between 00 and 1.1. This follows from the fact that, for any unit vector ψ,\vert\psi\rangle, the value ψPaψ\langle \psi \vert P_a \vert \psi \rangle is a nonnegative real number for each a{0,,m1}a\in\{0,\ldots,m-1\} (because each PaP_a is positive semidefinite), together with these numbers summing to one.

a=0m1ψPaψ=ψ(a=0m1Pa)ψ=ψIψ=1.\sum_{a = 0}^{m-1} \langle \psi \vert P_a \vert \psi \rangle = \langle \psi \vert \Biggl(\sum_{a = 0}^{m-1} P_a \Biggr) \vert \psi \rangle = \langle \psi \vert \mathbb{I} \vert \psi \rangle = 1.

Hence ψP0ψ\langle \psi \vert P_0 \vert \psi \rangle is always a real number between 00 and 1,1, and this implies that every eigenvalue of P0P_0 is a real number between 00 and 11 because we can choose ψ\vert\psi\rangle specifically to be a unit eigenvector corresponding to whichever eigenvalue is of interest.

From this observation we can conclude the following inequality for every density matrix ρ.\rho.

Tr(P0ρ)Tr(P0ρ)\operatorname{Tr}\bigl( \sqrt{P_0} \rho\bigr) \geq \operatorname{Tr}\bigl( P_0 \rho\bigr)

In greater detail, starting from a spectral decomposition

P0=k=0n1λkψkψkP_0 = \sum_{k=0}^{n-1} \lambda_k \vert\psi_k\rangle\langle\psi_k\vert

we conclude that

Tr(P0ρ)=k=0n1λkψkρψkk=0n1λkψkρψk=Tr(P0ρ)\operatorname{Tr}\bigl( \sqrt{P_0} \rho\bigr) = \sum_{k = 0}^{n-1} \sqrt{\lambda_k} \langle \psi_k \vert \rho \vert \psi_k \rangle \geq \sum_{k = 0}^{n-1} \lambda_k \langle \psi_k \vert \rho \vert \psi_k \rangle = \operatorname{Tr}\bigl( P_0 \rho\bigr)

from the fact that ψkρψk\langle \psi_k \vert \rho \vert \psi_k \rangle is a nonnegative real number and λkλk\sqrt{\lambda_k} \geq \lambda_k for each k=0,,n1.k = 0,\ldots,n-1. (Squaring numbers between 00 and 11 can never make them larger.)

Now we can prove the gentle measurement lemma by evaluating the fidelity and then using our inequality. First, let's simplify the expression we're interested in.

F(ρ,P0ρP0Tr(P0ρ))=TrρP0ρP0ρTr(P0ρ)=Tr(ρP0ρTr(P0ρ))2=Tr(ρP0ρTr(P0ρ))=Tr(P0ρ)Tr(P0ρ)\begin{aligned} \operatorname{F}\Biggl(\rho,\frac{\sqrt{P_0}\rho\sqrt{P_0}}{\operatorname{Tr}(P_0\rho)}\Biggr) & = \operatorname{Tr}\sqrt{\frac{\sqrt{\rho}\sqrt{P_0}\rho\sqrt{P_0}\sqrt{\rho}}{ \operatorname{Tr}(P_0\rho)}}\\ & = \operatorname{Tr}\sqrt{\Biggl(\frac{\sqrt{\rho}\sqrt{P_0}\sqrt{\rho}}{ \sqrt{\operatorname{Tr}(P_0\rho)}}\Biggr)^2}\\ & = \operatorname{Tr}\Biggl(\frac{\sqrt{\rho}\sqrt{P_0}\sqrt{\rho}}{ \sqrt{\operatorname{Tr}(P_0\rho)}}\Biggr)\\ & = \frac{\operatorname{Tr}\bigl(\sqrt{P_0}\rho\bigr)}{\sqrt{\operatorname{Tr}(P_0\rho)}} \end{aligned}

Notice that these are all equalities — we've not used our inequality (or any other inequality) at this point, so we have an exact expression for the fidelity. We can now use our inequality to conclude

F(ρ,P0ρP0Tr(P0ρ))=Tr(P0ρ)Tr(P0ρ)Tr(P0ρ)Tr(P0ρ)=Tr(P0ρ)\operatorname{F}\Biggl(\rho,\frac{\sqrt{P_0}\rho\sqrt{P_0}}{\operatorname{Tr}(P_0\rho)}\Biggr) = \frac{\operatorname{Tr}\bigl(\sqrt{P_0}\rho\bigr)}{\sqrt{\operatorname{Tr}(P_0\rho)}} \geq \frac{\operatorname{Tr}\bigl(P_0\rho\bigr)}{\sqrt{\operatorname{Tr}(P_0\rho)}} = \sqrt{\operatorname{Tr}\bigl(P_0\rho\bigr)}

and therefore, by squaring both sides,

F(ρ,P0ρP0Tr(P0ρ))2Tr(P0ρ)>1ε.\operatorname{F}\Biggl(\rho,\frac{\sqrt{P_0}\rho\sqrt{P_0}}{\operatorname{Tr}(P_0\rho)}\Biggr)^2 \geq \operatorname{Tr}\bigl(P_0\rho\bigr) > 1-\varepsilon.

Uhlmann's theorem

To conclude the lesson, we'll take a look at Uhlmann's theorem, which is a fundamental fact about the fidelity that connects it with the notion of a purification. What the theorem says, in simple terms, is that the fidelity between any two quantum states is equal to the maximum inner product (in absolute value) between two purifications of those states.

Theorem (Uhlmann's theorem). Let ρ\rho and σ\sigma be density matrices representing states of a system X,\mathsf{X}, and let Y\mathsf{Y} be a system having at least as many classical states as X.\mathsf{X}. The fidelity between ρ\rho and σ\sigma is given by

F(ρ,σ)=max{ϕψ:TrY(ϕϕ)=ρ,  TrY(ψψ)=σ}, \operatorname{F}(\rho,\sigma) = \max\bigl\{ \vert \langle \phi \vert \psi \rangle \vert \,:\, \operatorname{Tr}_{\mathsf{Y}}\bigl(\vert\phi\rangle\langle\phi\vert\bigr) = \rho,\; \operatorname{Tr}_{\mathsf{Y}}\bigl(\vert\psi\rangle\langle\psi\vert\bigr) = \sigma\bigr\},

where the maximum is taken over all quantum state vectors ϕ\vert\phi\rangle and ψ\vert\psi\rangle of (X,Y).(\mathsf{X},\mathsf{Y}).

We can prove this theorem using the unitary equivalence of purifications — but it isn't completely straightforward and we'll make use of a trick along the way.

To begin, consider spectral decompositions of the two density matrices ρ\rho and σ.\sigma.

ρ=a=0n1pauauaσ=b=0n1qbvbvb\begin{aligned} \rho & = \sum_{a = 0}^{n-1} p_a \vert u_a\rangle\langle u_a\vert \\[2mm] \sigma & = \sum_{b = 0}^{n-1} q_b \vert v_b\rangle\langle v_b\vert \end{aligned}

The two collections {u0,,un1}\{\vert u_0 \rangle,\ldots,\vert u_{n-1}\rangle\} and {v0,,vn1}\{\vert v_0 \rangle,\ldots,\vert v_{n-1}\rangle\} are orthonormal bases of eigenvectors of ρ\rho and σ,\sigma, respectively, and p0,,pn1p_0,\ldots,p_{n-1} and q0,,qn1q_0,\ldots,q_{n-1} are the corresponding eigenvalues.

We'll also define u0,,un1\vert \overline{u_0} \rangle,\ldots,\vert \overline{u_{n-1}}\rangle and v0,,vn1\vert \overline{v_0} \rangle,\ldots,\vert \overline{v_{n-1}}\rangle to be the vectors obtained by taking the complex conjugate of each entry of u0,,un1\vert u_0 \rangle,\ldots,\vert u_{n-1}\rangle and v0,,vn1.\vert v_0 \rangle,\ldots,\vert v_{n-1}\rangle. That is, for an arbitrary vector w\vert w\rangle we can define w\vert\overline{w}\rangle according to the following equation for each c{0,,n1}.c\in\{0,\ldots,n-1\}.

cw=cw\langle c \vert \overline{w}\rangle = \overline{\langle c \vert w\rangle}

Notice that for any two vectors u\vert u\rangle and v\vert v\rangle we have uv=vu.\langle \overline{u} \vert \overline{v}\rangle = \langle v\vert u\rangle. More generally, for any square matrix MM we have the following formula.

uMv=vMTu\langle \overline{u} \vert M \vert \overline{v}\rangle = \langle v\vert M^T \vert u\rangle

It follows that u\vert u\rangle and v\vert v\rangle are orthogonal if and only if u\vert \overline{u}\rangle and v\vert \overline{v}\rangle are orthogonal, and therefore {u0,,un1}\{\vert \overline{u_0} \rangle,\ldots,\vert \overline{u_{n-1}}\rangle\} and {v0,,vn1}\{\vert \overline{v_0} \rangle,\ldots,\vert \overline{v_{n-1}}\rangle\} are both orthonormal bases.

Now consider the following two vectors ϕ\vert\phi\rangle and ψ,\vert\psi\rangle, which are purifications of ρ\rho and σ,\sigma, respectively.

ϕ=a=0n1pauauaψ=b=0n1qbvbvb\begin{aligned} \vert\phi\rangle & = \sum_{a = 0}^{n-1} \sqrt{p_a}\, \vert u_a\rangle \otimes \vert \overline{u_a}\rangle \\[2mm] \vert\psi\rangle & = \sum_{b = 0}^{n-1} \sqrt{q_b}\, \vert v_b\rangle \otimes \vert \overline{v_b}\rangle \end{aligned}

This is the trick referred to previously. Nothing indicates explicitly at this point that it's a good idea to make these particular choices for purifications of ρ\rho and σ,\sigma, but they are valid purifications, and the complex conjugations will allow the algebra to work out the way we need.

By the unitary equivalence of purifications, we know that every purification of ρ\rho for the pair of systems (X,Y)(\mathsf{X},\mathsf{Y}) must take the form (IXU)ϕ(\mathbb{I}_{\mathsf{X}}\otimes U)\vert\phi\rangle for some unitary matrix U,U, and likewise every purification of σ\sigma for the pair (X,Y)(\mathsf{X},\mathsf{Y}) must take the form (IXV)ψ(\mathbb{I}_{\mathsf{X}}\otimes V)\vert\psi\rangle for some unitary matrix V.V. The inner product of two such purifications can be simplified as follows.

ϕ(IU)(IV)ψ=a,b=0n1paqbuavbuaUVvb=a,b=0n1paqbuavbvb(UV)Tua=Tr(a,b=0n1paqbuauavbvb(UV)T)=Tr(ρσ(UV)T)\begin{aligned} \langle \phi \vert (\mathbb{I}\otimes U^{\dagger}) (\mathbb{I}\otimes V) \vert \psi \rangle \hspace{-2.5cm}\\ & = \sum_{a,b = 0}^{n-1} \sqrt{p_a} \sqrt{q_b}\, \langle u_a \vert v_b \rangle \langle \overline{u_a} \vert U^{\dagger} V \vert \overline{v_b} \rangle \\ & = \sum_{a,b = 0}^{n-1} \sqrt{p_a} \sqrt{q_b}\, \langle u_a \vert v_b \rangle \langle v_b \vert (U^{\dagger} V)^T \vert u_a \rangle \\ & = \operatorname{Tr}\Biggl( \sum_{a,b = 0}^{n-1} \sqrt{p_a} \sqrt{q_b}\, \vert u_a \rangle\langle u_a \vert v_b \rangle \langle v_b \vert (U^{\dagger} V)^T\Biggr)\\ & = \operatorname{Tr}\Bigl( \sqrt{\rho}\sqrt{\sigma}\, (U^{\dagger} V)^T\Bigr) \end{aligned}

As UU and VV range over all possible unitary matrices, the matrix (UV)T(U^{\dagger} V)^T also ranges over all possible unitary matrices. Thus, maximizing the absolute value of the inner product of two purifications of ρ\rho and σ\sigma yields the following equation.

maxU,VunitaryTr(ρσ(UV)T)=maxWunitaryTr(ρσW)=ρσ1=F(ρ,σ)\begin{aligned} \max_{U,V\:\text{unitary}} \biggl\vert \operatorname{Tr}\Bigl( \sqrt{\rho}\sqrt{\sigma}\, (U^{\dagger} V)^T\Bigr)\biggr\vert & = \max_{W\:\text{unitary}} \biggl\vert \operatorname{Tr}\Bigl( \sqrt{\rho}\sqrt{\sigma}\, W\Bigr)\biggr\vert\\[2mm] & = \bigl\| \sqrt{\rho}\sqrt{\sigma} \bigr\|_1\\[2mm] & = \operatorname{F}(\rho,\sigma) \end{aligned}

Post-course survey

Congratulations on completing this course! Please take a moment to help us improve our course by filling out the following quick survey. Your feedback will be used to enhance our content offering and user experience. Thank you!"

Was this page helpful?
Report a bug or request content on GitHub.