# Demystifying Quantum Gate Fidelity for Electronics Engineers
## Appendix B
As shown in Equation (A24), the new formulated product of a sequence generates \(\left|\alpha_{i}\right|^{4}\) if \(m_{h}=2\) for \(h=i\) and \(m_{h}=0\) otherwise, and \(\left|\alpha_{i}\right|^{2}\left|\alpha_{j}\right|^{2}\) if \(m_{h}=1\) for \(h=i=j\) and \(m_{h}=0\) otherwise. Following Equation (A24), Equation (A5) takes the following form:  
\[\mathcal{I}=\int_{\mathbb{C}^{r}}e^{-|z|^{2}}\prod_{h=1}^{r}\left|z_{h}\right| ^{2m_{h}}dV^{r}\] (A25)  
It is now possible to remark that:  
\[ \begin{array}{l}\left|z\right|^{2}=\sum\limits_{h=1}^{r}\left|z_{h}\right|^ {2}\\ dV^{r}=\prod\limits_{h=1}^{r}dz_{h}\end{array} \] (A26)The substitution of Equation (A26) into Equation (A25) yields:  
\[\mathcal{I}=\int_{\mathbb{C}^{r}}\prod\limits_{h=1}^{r}e^{-|z_{h}|^{2}}|z_{h}|^{ 2m_{h}}dz_{h}=\prod\limits_{h=1}^{r}\int_{\mathbb{C}^{1}}e^{-|z_{h}|^{2}}|z_{h}| ^{2m_{h}}dz_{h}\] (A27)  
In this way, the integral in the r-dimensional complex vector space \(\mathbb{C}^{r}\) has been reduced to the product of a sequence of integrals in the one-dimensional complex vector space \(\mathbb{C}^{1}\). Because the dimension is one, in this space, \(z_{h}\) is the unique vector and \(dz_{h}\) is the infinitesimal Lebesgue measure. In polar coordinates, it holds therefore that \(|z_{h}|=\rho\). In addition, Equation (A6) provides the mathematical expression of the infinitesimal Lebesgue measure, because a one-dimensional complex vector space \(\mathbb{C}^{1}\) is dimensionally equivalent to a two-dimensional real vector space. It holds therefore that \(dz_{h}=\rho d\rho d\varphi\). Consequently, Equation (A27) can be reformulated as follows:  
\[\mathcal{I}=\prod\limits_{h=1}^{r}\int_{\mathbb{C}^{1}}e^{-\rho^{2}}\rho^{2m_{ h}}\rho d\rho d\varphi=\prod\limits_{h=1}^{r}\int_{0}^{2\pi}\int_{0}^{\infty}e^{- \rho^{2}}\rho^{2m_{h}}\rho d\rho d\varphi\] (A28)  
from which:  
\[\mathcal{I}=\prod\limits_{h=1}^{r}\int_{0}^{2\pi}d\varphi\int_{0}^{\infty}e^{ -\rho^{2}}\rho^{2m_{h}+1}d\rho=(2\pi)^{r}\prod\limits_{h=1}^{r}\int_{0}^{ \infty}e^{-\rho^{2}}\rho^{2m_{h}+1}d\rho\] (A29)  
The integral in \(\rho\) can be calculated by setting \(\rho=t^{1/2}\), as done for Equation (A20). In this way, you obtain:  
\[\mathcal{I}=\frac{(2\pi)^{r}}{2^{r}}\prod\limits_{h=1}^{r}\int_{0}^{\infty}e^ {-t}\rho^{m_{h}}dt=\frac{(2\pi)^{r}}{2^{r}}\prod\limits_{h=1}^{r}\int_{0}^{ \infty}e^{-t}\rho^{(m_{h}+1)-1}dt=\pi^{r}\prod\limits_{h=1}^{r}\Gamma(m_{h}+1)\] (A30)  
Since \(\Gamma(\text{n}+1)=\text{n}!\), Equation (A30) takes the following short form:  
\[\mathcal{I}=\pi^{r}\prod\limits_{h=1}^{r}m_{h}!\] (A31)  
The substitution of Equation (A31) into Equation (A23) yields:  
\[\pi^{r}\prod\limits_{h=1}^{r}m_{h}!=\frac{\pi^{r}(k+r-1)!}{(r-1)!}\int_{S^{2r- 1}}\prod\limits_{h=1}^{k}|\alpha_{h}|^{2}dV\] (A32)  
from which:  
\[\int_{S^{2r-1}}\prod\limits_{h=1}^{k}|\alpha_{h}|^{2}dV=\frac{(r-1)!}{\pi^{r}( k+r-1)!}\pi^{r}\prod\limits_{h=1}^{r}m_{h}!=\frac{(r-1)!}{(k+r-1)!}\prod \limits_{h=1}^{r}m_{h}!\] (A33)  
From the definition of \(k\) in Equation (A2) and of \(m_{h}\) in Equation (A24), it holds that:  
\[ \begin{array}{l}k=\sum\limits_{j=1}^{r}m_{j}\\ \int_{S^{2r-1}}\prod\limits_{h=1}^{k}|\alpha_{h}|^{2}dV=\int_{S^{2r-1}}\prod \limits_{h=1}^{r}|\alpha_{h}|^{2m_{h}}dV\end{array} \] (A34)  
By observing that \(|\alpha_{h}|^{4}\) can be interpreted as a product of vector components \(\alpha_{j}\) with \(m_{j}=2\), if \(j=h\) and \(m_{j}=0\) if \(j\
eq h\), you can write:\[ \begin{array}{c}\sum\limits_{j=1}^{r}m_{j}=2\\ \prod\limits_{j=1}^{r}m_{j}!=2\end{array} \] (A35)  
The substitution of Equations (A34) and (A35) into Equation (A33) yields:  
\[\int_{S^{2r-1}}|\alpha_{i}|^{4}dV=\frac{(r-1)!}{(2+r-1)!}2=\frac{2(r-1)!}{(r+1 )!}=\frac{2}{r(r+1)}\] (A36)  
Similarly, since, Equation (A24) generates \(|\alpha_{i}|^{2}\big{|}\alpha_{j}\big{|}^{2}\) if \(m_{h}=1\) for \(h=i=j\) and \(m_{h}=0\) otherwise, you get:  
\[ \begin{array}{c}\sum\limits_{j=1}^{r}m_{j}=2\\ \prod\limits_{j=1}^{r}m_{j}!=1\end{array}