# Quadratic constrained mixed discrete optimization with an adiabatic quantum optimizer

###### Abstract

We extend the family of problems that may be implemented on an adiabatic quantum optimizer (AQO). When a quadratic optimization problem has at least one set of discrete controls and the constraints are linear, we call this a quadratic constrained mixed discrete optimization (QCMDO) problem. QCMDO problems are NP-hard, and no efficient classical algorithm for their solution is known. Included in the class of QCMDO problems are combinatorial optimization problems constrained by a linear partial differential equation (PDE) or system of linear PDEs. An essential complication commonly encountered in solving this type of problem is that the linear constraint may introduce many intermediate continuous variables into the optimization while the computational cost grows exponentially with problem size. We resolve this difficulty by developing a constructive mapping from QCMDO to quadratic unconstrained binary optimization (QUBO) such that the size of the QUBO problem depends only on the number of discrete control variables. With a suitable embedding, taking into account the physical constraints of the realizable coupling graph, the resulting QUBO problem can be implemented on an existing AQO. The mapping itself is efficient, scaling cubically with the number of continuous variables in the general case and linearly in the PDE case if an efficient preconditioner is available.

## I Introduction

Quadratic unconstrained binary optimization (QUBO) is the set of problems for which the objective functional is quadratic in binary variables that are otherwise unconstrained. QUBO is NP-hard from a computational complexity perspective Barahona (1982). A number of interesting problems can be mapped to QUBO form, including those from the fields of image recognition Neven et al. (2008a), machine learning Neven et al. (2008b), protein folding Perdomo-Ortiz et al. (2012), and number theory Gaitan and Clark (2012); Bian et al. (2013). As the membership of useful problems in QUBO has grown, interest has intensified to develop QUBO solvers that can practically solve problems of increasing complexity. Adiabatic quantum optimization (AQO) is an alternative to standard classical heuristic algorithms for solving QUBO problems. In AQO, or quantum annealing, a system is initialized into the easily-prepared ground state of some initial Hamiltonian , and then this Hamiltonian is slowly distorted into a final problem Hamiltonian Finnila et al. (1994); Kadowaki and Nishimori (1998). The Hamiltonian is constructed such that its ground state corresponds to the solution of an optimization problem of interest. By the adiabatic theorem, if the Hamiltonian is modified sufficiently slowly, the system will remain at all times in the ground state of the instantaneous Hamiltonian Lidar et al. (2009). At the conclusion of the interpolation, the system can be measured to read out the solution. For certain problems, quantum annealing is known to provide a speedup over classical algorithms Somma et al. (2012), but the extent of problems for which quantum annealing performs faster than any known classical algorithm is still unknown. Recently, considerable attention has been devoted to answering whether an AQO can provide a speedup for solving QUBO Boixo et al. (2013, 2014); McGeoch and Wang (). An AQO platform is currently available on which QUBO problems can be implemented Johnson et al. (2011). Though it is currently an open question whether such an AQO platform will provide a qualitative and scalable speedup in solving QUBO over classical algorithms, developing new problems that such a device can implement motivates research in this area.

In this work, we consider the set of problems where the objective function is quadratic, the constraints are linear, some of the controls are discrete, and other controls may be continuous. We call this quadratic constrained mixed discrete optimization (QCMDO). QCMDO problems appear in a number of contexts, notably where the constraints are given by a linear partial differential equation (PDE) or system of linear PDEs, including gas/water network flow optimization Martin et al. (2006); Hante and Leugering (2009); Geißler et al. (2011), traffic optimization Fügenschuh et al. (2006), and microchip cooling optimization Xu et al. (2007). QCMDO is also NP-hard, as it contains QUBO. Linearly-constrained problems with only continuous controls are tractable because of their convex structure. However, the discrete nature of the controls in QCMDO destroys convexity.

We show that QCMDO can be mapped efficiently into quadratic unconstrained discrete optimization, which in some cases may then be efficiently mapped to QUBO. This mapping adds to the family of interesting problems that may be implemented on an AQO for which the problem Hamiltonian takes the form of a classical Ising model. If indeed an AQO were to provide a speedup over classical QUBO solvers, this speedup would translate directly to faster solution of QCMDO problems as well. However, notwithstanding such a speedup this mapping may serve as a useful method of casting the problem for standard classical solvers as well, since the dimensional reduction of the mapping efficiently removes a potentially very large set of auxiliary degrees of freedom from the problem.

## Ii Mapping QCMDO to QUBO

The general form of a complex QCMDO problem is

(1) |

The objective function is defined by Hermitian and . Linear constraints are defined by and . Each of the variables, , is restricted to a set that is either or a finite subset of . Without loss of generality, we partition into discrete variables, , and continuous variables, , with compatible block structure induced in , , and :

and . To ensure satisfiability of the linear constraints, we assume that and has linearly independent rows. Without this assumption, not all values of are guaranteed to respect the linear constraints.

We remove the linear constraints in Eq. (1) using the singular value decomposition (SVD) of ,

(2) |

where and are unitary, and is diagonal positive-definite. The restricted form of that satisfies the linear constraints is

(3) |

with a matrix pseudoinverse, , denoted by ‘’. The constrained optimization over is reduced to an unconstrained optimization over ,

(4) | |||

with induced ‘’ and ‘’ block structure in and .

For the minimization over to be bounded, must be positive semidefinite. If has a nullspace, it must be orthogonal to for all . The nullspace then has no effect on the optimization and we choose the minimizer .

A natural midpoint of the mapping is the remaining quadratic unconstrained discrete optimization over ,

(5) |

Assuming the standard cost of dense linear algebra, mapping Eq. (1) to Eq. (II) requires operations.

The discrete-to-binary mapping is less straightforward. We only consider linear maps of the form for that decompose into for , where each discrete variable has its own binary subvector. The best-case scenario of this form is when each choice of subvector produces a valid element of . An example of this is when is evenly-spaced numbers with spacing and . The worst-case scenario is when there is one binary variable for each distinct element of with and , and a penalty is needed to enforce . These two cases set bounds, . Other efficient mappings may be possible.

In terms of Eq. (II), the final QUBO form of Eq. (1) is

(6) | |||

In the worst-case scenario mentioned above, for each block constrained to one may add a block diagonal penalty to with on the off-diagonals and - on the diagonals, and add to where for the unpenalized . Note that the optimal value of the objective functional is the same for Eqs. (1) and (6). Because QCMDO contains QUBO, it is at least as hard as QUBO, which is NP-hard.

The solution to the QUBO problem in Eq. (6) can be encoded as a computational basis state, , in a -qubit Hilbert space. is the final ground state of an AQO Hamiltonian with linear couplings and both linear and quadratic couplings,

(7) | ||||

We initialize the AQO to , for , and monotonically increase from 0 to 1 as the time, , is varied from to . The maximum coupling strength is normalized to a unit magnitude corresponding to the largest realizable coupling within the AQO. The ground state energy gap is initially 2, and the runtime, , depends on the minimum gap, the desired accuracy, and the form of Lidar et al. (2009).

### ii.1 PDE-constrained combinatorial optimization

An important class of QCMDO problems are those with constraints derived from a discretized linear PDE or system of linear PDEs. Accurate discretization of the PDE often requires a large number of auxiliary variables, and it is desirable to perform a dimensional reduction that eliminates these variables from the problem. We term the following subclass of QCMDO problems PDE-constrained combinatorial optimization, in analogy with the field from which such problems frequently arise. However, a problem of this type may also originate from a non-PDE linear constraint.

We consider the case where a small observation vector, , is to be optimized to match a design vector, , relative to a positive definite metric matrix, ,

(8) |

The observation vector is related to a field vector, , through a measurement matrix, . The field vector satisfies a PDE constraint, , where is an invertible discretized PDE operator, are uncontrollable boundary values, and linearly relates the discrete controls to the controllable boundary values.

This problem written in the form of Eq. (1) is

(9) |

Since is invertible, has no nullspace and terms containing do not appear. In this notation, the continuous variable block, ‘’, is split into ‘’ and ‘’ with . For large , greater-than-linear costs in are often infeasible. However, the unconstrained form of Eq. (II) is simple for this class,

(10) | ||||

Assuming that is sparse or structured, can be calculated efficiently using iterative linear solvers in operations per iteration and with few iterations if a good preconditioner is known. The remaining algebra needs operations.

If and we are free to choose , then

(11) |

for any positive definite diagonal produces a diagonal that reduces the problem to a trivial independent optimization over each discrete variable.

#### ii.1.1 PDE-constrained QCMDO is NP-hard

Though the mapping from QCMDO to QUBO is more efficient in the PDE-constrained case, this does not alter the computational complexity of the resulting QUBO problem. To prove this assertion, we show that the NP-hard Max-Cut problem efficiently reduces to a problem of the form in Eq. (8).

First, we show that Max-Cut can be expressed as an instance of QUBO. Given a graph with vertices, the graph Laplacian is an positive-semidefinite matrix equal to the degree matrix of minus its adjacency matrix Merris (1994). It is simple to show that the problem is equivalent to the Max-Cut problem, which is NP-hard Garey et al. (1976). We can transform this problem from a maximization into a minimization trivially by taking . Let denote the maximum vertex degree of the graph . Then, adding the diagonal matrix to makes positive semidefinite, since the eigenvalues of are bounded above by Anderson and Morley (1985). This modification introduces a constant offset, , and does not alter the minimizing . Letting ‘’ denote equivalent problems,

Max-Cut | (12) | ||||

where is the vector of all ones and . To show that for any positive semidefinite and arbitrary this problem efficiently reduces to some PDE-constrained QCMDO problem, we simply consider a case where the interior domain governed by the PDE is reduced in size and eventually eliminated, leaving only Dirichlet boundary conditions applied to a vector of boundary points. In this case the matrix representation of the PDE is trivial, with . We take the metric to be . If we let , then we achieve the unconstrained form of the PDE-constrained QCMDO problem in Eq. (10),

(13) |

for , chosen such that . We have shown that the Max-Cut problem for any given graph can be efficiently mapped to a corresponding PDE-constrained QCMDO problem. Consequently, PDE-constrained QCMDO is NP-hard.

## Iii Example

To illustrate the QCMDO-to-QUBO mapping with a PDE constraint, we consider a potential, , on a square domain, , governed by the Poisson equation, , with on the boundary. The charge density is constrained to a set of Gaussians positioned on a sublattice of a regular lattice,

(14) | ||||

Our goal is to determine by measuring eigenmodes of the potential, , with eigenvalues for . For , this problem is underdetermined. The discrete nature of is necessary for reconstruction of from an incomplete set of measurements.

To put this example into the form of Eq. (10), we discretize the potential on a square grid with a grid spacing of and use a spectral representation of ,

(15) | ||||

We examine a case for , , and with randomly assigned charges. In Fig. 1 we plot the measured potentials and charge configurations for an optimal (ground state) and best sub-optimal solution (first excited state). This example is chosen for its large Hamming distance of 16 between the vectors of the ground and excited states. The measured potential is constructed by summing the measured eigenmodes with their coefficients. The similarity between potentials of distinct charge distributions is the result of an effective low-pass filtering and highlights the combinatorial difficulty of this optimization problem.

## Iv AQO implementation issues

The difficulty of an optimization problem in an AQO implementation grows with the inverse of the minimum energy gap of Eq. (7) along the adiabatic path. In addition, the final energy gap determines how sensitive the global optimum is to errors in the couplings. A disparity between these gaps indicates a numerically well-defined global optimum that is difficult to prepare through the prescribed adiabatic path. We simulate the AQO implementation of Eq. (15) in the Hamiltonian of Eq. (7) with exact diagonalization on a classical computer with results summarized in Fig. 2. Samples are organized into two populations according to whether or not the Hamming distance between the ground and first excited state charge distributions is . Observed non-unity Hamming distances range from to , with larger Hamming distances correlating well with smaller minimum and final gaps. For the example shown in Fig. (1), the final gap is and the minimum gap is .

The matrix parameterizing the quadratic term of the QUBO objective function is dense, in general. In order to implement this QUBO problem on an AQO, the complete coupling graph describing the problem must be embedded into a hardware-realizable coupling graph. This problem is known as minor embedding Choi (2008, 2011). Hardware limitations typically include constraints on the spatial locality of the couplings and on the degree of the coupling graph. The embedding step leads to an overhead in both the number of qubits required Choi (2011) and the strength (or equivalently, precision) of the qubit-qubit couplings Choi (2008). For the hardware graph implemented on the D-Wave device Harris et al. (2010), for example, embedding a complete graph incurs a quadratic overhead in the number of qubits Choi (2011); Klymko et al. (2014). We note that the largest problem size of 25 qubits that we have studied with exact diagonalization in Sec. III may be embedded into the Chimera graph of the 512 qubit D-Wave 2 device, using the complete graph embedding algorithm of Klymko, et al. Klymko et al. (2014).

A necessary condition for the Hamiltonian embedding to be successful is that the ground state of the Hamiltonian as implemented be equivalent to the solution of the original QUBO problem. However, finite precision in the coupling parameters may lead to errors of the form of implementing a perturbed Hamiltonian with a different ground state. In addition, during the quantum annealing process excitations due to non-adiabaticity and coupling to the environment will lead to suppressed occupation of the ground state. As a result, the annealing step may need to be repeated many times in order to obtain a sufficiently large probability of measuring the optimal solution Boixo et al. (2014).

## V Conclusion

In this work, we have extended the class of problems that may be implemented on an adiabatic quantum optimizer (AQO) to include quadratic constrained mixed discrete optimization (QCMDO). QCMDO corresponds to those optimization problems for which the objective functional is quadratic, the constraints are linear, and the optimization parameters are a mix of continuous and discrete controls. We construct an efficient dimension-reducing mapping from any given QCMDO problem to a quadratic unconstrained binary optimization (QUBO) problem, which may then be implemented on an existing AQO. Included in the class of QCMDO problems are those for which the linear constraint is given by a linear partial differential equation (PDE) or system of linear PDEs. This mapping is suitable for use by either an AQO or a standard classical solver.

## Acknowledgements

We thank Ojas Parekh and Denis Ridzal for informative discussions. This work was supported by the Laboratory Directed Research and Development program at Sandia National Laboratories. Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy National Nuclear Security Administration under contract DE-AC04-94AL85000.

## References

- Barahona (1982) F. Barahona, Journal of Physics A: Mathematical and General 15, 3241 (1982).
- Neven et al. (2008a) H. Neven, G. Rose, and W. G. Macready, arXiv:0804.4457 (2008a).
- Neven et al. (2008b) H. Neven, V. S. Denchev, G. Rose, and W. G. Macready, arXiv:0811.0416 (2008b).
- Perdomo-Ortiz et al. (2012) A. Perdomo-Ortiz, N. Dickson, M. Drew-Brook, G. Rose, and A. Aspuru-Guzik, Sci. Rep. 2 (2012).
- Gaitan and Clark (2012) F. Gaitan and L. Clark, Phys. Rev. Lett. 108, 010501 (2012).
- Bian et al. (2013) Z. Bian, F. Chudak, W. G. Macready, L. Clark, and F. Gaitan, Phys. Rev. Lett. 111, 130505 (2013).
- Finnila et al. (1994) A. Finnila, M. Gomez, C. Sebenik, C. Stenson, and J. Doll, Chemical Physics Letters 219, 343 (1994).
- Kadowaki and Nishimori (1998) T. Kadowaki and H. Nishimori, Phys. Rev. E 58, 5355 (1998).
- Lidar et al. (2009) D. A. Lidar, A. T. Rezakhani, and A. Hamma, J. Math. Phys. 50, 102106 (2009).
- Somma et al. (2012) R. D. Somma, D. Nagaj, and M. Kieferová, Phys. Rev. Lett. 109, 050501 (2012).
- Boixo et al. (2013) S. Boixo, T. Albash, F. M. Spedalieri, N. Chancellor, and D. A. Lidar, Nat Commun 4 (2013).
- Boixo et al. (2014) S. Boixo, T. F. Ronnow, S. V. Isakov, Z. Wang, D. Wecker, D. A. Lidar, J. M. Martinis, and M. Troyer, Nat Phys 10, 218 (2014).
- (13) C. C. McGeoch and C. Wang, Proceedings of the ACM International Conference on Computing Frontiers, Ischia, Italy, May 13-14, 2013, Article No. 23 .
- Johnson et al. (2011) M. W. Johnson, M. H. S. Amin, S. Gildert, T. Lanting, F. Hamze, N. Dickson, R. Harris, A. J. Berkley, J. Johansson, P. Bunyk, E. M. Chapple, C. Enderud, J. P. Hilton, K. Karimi, E. Ladizinsky, N. Ladizinsky, T. Oh, I. Perminov, C. Rich, M. C. Thom, E. Tolkacheva, C. J. S. Truncik, S. Uchaikin, J. Wang, B. Wilson, and G. Rose, Nature 473, 194 (2011).
- Martin et al. (2006) A. Martin, M. Möller, and S. Moritz, Mathematical Programming 105, 563 (2006).
- Hante and Leugering (2009) F. M. Hante and G. Leugering, HSCC (2009).
- Geißler et al. (2011) B. Geißler, O. Kolb, J. Lang, G. Leugering, A. Martin, and A. Morsi, Mathematical Methods of Operations Research 73, 339 (2011).
- Fügenschuh et al. (2006) A. Fügenschuh, M. Herty, A. Klar, and A. Martin, SIAM Journal on Optimization 16, 1155 (2006).
- Xu et al. (2007) X. Xu, X. Liang, and J. Ren, International Journal of Heat and Mass Transfer 50, 1675 (2007).
- Merris (1994) R. Merris, Linear Algebra and its Applications 197-198, 143 (1994).
- Garey et al. (1976) M. Garey, D. Johnson, and L. Stockmeyer, Theoretical Computer Science 1, 237 (1976).
- Anderson and Morley (1985) W. N. Anderson and T. D. Morley, Linear and Multilinear Algebra 18, 141 (1985).
- Choi (2008) V. Choi, Quantum Information Processing 7, 193 (2008).
- Choi (2011) V. Choi, Quantum Information Processing 10, 343 (2011).
- Harris et al. (2010) R. Harris, M. W. Johnson, T. Lanting, A. J. Berkley, J. Johansson, P. Bunyk, E. Tolkacheva, E. Ladizinsky, N. Ladizinsky, T. Oh, F. Cioata, I. Perminov, P. Spear, C. Enderud, C. Rich, S. Uchaikin, M. C. Thom, E. M. Chapple, J. Wang, B. Wilson, M. H. S. Amin, N. Dickson, K. Karimi, B. Macready, C. J. S. Truncik, and G. Rose, Phys. Rev. B 82, 024511 (2010).
- Klymko et al. (2014) C. Klymko, B. Sullivan, and T. Humble, Quantum Information Processing 13, 709 (2014).