# Demystifying Quantum Gate Fidelity for Electronics Engineers
## Appendix B
Dividing and multiplying by \(|z|^{2k}\) in the second integral leads to:  
\[\mathcal{I}=\int_{0}^{\infty}e^{-\rho^{2}}\rho^{2r-1}d\rho\int_{S^{2r-1}}\prod_ {h=1}^{k}|z|^{2k}\frac{|z_{h}|}{|z|^{2k}}\prod_{j=1}^{2r-1}d\varphi_{j} \tag{11}\]  
Since, as remarked above, \(\rho^{2}=|z|^{2}\), the term \(|z|^{2k}\) can be repositioned into the integral in \(d\rho\):  
\[\mathcal{I}=\int_{0}^{\infty}e^{-\rho^{2}}\rho^{2k+2r-1}d\rho\int_{S^{2r-1}} \prod_{h=1}^{k}\frac{|z_{h}|}{|z|^{2k}}\prod_{j=1}^{2r-1}d\varphi_{j} \tag{12}\]  
In the product of a sequence in integral in \(d\varphi_{j}\), the division by \(|z|^{2k}\) is equivalent to dividing, by \(|z|\), each \(|z_{h}|\) term in the product, so that, by defining \(\beta_{h}=z_{h}/z\), Equation (12) takes the following form:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]0  
It is possible to remark that:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]1  
because \(z_{h}\) are the components of \(z\). The integral in \(d\varphi_{j}\) in Equation (13) is therefore calculated on a hypersphere of unitary radius as it is in the case of Equation (A3). Since \(dV\) is the normalized infinitesimal Lebesgue measure in Equation (A3), the normalization of the second integral to the surface \(\Omega^{2r}\) of the unitary radius hypersphere makes this integral equal to Equation (A3):  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]2  
The substitution of Equation (15) into Equation (13) yields:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]3  
Appendix C shows that in an n-dimensional real vector space \(\mathbb{R}^{n}\), the surface \(\Omega^{n}\) of the unitary radius hypersphere is given by:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]4  
where \(\Gamma\) is [PERSON]'s gamma function:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]5  
Setting \(n=2r\) in Equation (17) leads thus to the following mathematical expression of \(\Omega^{2r}\):  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]6where the property \(\Gamma(n+1)=n!\) has been emphasized. The substitution of Equation (A19) into Equation (A16) yields:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]7 (A20)  
[PERSON]'s gamma function also comes into play for calculating the integral in \(d\rho\). By replacing \(\rho\) by \(t^{1/2}\), Equation (A20) takes the following form:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]8 (A21)  
from which:  
\[\sum\limits_{h=1}^{n}\ket{\alpha_{h}}^{2}=1 \tag{13}\]9 (A22)  
The comparison of the integral in \(dt\) with Equation (A18) leads to the reformulation of Equation (A22) as follows:  
\[\mathcal{I}=\int_{\mathbb{C}^{r}}e^{-|z|^{2}}\prod_{h=1}^{k}\lvert z_{h}\rvert^ {2}dV^{r} \tag{100}\]0 (A23)  
where it is again emphasized that \(\Gamma(n+1)=n!\). It is worth noting here that the aim of this appendix is to demonstrate the mathematical expression of the two integrals in Equation (24) that have been traced back to the integral in Equation (A3), which is in the right side of Equation (A23). To calculate this integral, you need to recalculate the integral \(\mathcal{I}\) from Equation (A5), as performed for achieving Equation (A23), but in a different way. For this purpose, the integrand quantities \(\left|\alpha_{i}\right|^{4}\) and \(\left|\alpha_{i}\right|^{2}\left|\alpha_{j}\right|^{2}\) in Equation (24) have to be re-interpreted, not as in Equation (A2) but rather as follows:  
\[ \begin{array}{l}\left|\alpha_{i}\right|^{4}=\prod\limits_{h=1}^{r}\left| \alpha_{h}\right|^{2m_{h}}\\ \left|\alpha_{i}\right|^{2}\left|\alpha_{j}\right|^{2}=\prod\limits_{h=1}^{r} \left|\alpha_{h}\right|^{2m_{h}}\end{array} \] (A24)  
where \(m_{h}\) is the multiplicity of the component \(\alpha_{h}\). It is worth noticing that, unlike in Equation (A2), Equation (A24) extends the product of a sequence over all of dimension \(r\) of the complex vector space; this compels us to introduce the multiplicity.