Skip to main content
Springer Nature - PMC COVID-19 Collection logoLink to Springer Nature - PMC COVID-19 Collection
. 2020 May 25;12142:576–590. doi: 10.1007/978-3-030-50433-5_44

Quantum Hopfield Neural Networks: A New Approach and Its Storage Capacity

Nicholas Meinhardt 15,16, Niels M P Neumann 15,, Frank Phillipson 15
Editors: Valeria V Krzhizhanovskaya8, Gábor Závodszky9, Michael H Lees10, Jack J Dongarra11, Peter M A Sloot12, Sérgio Brissos13, João Teixeira14
PMCID: PMC7304743

Abstract

At the interface between quantum computing and machine learning, the field of quantum machine learning aims to improve classical machine learning algorithms with the help of quantum computers. Examples are Hopfield neural networks, which can store patterns and thereby are used as associative memory. However, the storage capacity of such classical networks is limited. In this work, we present a new approach to quantum Hopfield neural networks with classical inputs and outputs. The approach is easily extendable to quantum inputs or outputs. Performance is evaluated by three measures of error rates, introduced in this paper. We simulate our approach and find increased storage capacity compared to classical networks for small systems. We furthermore present classical results that indicate an increased storage capacity for quantum Hopfield neural networks in large systems as well.

Keywords: Hopfield neural networks, Gate-based quantum computing, Storage capacity, Quantum machine learning

Introduction

While conventional computers are restricted to classical operations, quantum computers implement the rules of quantum mechanics to process information [5], using quantum principles such as superpositions. The basic units to store information on quantum computers are two-level quantum bits, or qubits. Due to superpositions of both levels, qubits allow for a more flexible representation of information than classical bits. One widely accepted premise is that quantum computers have computational advantages over classical processing [6], giving rise to the notion of ‘quantum supremacy’ [13], which only recently has been claimed for the first time in experiments [1].

A candidate to show a quantum advantage is believed to be quantum machine learning (QML) [4, 12], a field of research at the interface between quantum information processing and machine learning. Even though machine learning is an important tool that is widely used to process data and extract information from it [4], it also faces its limits. The amount of data processed worldwide each year is steadily increasing, while the limits of computing power are rapidly approaching [7]. Therefore, more efficient algorithms, such as found in the quantum domain, are crucial.

We consider neural networks (NN), a subclass of machine learning algorithms consisting of nodes that can be connected in various configurations and interact with each other via weighted edges. As special case, Hopfield neural networks (HNN) consist of a single layer of nodes, all connected with each other via symmetric edges and without self-connections [8]. In an HNN, nodes are updated using the updating rule Inline graphic, where Inline graphic refers to the sign-function, Inline graphic is the weight between node i and j and Inline graphic. A graphical representation of an HNN is given in Fig. 1, where k an indicator for the number of updating iterations in the direction of the dashed arrows.

Fig. 1.

Fig. 1.

Schematic overview of a fully-connected Hopfield neural network with 5 neurons. First, the neurons are initialized (orange nodes), then the network evolves in time or number of iterations k according to the weight matrix with entries Inline graphic (blue plane). The final configuration is read out (green nodes). The dashed arrows indicate the direction of updating or time. (Color figure online)

Due to this connectivity, HNNs can be used as associative memories, meaning that they can store a set of patterns and associate noisy inputs with the closest stored pattern. Memory patterns can be imprinted onto the network by the use of training schemes, for instance Hebbian learning [15]. Here, the weights are calculated directly from all memory patterns, and thereby only a low computational effort is required. It is possible to store an exponential number of stable attractors in an HNN if the set of attractors is predetermined and fixed [11]. In general, however, fewer patterns can be stored if they are randomly selected, resulting in a very limited storage capacity of HNNs. For Hebbian learning Inline graphic patterns can be stored asymptotically in an HNN with n nodes [9].

Translating HNNs to counterparts in the quantum domain is assumed to offer storage capacities beyond the reach of classical networks [14, 18]. For example, in [18] a quantum HNN is proposed that could offer an exponential capacity when qutrits are used. When using qubits however, no increased capacity has been demonstrated yet for quantum HNNs.

In this work, we provide a new approach for hybrid quantum-classical HNNs, which 1) allows for classical and quantum inputs and outputs; 2) is able to store classical bit strings as attractors; and 3) fulfills three minimum requirements to allow an analogy to classical HNNs as posed in Ref. [16]. The first requirement is that the quantum HNN must comply with quantum theory while respecting the structure of NNs. The second requirement is that the quantum model should solve the discrepancy between unitary quantum evolution and dissipative dynamics of NNs. Thirdly, it should offer the feature of an associative memory, meaning that inputs are mapped to the closest stable outputs that encode the learned bit patterns. We furthermore provide numerical evidence that the capacity indeed increases for gate-based quantum HNNs, when storing randomly chosen bit strings.

Previously proposed implementations of HNNs either deal with non-random memory patterns [3], or do not account for the discrepancy between dissipative and unitary dynamics, one of the three minimum requirements [14]. We follow the recent proposal of deep quantum neural networks in Ref. [2] for our HNN-development. Our model involves a training set, which is generated based on the chosen memories, and all involved gate operations are optimized using the training scheme given in Ref. [2]. We test the model’s ability to store randomly chosen bit strings and thereby estimate its capacity. While limited to small system sizes due to the model complexity, the results are compared to those of a classical HNN with Hebbian learning.

The remainder of this work is organized as follows: We present our quantum model in Sect. 2 and the setup for the simulations in Sect. 3. The results of these simulations are given in Sect. 4. Finally, we provide a summary of the results in Sect. 5 and a conclusion in Sect. 6.

Quantum Hopfield Neural Networks

We first present a feed-forward interpretation of quantum HNNs in Sect. 2.1 and then explain how to train these feed-forward quantum HNNs in Sect. 2.2.

A Feed-Forward Interpretation of Quantum HNNs

HNNs can be implemented as feed-forward NNs by regarding each update step as a new layer of neurons. In the feed-forward interpretation, the weight matrix is layer depended and can be written as Inline graphic. Depending on whether the HNN is updated synchronously or asynchronously, the weights might differ between layers. In the former case, the weights Inline graphic are exactly as Inline graphic of the usual HNN. Hence, the weights are symmetric in both the subscripts and the layers and the superscript l can be omitted. Note that HNNs have no self-connections, such that Inline graphic for all i. Therefore, the interpretation of an HNN with synchronous updating as a feed-forward NN is valid. The number of layers l can be seen as a time parameter. Figure 2a shows an HNN with three neurons and a feed-forward interpretation of this network is given in Fig. 2b.

Fig. 2.

Fig. 2.

Two interpretations of the updating process in classical HNNs and the corresponding quantum model. (Color figure online)

Note that we are not restricted to synchronous updating. In principle any updating rule may be applied and the weights of the feed-forward interpretation may differ drastically from the ones of the single-layer scheme in general. The weights do not necessarily need to agree with the ones of Hebbian learning. Note that the fundamental properties of HNNs of storing and retrieving patterns are retained.

One important advantage of the feed-forward interpretation is that we can use existing proposals to translate classical NNs to a gate-based quantum analog. To implement quantum analogs of feed-forward NNs, neurons can be implemented directly as qubits and weights between two neurons as operators [14, 17]. We use another promising approach to feed-forward NNs, where unitary operations U acting on a quantum register are associated with the classical perceptrons [2]. In the following, we will only consider a single synchronous update. More updating steps can be added by repeating the presented approach.

Using the qubit encoding scheme, a classical bit string Inline graphic is encoded in the corresponding computational basis state Inline graphic. In HNNs, neurons can only take the values Inline graphic and we identify Inline graphic and Inline graphic. Consequently, the classical input layer is replaced by state initialization of the quantum input register. The neurons of each subsequent layer of the classical feed-forward NN model are replaced by unitaries Inline graphic, which act on the input register and each on an additional, freshly prepared ancilla qubit. Figure 2c gives an example of this quantum analogue for three neurons and a single update. The colors correspond with those of the classical neurons of the classical network in Fig. 2b and the golden lines represent the ancilla qubits.

Note that input qubit i is not affected due to the absence of self-connections. The only output qubit affected by unitary Inline graphic is ancilla qubit i and the output state corresponds to the output of classical neuron i. To retrieve a classical output from the quantum system, ancilla qubits are measured at the end of the circuit. Using a majority vote over multiple measurement rounds, the most likely outcome is chosen as updated state. The original input qubits are discarded after an update round of applying all Inline graphic, meaning the input register is traced out. For a single update, 2n qubits are needed. For l updates, i.e. for l layers, Inline graphic qubits are needed and the output of a layer is used as input for the subsequent one.

Training a Quantum Hopfield Neural Network

The goal is to train the unitaries, opposed to variational quantum circuits, where classical gate parameters are trained and the gates themselves remain the same. Assume we have a training set of N input states Inline graphic for training and their desired output states Inline graphic, for Inline graphic. Let Inline graphic and let Inline graphic be the actual output of the quantum circuit U with input Inline graphic. Furthermore, let the fidelity of the circuit be given by

graphic file with name 500809_1_En_44_Equ1_HTML.gif 1

This fidelity corresponds with how well the output state after applying the unitary gates matches the desired output state. The cost function C is defined as

graphic file with name 500809_1_En_44_Equ2_HTML.gif 2

To optimize C, we train the unitary operations Inline graphic, which are parametrized by s as a measure of the training iterations or the training duration. After a time step Inline graphic, the unitaries are then updated according to

graphic file with name M20.gif 3

where the Inline graphic are Hermitian matrices given by

graphic file with name 500809_1_En_44_Equ4_HTML.gif 4

Here Inline graphic is a learning rate. These Inline graphic can be estimated by taking a partial trace of matrices Inline graphic that act on the whole space Inline graphic of all input and output qubits. This partial trace Inline graphic traces out all qubits not related to the unitary Inline graphic. These qubits are all other ancilla qubits and the j-th input qubit if self-connections are removed. The Inline graphic can be calculated from all unitaries, input and output training states as

graphic file with name 500809_1_En_44_Equ5_HTML.gif 5

where Inline graphic is the commutator of two operators A and B.

This updating scheme can be applied and implemented directly. In each iteration, all Inline graphic are estimated and Inline graphic is obtained by tracing out all unrelated qubits. Using Eq. (3), the unitaries are consequently updated in small time steps Inline graphic. The derivation of Eq. (4) and (5) involves Tayloring the exponential in Eq. (3) around Inline graphic to the first order and is provided in [2].

Simulating HNNs

In this section, we present the setup of our simulations of the HNNs. First we introduce the training set in Sect. 3.1, then we discuss the scaling of the simulations in Sect. 3.2 and afterwards we explain how to evaluate the performance of the HNNs in Sect. 3.3. Finally, Sect. 3.4 explains how we implemented the simulations and how we ran them.

Creating a Training Set

Let Inline graphic be a set of m classical memory patterns Inline graphic. We generate a training set Inline graphic of input and output states from Inline graphic using the qubit encoding. First, we add all memory patterns Inline graphic as both input and output patterns to Inline graphic. Additionally, we add noisy memory patterns to the training set to prevent the unitaries from simply swapping input and output registers, without actually acting as an associative memory. All bit strings at a Hamming distance smaller or equal to d around each memory pattern in Inline graphic are used as input states and are denoted by Inline graphic. These Inline graphic states are noisy versions of the memory state Inline graphic. Hence, for each memory state Inline graphic, the respective Inline graphic are associated with Inline graphic as output states.

The number of training samples depends on the number of patterns at distance at most d to a given pattern. For m memories, the total number of generated training samples Inline graphic depends on the binomial coefficients Inline graphic and is given by

graphic file with name M44.gif 6

Note that the order of training samples does not influence the results, as Inline graphic is estimated as a sum over all training samples in Eq. (4). Also note that for large enough d, one noisy input pattern may be associated with different output states. For example, for Inline graphic, Inline graphic and Inline graphic, the string (1, 0, 1) is at distance one from both (1, 0, 0) and (0, 0, 1), yielding two contradicting training pairs. Consequently, the cost function in Eq. (2) cannot be exactly one, but takes smaller values. Clearly, the larger m and d are with respect to n, the more contradicting training pairs there are and the smaller the maximum of the cost function is.

Model Complexity

Let us consider the complexity of our model. To estimate Inline graphic using Eq. (4), in each iteration, Inline graphic must be estimated for each training pair k. Hence, the duration of training is linear in the number of training samples Inline graphic and the time required to estimate Inline graphic, denoted by Inline graphic. The time to update Inline graphic according to Eq. (3) is denoted as Inline graphic. This is repeated for all n unitaries and Inline graphic iteration steps. The total training duration is thus given by

graphic file with name M55.gif 7

To estimate both terms in Eq. (5), we need Inline graphic multiplications of Inline graphic-matrices. As most matrices in Eq. (5) do not depend on k, the result of the multiplication can be reused. Therefore, the second term in Eq. (7) can be rewritten as Inline graphic, where we used that multiplying two complex Inline graphic matrices requires Inline graphic multiplications of complex numbers in general. Neglecting the computational costs for the partial trace and matrix exponential and assuming a constant time for each multiplication, the total time complexity can be summarized as

graphic file with name M61.gif 8

where only the samples at distance Inline graphic are included in the training set. This complexity is independent of whether or not self-connections are removed. It does however restrict us to classical simulations of small systems with Inline graphic only.

Evaluating the Performance

Different HNNs with different training and updating schemes can be compared by the capacity of the HNN, an important measure to estimate the performance as an associative memory. The capacity relates to the maximum number of storable patterns, which requires some measure of the number of retrieval errors. We give three types of errors, each decreasingly strict in assigning errors. The proposed error rates are the strict, message and bit error rates and are given by:

graphic file with name 500809_1_En_44_Equ9_HTML.gif 9
graphic file with name 500809_1_En_44_Equ10_HTML.gif 10
graphic file with name 500809_1_En_44_Equ11_HTML.gif 11

Here, n is the input size and m the number of distinct stored patterns, with Inline graphic. The memory patterns are chosen randomly. Furthermore, Inline graphic is the indicator function, which is one if its argument is true, and zero otherwise.

The Inline graphic (Eq. (9)) only considers the patterns the HNN should memorize and equals one if at least one bit of any memory pattern cannot be retrieved. This definition corresponds to the one given in [9]. The Inline graphic (Eq. (10)) is less strict and uses Inline graphic noisy probe vectors Inline graphic for each memory Inline graphic. These probe vectors are random noisy versions of the memory patterns, generated with noise parameter Inline graphic. The Inline graphic equals the fraction of the probe vectors from which Inline graphic cannot be recovered exactly. Finally, the Inline graphic (Eq. (11)) also uses the probe vectors Inline graphic. The BER considers all bits separately that cannot be retrieved correctly. For Inline graphic, these three error rates are decreasingly strict: Inline graphic.

For error rates Inline graphic and threshold t, we estimate the number of storable patterns in an HNN using

graphic file with name 500809_1_En_44_Equ12_HTML.gif 12

The capacity Inline graphic of an HNN is now given by normalizing Inline graphic by n. For large system sizes, Inline graphic is independent of t. For classical HNNs with Hebbian learning the capacity is given by Inline graphic.

The capacity of an HNN cannot be determined accurately with only a single set of random memory patterns. Therefore, the error rate for r different random sets of memory patterns are averaged to better approximate the error rates. Note that we require the learned patterns to be stable states of the network and that other states in the vicinity should be attracted. Furthermore, Inline graphic is not an appropriate measure for the attractiveness of memory patterns. This follows as the noisy probe samples are randomly generated and might therefore not be part of the memories basin of attraction.

Memories may contain some patterns multiple times, for instance due to small system sizes. For such memories, effectively fewer patterns are stored. Therefore, we generate memories at random, but require them to be distinct.

Simulation Methods

We simulate both the classical and the quantum HNN using matrix multiplications. The classical simulation is implemented straightforwardly by applying the updating rule for neurons and the Hebbian learning scheme to estimate the weights. For the quantum HNN, the unitaries Inline graphic are initialized uniformly at random and updated according to Eq. (3), where the matrices Inline graphic are estimated from Eq. (4) and (5). Quantum measurements are implemented by choosing the most likely outcome based on the probabilities calculated from the output states, in case of several equally likely outcomes an error is assigned in general. The code used for our simulations is available at [10].

The learning rate Inline graphic introduced in Eq. (4) can be chosen freely and controls the step width of updates. We chose Inline graphic based on an estimation of the Inline graphic with varying Inline graphic for system size Inline graphic, Inline graphic training iterations and Inline graphic repetitions.

We train the unitaries in 50 training iterations on r randomly generated sets of memory patterns. For each set, we estimate the three error rates of retrieval when presenting the memories as input to the trained quantum model. The training sets include all samples at a distance Inline graphic around the respective memory patterns. We repeat this estimation with systems of size Inline graphic and Inline graphic memories for all r runs. We sample the error rates Inline graphic times for Inline graphic, and up to 1200 times for Inline graphic, to reduce the confidence intervals to a reasonable level.

Results

We present the results for the error rates for noisy input retrieval and the capacity of both the quantum HNN (Sect. 4.1 and Sect. 4.2) and the classical HNN (Sect. 4.3 and Sect. 4.4). We end by comparing the results for both in Sect. 4.5. All results are presented with 99% confidence intervals (CI).

Error Rates of Retrieving Memory Patterns

The error rates when presenting stored memories as input states are displayed in Fig. 3 for system sizes Inline graphic. The error rates are averaged over the corresponding r rounds. In all simulations, the error rates are zero for Inline graphic and increase monotonically with m. The Inline graphic increases quickly for small m and reaches one at Inline graphic (Inline graphic), Inline graphic (Inline graphic) and Inline graphic (Inline graphic). The Inline graphic increases moderately and does not reach one, but settles at around 0.7 for Inline graphic and Inline graphic. The Inline graphic increases the least of all rates and remains below 0.2 for all considered systems.

Fig. 3.

Fig. 3.

Estimated Inline graphic, Inline graphic and Inline graphic versus the number of stored patterns m for different system sizes Inline graphic, 4, 5 for a quantum HNN.

The noisy input samples are generated with noise rates Inline graphic and performance is evaluated for Inline graphic and Inline graphic. The results are shown in Fig. 4, together with the noiseless results for Inline graphic. We find that both the Inline graphic and Inline graphic monotonically increase with m. Even for Inline graphic and noise rate Inline graphic, the Inline graphic remains below 0.3 and the Inline graphic below 0.85 in all considered cases.

Fig. 4.

Fig. 4.

Estimated Inline graphic and Inline graphic of retrieving the correct memory patterns from noisy inputs versus the number of stored patterns m. The considered system sizes are (a) Inline graphic, (b) Inline graphic and (c) Inline graphic.

For all m, the differences between the error rates for different noise rates remain approximately constant. We notice that the Inline graphic for Inline graphic and Inline graphic are within the range of each other’s confidence intervals for almost all m. For Inline graphic, the CIs are increasingly large due to the varying number of repetitions.

Capacity of the Quantum Model

Based on the error rate estimations, we estimate the ability of our quantum model to store and retrieve patterns. The estimated maximum numbers of storable patterns Inline graphic are given in Table 1 for error rates Inline graphic and Inline graphic and thresholds Inline graphic and Inline graphic. For this, the point estimates of both error rates and their CIs are compared to the thresholds. Only for Inline graphic, there are several m-values with confidence intervals that contain error rates below the threshold values. Hence, not all Inline graphic can be estimated with certainty, and therefore all possible values are indicated by curly brackets.

Table 1.

Maximum number of storable patterns Inline graphic when presenting memories as inputs, for Inline graphic and Inline graphic and thresholds Inline graphic. To obtain all Inline graphic, the 99% confidence intervals around error rates are considered.

n Inline graphic Inline graphic Inline graphic Inline graphic
3 1 1 1 1
4 1 1 1 1
5 1 {1, 2} 1 {1, 2}

Error Rates of Retrieving Memory Patterns Classically

We estimate the error rates for retrieving memory patterns with classical HNNs. For each fixed n and Inline graphic, we generate Inline graphic sets of memories at random. Each of the three error rates are estimated for Inline graphic and the memory patterns as inputs, the results are shown in Fig. 5. We find that with increasing number of patterns m, the error rates increase as well. All error rates are exactly zero for Inline graphic and one for Inline graphic. For even n, both the Inline graphic and Inline graphic fluctuate for different m and are higher if m is even. In contrast, for odd n we see a smooth evolution. The Inline graphic increases to 1 rapidly for all n. The results for Inline graphic are similar to those for the Inline graphic. The Inline graphic stays well below the other error rates and increases only moderately, before reaching unity for Inline graphic.

Fig. 5.

Fig. 5.

Estimated Inline graphic, Inline graphic and Inline graphic when presenting the stored patterns to the classical HNN versus their number m for different system sizes n. The stored patterns are required to be distinct.

When presenting noisy input states to the HNN, we see different behavior. As in the quantum case, only the Inline graphic and Inline graphic are estimated. For each memory pattern, we generate Inline graphic noisy samples with the same noise rates Inline graphic as before. The results for different system sizes n are shown in Fig. 6. The different noise rates are indicated by different colors. Again we see less fluctuations for increasing n. Errors increase earlier in the noisy case than in the noiseless case, as expected.

Fig. 6.

Fig. 6.

Estimated Inline graphic and Inline graphic versus the number of stored patterns m for system sizes Inline graphic when presenting noisy test samples as inputs to the classical HNN. The test samples are generated with noise rates Inline graphic. Additionally, the error rates for presenting the noiseless memories are shown.

Capacity of Classical HNNs with Hebbian Learning

We evaluate Inline graphic for 100 iterations and in each iteration we estimate the error rates using Inline graphic randomly chosen sets of distinct memories for different m and n. We consider the strict error rates in this analysis. In Fig. 7a and 7b the results are shown for thresholds Inline graphic and Inline graphic. The results for the Inline graphic are similar to those of the Inline graphic. The theoretical capacity Inline graphic is shown as an orange line. We see a step-wise behavior for all shown results and we see that the results for Inline graphic correspond relatively well with the theoretical limit.

Fig. 7.

Fig. 7.

Estimated Inline graphic for thresholds (a) Inline graphic and (b) Inline graphic. The obtained values are based on r = Inline graphic runs with random sets of memories to estimate the Inline graphic for a classical HNN with Hebbian learning. The asymptotic limit of retrievable patterns is displayed by the orange curve Inline graphic. (Color figure online)

Comparison of Classical and Trained Quantum HNN

We compare the error rates, which are estimated when presenting the memory patterns to the respective model, for the classical HNN with Hebbian learning and our trained quantum model in Fig. 8. The considered system sizes are Inline graphic. For Inline graphic, we have only few data for the quantum model due to the computational cost, such that a comparison can be only made for Inline graphic.

Fig. 8.

Fig. 8.

Comparison of estimated error rates versus the number of stored patterns m for different system sizes Inline graphic. The blue (red) data are achieved using our trained quantum model (classical HNN with Hebbian learning). (Color figure online)

For all n, the Inline graphic and Inline graphic of the quantum model are smaller than for the classical HNN. The only exception is for Inline graphic and Inline graphic, where the Inline graphic of the classical model is smaller. We also find that the Inline graphic of the quantum model is smaller than the classical Inline graphic for small m and reaches one only for higher values of m. While the Inline graphic and Inline graphic fluctuate like a saw-tooth for even n for the classical HNN, we do not find this behavior for the quantum model.

In Table 1 the maximum number of stored patterns without errors is given for the trained quantum model. Based on the results in Fig. 8, we see that the classical HNN with Hebbian learning can only store one pattern reliably.

Discussion

In contrast to the case of classical HNNs with Hebbian learning, both Inline graphic and Inline graphic remain well below one even for Inline graphic for our quantum model. This is reasonable, as it is possible that there are invariant sub-spaces of quantum states, that are not affected by the trained quantum channel. Even if all possible input states are considered as memories, a small number of them can remain invariant under the channel action and thus yield a retrieval error rate less than one.

The estimated error rates for noisy inputs for a quantum HNN stay well below the results for the classical HNN with Hebbian learning and they increase slower. However, when comparing the relative increase in error rate for noiseless and noisy patterns, the classical and the quantum HNN score roughly the same.

Within the level of confidence obtained with the results, we can conclude that our quantum model can store more memories than the classical HNN using Hebbian learning. Already for Inline graphic it is likely that the quantum model can store more than one memory given that Inline graphic or Inline graphic are below Inline graphic, whereas the classical model can only store a single memory reliably.

The capacity estimates for the classical HNN with Hebbian learning follow the theoretical optimal curve. Due to the high computational costs of the simulations, these results are unavailable for the quantum HNN. Based on the shown results, we do expect capacity improvements for the quantum model over the classical theoretical optimum.

The high computational costs of the simulations of the quantum model originate from the exponential complexity given in Sect. 3.2. This in turn results in very limited system sizes we can simulate. Nonetheless, simulating larger systems in sufficiently many repetitions is valuable, because it allows us to compare the number of stored patterns to other implementations of HNNs.

The presented model can be implemented on general quantum devices and an implementation would require Inline graphic qubits and Inline graphic multi-qubit gates.

Conclusion and Outlook

In this work we consider classical HNNs with Hebbian learning and quantum HNNs, where the unitaries are explicitly trained. Based on the presented results, we conclude that the quantum HNN can indeed be used to store classical bit strings as stable attractors with a higher capacity than classical HNNs.

Using a numerical analysis, we consider the number of randomly chosen bit strings that can be stored by an associative model. For Inline graphic we found that the number of storable patterns is one or two, given an error rate threshold of 0.1, whereas only a single pattern can be stored using a classical HNN with Hebbian learning. For threshold zero, the storage capacity for small system sizes is equal for both classical and quantum HNNs.

It is possible to implement the trained quantum model on actual quantum devices, requiring Inline graphic qubits. This might even allow for faster evaluation of the training scheme due to fast execution times on quantum devices. This would allow testing of the trained quantum model on larger systems than in our simulations. However, the number of required gate parameters of the algorithm has a similar scaling as the time complexity when implemented straightforwardly. Therefore, we expect that the scaling prevents experimental realizations of much larger systems.

We conclude that the trained quantum model of our work should be understood as a toy example on the path towards a quantum algorithm for associative memories with possibly larger capacity. The achievement of a quantum advantage by increasing the storage capacity of quantum neural networks beyond classical limits is far from obvious, and more research is required.

Although only classical inputs have been considered, the presented quantum models can also be used for quantum data as inputs and outputs. The ability of our model to store and retrieve quantum states should be studied in future research. We suggest comparing our trained quantum model to classical algorithms that involve non-static training schemes for HNNs, i.e., where the weights are optimized on a training set with respect to a cost-function. In this way, it can be clarified experimentally, whether the better performance of the quantum model originates purely from the fact that it is trained, or from an actual quantum advantage over classical schemes. Moreover, we propose to analyze the storage capacity of our model theoretically, both for quantum and classical memory states. In this way, we hope to find an answer to the ultimate question of whether a quantum advantage can be achieved in the storage capacity of neural networks.

Contributor Information

Valeria V. Krzhizhanovskaya, Email: V.Krzhizhanovskaya@uva.nl

Gábor Závodszky, Email: G.Zavodszky@uva.nl.

Michael H. Lees, Email: m.h.lees@uva.nl

Jack J. Dongarra, Email: dongarra@icl.utk.edu

Peter M. A. Sloot, Email: p.m.a.sloot@uva.nl

Sérgio Brissos, Email: sergio.brissos@intellegibilis.com.

João Teixeira, Email: joao.teixeira@intellegibilis.com.

Nicholas Meinhardt, Email: nmeinhar@student.ethz.ch.

Niels M. P. Neumann, Email: niels.neumann@tno.nl

Frank Phillipson, Email: frank.phillipson@tno.nl.

References

  • 1.Arute F, et al. Quantum supremacy using a programmable superconducting processor. Nature. 2019;574:505–510. doi: 10.1038/s41586-019-1666-5. [DOI] [PubMed] [Google Scholar]
  • 2.Beer, K., Bondarenko, D., Farrelly, T., Osborne, T.J., Salzmann, R., Wolf, R.: Efficient learning for deep quantum neural networks. arXiv:1902.10445, February 2019 [DOI] [PMC free article] [PubMed]
  • 3.Cabrera E, Sossa H. Generating exponentially stable states for a Hopfield neural network. Neurocomputing. 2018;275:358–365. doi: 10.1016/j.neucom.2017.08.032. [DOI] [Google Scholar]
  • 4.Dunjko V, Briegel HJ. Machine learning and artificial intelligence in the quantum domain: a review of recent progress. Rep. Prog. Phys. 2018;81(7):074001. doi: 10.1088/1361-6633/aab406. [DOI] [PubMed] [Google Scholar]
  • 5.Feynman RP. Quantum mechanical computers. Opt. News. 1985;11(2):11. doi: 10.1364/ON.11.2.000011. [DOI] [Google Scholar]
  • 6.Harrow AW, Montanaro A. Quantum computational supremacy. Nature. 2017;549(7671):203–209. doi: 10.1038/nature23458. [DOI] [PubMed] [Google Scholar]
  • 7.Hilbert M, Lopez P. The world’s technological capacity to store, communicate, and compute information. Science. 2011;332(6025):60–65. doi: 10.1126/science.1200970. [DOI] [PubMed] [Google Scholar]
  • 8.Hopfield JJ. Neural networks and physical systems with emergent collective computational abilities. Proc. Natl. Acad. Sci. 1982;79(8):2554–2558. doi: 10.1073/pnas.79.8.2554. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.McEliece R, Posner E, Rodemich E, Venkatesh S. The capacity of the Hopfield associative memory. IEEE Trans. Inf. Theory. 1987;33(4):461–482. doi: 10.1109/TIT.1987.1057328. [DOI] [Google Scholar]
  • 10.Meinhardt, N.: NMeinhardt/QuantumHNN 1.0 (Version 1.0). Zenodo (2019), 11 April 2020. 10.5281/zenodo.3748421
  • 11.Mitarai K, Negoro M, Kitagawa M, Fujii K. Quantum circuit learning. Phys. Rev. A. 2018;98(3):032309. doi: 10.1103/PhysRevA.98.032309. [DOI] [Google Scholar]
  • 12.Neumann N, Phillipson F, Versluis R. Machine learning in the quantum era. Digitale Welt. 2019;3(2):24–29. doi: 10.1007/s42354-019-0164-0. [DOI] [Google Scholar]
  • 13.Preskill, J.: Quantum computing and the entanglement frontier. In: 25th Solvay Conference on Physics, March 2012
  • 14.Rebentrost P, Bromley TR, Weedbrook C, Lloyd S. Quantum Hopfield neural network. Phys. Rev. A. 2018;98(4):042308. doi: 10.1103/PhysRevA.98.042308. [DOI] [Google Scholar]
  • 15.Rojas R. Neural Networks. Heidelberg: Springer; 1996. [Google Scholar]
  • 16.Schuld M, Sinayskiy I, Petruccione F. The quest for a quantum neural network. Quantum Inf. Process. 2014;13(11):2567–2586. doi: 10.1007/s11128-014-0809-8. [DOI] [Google Scholar]
  • 17.Schuld M, Sinayskiy I, Petruccione F. Simulating a perceptron on a quantum computer. Phys. Lett. A. 2015;379(7):660–663. doi: 10.1016/j.physleta.2014.11.061. [DOI] [Google Scholar]
  • 18.Ventura, D., Martinez, T.: Quantum associative memory with exponential capacity. In: 1998 IEEE International Joint Conference on Neural Networks Proceedings. IEEE World Congress on Computational Intelligence (Cat. No. 98CH36227), vol. 1, pp. 509–513. IEEE (2002)

Articles from Computational Science – ICCS 2020 are provided here courtesy of Nature Publishing Group

RESOURCES