## 4 Proposed Clustering Algorithm
### CH Selection Approach (Quantum)  
Before conducting CH selection through QSA, we must discuss the basics of the weighted Grover's search algorithm. We want to search for one specific item in a search space that consists of N elements. For instance, we assume \(N=2^{n}\), which states that the index of the search items can be kept to n bits. Additionally, the search problem has exactly M solutions within the range of \(1\leq M\leq N\). The algorithm starts with the state: \(\left\langle 0\right|^{\otimes~{}n}\). The algorithm starts with \(\left\langle 0\right|^{\otimes~{}n}\) state which can be transformed into a superposition state via Walsh-Hadamard transformation [34]:  
\[\left|\Phi\right\rangle=\dfrac{1}{\sqrt{N}}(\left|0\right\rangle+\left|1 \right\rangle+\ldots+\left|q_{1}\right\rangle+\ldots\left|q_{M}\right\rangle+ \ldots+\left|N-1\right\rangle) \tag{16}\]  
where \(\left|q_{1}\right\rangle,~{}\left|q_{2}\right\rangle,~{}\ldots\ldots\ldots \ldots\left|q_{M}\right\rangle\) are the marked states, and the set is Q = \(\{q_{1},q_{2},\ldots\ldots\ldots q_{M}\}\). If these marked states have weighted coefficients, which are denoted as \(w_{q_{1}}\), \(w_{q_{2}}\)\(\ldots\)\(\ldots\)\(\ldots\)\(w_{q_{M}}\), they must satisfy \(\sum_{i\in\mathcal{O}}w_{i}=1\), \(w_{i}<0\), as the denoted degree of significance of each search item. From [34], it can be written as:  
\[\left|q\right\rangle=\sum_{i=1}^{N-1}c_{i}\langle i|=\left\{ \begin{array}{ ll}\sum\sqrt{w_{i}}|i\\ 0|i\end{array} \right\rangle \tag{17}\]  
Based on Equation (17), the Oracle operator can be stated as follows:  
\[\text{O}=\text{I}-2\left|q\right\rangle\left\langle q\right| \tag{18}\]After assigning the weight coefficients in Equation (16), it can be represented by the following expression:  
\[ \begin{array}{ll}|\Phi\rangle&=x_{0}|0\rangle+x_{1}|1\rangle+x_{q_{1}}|q_{1} \rangle+\ldots+x_{q_{M}}|q_{M}\rangle+\ldots+x_{q_{N-1}}|N-1\rangle\rangle\\ &=\sum_{i=1}^{N-1}x_{i}|i\rangle\end{array}  \tag{19}\]  
Now multiplying Equation (18) with Equation (19), which gives system state using Oracle operator O and it can be represented as follows:  
\[ \begin{array}{ll}\text{O}|\Phi\rangle=|\Phi\rangle*[\text{I}-2|q\rangle \;\langle q|]\\ =|\Phi\rangle-(2\;|q\rangle\;\langle q|)|\Phi\rangle\\ =|\Phi\rangle-2\;|q\rangle\;\langle q|\Phi\rangle\\ =\sum_{i=1}^{N-1}x_{i}|i\rangle|-2\;\sum_{i=1}^{N-1}c_{i}|i\rangle\;|\;\langle q |\[PERSON]\rangle\end{array}  \tag{20}\]  
The iterative equation can be constructed from [43], and the first sub-step of the superposition becomes:  
\[|\[PERSON]\rangle^{(t+\frac{1}{2})}=\sum_{i=1}^{N-1}x_{i}^{(t)}|i\rangle-2\sum_{i= 1}^{N-1}c_{i}|i\rangle\langle q|\[PERSON]\rangle^{(t)} \tag{21}\]  
The second sub-step of the equation is:  
\[|\[PERSON]\rangle^{(t+1)}=2\sum_{i=1}^{N-1}\left\langle\Phi^{(t+\frac{1}{2})} \right\rangle|i\rangle-\sum_{i=1}^{N-1}x_{i}^{(t+\frac{1}{2})}|i\rangle \tag{22}\]  
Now, after inserting the value of \(|\Phi\rangle^{(t+\frac{1}{2})}\) into Equation (22), we obtain:  
\[|\[PERSON]\rangle^{(t+1)}= 2(\sum_{i=1}^{N-1}\left\langle x_{i}^{(t)}-2\langle q|\[PERSON] \rangle^{(t)}\rangle|c_{i}\rangle\right)-x_{i}^{(t)}+2\sum_{i=1}^{N-1}c_{i}|i \rangle\;\langle q|\Phi\rangle^{(t)} \tag{23}\]  
The term \(\langle q\Big{|}\Phi\rangle^{(t)}\) above can be written with the following assumptions:  
\[\langle\text{q}|\Phi\rangle^{t}=\text{V}\;\sin(\omega\text{t}+\varphi) \tag{24}\]  
The parameters of Equation (24) are obtained as follows:  
\[\text{V}=1 \tag{25}\]  
\[\omega=2\arcsin(\langle q|\Phi\rangle) \tag{26}\]  
\[\varphi=\arcsin(\langle q|\Phi\rangle) \tag{27}\]  
If \(|\Phi\rangle\) is equal to the superposition state, \(|\text{q}\rangle\), after some iterations, then the success probability should be equal to one, which means \((\langle q|\Phi\rangle)^{2}=1\).