# A Quantum-Inspired Predator-Prey Algorithm for Real-Parameter Optimization
## 3 Quantum Predator-Prey Algorithm
### Quantum Formulation  
We give further details of the equations that have been used to create new individuals from the population in QPPA through quantum formulation via the predator and prey subpopulations. We use the foundations of quantum mechanics to formulate the quantum predator phase shown in Algorithm 1 and Figure 1.  
A wave function can be solved using the Schrodinger equation [45]:  
\[i\hbar\frac{\partial\Psi}{\partial t}=\frac{-\hbar^{2}}{2m}\frac{\partial^{2} \Psi}{\partial^{2}t}+V\Psi \tag{14}\]  
\(V\) is the representation of the potential energy function, h-cross (\(\hbar\)) is [PERSON]'s constant divided by \(2\pi\), and \(i\) represents an iota that gives the imaginary part of a complex number. In order to find the probability of a particle at point \(x\) and time \(t\), we solve \(|\Psi(x,t)|\). Therefore, \(|\Psi(x,t)|^{2}dx\) gives the probability of finding the particle between \(x\) and \((x+dx)\) at time \(t\). The _variable separation method_[] is used to solve the Schrodinger equation. \[\Psi(x,t)=\psi(x).\varphi(t) \tag{15}\]  
The variable separation method creates two different functions dependent on \(x\) and \(t\), respectively. Therefore, the Schrodinger equation can be written as in Equation (16):  
\[i\hbar\frac{1}{\varphi}\frac{\partial\varphi}{\partial t}=\frac{-\hbar^{2}}{2 m}\frac{1}{\psi}\frac{\partial^{2}\psi}{\partial^{2}t}+V \tag{16}\]  
The second part of the above equation is dependent on \(x\) and independent of \(t\) and is therefore called the time-independent Schrodinger equation. The specification of the potential function \(V(x)\) is important to solve the Schrodinger equation. Some of the most common potential functions are the one-dimensional delta potential well, the harmonic oscillator, and the square potential well. In our algorithm, we use the delta potential function, and therefore we define the Dirac delta function \(\delta(x)\) as in Equation (17). \[\delta(x)= \begin{cases}0,x\
eq 0\\ \infty,x=0\end{cases} ,with\ \int_{-\infty}^{+\infty}\delta(x)dx=1 \tag{17}\]  
\(\delta(x-c)\) is a similar function that has the same properties at position \(c\) as the origin in \(\delta(x)\). If we multiply \(\delta(x-c)\) by an ordinary function \(f(x)\), it is the same as multiplying \(f(c)\). \[f(x)\delta(x-c)=f(c)\delta(x-c) \tag{18}\]  
Integrating both sides from -\(\infty\) with \(\infty\), we obtain \(f(c)\), where \(c\) is a constant. \[\int_{+\infty}^{-\infty}f(x)\delta(x-c)dx=\int_{+\infty}^{-\infty}f(c)\delta( x-c)dx \tag{19}\]  
We can consider the potential of the form of Equation (20):  
\[V(x)=-c\delta(x). \tag{20}\]  
Replacing the potential function in a time-independent Schrodinger equation, we have Equation (21):  
\[\frac{-\hbar^{2}}{2m}\frac{1}{\psi}\frac{\partial^{2}\psi}{\partial^{2}t}-c \delta(x)\psi=E\psi \tag{21}\]  
which can be written in the form given in Equation (22):  
\[\frac{1}{\psi}\frac{\partial^{2}\psi}{\partial^{2}t}+k^{2}\psi=0. \tag{22}\]where  
\[k=\sqrt{\frac{-2 mE}{\hbar^{2}}}. \tag{23}\]  
This potential yields both bound states \((E<0)\) and scattering states \((E>0)\). In the region x\(<0\), \(V(x)=0\), and \(E\) is negative by assumption, so \(k\) is real and positive, and hence we obtain Equation (24). \[\psi=Ae^{kx},x<0 \tag{24}\]  
In Equation (24), we assume that the pre-exponential factor is kept at 0 for the negative x part, for which the power of exponential would be \(-kx\), as it would blow up when \(x\rightarrow-\infty\). In the region x\(>0\), \(V(x)=0\), we obtain Equation (25):  
\[\psi=Be^{-kx},x>0 \tag{25}\]  
The above equation does not include the term whose power of exponential is \(kx\) because it would blow up as \(x\rightarrow\infty\), so the pre-exponential factor is kept at 0. On keeping \(A=B\), we obtain a general formula:  
\[\psi(x)= \begin{cases}Be^{kx},x<0\\ Be^{-kx},x>0\end{cases}  \tag{26}\]  
We assume that the particle is present in a one-dimensional space. We refer to point \(p\) as the local attractor that is at the center of the potential well.