## 3 HSP-QGA Algorithm Design
### Algorithm Design
#### 3.2.4 Variation Operations  
The coding and decoding process shows that each chromosome after decoding (processor serial number) corresponds to each chromosome before decoding (qubit matrix). A mutation operation on the decoded chromosome is equivalent to a mutation operation on the qubit matrix before decoding. Because of this correspondence, the quantum rotation gate [27] is introduced to mutate the gene bits (qubits) of the chromosome before decoding. In contrast to the randomness generated by the variation operation of the traditional genetic algorithm, the main function of the quantum rotation gate is to make the population mutate to the current optimal individual obtained. In this way, the optimal solution can be obtained and the speed of convergence increased. The rotation direction is shown in Figure 7.  
where \(\Delta\theta\) represents the directional rotation angle, \(\alpha\) and \(\beta\) represent the direction of 0 and 1 states in the qubit, corresponding to 0 and 1 in the binary string, respectively. The calculation formula of the quantum rotation gate \(\mathrm{U}(\theta_{i})\) is shown in (6). Where \(\theta_{i}\) represents the vector rotating to \(\alpha\) or \(\beta\), and the calculation method is shown in (7). The updated formula of the qubit \(\begin{pmatrix}\alpha_{i}\\ \beta_{i}\end{pmatrix}\) is shown in (8).  
\[\mathrm{U}(\theta_{i})\ =\ \begin{bmatrix}\cos(\theta_{i})&-\sin(\theta_{i}) \\ \sin(\theta_{i})&\cos(\theta_{i})\end{bmatrix} \tag{6}\]  
\[\theta_{i}\ =\ s(\alpha_{i},\beta_{i})\times\Delta\theta_{i} \tag{7}\]  
Figure 6: Scatter plot of the nodes of the full flow of the algorithm.  
Figure 7: Rotation direction of rotation gate.  
\[\left[\begin{array}{c}\alpha_{j}^{{}^{\prime}}\\ \beta_{i}^{{}^{\prime}}\end{array}\right]\ =\ \mathrm{U}(\theta_{i})\left[\begin{array}{c} \alpha_{i}\\ \beta_{i}\end{array}\right]\ =\ \left[\begin{array}{cc}\cos(\theta_{i})&-\sin(\theta_{i})\\ \sin(\theta_{i})&\cos(\theta_{i})\end{array}\right]\left[\begin{array}{c} \alpha_{i}\\ \beta_{i}\end{array}\right] \tag{8}\]  
In Formula (7), where \(s(\alpha_{i},\beta_{i})\) is the direction of rotation and \(\Delta\theta_{i}\) is the angle of rotation, their values are determined according to the calculation rules in Table 4[28].  
In Table 4, \(x_{(s,i)}\) is the \(i\)-th bit of the binary string encoded by the \(s\)-th chromosome (qubit-coded) of the current individual, \(x_{best(s,i)}\) is the \(i\)-th bit of the binary string corresponding to the \(s\)-th chromosome of the best individual. \(f(x)\) is the fitness function that represents the reciprocal of the system scheduling length corresponding to the processor scheduling strategy, as shown in (9).  
\[f(x)\ =\ 1/\mathrm{EFT}(v_{exit},p_{k}) \tag{9}\]  
where the independent variable \(x\) is the matrix of dimension \(t\times u\), \(t\) represents the number of chromosomes, \(u\) represents the coding length of each chromosome; \(v_{exit}\) is the last task in the scheduling system; \(p_{k}\) is the processor assigned by \(v_{exit}\), \(k\) is the real number converted from binary to decimal in decoding, representing the processor number, as shown in (10).  
\[k\ =\ \sum_{i\ =\ 0}^{m-1}\ b_{i}\times 2^{i} \tag{10}\]  
Table 4 shows that the fitness value \(f(x)\) of the current individual is compared with the fitness value \(f(x_{best})\) of the best individual in the population, if \(f(x)>f(x_{best})\), then \((\alpha_{i},\beta_{i})\) evolves in a direction that favors the appearance of \(x_{(s,i)}\); on the contrary, \((\alpha_{i},\beta_{i})\) evolves in the direction that favors the appearance of \(x_{best(s,i)}\).