# Will deep learning neural networks run on quantum computers?

Deep Learning (multiple layers of artificial neural networks used in supervised and unsupervised machine learning tasks) is an incredibly powerful tool for many of the most difficult machine learning tasks: image recognition, video recognition, speech recognition, etc. Given that it is currently one of the most powerful machine learning algorithms, and Quantum Computing is generally regarded as a game changer for certain very difficult computation tasks, I'm wondering if there has been any movement on combining the two.

• Could a deep learning algorithm run on a quantum computer?
• Does it make sense to try?
• Are there other quantum algorithms that would make deep learning irrelevant?
• I’m no expert, but I imagine the HHL algorithm would be useful in this context. – DaftWullie Sep 20 '18 at 5:20

1. Yes, all classical algorithms can be run on quantum computers, moreover any classical algorithm involving searching can get a $\sqrt{\text{original time}}$ boost by the use of grovers algorithm. An example that comes to mind is treating the fine tuning of neural network parameters as a "search for coefficients" problem.

2. For the fact there are clear computational gains in some processes: yes.

3. Not that I know of. But someone with more expertise can chime in here if they want. The one thing that comes to mind: often we may use Deep Learning and other forms of Artificial Intelligence to study problems of chemistry, and physics because simulation is expensive or impractical. In this domain, Quantum Computers will likely slaughter their classical ancestors given their ability to natively simulate quantum systems (like those in Nuclear Chemistry) in effectively real time or faster.

Last I spoke with him, Mario Szegedy was interested in precisely this, there are probably a lot of other researchers too working on it right now.

• I'm not convinced Grover's algorithm is relevant here. Grover's algorithm finds the one unique input that exactly produces a given output. OTOH, neural networks are very much nonunique by nature, and they aren't really exact either – at best asymptically accurate. – leftaroundabout Mar 28 '18 at 21:27
• It can be treated as a data base search problem by looking at a super position of all states the weights can be in. Let the search function return 1, if the norm of the derivative of the neural net on a standard input w.r.t the weights is less than some desired tolerance. – frogeyedpeas Mar 28 '18 at 21:36
• That would be completely useless. For any nontrivial problem there will be many combinations of weights at which the gradient is zero; even if Grover's algorithm gave you one of these it would generally not be a minimum, much less a global minimum. – leftaroundabout Mar 28 '18 at 22:03
• I’d disagree, considering the following protocol: vanilla gradient descent up to some threshold, then apply Grover’s search amongst a very restricted space of weights to pick up a hard minimum within some error bound, that end part is where gradient descent usually converges very slowly to the local optimum, and I grow curious if that’s where resorting to Grover Search could be interesting – frogeyedpeas Mar 28 '18 at 22:07
• Hm, that might work; however at that end part I'm sure you could also do much better than gradient descent with classical means. Biconjugate-gradient being the obvious candidate. – leftaroundabout Mar 29 '18 at 8:40

This is very much an open question, but yes, there is a considerable amount of work that is being done on this front.

# Some clarifications

It is, first of all, to be noted that there are two major ways to merge machine learning (and deep learning in particular) with quantum mechanics/quantum computing:

### 1) ML $\to$ QM

Apply classical machine learning techniques to tackle problems arising in the context of quantum mechanics/quantum information/quantum computation. This area is growing too fast for me to even attempt a decent list of references, so I will just link to a couple of the most recent works in this direction: in 1803.04114 the authors used a machine learning approach to find circuits to compute the overlap between two states (there are a number of other works in this same direction), and in 1803.05193 the authors studied how deep neural networks can be used to find quantum control correction schemes.

### 2) QM $\to$ ML

Study of quantum algorithms to analyze big data, which often amounts to look for "quantum generalizations" of classical machine learning algorithms. You can have a look at this other answer of mine to get some basic references about this topic. More specifically for the case of deep learning, in 1412.3489 (aptly named Quantum Deep Learning) the authors propose a method (effectively, a quantum algorithm) to generally speed-up the training of deep, restricted Boltzmann machines. Another relevant reference here is 1712.05304, in which the authors develop a low-depth quantum algorithm to train quantum Boltzmann machines. See 1708.09757, as well as the references in the linked answer, to find many more works on this. Note that the speed-up that is claimed in these works can vary wildly, from exponential speed-ups to polynomial ones.

Sometimes the speed-up comes from the use of quantum algorithms to solve particular linear algebraic problems (see e.g. Table 1 in (1707.08561), sometimes it comes from what basically amounts to the use of (variations of) Grover's search, and sometimes from other things (but mostly these two). Quoting from Dunjko and Briegel here:

The ideas for quantum-enhancements for ML can roughly be classified into two groups: a) approaches which rely on Grover’s search and amplitude amplification to obtain up-to-quadratic speed-ups, and, b) approaches which encode relevant information into quantum amplitudes, and which have a potential for even exponential improvements. The second group of approaches forms perhaps the most developed research line in quantum ML, and collects a plethora quantum tools – most notably quantum linear algebra, utilized in quantum ML proposals.

# More direct answer to the three questions

Having said the above, let me more directly answer the three points you raised:

1. Could a deep learning algorithm run on a quantum computer? Most definitely yes: if you can run something on a classical computer you can do it on quantum computers. However, the question one should be asking is rather can a quantum (deep) machine learning algorithm be more efficient than the classical counterparts? The answer to this question is trickier. Possibly yes, there are many proposals in this direction, but it is too soon to say what will or will not work.

2. Does it make sense to try? Yes!

3. Are there other quantum algorithms that would make deep learning irrelevant? This strongly depends on what you mean by "irrelevant". I mean, for what is known at the moment, there may very well be classical algorithms that will make deep learning "irrelevant".
• In the context of this answer, I would like to mention this recent paper which shows how the quantum approximate optimization algorithm can be used to train neural networks (restricted Boltzmann machines) by employing approximate Gibbs sampling on universal quantum computers. – Mark Fingerhuth Mar 30 '18 at 9:24
• @MarkFingerhuth I added it to the answer, thanks for the pointer (and welcome to the site!) – glS Mar 30 '18 at 9:31

Here is a latest development from Xanadu, a photonic quantum circuit which mimics a neural network. This is an example of a neural network running on a quantum computer.

This photonic circuit contains interferometers and squeezing gates which mimic the weighing functions of a NN, a displacement gate acting as bias and a non-linear transformation similar to ReLU function of a NN.

They have also used this circuit to train the network to generate quantum states and also implement quantum gates.

Here are their publication and code used to train the circuit. Here is a medium article explaining their circuit.

All of the answers here seem to be ignoring a fundamental practical limitation:

Deep Learning specifically works best with big data. MNIST is 60000 images, ImageNet is 14 Million images.

Meanwhile, the largest quantum computers right now have 50~72 Qbits.

Even in the most optimistic scenarios, quantum computers that can handle the volumes of data that would require Deep Learning algorithms instead more traditional modeling methods are not going to be around anytime soon.

So applying QC to Deep Learning might be a nice theoretical curiosity, but not something that's ever going to be practical.