This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

A quantum-inspired tensor network method for constrained combinatorial optimization problems

Tianyi Hao Department of Computer Science, Stanford University, Stanford, California 94305, USA    Xuxin Huang Department of Applied Physics, Stanford University, Stanford, California 94305, USA Stanford Institute for Materials and Energy Sciences, SLAC National Accelerator Laboratory, Menlo Park, California 94025, USA    Chunjing Jia [email protected] Stanford Institute for Materials and Energy Sciences, SLAC National Accelerator Laboratory, Menlo Park, California 94025, USA Department of Physics, University of Florida, Gainesville, Florida 32611, USA    Cheng Peng [email protected] Stanford Institute for Materials and Energy Sciences, SLAC National Accelerator Laboratory, Menlo Park, California 94025, USA
Abstract

Combinatorial optimization is of general interest for both theoretical study and real-world applications. Fast-developing quantum algorithms provide a different perspective on solving combinatorial optimization problems. In this paper, we propose a quantum-inspired tensor-network-based algorithm for general locally constrained combinatorial optimization problems. Our algorithm constructs a Hamiltonian for the problem of interest, effectively mapping it to a quantum problem, then encodes the constraints directly into a tensor network state and solves the optimal solution by evolving the system to the ground state of the Hamiltonian. We demonstrate our algorithm with the open-pit mining problem, which results in a quadratic asymptotic time complexity. Our numerical results show the effectiveness of this construction and potential applications in further studies for general combinatorial optimization problems.

I Introduction

Combinatorial optimization is the process of finding an optimal object from a discrete and finite set of objects. Combinatorial optimization has extensive applications in almost every field of industry, such as supply chain optimization [1], transportation networks and power grids [2], and finance [3]. The search space of a combinatorial optimization problem increases rapidly with the problem size. Problems like the Boolean satisfiability problem can have an exponentially large solution space, making an exhaustive search inapplicable for large-scale problems. From the complexity theory perspective, many combinatorial problems fall into the class of NP-hard, which is generally believed to be unsolvable in polynomial time on classical computers. Classical algorithms often employ heuristics and approximations to find nearly optimal solutions [4]. Quantum algorithms [5], on the other hand, harness the power of randomness, superposition, entanglement, and interference from quantum mechanics, which might lead to an advantage in exploring the solutions of a combinatorial optimization problem [6, 7, 8]. The implementation of quantum algorithms is currently limited by small-scale, noisy, and error-prone contemporary hardware [9]; nevertheless, they view the problems from a different perspective, motivating many quantum-inspired classical algorithms to appear [10, 11].

Tensor networks (TNs) have undergone rapid development in the last two decades, gaining tremendous success in quantum many-body physics, quantum information sciences, statistical physics, and so on. Tensor network algorithms based on matrix product states (MPS) [12, 13], projected entangled pair states (PEPS) [14, 15], and variational renormalization group methods [16, 17, 18] are very efficient in simulating a large class of quantum many-body systems. The tensor network structure can encode the combinatorial optimization problem with local constraints, providing an idea of utilizing the tensor network to solve combinatorial optimization problems.

This paper presents a quantum-inspired tensor network algorithm to solve constrained combinatorial optimization problems and demonstrates the algorithm with a particular problem with numerical results. The paper is structured as follows: The general quantum-inspired tensor network algorithm is proposed in Section 2, and the open-pit mining problem is provided as an example in Section 3. Section 4 shows our numerical results with the quantum-inspired tensor network algorithm and concludes with a discussion of open questions and directions for future work.

II A general tensor network algorithm for combinatorial optimization

In this section, we divide our algorithm into four components and describe each in detail. Section II.1 explains how to construct the Hamiltonian for a classical combinatorial problem to transform it to a quantum problem. Section II.2 serves as inspiration for our core idea, Section II.3, where the former studies how to satisfy the constraints without introducing a penalty term, and the latter details how to construct a tensor network state that represents the superposition of all feasible solutions. Finally, in Section II.4, we show how to find the optimal solution by evolving the tensor network state to the ground state of the problem Hamiltonian.

II.1 Hamiltonian construction/Problem mapping

We use an objective function ff and a discrete set of feasible solutions x to specify the combinatorial optimization problem. In many such problems, each solution involves a binary selection of the individual components under certain constraints, denoted as x=(x1,,xn)\textbf{x}=(x_{1},\cdots,x_{n}) with binary variables xn{0,1}x_{n}\in\{0,1\}, satisfying constraints c=(c1,,cm)\textbf{c}=(c_{1},\cdots,c_{m}). The goal is to find the solution x\textbf{x}^{\star} in all feasible solutions to maximize the objective function ff, i.e. x=argmaxx{0,1}nf(x)\textbf{x}^{\star}=\mathop{\mathrm{arg\,max}}_{\textbf{x}\in\{0,1\}^{\otimes n}}f(\textbf{x}). This goal can be achieved by mapping the problem to a Hamiltonian and looking for the ground state in the Hilbert space. The Hamiltonian is written as

H^=𝐱{0,1}na𝐱|𝐱𝐱|,\displaystyle\hat{H}=\sum_{\mathbf{x}\in\{0,1\}^{\otimes n}}a_{\mathbf{x}}\ket{\mathbf{x}}\bra{\mathbf{x}}, (1)

where axa_{\textbf{x}} are real values representing the elements of the Hamiltonian and |x=|x1|x2|xn|\textbf{x}\rangle=|x_{1}\rangle\otimes|x_{2}\rangle\cdots\otimes|x_{n}\rangle. Note that in this paper, we are interested in problems that require nn qubits, where nn is the number of the binary variables. Each variable xix_{i} of the set of solutions x is assigned on the basis of the Pauli operator Z^i\hat{Z}_{i} on the ii-th qubit, that is, Z^i=|00||11|\hat{Z}_{i}=\ket{0}\bra{0}-\ket{1}\bra{1} with |xi{|0,|1}\ket{x_{i}}\in\{\ket{0},\ket{1}\}. Thus, a general quantum state can be expressed as

|Ψ=𝐱{0,1}nb𝐱|𝐱.\displaystyle\ket{\Psi}=\sum_{\mathbf{x}\in\{0,1\}^{\otimes n}}b_{\mathbf{x}}\ket{\mathbf{x}}. (2)

Here b𝐱b_{\mathbf{x}} represents the linear coefficient that meets the normalized condition, i.e. i=1n|bxi|2=1\sum_{i=1}^{n}|b_{x_{i}}|^{2}=1. Consider a general unconstrained binary linear optimization problem:

min{𝐰T𝐱:𝐱{0,1}n}\displaystyle\min\{\mathbf{w}^{T}\mathbf{x}:\mathbf{x}\in\{0,1\}^{\otimes n}\} (3)

with weights 𝐰=(w1,,wn)\mathbf{w}=(w_{1},\cdots,w_{n}). Then the Hamiltonian is transformed as

H^\displaystyle\hat{H} =iwi2(Z^iI^),\displaystyle=\sum_{i}\frac{w_{i}}{2}(\hat{Z}_{i}-\hat{I}), (4)

where II is the identity. Such transformations take linear time in the number of variables.
The ground state of this Hamiltonian, denoted as |ψg\ket{\psi_{g}}, is the state that minimizes the energy defined as E(|Ψ)=Ψ|H^|Ψ/Ψ|ΨE(\ket{\Psi})=\bra{\Psi}\hat{H}\ket{\Psi}/\langle\Psi\ket{\Psi}. With an appropriate mapping, the original optimization problem is equivalent to solving the ground state of the Hamiltonian. Then the ground-state solving techniques in quantum many-body physics can be utilized to achieve an optimized solution of the combinational optimization problem.

II.2 Postselection: a penalty-free approach

For constrained problems, additional terms are usually needed in the Hamiltonian to penalize constraint violations. These penalty terms should be conditioned by multiplying with appropriate penalty factors to ensure that the overall Hamiltonian behaves as intended. Optimization of such a Hamiltonian containing penalty terms inevitably involves tuning of additional hyperparameters, which greatly increases the difficulty of the overall optimization process.

In our study, we present a hyperparameter-free algorithm that directly projects a randomized initial quantum state into a subspace that satisfies the constraints. We use a projector, defined as P^|Ψ=|Ψv\hat{P}\ket{\Psi}=|\Psi_{v}\rangle, to eliminate states that violate constraints. |Ψ\ket{\Psi} is an arbitrary state in the Hilbert space, and |Ψv|\Psi_{v}\rangle is the projected state that belongs to the subspace denoted by VV satisfying the constraints. The projector is then constructed as

P^=𝐱V|𝐱𝐱|.\displaystyle\hat{P}=\sum_{\mathbf{x}\in V}|\mathbf{x}\rangle\langle\mathbf{x}|. (5)

It satisfies P^2=P^\hat{P}^{2}=\hat{P}. The ground state |ψg\ket{\psi_{g}} under the projection is written as follows:

|ψg\displaystyle\ket{\psi_{g}} =min|ΨE(|Ψ),\displaystyle=\min_{\ket{\Psi}}\ E(\ket{\Psi}), (6)
E(|Ψ)\displaystyle E(\ket{\Psi}) =Ψv|H^|ΨvΨv|Ψv=Ψ|P^H^P^|ΨΨ|P^|Ψ.\displaystyle=\frac{\bra{\Psi_{v}}\hat{H}\ket{\Psi_{v}}}{\braket{\Psi_{v}}{\Psi_{v}}}=\frac{\bra{\Psi}\hat{P}\hat{H}\hat{P}\ket{\Psi}}{\braket{\Psi}{\hat{P}}{\Psi}}. (7)

We can then extract the optimal solution to the combinatorial optimization problem encoded in |ψg\ket{\psi_{g}}. It is worth noting that the solver only works for a normalized state, i.e. Ψ|Ψ=1\langle\Psi\ket{\Psi}=1, while the projected state are not normalized since a general projector P^\hat{P} is not unitary. However, with prior knowledge that the ground state is always a product state following the constraints, and thus Ψ0|P^|Ψ0=1\braket{\Psi_{0}}{\hat{P}}{\Psi_{0}}=1, we could simply apply the solver for the normalized ground state of P^H^P^\hat{P}\hat{H}\hat{P}.

II.3 Tensor network construction of the projected state

Directly constructing the projector P^\hat{P} incurs an exponential cost in time and memory. However, by encoding the constraints in a tensor network state, we can significantly reduce the cost to O(mn)O(mn), or O(m+n)O(m+n) if the constraints are “local”, i.e. the number of variables involved in each constraint is limited by a constant and vice versa. The general form of the tensor network state can be written as

|Ψ={α,β}i=1nTαiβ1βx[xi]Rβ1βc[ci]|α1αiαn.\displaystyle\ket{\Psi}=\sum_{\{\alpha,\beta\cdots\}}\prod_{i=1}^{n}T^{[x_{i}]}_{\alpha_{i}\beta_{1}\cdots\beta_{x}}R^{[c_{i}]}_{\beta_{1}\cdots\beta_{c}}|\alpha_{1}\cdots\alpha_{i}\cdots\alpha_{n}\rangle. (8)

There are two types of tensors, T[x]T^{[x]} and R[c]R^{[c]}. Each T[x]T^{[x]} has a single physical index labeled α\alpha with a bond dimension d=2d=2 reflecting the binary variable, that is, α=0\alpha=0 and 11, and multiple virtual indices labeled β\beta also with the same bond dimension. Each auxiliary tensor R[c]R^{[c]} encodes the constraint cc and connects to T[x]T^{[x]} tensors whose variable xx is involved in the constraint cc. To map the selection of the binary variable from the physical index to other indices, T00[x]T^{[x]}_{0\cdots 0} and T11[x]T^{[x]}_{1\cdots 1} are set to 11. The R[c]R^{[c]} tensors are constructed by traversing the allowed assignments of the constrained variables and setting the elements located in the corresponding indices to 11. We initialize the T[x]T^{[x]} and R[c]R^{[c]} tensors as zeros. For example, if we have variables x1,x2,x3{0,1}x_{1},x_{2},x_{3}\in\{0,1\} and a single constraint c1:x1+x2+x3mod2=1c_{1}:x_{1}+x_{2}+x_{3}\mod 2=1, then we can use four sparse tensors, i.e. Tαβ1[x1],Tαβ2[x2],Tαβ3[x3]T^{[x_{1}]}_{\alpha\beta_{1}},T^{[x_{2}]}_{\alpha\beta_{2}},T^{[x_{3}]}_{\alpha\beta_{3}} and Rβ1β2β3[c1]R^{[c_{1}]}_{\beta_{1}\beta_{2}\beta_{3}} to encode this particular constrained problem, with nonzero elements of the tensors specified as:

T00[x1]=T11[x1]=1\displaystyle T^{[x_{1}]}_{00}=T^{[x_{1}]}_{11}=1 (9)
T00[x2]=T11[x2]=1\displaystyle T^{[x_{2}]}_{00}=T^{[x_{2}]}_{11}=1 (10)
T00[x3]=T11[x3]=1\displaystyle T^{[x_{3}]}_{00}=T^{[x_{3}]}_{11}=1 (11)
R001[c1]=R010[c1]=R100[c1]=R111[c1]=1\displaystyle R^{[c_{1}]}_{001}=R^{[c_{1}]}_{010}=R^{[c_{1}]}_{100}=R^{[c_{1}]}_{111}=1 . (12)

The four possibilities to satisfy the constraint c1c_{1} have been included in R[c1]R^{[c_{1}]}; for example, R001[c1]=1R^{[c_{1}]}_{001}=1 with indices 001001 represents x1=x2=0x_{1}=x_{2}=0 and x3=1x_{3}=1. The construction of these tensors is visualized in Fig.1.

Refer to caption
Figure 1: Tensor network construction for a three-variable constrained problem. (a) The schematic for the three-variable constrained problem with x1,x2,x3{0,1}x_{1},x_{2},x_{3}\in\{0,1\} and the constraint c1c_{1}. (b) The tensor definitions in the general form of the tensor network for the three-variable constrained problem, with α\alpha as the physical index and β\beta as the virtual index.

By this construction, we encode all feasible variable assignments in the initialized tensor network. Since traversing the allowed assignments of each constraint requires exponential time in the number of variables involved, the overhead of our method is much lower for problems with local constraints, compared to directly building the projector. Additionally, existing tensor algebra methods and tensor network algorithms are applicable to structured problems, helping us solve problems efficiently.

II.4 Finding the optimal solution

The optimal solution is one of the basis vectors in Eq. (8), denoted by |α1αiαn|\alpha_{1}\cdots\alpha_{i}\cdots\alpha_{n}\rangle, with αi=0,1\alpha_{i}=0,1 on the ii-th binary variable xix_{i}. Having the superposition of all allowed variable assignments, we can screen out the optimal solution by imaginary time evolution (ITE), a technique to project the initial state to the ground state of an objective Hamiltonian. ITE effectively performs a power iteration by repetitively applying the ITE operator eτH^pe^{-\tau\hat{H}_{p}} to find the ground state of H^\hat{H}. The ground state minimizes the energy, which is equivalent to minimizing or maximizing the objective function. The simulation of the ITE takes the form of

|Ψ=limτeτH^|Ψ0eτH^|Ψ0,\displaystyle\ket{\Psi}=\lim_{\tau\rightarrow\infty}\frac{e^{-\tau\hat{H}}\ket{\Psi_{0}}}{||e^{-\tau\hat{H}}\ket{\Psi_{0}}||}, (13)

where τ\tau is referred to as the imaginary time. If the Hamiltonian only contains the summation of commuting terms, then eτH^e^{-\tau\hat{H}} can be directly rewritten into the product of the local evolution operators, i.e. eτH^=Πieτh^ie^{-\tau\hat{H}}=\Pi_{i}e^{-\tau\hat{h}_{i}}. Otherwise, the Trotter-Suzuki decomposition[19, 20], an approximation for doing the ITE if containing non-commuting terms in the Hamiltonian, should be involved.

To extract the optimal solution from the tensor networks, we take inspiration from measuring the spin magnetic moment. The assignment of the variable xix_{i} is calculated as

xi=𝟙(Ψ|Z^i|ΨΨ|Ψ<0),\displaystyle x^{\star}_{i}=\mathbbm{1}(\frac{\braket{\Psi}{\hat{Z}_{i}}{\Psi}}{\braket{\Psi}{\Psi}}<0), (14)

where Z^i\hat{Z}_{i} is the Pauli matrix. That is, if the expectation value is negative, xix_{i} is 11; otherwise, it is 0. Since we need to do this calculation for each variable, there is an O(n)O(n) factor multiplied with the complexity of computing a single expectation value, which we will discuss shortly.

Note that there could be certain variables whose either assignment gives the same final objective value and obeys the constraints, known as the degeneracy. In this case, if we prefer xix_{i} to be assigned a specific value, for example, zero, then the measurement operator can be adjusted as

Z~^i=[100μ],\displaystyle\hat{\tilde{Z}}_{i}=\begin{bmatrix}1&0\\ 0&-\mu\end{bmatrix}, (15)

where μ\mu is a value larger than 11 so as to create a slight difference between the expectation values of the 0 and 11 variable assignments. Then we should measure

x~i=𝟙(Ψ|Z^~i|ΨΨ|Ψ<ν),\displaystyle\tilde{x}^{\star}_{i}=\mathbbm{1}(\frac{\braket{\Psi}{\tilde{\hat{Z}}_{i}}{\Psi}}{\braket{\Psi}{\Psi}}<\nu), (16)

where ν\nu is a threshold value related to μ\mu used to detect the slight difference. In practice, μ\mu can be slightly larger than 11 and ν\nu is a small positive number approaching zero, such as μ=3\mu=3 and ν=0.04\nu=0.04, both depending on how many degenerate states exist. We can adjust μ\mu until the degenerate states are properly separated, then we can find our preferred one by setting an appropriate threshold ν\nu.

We calculate the expectation values Ψ|Z^~i|Ψ\bra{\Psi}\tilde{\hat{Z}}_{i}\ket{\Psi} by performing tensor network contractions [21, 22, 23], which sometimes take exponential time and space to obtain an exact result. Tensor decomposition methods, such as singular value decomposition (SVD), are regularly used in tensor network contractions to limit the rapidly increasing bond dimension. Specifically, we can preserve a predetermined number of columns and rows in the decomposed matrices with the largest singular values. An alternative common practice is to preserve columns and rows whose singular values are above a threshold. Using these techniques cleverly can reduce the complexity of the whole contraction to be polynomial in mm and nn, while still resulting in an accurate enough value. Moreover, for problems that have a structured tensor network construction, we can utilize existing tensor network algorithms to further optimize performance.

III The open-pit mining problem

III.1 Problem description

We use a real-world combinatorial optimization problem, the open-pit mining problem, as an example to demonstrate our algorithm. The goal of designing optimal open-pit mines is to maximize ore production while avoiding unnecessary mining of rocks. The planning is also subject to a variety of constraints on the size, shape, and form of the mine, making it a computationally taxing process. Theoretical studies of the problem often apply simplifying assumptions, converting the problem into a simpler and more well-understood form [24].

In particular, the 2D open-pit mining problem can be formally stated as a combinatorial optimization problem. Consider a 2D square lattice of mining blocks, where each block ii has an associated profit wiw_{i}. The coordinate of block ii is denoted as (ix,iy)(i_{x},i_{y}). A feasible solution should follow physical constraints, i.e. if the block ii is excavated, then all its child blocks jj should be excavated as well. In this work, we consider the 4545^{\circ} slope constraint: j{(ix1,iy1),(ix1,iy),(ix1,iy+1)}j\in\{(i_{x}-1,i_{y}-1),(i_{x}-1,i_{y}),(i_{x}-1,i_{y}+1)\}, as illustrated in Fig. (2) (a). Equivalently, we can consider an nn-node directed graph G=(V,E)G=(V,E) with node weight wiw_{i}, as shown in Fig. (2) (b). GG is structured into levels, where each level contains two more nodes than the previous level, starting from one node in the first level. Each node before the last level has exactly three child nodes at the next level, and each node after the first level has one to three parent nodes.

Refer to caption
Figure 2: Two-dimensional open-pit mining problem and the equivalent graph representation. (a) A schematic of two-dimensional open-pit mining problem. The blocks in light brown are excavatable. The blocks in dark brown are unexcavatable due to 4545^{\circ} slope constraint. ixi_{x} and iyi_{y} represent the vertical and horizontal indices, respectively. (b) The schematic for a directed graph representing a problem equivalent to the two-dimensional open-pit mining in panel (a). Each node i=(ix,iy)i=(i_{x},i_{y}) represents a mining block. Each directed edge (i,j)V(i,j)\in V represents the physical constraint: if block ii is excavated, block jj should be excavated too.

By assigning xi=0x_{i}=0 (unexcavated) or xi=1x_{i}=1 (excavated) to each node ii, we can write the open-pit mining problem as

maxi=1nwixi\displaystyle\max\sum_{i=1}^{n}w_{i}x_{i} (17)

subject to

xi{0,1}\displaystyle x_{i}\in\{0,1\}  for i=1,2,,n\displaystyle\text{\ \ \ for }i=1,2,\cdots,n (18)
j𝑐ℎ𝑖𝑙𝑑𝑟𝑒𝑛(i)xi(1xj)=0\displaystyle\sum_{j\in\mathit{children}(i)}x_{i}(1-x_{j})=0  for i=1,2,,n,\displaystyle\text{\ \ \ for }i=1,2,\cdots,n, (19)

where 𝑐ℎ𝑖𝑙𝑑𝑟𝑒𝑛(i)\mathit{children}(i) denotes the set of child nodes of node ii.

Traditionally, the open-pit mining problem is solved by reducing to the maximum closure problem or the maximum flow problem and utilizing efficient graph algorithms. In particular, the Lerchs-Gorssman (LG) algorithm [25, 26] was the most widely used algorithm in the mining industry, giving a provably optimal solution in polynomial time. In recent years, it has been surpassed by the more efficient Pseudoflow algorithm [27, 28], a O(|V||E|log|V|)O(|V||E|\log|V|) algorithm for the maximum flow problem. Recently, a quantum computing approach was proposed as the first attempt to solve this problem with quantum computers [29]. It modifies the objective function to

max(iwixiλi,jp(i)xi(1xj)),\displaystyle\max(\sum_{i}w_{i}x_{i}-\lambda\sum_{i,j\in p(i)}x_{i}(1-x_{j})), (20)

where λ\lambda is a hyperparameter introduced to regularize the penalty for constraint violations. Then the problem Hamiltonian is constructed using the method described in Section II.1.

Our algorithm takes inspiration from the quantum computing approach but is intrinsically different. Using tensor networks to represent quantum states, our algorithm can employ powerful non-unitary operations, which are unavailable to quantum algorithms. This fact allows us to directly construct the superposition state of all feasible solutions and avoids having to optimize the regularization of the penalty term. Our algorithm is also completely different from the graph algorithms. It provides a new perspective on such problems, utilizing the rapidly developing tensor network methods. Moreover, the core ideas can be applied to general combinatorial problems, not limited to just this one.

III.2 The tensor network framework

We construct the configurations of all allowed states obeying the smoothness constraints as a tensor network state. Fig.3 visualizes the construction process using the 5×35\times 3 mine as an example. Referring to the smoothness constraints that the walls of the pit should not exceed a maximum steepness, the sites marked dark brown in Fig.2(a) would, if excavated, violate the smoothness constraints, which therefore should be excluded from the pit profile as well as the initialized tensor network construction. The values of the tensors as defined in Fig.3(c) are as follows (here we group the tensors corresponding to different variables or constraints but have the same form together):

T11[1]=T00[1]=1\displaystyle T^{[1]}_{11}=T^{[1]}_{00}=1 (21)
T1111[2]=T0000[2]=1\displaystyle T^{[2]}_{1111}=T^{[2]}_{0000}=1 (22)
T111[3]=T000[3]=1\displaystyle T^{[3]}_{111}=T^{[3]}_{000}=1 (23)
T111[4]=T000[4]=1\displaystyle T^{[4]}_{111}=T^{[4]}_{000}=1 (24)
T11111[5]=T00000[5]=1\displaystyle T^{[5]}_{11111}=T^{[5]}_{00000}=1 (25)
R1111[1]=R1110[1]=R1101[1]=R1100[1]=R1000[1]=R0100[1]=R0000[1]=1\displaystyle R^{[1]}_{1111}=R^{[1]}_{1110}=R^{[1]}_{1101}=R^{[1]}_{1100}=R^{[1]}_{1000}=R^{[1]}_{0100}=R^{[1]}_{0000}=1 (26)
R111[2]=R110[2]=R100[2]=R010[2]=R000[2]=1.\displaystyle R^{[2]}_{111}=R^{[2]}_{110}=R^{[2]}_{100}=R^{[2]}_{010}=R^{[2]}_{000}=1. (27)

All remaining elements are zero, which means that the corresponding projections are forbidden. The first index of the TT tensors is the physical index, where α=0\alpha=0 represents an unexcavated block and α=1\alpha=1 represents an excavated block. The virtual indices other than the physical one of TT are used to transfer the status of neighboring tensors. As in the illustration of the tensors shown in Fig.3(c), the arrow on each index is used to distinguish the directions of the transferring status of the geometrical bonds, i.e. the indices with incoming arrows are carrying the status originated from their parent blocks, and the indices with outgoing arrows are carrying the status, which should be the same as their physical indices and will head to their child blocks. The constraints of the excavated ore have been reflected in our tensor network definition with very limited nonzero elements of the tensor. Under the constraint that if a block (ix,iy)(i_{x},i_{y}) is excavated, so must its parent blocks (ix1,iy1)(i_{x}-1,i_{y}-1), (ix1,iy)(i_{x}-1,i_{y}) and (ix1,iy+1)(i_{x}-1,i_{y}+1), but an excavated block itself does not have to have child blocks.

Refer to caption
Figure 3: Tensor network construction for open-pit mining problem. (a) Directed graph representation of the open-pit mining problem, with the excavatable blocks expressed as nodes in light brown. (b) A corresponding tensor network construction, where the light brown blocks show the physical nodes and the gray blocks show the virtual nodes. (c) The definition of nonequivalent tensors in our tensor network construction. α\alpha and β\beta represent the physical and virtual indices, respectively.
Refer to caption
Figure 4: The optimization process using imaginary time evolution (ITE) on the tensor network for the open-pit mining problem. (a) The schematic of ITE process as described in Eq.(13). The left panel shows the ITE process using the local evolution gate exp(τh^i)\exp(-\tau\hat{h}_{i}) with h^i=wi2(Z^iI^)\hat{h}_{i}=\frac{w_{i}}{2}(\hat{Z}_{i}-\hat{I}), as shown in blue, to project the tensor network state, as shown in light brown and grey square defined in Fig.3. The right panel shows the obtained ground state wavefunction, with each blue block being an updated local tensor. (b) The schematic of measuring a local operator as described in Eq.(14) or Eq.(16). The operator may change to different form. The left panel shows the tensor network construction of the expectation value calculation. The right panel shows the scalar tensor network for the local observation with renewed local tensors.

Since there is only a very limited number of nonzero elements in the initialized tensor network, there is a lot of room for optimization in terms of computational memory and time cost. In addition, the three-dimensional open-pit mine can also be defined in a similar way, just by adjusting the local tensors TT and the auxiliary tensors RR to higher-order tensors and designing the nonequivalent tensor for boundary conditions in the three-dimensional mine.

The schematic of ITE is shown in Fig.4a. As the Hamiltonian for the open-pit mining problem, the same as defined in Eq.(4), only contains single site commuting terms, we can rewrite the evolution operator for the whole system, i.e. eτH^e^{-\tau\hat{H}} in Eq.(13) into the product of the local evolution operators, i.e. eτH^=Πieτh^ie^{-\tau\hat{H}}=\Pi_{i}e^{-\tau\hat{h}_{i}}, with h^i=wi2(Z^iI^)\hat{h}_{i}=\frac{w_{i}}{2}(\hat{Z}_{i}-\hat{I}). Then directly set the imaginary time τ\tau as a relatively large number, such as τ=10\tau=10, to achieve the ground state in the complexity of O(n)O(n).

IV Results and discussions

Refer to caption
Figure 5: Computational time for two-dimensional open-pit mining problems with mine side length ranging from 3 to 13, using three different PEPS contraction approaches.

We implement our algorithm for the mining problem as an open source Python library, available at [30]. Specifically, the tensor network construction described in Section III.2 is a 2D tensor network, which can be viewed as projected entangled pair states (PEPS) [15], with trivial physical indices on the RR tensors. We employ Koala [22], a high-performance PEPS simulation library, to perform the imaginary time evolution and calculate the expectation values by contractions.

We perform numerical experiments on open-pit mining problems with different size scales, as defined in Section III.1. Problem instances are generated randomly, where the value of each site follows a normal distribution with a mean of 0.10.1 and a standard deviation of 11. Each problem size is repeated five times with different mine instances to account for the possible fluctuating running condition of the computing device. In an ideal world, the runtime should be the same given a fixed problem size since the algorithm is purely deterministic. The ITE is conducted with τ=6\tau=6, which is large enough to achieve the ground state, but not too large to cause numerical instability, such as exceeding the maximum allowed value of the complex type in Python. Note that one can also set τ\tau with a heuristic related to problem size to better achieve the goals. We obtain the solutions by calculating the expectation values of the Pauli Z operators following Eq. (14).

Fig.5 shows a comparison of our algorithm’s runtime with different contraction approaches. If no bond dimension truncation is desired, the “PEPS Exact” method in the figure contracts a PEPS in a generally optimal order [23]. The boundary matrix product state (BMPS) method has poorly scaled performance on its own, but can be executed with bond dimension truncation to significantly lower time and memory complexities [22]. Following the references, we can calculate the asymptotic time complexities of the three contraction approaches. While “PEPS Exact” and “BMPS no truncation” both take 2O(n)2^{O(\sqrt{n})}, BMPS with truncation only takes O(d6n)=O(n)O(d^{6}n)=O(n), where nn is the number of sites. Since we need to do nn full contractions, the total time to calculate the expectation values with truncation is O(n2)O(n^{2}). As other parts of the algorithm all run in linear time for the open-pit mining problem, the overall time complexity is O(n2)O(n^{2}). In comparison, the state-of-the-art classical algorithm Pseudoflow finds the optimal solution in O(|V||E|log|V|)=O(n2logn)O(|V||E|\log|V|)=O(n^{2}\log n) [27]. Note that although our algorithm is asymptotically faster, its constant factor is larger, and it makes approximations when truncating bond dimensions. In Fig.5, we see that truncating the bond dimension to d=2d=2 incurs an additional overhead but has a polynomial runtime in contrast to the exponential runtime of both exact methods, which agrees well with our theoretical analyses. We compare the results produced with the optimal solution given by Pseudoflow. For all problem instances that we run, given an appropriate ITE evolution time, our algorithm can always find the optimal solution with maximized profit and zero constraint violations. Thus, we conclude that truncating the bond dimension to as small as d=2d=2 does not affect the accuracy of our algorithm.

It is worth noting that the open-pit mining problem has a few desirable properties for our algorithm. First, the system has a large energy gap between the ground state and the first excited state, allowing ITE to efficiently separate the optimal solution. Second, local and structured constraints decrease the complexity of constructing the tensor networks and make them reducible to well-studied tensor network forms. Third, the Hamiltonian contains only local interactions, resulting in well-controllable long-range entanglement, thus allowing aggressive bond-dimension truncations. It would be intriguing to see how the algorithm performs for more complicated and less suitable problems. Furthermore, by increasing the initial bond dimension, our algorithm can be extended beyond binary variables. A study on the performance sacrifice due to the increased initial bond dimension would be of interest. Moreover, as most of the tensor elements are zero in our construction, sparse tensor techniques could be applied, in addition to parallel computing implementations, to further improve performance.

V Acknowledgement

The authors thank Mario Motta, Joseph A. Latone, Jay Borenstein, Sreeram Venkatarao, Meltem Tolunay, Allyson Stoll and Stanford CS210 class. The code used to generate the data presented in this study can be publicly accessed on GitHub at [30]. This work was supported by the Department of Energy, Office of Science, Basic Energy Sciences, Materials Sciences and Engineering Division, under Contract No. DE-AC02-76SF00515.

References

  • [1] Majid Eskandarpour, Pierre Dejax, Joe Miemczyk, and Olivier Péton. Sustainable supply chain network design: An optimization-oriented review. Omega, 54:11–32, 2015.
  • [2] Pei Yao and Longkun Guo. Fast approximation algorithms for computing constrained minimum spanning trees. Combinatorial Optimization and Applications (COCOA 2017). Lecture Notes in Computer Science, 10627:103–110, 2017.
  • [3] Bernhard Korte and Jens Vygen. volume 2. Springer, 2012.
  • [4] Shen Lin and Brian W Kernighan. An effective heuristic algorithm for the traveling-salesman problem. Operations research, 21(2):498–516, 1973.
  • [5] Ashley Montanaro. Quantum algorithms: an overview. npj Quantum Information, 2(1):1–8, 2016.
  • [6] Nikolaj Moll, Panagiotis Barkoutsos, Lev S Bishop, Jerry M Chow, Andrew Cross, Daniel J Egger, Stefan Filipp, Andreas Fuhrer, Jay M Gambetta, Marc Ganzhorn, et al. Quantum optimization using variational algorithms on near-term quantum devices. Quantum Science and Technology, 3(3):030503, 2018.
  • [7] Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. A Quantum Approximate Optimization Algorithm. arXiv e-prints, page arXiv:1411.4028, November 2014.
  • [8] A. Peruzzo, J. McClean, and P. et al. Shadbolt. A variational eigenvalue solver on a photonic quantum processor. Nat Commun, page 4213, 2014.
  • [9] John Preskill. Quantum computing in the nisq era and beyond. Quantum, 2:79, 2018.
  • [10] Kuk-Hyun Han and Jong-Hwan Kim. Quantum-inspired evolutionary algorithm for a class of combinatorial optimization. IEEE transactions on evolutionary computation, 6(6):580–593, 2002.
  • [11] Ewin Tang. A quantum-inspired classical algorithm for recommendation systems. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, pages 217–228, 2019.
  • [12] B. Derrida and M. Evans. Exact correlation functions in an asymmetric exclusion model with open boundaries. Journal de Physique I, 3(2):311–322, 1993.
  • [13] B Derrida1, M R Evans, V Hakim, and V Pasquier. Exact solution of a 1D asymmetric exclusion model using a matrix formulation. J. Phys. A: Math. Gen., (26):1493, 1993.
  • [14] F. Verstraete and J. I. Cirac. Valence-bond states for quantum computation. Phys. Rev. A, 70:060302, Dec 2004.
  • [15] F. Verstraete and J. I. Cirac. Renormalization algorithms for Quantum-Many Body Systems in two and higher dimensions. arXiv e-prints, pages cond–mat/0407066, July 2004.
  • [16] Kenneth G. Wilson. The renormalization group: Critical phenomena and the kondo problem. Rev. Mod. Phys., 47:773–840, Oct 1975.
  • [17] Steven R. White. Density matrix formulation for quantum renormalization groups. Phys. Rev. Lett., 69:2863–2866, Nov 1992.
  • [18] Steven R. White. Density-matrix algorithms for quantum renormalization groups. Phys. Rev. B, 48:10345–10356, Oct 1993.
  • [19] Masuo Suzuki. General theory of fractal path integrals with applications to many‐body theories and statistical physics. Journal of Mathematical Physics, 32(2):400–407, 1991.
  • [20] Masuo Suzuki. Fractal decomposition of exponential operators with applications to many-body theories and monte carlo simulations. Physics Letters A, 146(6):319–323, 1990.
  • [21] Shi-Ju Ran, Emanuele Tirrito, Cheng Peng, Xi Chen, Luca Tagliacozzo, Gang Su, and Maciej Lewenstein. Two-Dimensional Tensor Networks and Contraction Algorithms, pages 63–86. Springer International Publishing, Cham, 2020.
  • [22] Yuchen Pang, Tianyi Hao, Annika Dugad, Yiqing Zhou, and Edgar Solomonik. Efficient 2d tensor network simulation of quantum systems. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pages 1–14. IEEE, 2020.
  • [23] Chu Guo, Yong Liu, Min Xiong, Shichuan Xue, Xiang Fu, Anqi Huang, Xiaogang Qiang, Ping Xu, Junhua Liu, Shenggen Zheng, et al. General-purpose quantum circuit simulator with projected entangled-pair states and the quantum supremacy frontier. Physical review letters, 123(19):190501, 2019.
  • [24] Helmut Lerchs. Optimum design of open-pit mines. Trans CIM, 68:17–24, 1965.
  • [25] Luciano Mario Giannini. Optimum design of open pit mines. PhD thesis, Curtin University, 1990.
  • [26] Reza Khalokakaie, Peter A Dowd, and Robert J Fowell. Lerchs–grossmann algorithm with variable slope angles. Mining Technology, 109(2):77–85, 2000.
  • [27] Dorit S Hochbaum. The pseudoflow algorithm: A new algorithm for the maximum-flow problem. Operations research, 56(4):992–1009, 2008.
  • [28] DCW Muir. Pseudoflow, new life for lerchs-grossmann pit optimisation. Spectrum Series, Orebody Modelling and Strategic Mine Planning, 14:97–104, 2008.
  • [29] Yousef Hindy, Jessica Pointing, Meltem Tolunay, Sreeram Venkatarao, Mario Motta, and Joseph A Latone. A quantum computational approach to the open-pit mining problem. arXiv preprint arXiv:2107.11345, 2021.
  • [30] Tianyi Hao, Xuxin Huang, Cheng Peng, and Chunjing Jia. https://github.com/haoty/qore. Github repository, 2021.