Quantum-Inspired Acromyrmex Evolutionary Algorithm

Obtaining efficient optimisation algorithms has become the focus of much research interest since current developing trends in machine learning, traffic management, and other cutting-edge applications require complex optimised models containing a huge number of parameters. At present, computers based on the classical Turing-machine are inefficient when intent to solve optimisation tasks in complex and wicked problems. As a solution, quantum computers that should satisfy the Deutsch-Church-Turing principle have been proposed but this technology is still at an early stage. quantum-inspired algorithms (QIA) have emerged trying to fill-up an existing gap between the theoretical advances in quantum computation and real quantum computers. QIA use classical computers to simulate some physical phenomena such as superposition and entanglement to perform quantum computations. This paper proposes the quantum-inspired Acromyrmex evolutionary algorithm (QIAEA) as a highly efficient global optimisation method for complex systems. We present comparative statistical analyses that demonstrate how this nature-inspired proposal outperforms existing outstanding quantum-inspired evolutionary algorithms when testing benchmark functions.

are working in the development of quantum computers, some of these companies are D-Wave systems 11 , IBM 12 , Google 13 , the QuTech 14 , Intel 15 , and Rigetti 16 . Most of these companies are offering cloud services, however, none of them satisfies the Deutsch-Church-Turing principle yet.
A comparison of three conventional software tools when solving three instances in the NP-hard problem domain, demonstrated that a quantum annealing based system, which carries out quantum adiabatic computation, outperformed conventional software like the CPLEX, METSlib tabu search, and the branch-and-bound solver named Akmaxsat. In one of the tests, the quantum annealing system was 3600 times faster than the CPLEX software 17 .
Adiabatic quantum computers, such as the developed by D-Wave systems 11 , have solved successfully NP-hard quadratic unconstrained binary optimisation (QUBO) problems 18 on a graph G. The idea is to obtain a minor-embedding of G to map it in the hardware graph U. In particular, the D-Wave system architecture can be seen as an indirect graph U with its vertices and edges weighted. Using the QUBO representation it is possible to solve problems that require more qubits than those provided by the quantum computer, nevertheless, as the size of the problem to be solved increases, the difficulty of representing it can increase exponentially, which is a definite limitation.
Recent research in evolutionary computing has focused on exploiting the benefits of quantum computing 19,20 . The interaction between quantum computing and evolutionary computation can be divided into three kinds of algorithms 21 . The first type is evolutionary-designed quantum algorithms (EDQA), where the main idea is to use genetic programming to generate new quantum algorithms; the second type is quantum evolutionary algorithms (QEA), which focus on developing algorithms for quantum computers; and, the third type is quantum-inspired evolutionary algorithms (QIEA), which use concepts of quantum mechanics to develop evolutionary methods for a classical computer 22 .
This quantum-inspired Acromyrmex evolutionary algorithm (QIAEA) proposal falls within the rapidly growing emergent field of QIEAs that have shown to outperform traditional evolutionary algorithms in some cases [23][24][25] . Similar than a quantum mechanical system, a QIEA can be considered as a probabilistic system where the probabilities related to each state describe the behaviour of the system. Since Narayanan and Moore introduced the QIEA in 1996 22 several variants have been proposed, most of them can be found in the surveys 21,26 . The QIAEA is inspired in the colony evolution of the leaf-cutters and weaver ant species. This idea is different to the ant colony optimisation (ACO) metaheuristics that were first proposed by Marco Dorigo 27,28 , where the central idea is to use swarm intelligence based on food catering to solve complex optimisation problems.
This paper contributes to the state-of-the-art in quantum-inspired evolutionary algorithms with the QIAEA to solve complex optimisation problems. The QIAEA, based on the statistical results of hundreds of tests performed on benchmark functions, has proven to outperform existing outstanding quantum-inspired evolutionary algorithms.

Methods
Existing ant-inspired algorithms, such as the ACO, use the foraging behaviour of ants to find the optimal solutions for a variety of optimisation problems 28 . In ACO, scouting ants search the area for food leaving pheromones. At each generation, the routes are updated by a decision made by the ant using a probability density function. The best trails have a higher amount of pheromones, enabling the ants to find the shortest routes between the nest and their food source. Our ant-inspired method model is different from the current ant-inspired proposals and has a higher similarity to genetic algorithms, where the fittest individuals in a population survive and pass their genes to the next generation.
The proposed model, called quantum-inspired Acromyrmex evolutionary algorithm (QIAEA), is inspired in the Acromyrmex ant species, also known as leaf-cutter ants. Another minor inspiration for the model were the Atta, and the Oecophylla smaragdina also known as weaver ant. The life cycle of this species consists of four stages: eggs, larva, pupa, and adult. Typically, these advanced social insects live in nests, and they have well-organized colonies formed by the queen, males, workers, soldiers, and sometimes virgin queens. Queens are the only female ants with reproductive capabilities. Fertilized eggs produce female ants which eventually become queens, workers or soldiers, while unfertilized eggs produce male ants. Each member of the ant population has a set of chromosomes that represent a solution in an optimisation problem. The aptitude of each colony member is evaluated using a fitness function. The fittest individuals of the population are the queen and the males, and their matting produces new offspring (eggs) at every generation that replace the least fit colony members. The queen mates with each male, producing the same quantity of eggs for each matting. If any of the offspring has higher fitness than the existing queen or male, they replace them in the next generation.
In QIAEA, we used c i to denote the chromosome representing a colony member, and ∪ = p c f i i i to represent a conventional individual containing its fitness value f. A population of individuals  ↓ is defined by Equation (1) and it consists of the set of all the N individuals p i sorted in descending order (the fittest individuals are first). A general function  , called the fitness function, assigns the corresponding fitness value f to each element of , described as = ∈ ⋃ f i N i  , and → ↓ ↓ : F P F. The QIAEA can be formally defined by the 5-tuple { , , , , } Q V M R F , where  stands for queens,  for virgin queens,  for males,  for the rest of the ant population (workers and soldiers), and  for the fitness of the individuals. The QIAEA is an elitist algorithm, hence Equation (1) defines a population  ↓ consisting in the set of all the N individuals p i sorted in descending order. Equation (2) shows the ranked population accordingly to their function in the colony; the shorthand notation is depicted in Equation (3).
As it was described in Equation (2), the general proposal can have several queens and virgin queens, nevertheless, in our particular implementation the population set is represented by where only one queen exists. The decision of simplifying Equation (2) comes from the necessity of reducing computational hardware requirements since quantum computer emulators grow exponentially based on their number of qubits.
To evolve the population, the QIAEA model uses a quantum representation for every colony member and applies quantum operations over them. Each ant in the population is interpreted by a set of qubits |ψ ι 〉 defined by Equation (4). A set of qubits is called a quantum register, and it can be described as |Ψ〉 = |ψ 1 〉 ⊗ |ψ 2 〉 ⊗ … ⊗ |ψ n 〉, where the symbol ⊗ represents the tensorial product in the Hilbert space and n is the number of qubits; therefore, the quantum register |Ψ〉 is a general state vector that lives in the 2 n complex dimensional space  2 . In the framework of our model, the qubits are quantum alleles in the quantum chromosome |Ψ〉, and the genes are subsets of |Ψ〉 that serve to codify the decision variables of an optimisation problem.
When nature evolves a closed quantum system of qubits, it is impossible to know with precision its state, however, real-world problems need solutions in known states; therefore, it is necessary to observe the quantum chromosomes using a measurement operator. Quantum measurements can be characterised by a set of linear and o is the number of possible outcomes. Once the system is measured, the quantum information is destroyed. In general, the probability of obtaining the outcome μ of a qubit in the state |ψ〉 using the measurement operator  μ is given by: where the symbol † named the dagger operation represents the combined transpose and conjugate operations of a matrix. If the output is μ then the state collapses to: For a single qubit, in our case in the computational basis {|0〉, |1〉}, we used the measurement operators  = | 〉〈 | 0 0 0 and  = | 〉〈 | 1 1 1 -i.e., when a qubit is measured, it only ever gives '0' or '1' as the measurement result. The expression (7) illustrates a quantum chromosome |Ψ i 〉 and one of its possible values after collapsing to a classical state after measurement. Since this chromosome can simultaneously represent all possible bit strings of length 2 n , it is possible to modify standard evolutionary algorithms to work with few or even a single quantum chromosome instead of having a large population of non-quantum chromosomes encoding solutions. The capacity of the chromosome to represent multiple states simultaneously helps to maintain diversity during the search process of the quantum evolutionary algorithm.
The pseudocode to implement the QIAEA is described in Algorithm 1, with one queen and three sub-processes. Algorithm 2 shows the first sub-process that performs single qubit measurements (SQM), where [left, right] is a uniform random number generator in the range [0, 1]. Algorithm 3 describes the second sub-process which performs a full measurement (FM) of an n-qubit quantum chromosome, this is done by repeating one-qubit measurement n times. Algorithm 4 contains the third sub-process that carries out the crossover operation of the queen considering the male to produce an offspring c new .
In the proposed QIAEA, see Algorithm 1, the first step (lines 3-8) is to initialize the ant colony  of size N. In the for-loop, a colony-member c i is obtained performing a full-measurement of the quantum register Q H previously set in the superposition state through the Hadamard operator H. The algorithms use the symbol  to indicate quantum measurements. Hence, to achieve a single qubit measurement we wrote  SQM -i.e., we are observing using the SQM process, and for achieving a full-measurement we used  FM to say that we are invoking the process FM to measurement the whole chromosome. In the second step, we proceed to form the five-tuple according to (3). We evaluate and assign their fitness values to all the colony members (lines 9-11), then the whole population is sorted in descending order ↓, the subsets 1  and = k l 2  are created. The best individuals are saved into j 1  , where j is the number of individuals to be preserved. The third step is a repeat-until-loop (lines [16][17][18][19][20][21][22][23][24][25][26][27], where the ant colony is bred to search for the optimal colony member. The general idea is to compare substrings of the queen and a random male, bit by bit. When the corresponding bit of both colony members are equal we conduct a Hadamard quantum operation to the

Results
The proposed QIAEA was compared with a classic genetic algorithm (GA), the ACO implementations for continuous domains 28 , the particle swarm optimisation (PSO) algorithm, the quantum GA (QGA) using a combination of the rotations strategies proposed by Nicolau et al. 29 and by Wang et al. 30 , and the improved QGA developed by Wang et al. 30 tagged as AQGA. The general programming implementation characteristics of the GA, ACO, PSO, QGA, and AQGA are described in the next paragraphs.
The GA is an elitist algorithm; at each generation, the best individuals are chosen for the next generation. New individuals are generated with the best individuals using tournament selection and the two-point crossover method. The rest of the population are randomly generated, and a mutation operator is used to enhance diversity. The ACO is an ant population-based metaheuristics where the ants search for the best paths for finding food, which is interpreted as finding the best solutions to a given optimisation problem. For testing, we used the ACO for continuous domains proposed by Socha 28 . The PSO is inspired by the social behaviour of bird flocks and is different from the GA since the solution-space is explored based on individual and neighbourhood-based best-known particle positions. The particular implementation of the PSO for this work is the SPSO-2011 developed by Zambrano-Bigiarini and Clerc 31 .
In the QGA and the AQGA each individual is coded using two quantum registers, one register for each decision variable. To implement these two algorithms is necessary to clone the main population before taking measurements to preserve the amplitudes and probabilities before collapsing the registers to specific values. At each generation, the best solution is kept and is used to obtain the new population by evolving it according to the rotation strategy proposed in 30 . Thus, these algorithms use the quantum rotation gate as the main operator to evolve the population. The rotation angle, θ t is 0.05π for the QGA, whereas the AQGA auto-adjust 30 the rotation angle θ t using θ t = θ max − (θ max − θ min )*t/t max . In AQGA, the value of θ t ∈ {θ min , θ max } depends on the current generation t ∈ {1, t max }, initializing in θ max and decreasing over time to θ min . The quantum alleles are updated using the quantum rotation gate, see Equation (8). www.nature.com/scientificreports www.nature.com/scientificreports/ Additionally, the AQGA includes mutation and disaster operations. The general idea of the mutation operator is to slightly deviate the selected individual from the current evolutionary direction to avoid local minima 32 , which is done by swapping the value α i and β i . If after several generations, the population is stuck, then a disaster condition occurs. The disaster operation applies a disturbance to the population by generating new individuals to substitute randomly selected members of the population (excluding the best individual). Particularly, in this implementation, we performed the disaster operation after five generations without improvements in the best solution.
Experimental setup. Quantum-inspired algorithms require a massive amount of computational resources that are very expensive regarding computational time. For these reasons, we took advantage of the quantum computing mathematical properties to parallelize all the quantum-based methods using CUDA/C++ and a Graphical Processing unit (GPU), particularly the GeForce GTX 1080 Ti GPU.
To test the performance of the optimisation methods, we designed three experiments based on 15 benchmark optimisation functions. The description of each function, the global minimum, and the range for the variables are described in Table 1. All of these functions are two-dimensional minimization problems. Functions 1, 5, and 7 are unimodal, and the rest are multimodal functions.
The common characteristics for all the experiments are as follows. For the ACO, the ξ parameter was set to 1 and the diversification factor to 0.5. The parameter settings for PSO were those specified in 31 . For the GA, QGA, AQGA, and QIAEA each individual was coded using two variables with a resolution of 16 bits for the GA, and 16 qubits for the QIEAs. All the algorithms were executed 40 times for computing statics to compare the methods. Experiment 1. This experiment has two objectives: the first one is to statistically evaluate the performance of the different GA based methods (GA, QGA, AQGA and QIAEA), and the second is to calculate the accuracy of each optimisation algorithm using every function in Table 1. For this experiment, the population size was set to 40 and the number of iterations was fixed to 50. To compare the performance of the proposed method, the mean and the standard deviation of the optimal values in every run, and for each function, were calculated. The results are presented in Table 2 and the best results are indicated in bold with the standard deviation serving as the deciding factor for those cases with the same mean value. Overall, the proposed QIAEA had the best performance in terms of precision and accuracy, with the smallest mean in 10 functions and the lowest standard deviation in 8 functions. The second best algorithm was the classic GA, followed by the AQGA, with the worst being the QGA.
The second objective is to compare the above mentioned algorithms against the ACO and PSO. To achieve this objective, we used an accuracy factor, in which we considered the percentage of hits reached by the algorithm. We f(x * ) = 0.9, x * = (0, 0) [−10, 10]

Six-Hump Camel
(4 4 )  www.nature.com/scientificreports www.nature.com/scientificreports/ defined a hit as a solution within a range of 10 −3 from the true global minimum. The results of the hit accuracy are shown in Table 3. The QIAEA obtained the best results, with an average accuracy of 76.6% over all the functions and the best performance in 11 functions. Out of those, it achieved an accuracy higher than 90% in 8 occasions, reaching 100% in 5 of them. The second best algorithm was the ACO with 54.33% on average, and the worst algorithm was the PSO with an average of 31.88%.

Experiment 2.
For this experiment, we chose all the functions from Table 1 that reached an accuracy lower than 60% in the QIAEA (functions 4, 7, 8, 9, and 13). The population and the number of generations were incremented on the QIAEA until it reached a hit accuracy near 100%. The new values of population size and generations were also used in QGA and AQGA to compare their new performance. As illustrated in Table 4, the highest hit accuracy was obtained by the QIAEA, followed by the AQGA. The accuracy of QIAEA for the most challenging functions was almost 100%, except for function 13 (Trigonometric function), in which the accuracy was 70%. The AQGA was superior only in function 8 with an accuracy of 100%, where the QIAEA obtained 92.5%. For function 13, both QIAEA and AQGA reached 100%, however, the QIAEA had a smaller standard deviation. Experiment 3. The aim of this experiment is to analyse the time complexity of our proposal and compare it against the other QIEA. To achieve a fair comparison, we calculated the average time of execution of the 15 benchmark functions for each algorithm. As Table 2 indicates, the QIAEA was faster than any other QIEA     www.nature.com/scientificreports www.nature.com/scientificreports/ implemented, with an average of 4.37 s, being six times faster than the QGA and AQGA, both with an approximate average of 26.7 s. The QGA is slightly faster than the AQGA because the latter implements the mutation and disaster operators.
Additionally, we evaluated the speed of convergence of each QIEA. To do this, we took every run in which a hit was obtained, and we calculated the number of generations that took that specific run to get a hit. This was done for every function and for each QIEA. Figure 1 shows the distribution in box plots of the convergence rate for each of the quantum-inspired methodologies. The QIAEA has a lower median than the other QIEAs, requiring 11 generations, compared with the 18 generations of the AQGA and 24 generations of the QGA. Although the interquartile space is higher for the QIAEA, Q1 and Q3 are lower for the QIAEA than for the other two methods. Figure 2 illustrates an example of the convergence speed for function 1 of Table 1 using all the evolutionary algorithms. In this figure, the QIAEA reached the objective value goal of 10 −3 in 8 iterations whereas the AQGA and the ACO needed 10 iterations, and the QGA, GA and the PSO needed 20, 25 and 37 iterations, respectively.

Discussion
Classical and quantum computation are intrinsically different. In classical computation, the information is stored in bits, if storing a number needs a 64-bit register, then storing all the possible numbers that this register can hold will require 2 64 ≈ 1.85 × 10 19 number of bits. On the other hand, quantum computing stores information using qubits, every time that we add a qubit the capacity to store information is doubled. Therefore, one quantum register of 64 qubits can store the same information that approximately 1.85 × 10 19 classical bits. This means that to simulate a quantum computer, the amount of memory required by a classical computer to store n qubits is 2 n bits. The aforementioned is an essential issue when working with quantum evolutionary algorithms making the simulation of quantum systems by classical computers viable yet inefficient. Nevertheless, the interest in quantum computing has incremented and it will be in its plateau of productivity in the next ten years 33 , opening the door to the development of new and more efficient quantum evolutionary algorithms.
In this paper, we compared our nature-inspired QIAEA proposal with two quantum evolutionary algorithms, the QGA and the AQGA, and three classical evolutionary algorithms, the GA, the PSO, and the ACO. We implemented three experiments to measure the accuracy and the time complexity of each method. The experiments were performed in 15 well-known benchmark functions broadly used in similar works. We found that in all the proposed experiments, the QIAEA outperformed all the other algorithms in terms of accuracy, precision, and iterations needed to find the optimal value.
The results displayed in Tables 2 and 3, indicate that the QIAEA has higher average accuracy and lower standard deviation than any of algorithm used for the comparison, making the QIAEA a more accurate and precise algorithm for solving the type of problems used in the test. Table 2 shows that the QIAEA outperforms the execution time of the other QIEAs, approximately 611% faster. This speedup lies in the algorithmic structure of the QIAEA, since it only uses one quantum register for any population size, whereas the other quantum genetic algorithms use one quantum register for each individual. Therefore, in the experiments of this paper, the QIAEA used one quantum register while the other quantum algorithms used 40 quantum registers. On top of that, the QIAEA needed a lower amount of iterations to find the optimal value than any other algorithm, see Fig. 2. We considered these two results very important since they show that the QIAEA is more viable to be used in real-world applications than the other QIEAs.
Future work includes the test of the algorithm with multiple objective optimisation problems and combinatorial optimisation, the implementation on engineering and other applied problems, and to test the algorithm on a quantum computer such as IBM 12 .

Data Availability
The authors can provide an executable version of the software for testing and checking the results.