# A Hybrid Optimization Algorithm for the Synthesis of Sparse Array Pattern Diagrams
## 2 Quantum Hybrid Particle Swarm Optimization Algorithm Combined with Quantum Behavior
### Quantum-Behaved Particle Swarm Optimization Algorithm  
The quantum-behaved particle swarm optimization (QPSO) algorithm integrates PSO optimization mechanisms with quantum-inspired strategies. It uses parallel fitness evaluation to compute the objective function for all individuals in the population. Its core process is shown in Figure 1.  
In QPSO, the PSO update dominates in the early iterations, leveraging its velocity term advantage to rapidly approach the global optimum. As iterations progress, the probability of quantum collapse update gradually increases, fully utilizing the local fine search capability of quantum behavior to compensate for the PSO's tendency to fall into local optima. The relevant definitions are as follows:  
\[X_{t}=\left\{ \begin{aligned} C+\beta\cdot|C-X_{t-1}|\cdot\text{ln} \bigg{(}\frac{1}{u}\bigg{)}rand\leq p\\ X_{t-1}+alpha\cdot(c_{1}\cdot rand\cdot(\text{{pbest}}_{i}-x_{i}(t))+c _{2}\cdot rand\cdot(\text{{gbest}}-x_{i}(t))+m)rand\geq p\end{aligned} \right. \tag{8}\]  
The real-time optimal position of particles is calculated using a hybrid strategy probability mechanism, which involves both quantum collapse and PSO\(-\)dominated position updates. Here, \(rand\in(0,1)\) and the critical probability \(p\) are introduced, defined as:  
\[p=0.2+0.6\cdot\bigg{(}1-e^{-5\frac{1}{T}}\bigg{)} \tag{9}\]\(p\) is a dynamically adjusted value that invokes a power function to control the update method that is suitable for the current particles, based on the iteration count. When \(rand\leq p\), the quantum behavior of a particle update is triggered. In this case, the gravitational center \(C\) of quantum behavior replaces the real-time global optimum \(gbest\) of PSO, defined as:  
\[C=sum\Big{(}pbest\cdot\Big{(}1/\Big{(}pbest_{fitness}+eps\Big{)}\Big{)},1 \Big{)}/sum\Big{(}1/\Big{(}pbest_{fitness}+eps\Big{)}\Big{)} \tag{10}\]  
By introducing an inverse fitness weighting mechanism, the numerator is the row vector of the product of particle position and inverse fitness, and the denominator is the sum of \(C\), namely, the inverse fitness of the population. This design effectively avoids the risk of division by zero, enhances the numerical calculation stability, and uses the quantum gravitational effect to guide particles to accurately search for high-quality solution regions. The improved quantum behavior replaces the original \(gbest\) with the gravitational center \(C\) and introduces a contraction factor \(\beta\) to further enhance local search efficiency. Its value is defined as:  
\[\beta=0.3\cdot(1+\sin(\pi\cdot(t/T))) \tag{11}\]  
Figure 1: Flowchart of the algorithm. When \(rand\geq p\), the position update mechanism that is dominated by the particle swarm algorithm is triggered. Its definition is different from the calculation method shown in Equation (3). In addition to using the improved sigmoid-type inertia weight \(W\) as the variable factor of \(c_{1}\) in Equation (5), the classic inertia weight in the particle swarm algorithm is also replaced by the momentum term [24]. It is defined as:  
\[m=0.3\cdot\left(X_{t-1}-X_{average}\right) \tag{12}\]  
In the above equation, \(X_{t-1}\) and \(X_{average}\) represent the position of the particle in the previous iteration and the average of the previous positions, respectively. Moreover, the gravitational coefficient \(alpha\) is newly added in its definition:  
\[alpha=1.2\cdot\left(1-\left(t/T\right)^{2}\right) \tag{13}\]  
This represents the step length of particle movement in each position update. Compared with the classic particle swarm algorithm, QPSO also introduces the mutation operation in genetic algorithms, which is specifically defined as:  
\[\sigma=0.1+0.4\cdot\left(1-\left(t/T\right)\right)\;rand\leq P_{mutation} \wedge f_{i}\geq f_{median} \tag{14}\]  
The mutation intensity \(\sigma\) is dynamically adjusted and decreases with the increase in iteration times.