# A Setting Optimization Ensemble for a Distributed Power Grid Protective Relay
## 4 Quantum Genetic Optimization Model
### The Model Building of QGO  
In the theoretical framework of two-state quantum computing, the smallest information storage unit is referred to as a qubit. Qubits can exist in states \"1\" or \"0\", or they may simultaneously exist in any superposition between the two.  
The state of any qubit \(\psi\) can be described by the following equation:  
\[\left\langle\psi\right\rangle=a\left\langle 0\right\rangle+b\left\langle 1\right\rangle \tag{24}\]  
where \(a\) and \(b\) are complex coefficients of the probability that the qubit is in the corresponding state. Specifically, \(\left|a\right|^{2}\) represents the probability that the qubit is in state 0, and \(\left|b\right|^{2}\) represents the probability that the qubit is in state 1.  
Normalize this complex coefficient to receive  
\[\left|a\right|^{2}+\left|b\right|^{2}=1 \tag{25}\]  
Therefore, for a system with \(n\) qubits, \(2^{n}\) states will be covered.  
For QGO algorithm, we often use qubits to encode the optimization scheme. A qubit is defined by a pair of complex numbers, which may be denoted as \(\left(a,b\right)^{\mathrm{T}}\), where the two parameters have the same meaning as those in Equation (24).  
The space of an m qubit is defined as follows:  
\[\begin{bmatrix}a_{1}&a_{2}&\cdots&a_{m}\\ b_{1}&b_{2}&\cdots&b_{m}\end{bmatrix} \tag{26}\]  
The above matrix satisfies the constraint (25), which means \(\left|a_{i}\right|^{2}+\left|b_{i}\right|^{2}=1\), \(i=1,2,\cdots,m\).  
The advantage of this representation is that it covers superposition states other than \"1\" and \"0\". Taking a three-qubit system with three states as an example, the probability amplitude can be expressed as  
\[\begin{bmatrix}\cos\theta&\cos\varphi&\cos\delta\\ \sin\theta&\sin\varphi&\sin\delta\end{bmatrix} \tag{27}\]The state of the system can be expressed as  
\[\begin{array}{l}\cos\theta\cos\varphi\cos\delta(000)+\cos\theta\cos\varphi\sin \delta(001)\\ +\cos\theta\sin\varphi\cos\delta(010)+\cos\theta\sin\varphi\sin\delta(011)\\ +\sin\theta\cos\varphi\cos\delta(100)+\sin\theta\cos\varphi\sin\delta(101)\\ +\sin\theta\sin\varphi\cos\delta(110)+\sin\theta\sin\varphi\sin\delta(111)\\ \end{array} \tag{28}\]  
According to Equation (28), the three-qubit system contains eight kinds of state information, that is, (000), (001), (010), (011), (100), (101), (110), and (111).  
The corresponding occurrence probabilities are, respectively, as follows:  
\[\begin{array}{l}\cos^{2}\theta\ \cos^{2}\varphi\ \cos^{2}\delta,\cos^{2}\theta\ \cos^{2}\varphi\ \sin^{2}\delta\\ \cos^{2}\theta\ \sin^{2}\varphi\ \cos^{2}\delta,\cos^{2}\theta\ \sin^{2}\varphi\ \sin^{2}\delta\\ \sin^{2}\theta\ \cos^{2}\varphi\ \cos^{2}\delta,\sin^{2}\theta\ \cos^{2}\varphi\ \sin^{2}\delta\\ \sin^{2}\theta\ \sin^{2}\varphi\ \cos^{2}\delta,\sin^{2}\theta\ \sin^{2}\varphi\ \sin^{2}\delta\\ \end{array} \tag{29}\]  
Therefore, a quantum chromosome with \(n\) qubits can express \(2^{n}\) states. If the traditional genetic algorithm is used, at least \(2^{n}\) chromosomes are needed. In addition, when the coefficients \(|a_{i}|^{2}\) or \(|b_{i}|^{2}\) tend toward \"1\" or \"0\", the multi-state nature of qubit chromosomes will gradually disappear until they converge to a single state. From the above two aspects, it can be seen that qubit representation has a large range, easier convergence, and more advantages.