# What is fidelity in quantum computing?

As I studied quantum computing, I saw term 'Fidelity' in many papers that related to quantum algorithm. So, I really wonder about following two things.

What is the real meaning of 'Fidelity' (As I searched, it is reliablity of thing)?

• Here you can find a very good explanation. Commented Aug 9, 2022 at 7:36

Fidelity can refer to any measure of similarity between two things. This can include quantum states (statevectors or density matrices), quantum gate operations (unitary matrices), or more general quantum channels. In all cases, it is a number between 0 (as different as possible) to 1 (the same object).

The infidelity between two objects is defined as $$I=1-F$$, where $$F$$ is the fidelity.

## State fidelity

As user1271772 wrote, you can define the state fidelity between two general quantum states (density matrices) $$\rho$$ and $$\sigma$$ as

$$F = \Big|\text{tr}\big(\sqrt{\sqrt{\rho}\sigma \sqrt{\rho}}\big)\Big|^2,$$

which simplifies to

$$F_{pure} = \big|\langle \psi_{\rho} | \psi_{\sigma} \rangle \big|^2$$

for pure (statevector) states (wikipedia).

## Unitary gate fidelity

In a unitary, pure-state world, we can define the gate fidelity between two $$d \times d$$ unitaries $$U$$ and $$V$$ simply as

$$F = \frac{1}{d^2} \Big|\text{tr}( U^\dagger V )\Big|^2.$$

This fidelity is often used to measure the quality of a quantum logic gate, and is used in e.g. quantum optimal control as part of the objective function. You can think of the gate fidelity as a sort of average of the state fidelities over the output states of $$U$$ and $$V$$ acting on the standard basis, although it also takes into account the phases of these output states to make sure they are consistent with each other.

This fidelity can be used to compute the reliability of a quantum operation by measuring the actual applied operation and calculating its fidelity with the ideal operation.

## General quantum operation fidelity

In general, calculating the fidelity of a quantum operation is more complicated. As discussed in Magesan et al. 2012, for two operations $$\eta$$ and $$\xi$$ and a given input state $$\rho$$, we can calculate the state fidelity of $$\eta(\rho)$$ and $$\xi(\rho)$$ as defined above: $$F = \Big|\text{tr}\big(\sqrt{\sqrt{\eta(\rho)}\xi(\rho) \sqrt{\eta(\rho)}}\big)\Big|^2.$$

Averaging this value over all possible $$\rho$$ is a bit more complicated; Magesan et al. 2012 derive this averaged fidelity to be $$\bar F = \frac{\text{tr}[\chi_0\chi]d+1}{d+1},$$ where $$\chi$$ is the Choi representation of the channel $$\Lambda = \eta^\dagger \circ \xi$$ (this channel represents how much $$\xi$$ deviates from $$\eta$$) and $$\chi_0$$ represents the identity channel.

"What is the real meaning of 'Fidelity' (As I searched, it is reliablity of thing)?"

Since "fidelity" means "reliability of a thing" in everyday (not necessarily quantum) English, you have to search "fidelity quantum" to get the answer you are seeking.

Repeating what you'll find in the second paragraph of that article, a quantum state $$\rho$$ has the following fidelity with respect to another quantum state $$\sigma$$:

$$F = \left(\textrm{tr}\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}}\right)^2.\tag{1}$$