# Quantum Circuit Synthesis Using Fuzzy-Logic-Assisted Genetic Algorithms
## 5 Results
### GA-Based Compilers vs. Qiskit and BQSkit  
We present the results of our comparison of the GA-based compiler with Qiskit and BQSkit. We configured GA with a crossover rate of 1.0 (always occurs) and a mutation rate of 0.1. For the comparison, GA, GA-F and BQSkit were given error threshold targets of 0.1, 0.01 and 0.001 and the results were compared in terms of depth and CNOT count. It is worth mentioning that the compilation techniques used in BQSkit are designed to perform approximate compilation up to a target error threshold, although it is usually also possible to perform exact compilation by setting the error threshold to zero. Thus, we use BQSkit to compare our GAs against existing approximate compilation techniques. Qiskit, on the other hand, uses exact compilers based on analytical methods and does not compile against an error threshold. It always produces unitary preserving circuits [88], i.e., circuits with effective approximation error of zero. For a fair comparison between Qiskit and the other approximate compilers, we also test GA, GA-F and BQSkit with an extremely low error threshold of \(10^{-8}\). This is the default error threshold for the BQSkit compiler and is also the default used by the equiv method of the Operator class in Qiskit [89], which is used to check if two operators are equivalent up to a global phase. The Qiskit transpile function was used for synthesis with the highest optimization level of 3 and the BQSkit compile function was used with the highest optimization setting of 4. Each compiler was given a 12 h timeout limit per trial. The compilation results are displayed in Figure 11, showing the median values across five trials for each metric. These show that the GA and GA-F appear to produce results comparable with BQSkit across all metrics across for thresholds of 0.1, 0.01 and 0.001 for 2 qubit unitaries. Furthermore, it able to achieve comparable results with both BQSkit and Qiskit for 2 qubit unitaries with the much more restrictive error threshold of \(10^{-8}\). For 3 qubits, however, GA and GA-F are unable to achieve the target error thresholds, indicating that the 12 h limit was not adequate. This can be explained by the fact that moving from 2 qubits to 3 qubits drastically increases the search space, since the number of possible circuits increases exponentially with the number of qubits. Thus, a reasonable conclusion could be that many more generations of the GA and GA-F are needed to converge to an acceptable solution for larger qubit numbers. Looking at the runtime characteristics of both GA-based compilers (Figures 12-14) provides further evidence of this. In particular, the plots of best error vs. generations for  
Figure 10: Ring-shaped qubit topologies for 2 and 3 qubit target machines with bidirectional connectivity. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Gate 1** & **Gate 2** & **Action** & **New Gate on Left-Most Position** \\ \hline \(X\) & \(X\) & Elimination & \(I\) \\ \hline \(CX(q_{x},q_{y})\) & \(CX(q_{x},q_{y})\) & Elimination & \(I\) on both qubits \(q_{x}\) and \(q_{y}\) \\ \hline \(R_{z}(\theta_{1})\) & \(R_{z}(\theta_{2})\) & Fusion & \(R_{z}(\theta^{\prime})\) \\ \hline \(\sqrt{X}\) & \(\sqrt{X}\) & Fusion & \(X\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Gate fusion and elimination rules. 3 qubits in Figure 14e-h are missing the sharp drop in error towards the target threshold that we see for 2 qubits in Figure 13e-h. It indicates that they are struggling to converge to the provided error threshold within the time limit. We can also observe in those figures that the convergence times for GA and GA-F appear to be less than 1000 generations for all but the lowest error threshold when compiling 2 qubit unitaries, whereas for 3 qubits unitaries, they were unable to achieve median errors less than 0.25 even after 1500 generations. Finally, Figures 13a-d and 14a-d indicate that the proposed methods are able to maintain slightly higher updates on average for 2 qubits than 3 qubits, although the difference is not much.