# Demystifying Quantum Gate Fidelity for Electronics Engineers
## 2 Fidelity According to [PERSON]  
The concept of fidelity is rooted in the communication theory conceived by [PERSON] (1916-2001) in 1948 at Bell Laboratories (1936). [PERSON] introduced the term fidelity to indicate the degree of exactness in recovering, at the receiver side R\({}_{\text{X}}\) of a transmission channel, the signal generated by a source at the transmitter side T\({}_{\text{X}}\). In particular, his historical paper introduces the probability \(P(m_{IN},m_{OUT})\), which represents, as follows, the likelihood that \(m_{OUT}\) and [PERSON]m_{IN}\) are, respectively, the input and output signals:  
\[P(m_{IN},m_{OUT})=P(m_{IN})P(m_{OUT}|m_{IN}) \tag{1}\]  
where \(P(m_{IN})\) is the probability that the input message source generates the signal \(m_{IN}\) and \(P(m_{OUT}|m_{IN})\) is the conditional probability that the received signal is \(m_{OUT}\) given that the sent message is \(m_{IN}\). The conditional probability in Equation (1) implicitly attributes a stochastic nature to the transmission channel. Indeed, it introduces the fact that, for a given input signal, different output signals may be observed, each with its own conditional probability. All possible messages \(m_{IN}\) and \(m_{OUT}\) form the message space \(S_{m}\). The probability \(P(m_{IN},m_{OUT})\) fully statistically describes the whole transmission system (message source plus transmission channel) in terms of the pairs of messages \(m_{IN}\) and \(m_{OUT}\). If the probability \(P(m_{IN},m_{OUT})\) is known for the whole space \(S_{m}\), the fidelity is also known in a qualitative sense. Nevertheless, if you desire a more operative and quantitative definition of fidelity, you need to introduce a function \(F\{\cdot\}\) that yields a number from \(P(m_{IN},m_{OUT})\). [PERSON] interpreted this number as the distance between the ideally expected and the actually received output signals. He dubbed this distance fidelity because it quantifies the degree of exactness in receiving the transmitted message. In his paper, [PERSON] mathematically introduced fidelity as the weighted average distance calculated over the message space, where the probability \(P(m_{IN},m_{OUT})\) serves as the weighting factor (1936):  
\[F\{P(m_{IN},m_{OUT})\}=\sum_{S_{m}}P(m_{IN},m_{OUT})\delta(m_{IN},m_{OUT}) \tag{2}\]  
where \(\delta(m_{IN},m_{OUT})\) quantifies, based on a given criterion, the distance between the received \(m_{OUT}\) and the transmitted \(m_{IN}\) signals. This makes sense because for an ideal transmission channel, the ideal received output signal \(m_{OUT}^{I}=m_{IN}\), where the superscript \"I\" stands for ideal. The quantity \(\delta(m_{IN},m_{OUT})\) therefore measures the distance between the ideal and actual output messages. Since in Equations (1) and (2), \(m_{OUT}\) is the actual output signal, for reasons of unambiguous, it is good practice to replace the symbol with \(m_{OUT}^{R}\) in these equations. With these representations, the substitution of Equation (1) into Equation (2) yields:  
\[F\Big{\{}P\Big{(}m_{OUT}^{I},m_{OUT}^{R}\Big{)}\Big{\}}=\sum_{S_{m}}P(m_{IN})P \Big{(}m_{OUT}^{R}\Big{|}m_{IN}\Big{)}\delta\Big{(}m_{OUT}^{I},m_{OUT}^{R} \Big{)} \tag{3}\]  
where, in the mathematical expressions of the distance \(\delta\) and fidelity \(F\), it has been emphasized that \(m_{OUT}^{I}=m_{IN}\). In this way, it is made plain that the distance \(\delta\) and fidelity \(F\) address the difference between the ideal \(m_{OUT}^{I}\) and actual \(m_{OUT}^{R}\) output messages. A deterministic (not stochastic) transmission channel implies \(P\big{(}m_{OUT}^{R}\big{|}m_{IN}\big{)}=1\), reducing the mathematical expression of the fidelity to the following:  
\[F\Big{\{}P\Big{(}m_{OUT}^{I},m_{OUT}^{R}\Big{)}\Big{\}}=\sum_{S_{m}}P(m_{IN}) \delta\Big{(}m_{OUT}^{I},m_{OUT}^{R}\Big{)} \tag{4}\]  
It is worth noticing that, being deterministic, the channel does not imply an ideal channel. The distance \(\delta\) in Equation (4) accounts for that.