## 4 Quantum Exchange Lock Parallel Scheduler
### Quantum Circuit Hierarchical Strategy Based on Qelps
The cost function, \(Cost(i,l,e)\), evaluates the optimization impact from the \(e^{th}\) layer to the \(e+l^{th}\) layer during the \(i^{th}\) optimization. The variable \(S(i,l,e)\) represents the number of SWAP gates used by the FJOSA algorithm for the \(e^{th}\) to \(e+l^{th}\) layer, whereas \(s(i,l,e)\) represents the number of SWAP gates used by the QELPS algorithm for the same range during the \(i^{th}\) optimization. The difference between these values, \(\Delta S(i,l,e)\), quantifies the reduction in SWAP gate usage achieved by the FJOSA algorithm compared to QELPS. The parameters \(\lambda\) and \(1-\lambda\) serve as weights for different optimization indicators, ensuring a balanced contribution of each factor to the overall optimization goal. These weights are derived from experimental data. \(Q(i)^{l}\) represents the scheduling complexity of quantum bits, defined as the number of optimized layers raised to the power \(l\) after the \(i^{th}\) optimization. The variable \(S_{norm}\) is a normalization factor used to balance the SWAP gate reduction effect across different layers, while \(Q_{norm}\) is another normalization factor designed to assess the complexity of quantum bit scheduling. The Full-level Joint Optimization SWAP Algorithm is executed in multiple rounds. In each round, optimization begins at the \(e^{th}\) layer, and the circuit up to the \(e+l^{th}\) layer is simulated to determine possible SWAP gate insertions (\(e=0,\ 1,\ 2,\ldots,m;l=0,\ 1,\ 2,\ldots,n\)). As the number of optimization rounds increases, more layers are included in the optimization process. After each round, the corresponding cost function value is computed, and the layer with the lowest cost function value is selected as the optimal choice. Once the current optimization is completed, the process proceeds to the next layer. In Formula (4), \(\Delta S(i,l,e)\) represents the reduction in the number of SWAP gate insertions after optimizing \(l\) layers starting from the \(e^{th}\) layer during the \(i^{th}\) optimization. As the number of optimized layers \(l\) increases, the algorithm evaluates the potential reduction in SWAP gate insertions with each additional layer. However, since all possible SWAP gate insertion schemes must be explored, identifying the scheme with the fewest SWAP gate insertions significantly increases computational complexity as the number of optimization layers grows. In order to control the computational cost caused by an increase in the number of optimization layers, a limiting factor \(Q(i)^{l}\) is introduced in the cost function (Formula (3)). Quantum circuits are composed of multiple gates acting on quantum bits, and as the number of quantum bits increases, the overall circuit complexity increases. \(Q(i)^{l}\) reflectsthe exponential growth in algorithm complexity as the number of optimization levels \(l\) increases. Because the number of quantum bits involved in each optimization may vary with the number of levels, the insertion of SWAP gates and the scale of the search space are also affected. By incorporating \(Q(i)^{l}\), the effects of both the number of quantum bits and the number of optimization levels are dynamically combined to accurately model this complexity growth. In addition, normalization factors \(S_{norm}\) and \(Q_{norm}\) are introduced into the cost function, as shown in Formulas (5) and (6), to balance complexity cost and optimization benefits within a unified scale. This improves both the versatility and interpretability of the cost function, allowing it to adapt to different circuit structures and optimization requirements. Specifically, as the number of optimization layers \(l\) increases, the number of SWAP gates that can be reduced by \(\Delta S(i,l,e)\) gradually decreases. However, the value of \(Q(i)^{l}\) increases exponentially, causing the cost function value to rise rapidly. This exponential relationship reflects the characteristic of diminishing returns in optimization.