# Quasi-Shor Algorithms for Global Benchmarking of Universal Quantum Processors
## 4 Error Metrics for Benchmarking
Based on the above calculations, a global benchmarking protocol for universal quantum processors is introduced as follows:  
1. For an \(N\)-qubit quantum processor, choose five qubits randomly;  
2. Run the Bell-Shor algorithm on the five qubits;  
3. Carry out state tomography for the final state;  
4. Construct density matrices of the final state;  
5. Look up Table 1 for the coordinates of the required entries;  
6. Calculate two metrics \(\Gamma_{a}\) and \(\Gamma_{b}\). For the remaining \(N-5\) qubits, there are at least three feasible treatments:  
(1) Leave the remaining \(N-5\) qubits in idle states when running the Bell-Shor algorithm on the five qubits. In this situation, it is important to move a certain number of frequencies of those \(N-5\) qubits away from the work frequency to reduce the disturbance on working qubits. (2) Initialize and keep the remaining \(N-5\) qubits in the ground state. Because no other driving signal is applied to the \(N-5\) qubits, less resonance or entanglement would be generated among the selected five qubits to other qubits. (3) Try to conduct parallel operations on a multi-group of five (or other) qubits. The advantage of this method is the high benchmarking efficiency, nevertheless, more control and readout lines are needed. For the state tomography [59], measure \(\langle\sigma_{v_{1}}\otimes\sigma_{v_{2}}\otimes\sigma_{v_{3}}\otimes\sigma_{ v_{4}}\otimes\sigma_{v_{5}}\rangle\), where \(\sigma_{v_{i}}(i=1,2,...,5)\) are chosen from the set of Pauli matrices \(\sigma_{0},\sigma_{1},\sigma_{2},\sigma_{3}\). The density matrices are reconstructed by  
\[\rho=\sum_{\vec{v}}\frac{\text{tr}(\sigma_{v_{1}}\otimes\sigma_{v_{2}}\otimes...\otimes\sigma_{v_{5}}\rho)\sigma_{v_{1}}\otimes\sigma_{v_{2}}\otimes... \otimes\sigma_{v_{5}}}{2^{5}}. \tag{4}\]  
An alternative method for state tomography and reconstructing density matrices has been demonstrated by [PERSON], et al [62; 63]. The Bell-Shor algorithm can be extended to a reasonably larger number of qubits, e.g., five to eight qubits. Here, a subset of \(k\) qubits with \(2^{k}\times 2^{k}\) density matrices is used to benchmark the \(N\)-qubit quantum processor. The total number of selections could be counted as:  
\[C_{N}^{k}=\frac{N!}{k!(N-k)!}<\frac{N^{k}}{k!},(k=5,6,7,8). \tag{5}\]  
Then the number of elements in the density matrices for the 5-qubit Bell-Shor algorithm is:  
\[\frac{N!}{5!(N-5)!}\times 32^{2}<\frac{N^{5}}{5!}\times 32^{2}=\frac{N^{5}}{1 20}\times 32^{2}=8.53\;N^{5}, \tag{6}\]  
which has polynomial scalability. Comparing with benchmarking \(N\)-qubit directly by \(2^{N}\times 2^{N}\) density matrices, the total number of elements is \(4^{N}\), which scales exponentially. As listed in Table 2, the number \(k\) of the calculating qubits is increased to study the change in the number (\(\sum_{j=1}^{4}n_{j}\)) of zero elements. It could be seen that the total number of elements grows exponentially with \(k\). However, the percentage of the number of zero elements keeps relatively steady except in the 6-qubit case, where an abnormal increase occurs. There is a trade-off between the choice of the qubit numbers \(k\) and the percentage of zero elements. The large sizes of elements would increase the calculation complexity, while too small qubit numbers would destroy the integrity of quasi-Shor algorithm. Based on the information mentioned in Table 2, the locations of these special entries are shown in Figure 6, including all the zero entries in the four final density matrices with the following different initial states \(|0\rangle^{\otimes k-2}|00\rangle\), \(|0\rangle^{\otimes k-2}|01\rangle\), \(|0\rangle^{\otimes k-2}|10\rangle\), and \(|0\rangle^{\otimes k-2}|11\rangle\) (\(k=5\), \(6,7,8\)). It could be seen that though the number of special elements in the 6-qubit case is abnormally larger than the others, and the distribution of zero entries has a spectacular cross \"+\" feature. Moreover, all these special points keep some characteristics of symmetry.