# Quantum-Based Analytical Techniques on the Tackling of Well Placement Optimization
## 3 Methodology
### Quantum-Behaved Bat Algorithm  
The basic Bat Algorithm is formulated by using idealized rules. The three rules are, (i) The use of echolocation capability to measure distance and to sense the difference between their prey (food) and background barriers are common to every bat. (ii) If the bats are in \(x_{i}\) position having velocity \(v_{i}\), with \(f_{min}\) fixed frequency as well as \(\lambda_{0}\) varying wavelength, then loudness \(A_{0}\) will be used for the search of food while flying randomly. Automated adjustment of the wavelength of their emitted pulses as well as adjustment of the rate of pulses r \(\in\) [0, 1] can be done by bats which is dependent on target proximity, (iii) It is presumed that loudness changes from a positive large value \(A_{0}\) to a minimum value \(A_{min}\) that is constant. Assuming that the solution is not known, to initialize bats randomly, in the search space of each dimension both lower and upper bound is used. The common solution will be generated by using:  
\[X_{ij}=X_{0}-(X_{m}X_{0})rand. \tag{24}\]  
For \(i\)th bat in the \(j\)th dimension \(X_{0}\) and \(X_{m}\) denotes the lower and upper bound, respectively. Considering this, frequency, velocity, and position of bats can be formulated in the following manner:  
\[f_{i}=f_{min}+(f_{max}-f_{min})\alpha; \tag{25}\]  
\[v_{i}^{t}=v_{i}^{t-1}+\left(x_{i}^{t}-g^{t}\right)f_{i}; \tag{26}\]  
\[x_{i}^{t}=x_{i}^{t-1}+v_{i}^{t} \tag{27}\]  
where \(\alpha\) is random vector ranging [0, 1]; \(f_{i}\), \(f_{min}\) as well as \(f_{max}\) are pulse frequency, minimum frequency, and maximum frequency, respectively. Moreover, \(v_{i}^{t}\), \(v_{i}^{t-1}\), \(x_{i}^{t}\), \(x_{i}^{t-1}\), and \(g^{t}\) denote \(i\)th bat's velocity for \(t\) iteration, \(i\)th bat's velocity at \((t-1)\) iteration, \(i\)th bat's position at \(t\) iteration, \(i\)th bat's position at \((t-1)\) iteration, and global best location currently found by bats, respectively. For the generation of new solutions for every bat, a random naturel local walk is used once a suitable solution is selected from the recent best solutions. Hence, a new position may be expressed as follows:  
\[x_{n}=x_{o}+\varepsilon A^{t}, \tag{28}\]  
where \(\varepsilon\) is denoted for expressing a random number ranging [-1, 1] and \(A^{t}\) expresses average loudness of all the bats for total t iterations. Loudness \(A_{i}\) and pulse rate denoted by \(r_{i}\) are the parameters that control the flow of the bat algorithm. For every iteration, loudness \(A_{i}\) and pulse rate \(r_{i}\) can be found using the following expression:  
\[A_{i}^{t+1}=\Delta A_{i}^{t}, \tag{29}\]  
\[r_{i}^{t+1}=r_{i}^{0}[1-\exp(-\gamma t)], \tag{30}\]  
where \(A_{i}^{t}\), \(A_{i}^{t+1}\), \(r_{i}^{0}\) and \(r_{i}^{t+1}\) denoted for \(i\)th bat's loudness for \(t\)th iteration, \(i\)th bat's loudness for \((t+1)\)th iteration, \(i\)th bat's initial pulse rate, and \(i\)th bat's pulse rate for \((t+1)\)th iteration, respectively. Both \(\Delta\) and \(\gamma\) are values that are constant ranging [0, 1] and positive, respectively. The Quantum-behaved bat algorithm (QBA) is the improved variant of the original bat algorithm. Pioneered in 2010 by [PERSON] [49], the original bat algorithm was based on the echolocation or bio-sonar capability of bats. The flowchart of QBA is depicted in Figure 3. The flowchart in Figure 3 shows that after random initialization loudness, frequency and plus rate are updated. After that,the search equation is employed to update search location. A local search is incorporated into the search technique. This process will continue unless the termination criteria are satisfied. Unlike the traditional bat algorithm, for QBA, a new position is assessed differently, and it can be expressed by the equations below:  
\[x_{id}^{t+1}=g_{d}^{t}[1+j\big{(}0,\sigma^{2}\big{)}]\sigma^{2}=\big{|}A_{i}^{t }-A^{t}\big{|}+\varepsilon, \tag{31}\]  
where \(j\big{(}0,\sigma^{2}\big{)}\) denotes a Gaussian distribution that has zero mean and standard deviation of \(\sigma^{2}\).