An evolutionary strategy for finding effective quantum 2body Hamiltonians of pbody interacting systems
 78 Downloads
Abstract
Embedding pbody interacting models onto the 2body networks implemented on commercial quantum annealers is a relevant issue. For highly interacting models, requiring a number of ancilla qubits, that can be sizable and make unfeasible (if not impossible) to simulate such systems. In this manuscript, we propose an alternative to minor embedding, developing a new approximate procedure based on genetic algorithms, allowing to decouple the pbody in terms of 2body interactions. A set of preliminary numerical experiments demonstrates the feasibility of our approach for the ferromagnetic pspin model and paves the way towards the application of evolutionary strategies to more complex quantum models.
Keywords
Adiabatic quantum computation Quantum annealing pspin model Genetic algorithms Graph embedding1 Introduction
Finding the solution of NPhard problems requires a timetosolution increasing exponentially as a function of the system size (Cook 1971). NPhard tasks can be studied with adiabatic quantum computation (Farhi et al. 2000; Albash and Lidar 2018), a heuristic tool for finding the optimal solution to this kind of problems. The DWave quantum machines (Harris et al. 2011) can perform finitetime adiabatic quantum computation, or quantum annealing. The superconducting architecture of DWave processors is built on the Chimera graph (Choi 2008; 2011), a sparsely connected graph that can host N ≤ 2048 qubits, with at most 2body interactions. However, many interesting problems, including the ferromagnetic pspin model (Derrida 1981; Gross and Mezard 1984; Bapst and Semerjian 2012), can be mapped on fully connected qubit systems with pbody interactions (p ≥ 2). In order to exploit the available quantum hardware, these problems have to be mapped to effective Hamiltonians (Lucas 2014), containing at most 2body interactions. This necessarily implies the introduction of auxiliary degrees of freedom, or ancillae (Biamonte 2008). The major challenge in this problem is to find the free parameters in the 2body Hamiltonian, corresponding to the pbody one, such that the two Hamiltonians share the same spectral properties (Brell et al. 2011).
In this paper, we show that genetic algorithms can be a powerful tool to optimize the free parameters in the effective 2body model, focusing on the ferromagnetic pspin system. Genetic algorithms are stochastic metaheuristics for finding solutions to optimization problems, inspired by the Darwinian theory of evolution (Goldberg and Holland 1988). The (real) free parameters to optimize, or genes, are arranged in a chromosome. Many such chromosomes, or individuals, compose a population. The fitness of each individual represents its chances of survival along generations. Choosing an appropriate fitness function is the core of genetic algorithms. As shown with more indepth in the following sections, we use the mean square error of the effective spectrum from that of the original Hamiltonian as our fitness function. The idea to apply genetic algorithms is motivated by recent works (O’Driscoll et al. 2019; Hardy and Steeb 2010), where this kind of evolutionary algorithms has been successfully exploited to solve optimization problems in quantum computing domain.
The ferromagnetic pspin model is equivalent to the Grover search algorithm in the limit of large and odd p. However, in this paper, we focus on the very simple cases involving small p (p = 3) that can be also analytically addressed. As shown by a set of preliminary experiments involving two simple configurations of ferromagnetic pspin model, the analytic solutions are wellreproduced by the designed genetic algorithm. Moreover, to ensure the validity of our approach, we also simulate a quantum annealing and study the time evolution of the ground state probability for the pspin system and its effective 2body counterpart.
The rest of the paper is organized as follows. In Section 2, our model Hamiltonian is introduced. In Section 3, the details about the proposed genetic algorithm including chromosome structure and fitness function are given. Section 4 presents the settings and the results of a set of preliminary experiments related to the application of the proposed genetic algorithm to two small instances of the pspin model, which we use as benchmarks for the accuracy of our scheme. Conclusions and improvements to be performed in the future are reported in Section 5.
2 Problem definition
We consider a system of N qubits. The two logical states in the computational basis of qubit i can be equivalently labeled as σ_{i}〉, with σ_{i} = ± 1, or x_{i}〉, with x_{i} = 0,1. The two choices are related by σ_{i} = 1 − 2x_{i}. In the following, we will use the x_{i} representation, unless stated otherwise. We denote by \( {\sigma _{i}^{k}} \), with k = x,y,z, the Pauli matrices acting on the i th qubit. Moreover, we work in natural units and fix \( \hslash = 1\).
Despite the fact that it is analytically solvable, the pspin model is heavily studied in the context of quantum optimization (Seki and Nishimori 2012; Seoane and Nishimori 2012; Susa et al. 2018; Ohkuwa et al. 2018; Passarelli et al. 2018, 2019, 2019) due to its ability to capture the essential feature of NPhard problems, i. e., the exponentially growing timetosolution as a function of N. In fact, when p > 2 and in the thermodynamic limit, the pspin system with the Hamiltonian of Eq. 3 undergoes a firstorder quantum phase transitions that makes its spectral gap Δ close exponentially fast as a function of N (Bapst and Semerjian 2012).
To map the Hamiltonian Eq. 2 to the Hamiltonian Eq. 5 means that the low part of the spectrum of \( H_{\text {p}}^{\prime } \) has to match the spectrum of H_{p}, and all other energy levels must be separated by a large energy gap from the original eigenvalues. Indeed, for the purpose of adiabatic quantum computation, only the ground state and the first excited subspace have to be matched in the purely adiabatic limit. However, in this paper, we will always aim at matching the first L = 2^{N} eigenvalues of \( H_{\text {p}}^{\prime } \) and all the original spectrum. We stress that even if the lowenergy subspace of \( H_{\text {p}}^{\prime } \) correctly reproduces the spectrum of H_{p}, the quantum dynamics could be different. However, this mapping allows to solve the original optimization problem, through an experimentally viable effective model.
3 A genetic algorithm for optimizing Hamiltonian free parameters
This section is devoted to present the application of genetic algorithms for finding the free parameters useful for mapping pbody interacting systems in the 2body Hamiltonian. Genetic algorithms are populationbased metaheuristics which try to solve an optimization (or search) problem by manipulating a multiset of potential solutions and reproducing the natural selection process involving living beings. In detail, as natural selection process leads to the survival of only the fittest individuals (i. e., those capable of adapting to the changing environment), so the genetic algorithms perform an evolution process that leads to the survival of only the fittest solutions (i. e., those that better solve the optimization problem). Specifically, genetic algorithms operate on encoded representations of the solutions, called chromosomes. To determine how good a solution is, a method named fitness function is used to reflect the capability of the solution to solve the problem. In general, the workflow of a genetic algorithm includes the following steps. Firstly, a population of chromosomes is generated randomly and evaluated by using the fitness function. Successively, the algorithm performs a set of generations until some termination criteria are satisfied. In each generation, a set of chromosomes is selected to survive (parent selection mechanism) and reproduce by means of the crossover operator. Generally, this operator takes in input two chromosomes (parent) and gives in output two new chromosomes (offspring) by exchanging portions of the parents. As in the natural evolution process, some mutations can occur. The mutation operator performs by randomly changing some of the genes in the chromosomes. Both mutation and crossover operators are stochastic procedures that are applied according to a probability, named mutation probabilityp_{mut} and crossover probabilityp_{cx}, respectively. As for the termination criteria, the most common one is the achievement of a maximum number of generations. Therefore, in this paper, we use this termination criterion.
Starting from this description, in order to implement a genetic algorithm for our problem, it is necessary to define the chromosome structure, the fitness function, and the used genetic operators. Hereafter, a detailed description of the genetic algorithm components is given.
3.1 Chromosome structure
3.2 Fitness function
3.3 Genetic operators
Once defined the chromosome structure and the fitness function, it is necessary to discuss about the genetic operators, that is, crossover, mutation, and selection mechanism. In the literature, different kinds of crossover, mutation, and selection operators have been defined (Yao 1993; Herrera et al. 2003). However, when a new problem is addressed with genetic algorithms, it is necessary to select the most opportune configuration for these operators. For this reason, in this paper, we perform a design study of the implemented genetic algorithm aimed at selecting the most opportune configuration for the problem at issue. In detail, this study has involved the investigation of two different crossover operators, that is, the onepoint crossover and the two pointcrossover, different Gaussian distributions for mutation operator, and different values for tournament size for the selection mechanism. The results of this design study are reported in the next section. To conclude, in this section, we give more details about the investigated genetic operators.
 Crossover operators.

Generally, the crossover operator works by combining portions of two chromosomes, denoted as parents. In this work, we investigate two different strategies, i. e., one and twopoint crossovers. In detail, the one point crossover chooses a random number r in the range [1,D − 1] (with D the length of the chromosome), and then splits both parents at this point by creating the two children by exchanging the tails. Instead, the twopoint crossover chooses two random numbers r_{1} and r_{2} in the range [1,D − 1] and breaks parents in these two points by creating the children by taking alternative segments from the parents.
 Mutation.

Generally, the mutation operator works by changing values of chromosome genes randomly. The Gaussian mutation chooses values drawn from a Gaussian distribution with zero mean and standard deviation σ. In this work, we investigate several values for σ, i. e., σ = 0.2,0.4,0.6,0.8,and 1.0.
 Selection.

Selection mechanism is devoted to select the chromosomes that will become parents of the next generation. One of the most known selection operators is the tournament mechanism which selects each parent by performing a tournament among N_{T} chromosomes, randomly selected, where the chromosome that wins is the fittest one. In this work, we investigate N_{T} = 2,3,and 5.
4 Preliminary experiments and results
This section is devoted to show the results of some preliminary experiments carried out to demonstrate the feasibility of the proposed approach. In detail, the designed genetic algorithm is applied to solve two simple configurations of the ferromagnetic pspin model. This choice is due to the possibility to analytically solve these configurations and perform a comparison with the output of the genetic algorithm. The configuration of the applied genetic algorithm is the result of a design study involving the genetic operators described in Section 3.3. The comparison between the solution obtained by the designed genetic algorithm and that computed analytically is carried out by considering the energy eigenvectors and eigenvalues of the first 2^{N} Hamiltonian states, as well as the Hamiltonian free parameters. Moreover, the use of the solution obtained by the genetic algorithm is investigated for the adiabatic quantum computation with respect to the original pspin model. Hereafter, more details about the considered configurations of the ferromagnetic pspin model, the design study, the comparison results, and the exploitation of genetic solutions in the adiabatic quantum computation are given.
4.1 Experimental setup
These two cases are selected because it is possible to work out by hand the analytic solution for these settings with little effort and, this is useful for carrying out the comparison study with the designed genetic algorithm. We report the analytic solutions below.
4.2 Design study
Combinations of genetic operators investigated in the design study. 1P (2P) stands for onepoint (twopoint) crossover
No.  Crossover  σ  N_{T}  No.  Crossover  σ  N_{T} 

1  1P  0.2  2  16  2P  0.2  2 
2  1P  0.2  3  17  2P  0.2  3 
3  1P  0.2  5  18  2P  0.2  5 
4  1P  0.4  2  19  2P  0.4  2 
5  1P  0.4  3  20  2P  0.4  3 
6  1P  0.4  5  21  2P  0.4  5 
7  1P  0.6  2  22  2P  0.6  2 
8  1P  0.6  3  23  2P  0.6  3 
9  1P  0.6  5  24  2P  0.6  5 
10  1P  0.8  2  25  2P  0.8  2 
11  1P  0.8  3  26  2P  0.8  3 
12  1P  0.8  5  27  2P  0.8  5 
13  1P  1.0  2  28  2P  1.0  2 
14  1P  1.0  3  29  2P  1.0  3 
15  1P  1.0  5  30  2P  1.0  5 
Genetic algorithms are stochastic procedures; thus, we repeat the simulation 100 times for every combinations.
By analyzing Fig. 3, for N = 3, M = 4, the best median of the fitness values (the minimum one) is the combination 18, i. e., the combination involving the twopoint crossover, the Gaussian mutation with σ = 0.2 and tournament selection with N_{T} = 5. Instead, for N = 4 and M = 6, the configuration 2 is the one yielding the smallest median fitness value, i. e., the combination involving onepoint crossover, σ = 0.2 and N_{T} = 3.
4.3 Results
The results of the comparison between the best chromosome obtained by the genetic algorithm and the analytically computed solution for N = 3, M = 4 problem. We fixed δ = 50
Free parameters  Eigenvectors  Eigenvalues  

Analytic  Genetic  Analytic  Genetic  Analytic  Genetic 
− 3  − 2.99919  [0, 0, 0]  [0, 0, 0, 0]  − 3.00000  − 2.99919 
− 150  − 150.853  [0, 0, 1]  [0, 1, 0, 0]  − 0.11111  − 0.11138 
26/9  2.88781  [0, 1, 0]  [0, 0, 0, 1]  − 0.11111  − 0.11129 
26/9  2.88795  [1, 0, 0]  [0, 0, 1, 0]  − 0.11111  − 0.11124 
26/9  2.88790  [0, 1, 1]  [1, 1, 1, 0]  0.11111  0.11111 
100  100.720  [1, 0, 1]  [0, 1, 0, 1]  0.11111  0.11120 
100  101.118  [1, 1, 0]  [0, 0, 1, 1]  0.11111  0.11120 
16/3  5.33174  [1, 1, 1]  [1, 1, 1, 1]  3.00000  2.99999 
− 158/3  − 53.6496  
− 8/3  − 2.66531  
− 8/3  − 2.66545 
The results of the comparison between the best chromosome obtained by the genetic algorithm and the analytically computed solution for N = 4, M = 6 problem. We fixed δ = 50
Free parameters  Eigenvectors  Eigenvalues  

Analytic  Genetic  Analytic  Genetic  Analytic  Genetic 
− 4  − 3.99450  [0, 0, 0, 0]  [0, 0, 0, 0, 0, 0]  − 4.0  − 3.99450 
− 150  − 148.165  [0, 0, 0, 1]  [0, 0, 0, 0, 1, 0]  − 0.5  − 0.53947 
− 150  − 144.833  [0, 0, 1, 0]  [0, 0, 1, 0, 0, 0]  − 0.5  − 0.52837 
7/2  3.46613  [0, 1, 0, 0]  [0, 0, 0, 0, 0, 1]  − 0.5  − 0.47565 
7/2  3.54304  [1, 0, 0, 0]  [0, 0, 0, 1, 0, 0]  − 0.5  − 0.45146 
7/2  3.45503  [0, 0, 1, 1]  [1, 0, 1, 1, 0, 0]  − 0.0  − 0.03157 
7/2  3.51886  [0, 1, 0, 1]  [0, 0, 0, 1, 0, 1]  − 0.0  − 0.02561 
0  − 0.02015  [0, 1, 1, 0]  [0, 0, 1, 0, 0, 1]  − 0.0  − 0.01985 
100  96.397  [1, 0, 0, 1]  [0, 0, 1, 0, 1, 0]  − 0.0  − 0.01965 
100  95.7088  [1, 0, 1, 0]  [0, 0, 0, 1, 1, 0]  − 0.0  0.00748 
3  2.98789  [1, 1, 0, 0]  [0, 1, 0, 0, 1, 1]  − 0.0  0.04105 
3  3.12228  [0, 1, 1, 1]  [1, 0, 1, 1, 1, 0]  0.5  0.46894 
3  2.91879  [1, 0, 1, 1]  [0, 1, 1, 0, 1, 1]  0.5  0.46932 
3  3.04070  [1, 1, 0, 1]  [1, 0, 1, 1, 0, 1]  0.5  0.50621 
100  97.8836  [1, 1, 1, 0]  [0, 1, 0, 1, 1, 1]  0.5  0.53568 
100  97.9453  [1, 1, 1, 1]  [1, 1, 1, 1, 1, 1]  4.0  4.00773 
− 53  − 58.5698  
− 3  − 2.94631  
− 3  − 3.01034  
− 3  − 2.99610  
− 3  − 3.09301  
− 53  − 56.9343 
4.4 Discussion for adiabatic quantum computation
The genetic 2body model can be used for adiabatic quantum computation, with the timedependent Hamiltonian of Eq. 3, and compared with the original pspin model, or with the analytic 2body model. In this last part, we focus on N = 3, M = 4 for computational ease. We performed the same analysis also for N = 4, M = 6 with similar results. For the purpose of quantum optimization, it is paramount that the fidelity Φ, i. e., the ground state occupation probability at the end of the annealing (s = 1), is large. Of course, due to the larger number of degrees of freedom of the effective model with ancillae, we expect that a slower annealing is needed to reach the target ground state, compared with the original pspin model.
5 Conclusions and future research directions
Using a genetic algorithm, we have mapped the ferromagnetic pspin Hamiltonian into a Hamiltonian with only 2body interactions. We have shown, in two analytically solvable cases, that our strategy can successfully be used for this task. In fact, the energy eigenvalues and eigenvectors of the first 2^{N} states of the original Hamiltonian are correctly reproduced, with rms (Eq. 16) of ≈ 1.19 × 10^{− 3} for the best combination of genetic operators for the case of M = 4. However, the considered configurations of the ferromagnetic pspin model are the simplest ones. In the future, a wider experimentation involving higher configurations (i. e., larger integral values for N and p) will be carried out to show the benefits of our proposal, compared with other existing techniques (Tanahashi et al. 2019). Since higher configurations represent harder problem instances, dealing with them could require to change genetic algorithm parameters by increasing, for example, the population size or the number of maximum generations. Moreover, the complexity of dealing with higher configurations could open the doors to the application of new evolutionary algorithms such as memetic algorithms (Moscato 1989), i. e., populationbased metaheuristics combining global search with local search procedures. Finally, for larger systems, the required number of ancillae becomes nontrivial and, as a consequence, improvements should be done to address also this problem. We could also use our technique to predict the minimum number of ancillae required for the embedding, in the case of large systems where the analytical mapping could be cumbersome.
Genetic algorithms can have countless applications in the context of adiabatic quantum computation. These include the derivation of simpler effective models, or the optimization of adiabatic paths as in quantum optimal control (Rezakhani et al. 2009; del Campo and Kim 2019).
Notes
References
 Albash T, Lidar DA (2018) ., vol 90. https://doi.org/doi/10.1103/RevModPhys.90.015002
 Bapst V, Semerjian G (2012) . Journal of Statistical Mechanics: Theory and Experiment 2012(06):P06007. http://stacks.iop.org/17425468/2012/i=06/a=P06007 CrossRefGoogle Scholar
 Biamonte JD (2008) . Phys Rev A 77:052331. https://doi.org/doi/10.1103/PhysRevA.77.052331 MathSciNetCrossRefGoogle Scholar
 Brell CG, Flammia ST, Bartlett SD, Doherty AC (2011) . New J Phys 13(5):053039. https://doi.org/10.1088/13672630/13/5/053039 CrossRefGoogle Scholar
 Choi V (2008) . Quantum Inf Process 7(5):193. https://doi.org/10.1007/s1112800800829 MathSciNetCrossRefGoogle Scholar
 Choi V (2011) . Quantum Inf Process 10(3):343. https://doi.org/10.1007/s1112801002003 MathSciNetCrossRefGoogle Scholar
 Cook SA (1971) .. In: Proceedings of the 3rd annual ACM symposium on theory of computing. STOC ’71. ACM, New York, pp 151–158, https://doi.org/10.1145/800157.805047, (to appear in print)
 del Campo A, Kim K (2019) . New J Phys 21(5):050201. https://doi.org/10.1088/13672630/ab1437 CrossRefGoogle Scholar
 Derrida B (1981) . Phys Rev B 24:2613. https://doi.org/doi/10.1103/PhysRevB.24.2613 MathSciNetCrossRefGoogle Scholar
 Farhi E, Goldstone J, Gutmann S, Sipser M (2000) . arXiv:quantph/0001106
 Goldberg DE, Holland JH (1988) . Mach Learn 3(2):95. https://doi.org/10.1023/A:1022602019183 CrossRefGoogle Scholar
 Gross D, Mezard M (1984) . Nucl Phys B 240(4):431. https://doi.org/10.1016/05503213(84)902372. http://www.sciencedirect.com/science/article/pii/0550321384902372 CrossRefGoogle Scholar
 Grover LK (1996) In Proceedings of the Twentyeighth annual ACM symposium on theory of computing (ACM, 1996), STOC ’96, pp 212–219. http://doi.acm.org/10.1145/237814.237866
 Hardy Y, Steeb W H (2010) . Int J Modern Phys C 21(11):1359CrossRefGoogle Scholar
 Harris R, Berkley A J, Johansson J, Bunyk P, Chapple E M, Enderud C, Hilton J P, Karimi K, Ladizinsky E, Ladizinsky N, Oh T, Perminov I, Rich C, Thom M C, Tolkacheva E, Truncik C J S, Uchaikin S, Wang J, Wilson B, Rose G (2011) . Nature 473:194CrossRefGoogle Scholar
 Hauke P, Katzgraber H G, Lechner W, Nishimori H, Oliver WD (2019) . arXiv:1903.06559
 Herrera F, Lozano M, Sánchez AM (2003) . International Journal of Intelligent Systems 18:309CrossRefGoogle Scholar
 Leib M, Zoller P, Lechner W (2016) . Quantum Sci Technol 1(1):015008. https://doi.org/10.1088/20589565/1/1/015008 CrossRefGoogle Scholar
 Lucas A (2014) . Frontiers in Physics 2:5. https://doi.org/10.3389/fphy.2014.00005. https://www.frontiersin.org/article/10.3389/fphy.2014.00005 CrossRefGoogle Scholar
 Moscato P (1989) Caltech concurrent computation program. C3P Report 826:1989Google Scholar
 O’Driscoll L, Nichols R, Knott PA (2019) Quantum Machine Intelligence. https://doi.org/10.1007/s42484019000038 CrossRefGoogle Scholar
 Ohkuwa M, Nishimori H, Lidar DA (2018) . Phys Rev A 98:022314. https://doi.org/doi/10.1103/PhysRevA.98.022314 CrossRefGoogle Scholar
 Passarelli G, De Filippis G, Cataudella V, Lucignano P (2018) . Phys Rev A 97:022319. https://doi.org/doi/10.1103/PhysRevA.97.022319 CrossRefGoogle Scholar
 Passarelli G, Cataudella V, Lucignano P (2019) Improving quantum annealing of the ferromagnetic pspin model through pausing. Phys Rev B 100(2):024302. https://doi.org/10.1103/PhysRevB.100.024302. https://doi.org/doi/10.1103/PhysRevB.100.024302 CrossRefGoogle Scholar
 Passarelli G, De Filippis G, Cataudella V, Lucignano P. (2019) . arXiv:1901.07787
 Rezakhani A T, Kuo W J, Hamma A, Lidar D A, Zanardi P (2009) . Phys Rev Lett 103:080502. https://doi.org/10.1103/PhysRevLett.103.080502 CrossRefGoogle Scholar
 Seki Y, Nishimori H (2012) . Phys Rev E 85:051112. https://doi.org/doi/10.1103/PhysRevE.85.051112 CrossRefGoogle Scholar
 Seoane B, Nishimori H (2012) . Journal of Physics A: Mathematical and Theoretical 45(43):435301. http://stacks.iop.org/17518121/45/i=43/a=435301 MathSciNetCrossRefGoogle Scholar
 Susa Y, Yamashiro Y, Yamamoto M, Hen I, Lidar DA, Nishimori H (2018) . Phys Rev A 98:042326. https://doi.org/doi/10.1103/PhysRevA.98.042326 CrossRefGoogle Scholar
 Tanahashi K, Takayanagi S, Motohashi T, Tanaka S (2019) . Journal of the Physical Society of Japan 88(6):061010. https://doi.org/10.7566/JPSJ.88.061010 CrossRefGoogle Scholar
 Yao X (1993) . Microprocessing and Microprogramming 38(1):707. https://doi.org/10.1016/01656074(93)902157. http://www.sciencedirect.com/science/article/pii/0165607493902157. Proceedings Euromicro 93 Open System Design: Hardware, Software and ApplicationsMathSciNetCrossRefGoogle Scholar