Introduction

While conventional computers rely on predetermined algorithms for performing tasks, computers based on artificial neural networks are flexible and can learn from example in analogy to a biological brain. Their resilience allows them to be versatile in applications and adaptive to practical situations. For instance, artificial neural networks are used across disciplines for a multitude of tasks1,2,3,4,5,6,7,8,9, and are capable of extracting features from noisy10,11 or incomplete data12,13, as well as perturbed systems14.

An artificial neural network is a system of interconnected nonlinear nodes capable of modelling complex mapping between input and output data. A given map is formed by carefully adjusting the connection weights between the nodes during a training procedure. While neural networks have been used for various applications, most of them are in the form of softwares implemented in conventional computers. Hardware realisations have been sought; however, a major challenge is the control of the large number of connections between the nodes in conventional neural network architectures15.

“Reservoir computing” refers to an alternative neural network architecture where the connections inside the network are taken to be fixed and random16,17, thus avoiding the overhead of controlling a large number of connections, while keeping its wide range of applications18,19. In this context, the fixed random network is known as the “reservoir”. As it is easier to engineer a fixed and random network than a well-controlled one, reservoir computing has been successfully implemented in a variety of physical systems20,21,22,23. Recently, the reservoir computing concept was brought to the quantum domain24, using networks of quantum nodes25,26 and the performance of specific non-classical tasks27 including quantum state preparation28,29 and tomography30 was investigated. While these examples operate with quantum systems, they work with classical data either in the input or output and are far from being quantum computers, which should be able to implement unitary transformations (at least approximately) of a quantum state.

In quantum computing, one of the most commonly used architectures is the quantum circuit model where an arbitrary quantum operation is decomposed with elementary quantum gates31. Their realisation requires precise engineering32, which has led to the developments of quantum computers with a limited number of qubits so far33,34, while the actual number required for meaningful applications is orders of magnitude higher35. Although any quantum operation can be in principle obtained by applying gate combinations from a small set of quantum gates (referred to as universal gate set), long gate sequences require long operation time and lead to large errors. Alternatively, many frequently used elementary quantum operations can be obtained directly instead of obtaining them as combinations of gates from a universal gate set. However, realising different types of operations has required different types of interaction between the qubits, leading to more complex engineering.

Here, we introduce a scheme of quantum computing based on a reservoir computing framework. As the main network, we take a set of quantum nodes coupled via random and uncontrolled quantum tunnelling. This network would traditionally be referred to as a reservoir within the context of neural networks. However, we will refer to the set of quantum nodes as the “quantum network” (QN) with its main feature being that its weight connections are not engineered. Similar networks of qubits were used before in refs. 36,37 to realise non-trivial multi-qubit gates, where, unlike the reservoir computing architecture, all network weights were optimised. Let us also point out that our scheme has no relation to techniques of reservoir engineering, as we are not operating with a thermal bath or proposing to engineer the QN38,39,40,41. Our use of the term “network” is not supposed to convey a particularly large number of nodes. For efficiency we will work with the smallest possible network.

The QN is connected to a layer of “computational” qubits upon which quantum processing is to be performed. We allow the strengths of the weights between the QN and computational qubit layer as the only layer of the network that needs optimisation, as illustrated in Fig. 1. We show that a single QN can induce a wide variety of quantum operations on the qubits. In addition to universal quantum gates, we show that our scheme can directly induce non-unitary quantum operations, which is useful to simulate open quantum systems. We emphasise that these are achieved with quantum tunnelling as the only mode of interaction.

Fig. 1: The scheme for quantum computing based on a quantum network.
figure 1

The QN is composed of a randomly connected network of nodes (black circles) driven with coherent excitation P (blue arrow). The qubits on which computation is performed are denoted by qk (k ranges from 1 to the number of qubits). Quantum operations on qubits qk are performed by coupling them through the QN. Jkl (l ranges from 1 to the number of network sites N) represents a control layer of tunnelling amplitudes connecting the qubits to the QN. Different colours of qubits correspond to different levels of optimisation.

Result

A QN is formed with a network of two-level quantum nodes, which are interconnected via quantum tunnelling with random weights and excited with a classical field. The Hamiltonian is

$${\hat{\mathcal{H}}}_{QN}=\, \mathop{\sum}\limits_{l}{E}_{l}{\hat{a}}_{l}^{\dagger }{\hat{a}}_{l}+\mathop{\sum}\limits_{\langle ll^{\prime} \rangle }{K}_{ll^{\prime} }({\hat{a}}_{l}^{\dagger }{\hat{a}}_{l^{\prime} }+{\hat{a}}_{l^{\prime} }^{\dagger }{\hat{a}}_{l})\\ +\mathop{\sum}\limits_{l}({P}_{l}^{* }{\hat{a}}_{l}+{P}_{l}{\hat{a}}_{l}^{\dagger }).$$
(1)

The field operators \({\hat{a}}_{l}^{\dagger }\) and \({\hat{a}}_{l}\) are the raising and lowering operators of a two-level system, which can be defined as \({\hat{a}}_{l}^{\dagger }=\left|e\right\rangle {\left\langle g\right|}_{l}\) and \({\hat{a}}_{l}=\left|g\right\rangle {\left\langle e\right|}_{l}\), where \(\left|g\right\rangle\) and \(\left|e\right\rangle\) are the ground and excited states of the system with index l. El and \({K}_{ll^{\prime} }\) are site-dependent energies and nearest-neighbour hopping amplitudes, uniformly distributed in the intervals [±E0/2] and [±K0/2], respectively. The last term in Eq. (1) corresponds to the driving by a classical field. For simplicity we consider a uniform driving, such that Pl = P. All calculations are performed with an open boundary condition (i.e. finite lattice with no periodicity) for the QN Hamiltonian.

The QN interacts with a set of computational qubits with the coupling weights Jkl, such that the whole system is described by the Hamiltonian

$$\hat{\mathcal{H}}={\hat{\mathcal{H}}}_{QN}+\mathop{\sum}\limits_{kl}\left({J}_{kl}^{* }\ {\hat{\sigma }}_{k}^{+}{\hat{a}}_{l}+{J}_{kl}\ {\hat{a}}_{l}^{\dagger }{\hat{\sigma }}_{k}^{-}\right),$$
(2)

where \({\hat{\sigma }}_{k}^{\pm }={\hat{\sigma }}_{k}^{x}\pm i{\hat{\sigma }}_{k}^{y}\) with \({\hat{\sigma }}_{k}^{x}\) and \({\hat{\sigma }}_{k}^{y}\) being the Pauli-X and Y operators for the qubit qk. Note that the computational qubits do not directly interact with each other, but only via the QN through quantum tunnelling. Our proposition is to induce quantum operations on the qubits qk by switching on the tunnelling amplitudes Jkl for a time τ. The parameters are chosen with a four-step method: (a) We consider a sufficiently large QN with random fixed hopping amplitudes \({K}_{ll^{\prime} }\) and energies El. (b) P and τ are chosen (but not fine-tuned) in regimes where the output fidelity is high. (c) We then train (fine-tune) the tunnelling amplitudes Jkl by maximising the fidelity. (d) For very small QNs, we train Jkl, Pl and τ to maximise the fidelity.

For training, we sample a set of pure input states for the qubits and compute fidelity of the states resulting from the QN compared to the ideal states corresponding to a desired quantum operation. The optimisation is performed using a hybrid genetic Nelder–Mead algorithm to set the tunnelling amplitudes Jkl (details in Supplementary Section 1). In practice, this supervised learning procedure requires access to a set of ideal input–output state pairs (we considered 10 randomly generated states), which can either be calculated theoretically or taken as a resource in an experimental setup. We allow Jkl to be complex, for generality, however this is not strictly necessary for our scheme. Once Jkl are optimised, the fidelity is retested with an independent sample of input states.

Regarding the practical feasibility we note that the Fermi–Hubbard model represented by the Hamiltonian \(\hat{\mathcal{H}}\) has efficiently been implemented using cold atoms in optical lattices42,43,44 and is expected to be accessible in nonlinear cavity arrays45,46, depending on the strongly interacting photon regime. Substantial progress has been made toward reaching this regime using a variety of systems, including Rydberg atoms in high quality factor cavities47, photonic crystal structures48, superconducting circuits49, exciton-polaritons50 and trion-polaritons51,52. A variety of physical implementations of coupling of quantum emitters to waveguides53 or resonators54 have also been considered, where lattices of superconducting qubits55 have been particularly successful. These classes of systems are typically described by the Jaynes–Cummings–Hubbard model56,57 where bosonic cavity modes are used to couple separated fermionic modes. The bosonic modes can be eliminated (under some conditions), giving an effective Fermi–Hubbard model58.

Quantum operations

Here we describe the protocol for inducing quantum operations on the computational qubits. An operation begins at time t = 0 with the initialisation of qubits. We sample the initial states \(\left|{\varphi }_{\text{in}}\right\rangle\) uniformly at random, assuming that the QN starts in the vacuum state \({\left|\text{vac}\right\rangle }_{QN}\). The whole system is allowed to evolve up to a time t = τ, corresponding to the unitary operator \(\hat{U}=\exp [-i\hat{\mathcal{H}}\tau /\hslash ]\). The final state of the combined system is thus given by \(\left|{{{\Psi }}}_{\text{out}}\right\rangle =\hat{U}\ \ \left|{\varphi }_{\text{in}}\right\rangle \otimes {\left|\text{vac}\right\rangle }_{QN}\). The final state of the qubits is given by \({\rho }_{q}={\text{Tr}}_{QN}[\left|{{{\Psi }}}_{\text{out}}\right\rangle \left\langle {{{\Psi }}}_{\text{out}}\right|]\) where TrQN[… ] represents the partial trace that traces out the QN. For each initial state we compute the fidelity given by the overlap of the ideal final quantum state \(\left|{\varphi }_{\text{ideal}}\right\rangle ={\hat{u}}_{q}\left|{\varphi }_{\text{in}}\right\rangle\) and the obtained state ρq:

$$F=\left\langle {\varphi }_{\text{ideal}}\right|{\rho }_{q}\left|{\varphi }_{\text{ideal}}\right\rangle,$$
(3)

where \({\hat{u}}_{q}\) is the desired quantum operation for the qubits. We plot fidelity histograms to show that the realised gates are almost perfect for any input state.

We first show that the same QN can realise a range of different two-qubit gates, e.g., controlled inversion (cNOT), controlled-Y (cY), controlled-Z (cZ) and qubit swap (SWAP), see Fig. 2. A specific gate operation is induced with well-chosen tunnelling amplitudes Jkl and appropriate values of P and τ. In Fig. 3, we also demonstrate that high fidelity single-qubit gates are realised with a QN consisting of only one node. The same can be achieved with larger QNs; see Supplementary Section 2. These quantum gates, together with the two-qubit gates, form a universal gate set, from which any quantum operation can be constructed in principle.

Fig. 2: Two-qubit gates and their fidelity distributions.
figure 2

a, b, c, and d are the fidelity distributions of the realised controlled-NOT (cNOT), controlled-Y (cY), controlled-Z (cZ) and SWAP gates, as their circuit diagrams are shown in the insets. Here we consider 6 nodes for the quantum network. The fidelity distributions are obtained over 2000 uniformly at random generated states. The average fidelities for all gates are larger than 0.99. Here, we use E0/K0 = (1, 1, 1, 2), P/K0 = (400, 400, 154, 5.5) and τK0/ℏ = (0.23, 0.2, 0.23, 0.3) for (a to d), respectively, and 10 randomly generated pure states for training. E0, K0, P and τ are energy, hopping strength, driving strength and evolution time, respectively.

Fig. 3: Fidelities of the single-qubit gates.
figure 3

We show the fidelity distributions for different single-qubit gates over 2000 uniformly at random generated states. af show the fidelity distributions for Pauli-X, Y, Z, Hadamard, phase and π/8 gates, respectively. For these gates a single network node is sufficient. A larger quantum network with 6 sites can also be considered, see Supplementary Section 2. The average fidelities for all the single qubit gates are larger than 0.9984. Here, we use P/E0 = (60, 60, 0.1, 4.96, 0.1, 0.1) and τE0/ℏ = (3.08, 16.68, 6.28, 1.53, 3.07, 4.71) for (a to f), respectively, and 10 randomly generated pure states for training. E0, P and τ are energy, driving strength and evolution time, respectively.

Although our demonstrations are based on only few-qubit quantum operations, it is to be noted that, even within this few-qubit regime, many frequently used quantum gates are not native gates in most physical systems. Consequently, these gates are then composed of the native universal gate set. As a result, the depth of the circuits increases. Our idea is that since the same QN can induce a large number of quantum operations, this will reduce the depth of the circuits (effectively compressing them). Our study also opens up the possibility of inducing quantum operations involving large numbers of qubits with a single QN, however that requires further study for a definitive answer.

Nonunitary operations

In general, the operations induced by the QN on the qubits can be nonunitary. The signature of the nonunitary nature of the operation can be observed in the purity of the qubits, shown in Fig. 4a. The purity oscillates and reaches 1 only at certain times (only at which the effective operation on the qubit can be considered unitary). We conclude that the system can also be trained to perform non-unitary gates. For a demonstration we consider a Markovian dynamics for the qubit given by the master equation: \(\hslash \dot{\rho }=(\gamma /2)(2{\sigma }^{-}\rho {\sigma }^{+}-{\sigma }^{+}{\sigma }^{-}\rho -\rho {\sigma }^{+}{\sigma }^{-})\). Using the QN, we obtain a non-unitary quantum operation equivalent to the same induced by the master equation of the qubit (see Fig. 4b).

Fig. 4: A quantum network can induce nonunitary operation.
figure 4

a Time dependence of qubit purity. b Distribution of fidelity of a qubit evolving under a Markovian process. We consider a decay strength γ and a propagation time t = 0.5 ℏ/γ for the Markovian process. Here, we considered a single network node and 2000 uniformly distributed initial states. K0 is the hopping strength.

Compression of quantum circuits

We have achieved a universal gate set from single- and two-qubit quantum gates with the QN. In the quantum circuit model, an arbitrary unitary is approximated with a sequence of single- and two-qubit gates. Using the same method, we achieve universality of a QN. Here, a single QN induces different quantum gates in a quantum circuit by changing the output tunnelling amplitudes Jkl. However, a QN has an important advantage. A long sequence of quantum gates in a circuit model can be replaced with a single operation by a QN. For instance, a two-qubit Grover’s algorithm59,60 can be implemented in one step with a QN, while the circuit model requires several quantum gates in sequence (see Fig. 5).

Fig. 5: Implementation of the two-qubit Grover’s algorithm with a quantum network.
figure 5

a A quantum circuit implementing the two-qubit Grover’s algorithm. The circuit in the blue box contains 11 gates, which we have replaced with a single operation acting on a state \(\left|\psi \right\rangle\). Here, \(\left|\psi \right\rangle\) is created with a state preparation circuit (green box) and an oracle (red box). We achieved an average fidelity 0.99 with six sites in the quantum network. The obtained output probabilities (expressed in percentage) for the Grover’s search task are presented in panels be for different \(\left|\psi \right\rangle\), where the x-axis represents the measurement basis states. Here, we use E0/K0 = 300, P/K0 = 98 and τK0/ℏ = 10.6 and 10 randomly generated pure states for training. Here, H, X and the yellow box represent Hadamard, Pauli-X and controlled-NOT gates, and E0, K0, P and τ are energy, hopping strength, driving strength and evolution time, respectively.

In Fig. 6, we present numerical evidence for the possibility of replacing an entire quantum circuit by a single operation. A diffusion operator for the three-qubit Grover’s algorithm is shown in Fig. 6a. This circuit includes a three-qubit Toffoli gate, which can also be implemented with single- and two-qubit gates; see Fig. 6b. The whole circuit would require 29 quantum gates in the conventional quantum circuit architecture. In contrast, a QN can implement all the gates by a single operation. The distribution of the output fidelity is plotted in Fig. 6c. We note that although considering fault-tolerance in Grover’s algorithm, as it is the case in the circuit model, could be interesting, it is beyond the scope of this paper.

Fig. 6: Implementation of the three-qubit Grover’s algorithm with a quantum network.
figure 6

a A quantum circuit (blue box) implementing the three-qubit Grover’s diffusion operator, which includes 29 single- and two-qubit gates. The circuit in the red box represents a three-qubit Toffoli gate. We have replaced the whole circuit with a single operation implemented by a quantum network (QN). We achieved an average fidelity 0.986 with five sites in the QN. b Quantum circuit (blue box) composed with single- and two-qubit gates for a three-qubit Toffoli gate (red box) used in a. c The distribution of fidelity for 2000 randomly generated input states. Here, X, H, T, T and yellow boxes represent Pauli-X, Hadamard, π/8, −π/8 and controlled-NOT gates, respectively. We have use E0/K0 = 2.99 × 103, P/K0 = 994.25 and τK0/ℏ = 1.22 and 10 randomly generated pure states for training, where E0, K0, P and τ are energy, hopping strength, driving strength and evolution time, respectively.

For implementing Grover’s search algorithm, a diffusive operator \(\hat{{\mathcal{D}}}\) is required to operate \(\sqrt{N}\) times on an N-qubit initial state to find out the search query. The operator \(\hat{{\mathcal{D}}}\) can be expressed as,

$$\hat{{\mathcal{D}}}={H}^{\otimes N}\left({\mathbb{1}}-2\left|{0}^{\otimes N}\right\rangle \left\langle {0}^{\otimes N}\right|\right){H}^{\otimes N}$$
(4)

where HN stands for Hadamard gates applied on all N qubits and \(\left|{0}^{\otimes N}\right\rangle\) represents the qubits in their ground state. For N = 2 and 3, the quantum circuits composed of single- and two-qubit gates are presented in Figs. 5 and 6, respectively.

Robustness

Our scheme is inspired by reservoir computing frameworks, which are known for their robustness against imprecisions in the fabrication of the network. Similarly here quantum operations can withstand any undesirable change in the QN, provided that we retrain the amplitudes Jkl. Indeed, as shown in the Supplementary Section 3, we find that the use of a neural network approach means that the system automatically learns how to deal with static errors in fabrication.

Physical systems

In our considered QN, quantum tunnelling is the only mode of interaction between the nodes. It is thus in principle compatible with a wide range of experimental platforms, including essentially all platforms currently considered for quantum computing, but with far less stringent requirements on the control of coupling between nodes. For example, let us mention ultracold atoms or ions (arguably the most advanced platform), cavity quantum electrodynamic systems (which enjoy relatively accessible measurement via optics), circuit quantum electrodynamic systems (which can be considered more accessible in setup)61, or novel platforms such as those based on the internal states of molecules62, coupled Bose–Einstein condensates63 and lattices of exciton-polaritons64. In some systems, interactions such as the Coulomb interaction are present in addition to tunnelling, which can in principle further enrich the complexity of quantum networks and potentially improve their computing capacity. Our scheme is particularly applicable for systems like quantum dots (QDs) where positioning them in regular patterns is a challenge. Consequently, these systems face challenges with disorder in the couplings between QDs, but this poses no problem for our scheme based on random coupling between nodes. The reduction in the number of gates may help less developed systems to implement examples of complete algorithms, even without having the relatively larger number of coupled qubits available in advanced ultracold ion traps.

Conclusion

We have presented a platform for quantum computing where an underlying set of quantum nodes connects computing qubits and a learning algorithm is used to adapt the system to a particular quantum operation. Several previous works have considered how quantum neural networks can enhance the efficiency of solving classical tasks25, while others have considered the use of assumed quantum computers65,66 and quantum annealers67 in neuromorphic architectures. In contrast, here we imagine a neuromorphic architecture that can allow a set of quantum nodes to realise quantum computation. The learning of quantum operations from quantum networks has been considered before, based on nonlocal spin coupling36 and adiabatic pulse control68. The advantage of the QN architecture introduced here is that only quantum tunnelling is considered for network connections, which is readily accessible in many systems (e.g. photonics, polaritons, cold atoms and trapped ions), and that only a small subset of total network connection weights need to be controlled. We note that while an advantage of quantum reservoir computing is that effects from disorder are corrected for at the training stage, a limitation is that each individual device would require separate training. This could make large-scale deployment by a manufacturer difficult. We also note that a very simple learning algorithm in the optimisation of the tunnelling amplitudes was used. The application of more advanced evolutionary algorithms in quantum control would likely lead to improved results for our system69. Alternatively, emerging quantum assisted algorithms70 can be used for operations with large number qubits, for instance, using hybrid quantum-classical algorithms based on gradient descent, since gradients can be efficiently measured on near term hardwares71.