An Artificial Spiking Quantum Neuron

Artificial spiking neural networks have found applications in areas where the temporal nature of activation offers an advantage, such as time series prediction and signal processing. To improve their efficiency, spiking architectures often run on custom-designed neuromorphic hardware, but, despite their attractive properties, these implementations have been limited to digital systems. We describe an artificial quantum spiking neuron that relies on the dynamical evolution of two easy to implement Hamiltonians and subsequent local measurements. The architecture allows exploiting complex amplitudes and back-action from measurements to influence the input. This approach to learning protocols is advantageous in the case where the input and output of the system are both quantum states. We demonstrate this through the classification of Bell pairs which can be seen as a certification protocol. Stacking the introduced elementary building blocks into larger networks combines the spatiotemporal features of a spiking neural network with the non-local quantum correlations across the graph.


INTRODUCTION
As Moore's law slows down [1], increased attention has been put towards alternative models for solving computationally hard problems and analyzing the ever growing stream of data [2,3].One significant example has been the reinvigoration of the field of machine learning: neuromorphic models, inspired by biology, found applications in a large host of fields [4,5].In parallel, quantum computing has been taking significant steps moving from a scientific curiosity towards a practical technology capable of solving real-world problems [6].Given the prominence of both fields, it is not surprising that a lot of work has gone into exploring their parallels, and how one may be used to enhance the other.One such synergy has emerged in the field of quantum machine learning [7][8][9].Recent results aim to mimic the parametric, teachable structure of a neural network with a sequence of gates on a set of qubits [10][11][12].A subset of these algorithms focus on quintessentially quantum problems: the input to the learning model is a quantum state and so is its output.This scenario is relevant in building and scaling experimental devices and it is often referred to as quantum learning [13,14].
We take a slightly different approach to quantum learning wherein the structure of the network manifests itself as interactions between qubits in space rather than as gates in a circuit diagram.Specifically, we will present a small toolbox of simple spin models that can be combined into larger networks capable of neuromorphic quantum computation.To illustrate the power of such networks, a small example of such a 'spiking quantum neural network' capable of comparing two Bell states is presented, a task which could have applications in both state preparation and quantum communication.The term 'spiking' refers to the temporal aspect in the functioning of the model during the activation of the neuron, akin to the classical spiking neural networks [15].As illustrated in the example, a fundamental property of these networks is that they generate entanglement between the inputs and outputs of the network, thus allowing measurement back-action from standard measurements on the output to influence the state of the input in highly non-trivial ways.The proposed model for spiking quantum neural networks is amenable to implementation in a variety of physical systems, e.g., using superconducting qubits [16][17][18].

BUILDING BLOCKS
The first step towards a neuromorphic quantum spin model is the construction of neuron-like building blocks.In other words, we need objects capable of sensing the state of a multi-spin input state and encoding information about relevant properties of this input into the state of an output spin.Additionally, we will require that this operation does not disturb the state of the input.Inspired by the way classical neurons activate based on a (weighted) sum of their inputs, the first building block will be one that flips the state of its output spin, depending on how many of the input spins are in the 'active' |↑ -state.The second building block, on the other hand, measures relative phases of components in the computational (i.e. the σ z ) basis, and thus has no classical analogue.

A. Neuron 1: Counting Excitations
In analogy to the thresholding behaviour of classical spiking neurons, we start by constructing a spin system that is capable of detecting the number of excitations (i.e. the number of inputs in the state |↑ ) and exciting its output spin conditional on this information.As shown in the supplemental material [19], this behaviour can be implemented using dynamical evolution driven by the Hamiltonian subject to some restrictions on the interaction strengths J, β, A that will be discussed below.In this model, we label spins 1 and 2 as the input, and spin 3 as the output.
The intuition behind this model is that the Heisenberg interaction between the inputs sets up energy differences among the four possible Bell state of the inputs.Through the σ z 2 σ z 3 coupling to the output, these differences then influence the energy cost of flipping the output spin, resulting in the cosine drive on the output only being resonant when the input qubits are in certain states.The result is that the driving induces flips in the output qubit if and only if the input is in a Bell state with an even number of excitations.Since the conditionality is a resonance/offresonance effect, the detuning of the undesired transitions needs to be much larger than the strength of the driving, which leads to the criterion which is naturally fulfilled whenever the driving-strength A is much smaller than the chain interaction strength J. Due to dynamical phases, the requirement that superpositions of input states should be preserved adds two additional constraints for the parameters of the model.Specifically, conservation of relative phases within the subspaces of inputs that either flips ("above threshold") or does not flip ("below threshold") the output yields If these constraints are fulfilled, the only non-trivial phase will be a coherent phase between the above-threshold and below-threshold subspaces of −i(−1) k+l exp (−iJt/ ).Since these two subspaces are now distinguished by the state of the output, correcting for this phase is just a matter of performing the corresponding phase-gate on the output qubit.In the special case where √ l 2 − k 2 is an integer, this reduces to performing a π/2-rotation of the output about the z-axis (see supplemental material [19] for details).When combined with this subsequent unconditional phase gate, the dynamical evolution induced by the Hamiltonian in ( 1) is to coherently detect the parity of the number of excitations of the input, and to encode this information in the output spin, i.e. in conventional Bell-state notation: where the first ket denotes the state of the inputs and the second ket the state of the output.The output is either fully excited or not excited at all by the evolution-hence we refer to this structure as a spiking quantum neuron, in analogy to similar objects from classical computing.Sample simulations showing the dynamics of the spiking process are shown in Fig. 1.

B. Neuron 2: Detecting Phases
While neuron 1 is a fully quantum mechanical object, capable of coherently treating superpositions in the inputs, the property that it detects-the number of excitations in the input-would be similarly well-defined for a classical neuron participating in a classical digital computation.However, the state of the two input qubits will also be characterized by properties that have no classical analogue, such as the relative phases of terms in a superposition state.The goal of the second neuron is to be able to detect these relative phases of states in the computational basis.Specifically, it aims to distinguish the states {|Ψ + , |Φ + } from the states {|Ψ − , |Φ − }.Combining this detectioncapability with the capabilities of the excitation-counting neuron of the previous section (exemplified by (3)) allows complete discrimination between the four Bell states.
The operational principle of the phase-detection neuron is similar to that of the excitation-detection neuron: it relies on a combination of single-qubit gates and the unitary time-evolution generated by a Hamiltonian of the form: As shown in the supplemental material [19], running the dynamics of this Hamiltonian for a time τ = π /2B performs a (−iZ)-gate on the output qubit if and only if the state of input qubits are in the subspace spanned by |Ψ − and |Φ − .Thus by conjugating this operation with FIG.1: Schematic depiction of the excitation-number detecting neuron (top) and plots of the time-evolution of the output-qubit state (red) and the overlap between the state of the input qubits and their initial state (green) for the four Bell states during the operation of the neuron.As illustrated in these plots, the state of the output is either flipped or not depending on whether the input contains an odd (middle) or even (bottom) number of excitations.In contrast, the input qubits return to their initial states in all four cases.Parameters used are l = 17, k = 8, which yields an average operational fidelity of 99.98% in the absence of noise.
Hadamard gates on the output qubit and correcting for the −i-phase using a phase-gate (see Figure 2) yields the desired phase-detection operation: The fundamental principle of operation is identical to the one of the excitation-counting neuron, in that the Hamiltonian once again contains three terms: a Heisenberg interaction to set up an energy spectrum that distinguishes the Bell states, an interaction that tunes the energy of the output qubit (i.e.qubit 3) dependent on the state of the inputs, and a single-qubit operator attempting to change the state of the output and succeeding if and only if the driving related to this term matches the energy cost of flipping the output.The only difference is that the interaction term now sets up an energy splitting between the spin states |± = 1 √ 2 (|↓ ± |↑ ) rather than the states |↑ / |↓ , hence the need for Hadamard gates to convert between the two bases.
As the operation of this neuron also relies on resonance/offresonance effects, a restriction of similar to (2) is present.Specifically, we require that ∆ = 2δ B .
Additionally, the requirement that the state of the inputs should not be distorted by the operation of the neuron yields the requirement that the ratios between J, δ and B should fulfil: with n m.FIG.2: Schematic depiction of the phase-detecting neuron (top) and plots of the time-evolution of the X-(blue) and Z-components of the output-qubit state as well as the overlap between the state of the input qubits and their initial state (green) for the four Bell states during the operation of the neuron.As illustrated in these plots, the state of the output is either flipped or not depending on whether the input contains a positive (top) or negative (bottom) relative phase.In contrast, the input qubits return to their initial states in all four cases.Parameters used are n = 82, m = 3, which yields an average operational fidelity of 99.07% in the absence of noise.As detailed in the supplemental material [19], small adjustments around these values can yield a slightly higher fidelity, in this case 99.58%.

STATE COMPARISON NETWORK
Having introduced a set of computational building blocks above, we now aim to illustrate how these can be combined into larger networks in order to solve computation-and classification-problems. Specifically, we will illustrate how a network of these objects allows one to compare pairs of Bell states to determine if they are the same Bell state.As detailed below, such a network could play a central role in the certification of Bell-pair sources and quantum channels, and may also have potential applications for machine learning and state preparation tasks.FIG.3: Schematic depiction of network for comparing pairs of Bell states.The left-most layer marked in red constitute the inputs to the network, with subsequent layers extracting and comparing information about either the phase (blue) or the excitation parity (orange) of the input states, with the result of the comparison stored in the green output qubit.The comparative nature of the task allows for the omission of the first hidden layer at the cost of a less neuromorphic operational proceduresee supplemental material [19] for details.
The basic structure of the proposed network is depicted in Fig. 4, and consists of three layers.The first layer constitutes the input to the system.It is in these four qubits that the two Bell states to be compared are stored.Each pair is used as an input to both of the types of neurons detailed in sections A and B, with the output stored in two pairs of qubits in the second layer.In this way, sequentially running each of the two neuron operations extracts both the excitation-number parity and the relative phase of superpositions in the inputs and encodes it into the second layer.In other words, this layer ends up containing exactly the information needed to distinguish among the four Bell states.State comparison therefore boils down to detecting if the information extracted from one input matches that extracted from the other input.Since detecting if two qubits are in the same state (i.e. both |↓ or both |↑ ) boils down to checking the number of excitations modulo two, this comparison can be done using the neuron of Section A. The third layer thus encodes two bits of information: whether the excitation parity of the two inputs match, and whether the relative phases match.Detecting if the two inputs were the same Bell state is thus a matter of detecting if both of these bits are in the |↑ -state.This can be done using methods similar to those of Section A -see supplemental material [19] for details.
The result of the manipulations is that the output is put into the |↑ -state if the two Bell-state inputs were identical and |↓ otherwise.Since all of the operations are achieved through linear, unitary dynamics, the behaviour for superposition inputs follow from this rule and linearity.This also implies that the network cannot compare arbitrary states, as is indeed prohibited by the no-cloning theorem of quantum mechanics.For instance, two identical inputs in a superposition in the Bell basis may return either |↑ or |↓ as output: This illustrates an interesting property of quantum neural networks, namely that entanglement between inputs and outputs means that measurements of the outputs may have dramatic effects on the state of the inputs.In this case, a measurement of |↑ in the output will always project the input qubits into the states corresponding to this output, i.e to identical Bell-state pairs.In this sense, a classifying quantum network like the one above will simultaneously be a projector onto the spaces corresponding to the states it is build to classify-a property that might prove helpful in, for instance, state preparation schemes.
A more concrete application of the network above is the certification of quantum channels and Bell-state sources.
The ability to determine the reliability of resources such as Bell-state sources and quantum channels would be a practical benefit in many quantum communication and quantum cryptography applications.This is an active area of research: for instance, device-independent self-testing through Bell inequalities works for certain multipartite entangled states [20], or quantum template matching for the case where we have two possible template states [21,22].Since the device presented above allows for the comparison of unknown systems with known-good ones, it is ideally suited to this kind of certification task.
Finally, it is worth noting that the comparative nature of the network means that the output of the network defines a kernel between 2-qubit quantum states.Specifically, given two inputs represented by amplitudes {a i } and {b i } in the Bell-state basis, the probability of measuring |↑ in the output will be given by which bears a strong resemblance to the classical "expected likelihood" kernel [23].Considering this, comparison networks like the one above may also find applications within kernel-based quantum machine learning approaches [24,25].

CONCLUSION AND OUTLOOK
We have presented a set of building blocks that detects properties of two-qubit inputs and encodes these properties in a binary and coherent way into the state of an output qubit.To illustrate the power of such spiking quantum neurons, we have presented a network of these building blocks capable of identifying if two Bell states are identical or not, and argued the usefulness of such comparison networks for quantum certification tasks within quantum communication and quantum cryptography.Additionally, we have seen how the entanglement of the inputs and output results in highly non-trivial effects on the inputs when a measurement is performed on the output of the network.
From the considerations above, several interesting questions arise.A main question might be how to scale up structures made from these and similar building blocks into larger networks capable of performing more complex quantum processing tasks.Concerning scaling, it seems reasonable to expect that the kind of intuitive reasoning behind the operation of the network presented here will become ever more challenging.As a result, it might be fruitful to take inspiration from the field of classical neural networks and design quantum networks whose operation depend on parameters.In this way, one can then adjust these parameters to make the network perform a certain task, in a way analogous to how both classical and quantum neural networks are trained.Since the Hamiltonians responsible for the operation of the neurons already contain a number of parameters, the architecture presented in this paper seems well-suited to such an approach.
Another possible avenue of improvement is to reduce the complexity of operation related to having to turn interactions between the different layers on and off by instead employing autonomous methods similar to those already used within the field of quantum error correction.Using such methods to perform quantum operations in a coherent way can be highly non-trivial, but for networks like the one described above where the latter stages of the network are essentially classical processing, strict coherences should not be needed for the network to operate, thus lowering the bar for autonomous implementations of similar networks.Finally, tapping into the temporality of the neurons presented above also holds great promise.Indeed, it has already been shown that the temporal behaviour of comparatively simpler networks of spins allows for universal quantum computation [26].Thus we believe that augmenting the neurons of this paper with less constrained and clock-like dynamics combined with tunable, teachable behaviour and perhaps partial autonomy would be a promiseful route towards a neuromorphic architecture capable of solving complicated and interesting problems within quantum learning.
This supplemental material aims to give a more detailed analysis of the spin-models leading to the two neurons presented in the main text (Sec.I and II), as well as some elaborations on the construction and operation of the Bell-state comparison network (Sec.III).

I. FURTHER DETAILS ON EXCITATION-PARITY NEURON
As explained in the main text, the goal with the first neuron is to detect the odd/even parity of the number of excitations (i.e.|↑ -states) in the input.In other words, we wish to be able to distinguish the Bell-states It turns out that this can be achieved using three ingredients.First, we add a Heisenberg-XXZ interaction between the two input-qubits: where J, β are energies and γ is a unitless parameter.The intuition behind this interaction is that it tunes the energy-spectrum of the system in such a way that it allows us to distinguish between the |Φ ± -and |Ψ ± -states: The next ingredient is to couple the output-qubit to the input-qubits in such a way that the state of the inputqubits influences the energy-spacing of the output-qubit, thus allowing us to do conditional flips of the output qubit by only driving at specific frequencies.Since the property we want to detect has to do with the total z-component of the input state (when thought of as a spin state), a reasonable interaction for achieving this would be As a result of this interaction, the eigenstates of the system are no longer the Bell states, but instead take the general form: for suitable coefficients A ± , B ± .Assume now that we add as the final ingredient a drive on the output-qubit: This drive will resonantly drive the two transitions On the other hand, all other transitions that this drive could potentially induce will be detuned due to the structure of the energy-spectrum.Specifically, the energydifferences between other pairs of states connected by the σ x 3 -operator will be and as a result the driving with frequency 2β/ will be detuned by As long as the strength of the driving is weak compared to these energy-scales, the driving will be unable to induce the corresponding transitions.Thus if we require the only effect of the term in (6) to first order will be to induce the transitions of (7).
In the basis of these two states, the Hamiltonian reads: Performing the unitary transformation yields the transformed Hamiltonian Neglecting the rapidly oscillating terms thus yields an effective Hamiltonian Letting this run for a time which corresponds to the transition if we undo the unitary transformation.
A similar analysis can be performed on the subspace Span (|↑ ↑ |↓ , |↑ ↑ |↑ ), and the dynamics of the rest of the states are undisturbed by the driving and thus conforms to the description in eq. ( 5).In other words, the effect of waiting the time τ is that the system performs the operation where |ξ ± are the states with a single excitation in the input, as sketched in (5).Note that this already implements an operation akin to the one we want-the output-qubit is flipped if and only if the input-register contains an even number of excitations.However, the fact that different components pick up different phases results in a distortion of the input-states.For instance, the difference in phase between the |↓ ↓ and |↑ ↑ -states may partially convert a |Φ + -input to a |Φ − .Additionally, the difference in phase between the states where a flip of the output occurs and those where it does not will distort the relative amplitudes when superpositions are used as input.We would like to pick the parameters in such a way that we avoid these effects, i.e. in such a way that all of the phases are identical.Starting with the two first states, we see that this imposes the restriction Note that this implies Turning to the two other states, requiring identical phases among these implies Note that in order to assure J is real we are forced to pick l so that it is larger than k, and that picking J as prescribed above gives At this point, the phases look as follows: The criterion for identical phases therefore reduce to with the sign inherited from the sign of J.Note that neither γ = 0 nor γ = 1 allow solutions to this equationin both cases, squaring the expression yields an integer on the left-hand side and not on the right-hand side.However, if we allow the factor of −i to be corrected by a subsequent phase-gate, the requirement above in the case γ = 1 reduces to For this to be fulfilled, we will at the very least need √ l 2 − k 2 to be an integer, meaning k, l need to be part of a pythagorean triple.In fact, going through all of the possible combinations of l and k being even or odd yields the fact that whenever ± √ l 2 − k 2 is an integer it is even (odd) whenever (k + l) is even (odd).In other words, the sum of these objects is always even when both are integers.Thus it is not just necessary but also sufficient to require k and l to be part of a pythagorean triple for (9) to be fulfilled.The reason that γ = 1 is especially interesting is that this is required for the operation of the phasedetection neuron (see Sec. II below), and thus using another value of γ for our excitation-detection neuron either prohibits the detection of phase or necessitates an implementation where γ can be easily tuned.
Returning to the general case where γ may be arbitrary, we see that the phases match when This fully specifies the parameters of the model.However, as alluded to in the case where γ = 1 above, fixing the final phase between the subspace outputting |↓ and the subspace outputting |↑ is not essential, since this phase can be adjusted separately through a subsequent phasegate.Thus ( 10) is a less strict requirement than those determining β and J.

II. FURTHER DETAILS ON PHASE-DETECTION NEURON
The goal of the second neuron is to detect the relative phases of the two components of Bell-states in the computational basis.In other words, we wish to be able to distinguish the states {|Φ + , |Ψ + } from the states {|Φ − , |Ψ − }.Similarly to the neuron of the previous section we start by adding a Heisenberg-XXZ interaction among the input-qubits in order to set up an energyspectrum that distinguishes among the four Bell-states: yielding the spectrum Next, we add an interaction that will tune the energyspectrum of the output-qubit dependent on the state of the input-qubits.An obvious interaction to use would be one of the form σ x 1 σ x 2 σ z 3 , since that exactly tunes the energy it takes to flip the output-qubit in a way that is conditional on the phase encoded in the input.However, as we will see below it is also possible to achieve the same result using only 2-qubit interactions.Specifically, adding a term of the form will also allow us to do the required phase detection.The effect of this term is to couple states with the same phase but different number of excitations.For instance, the state |Φ + |+ becomes coupled to the state |Ψ + |+ through a Hamiltonian that in the basis of these two states takes the form Of course a similar coupling of the states |Φ + |− and |Ψ + |− takes place as well.Indeed, switching the state of the output-qubit is essentially equivalent to switching the sign of δ.Applying similar arguments to the other four states, we arrive at coupling-Hamiltonians with the following structure: For general γ, these expressions look relatively symmetric, thus making it hard to fulfil our goal of distinguishing the upper and lower subspaces from each other.The exception to this is whenever γ = ±1.In this case, the symmetry of the two expressions is very explicitly brokenone contains a σ z -term while the other does not.Let us for definiteness pick γ = 1, resulting in the Hamiltonians The eigenstates in the subspaces {|Φ + |± , |Ψ + |± } are then straightforward to write down: The eigenstates of the subspaces {|Φ − |± , |Ψ − |± } are in principle more involved.However, in the limit where J δ, the effect of the σ x -term in (12) will be negligible, leading to an effective Hamiltonian of the form and thus approximate eigenstates Note that flipping the state of the output-qubit between |+ and |− does not change the energy of this second batch of states, while flipping the state of the outputqubit changes the energy of the first batch of states ( 13) by the amount 2δ.In other words, adding a constant driving-term of the form would yield the transitions As described in the section on the excitation-parity neuron, we would like the phases picked up by these terms to match so that the input-amplitudes are not distorted by the evolution of the neuron.Matching the phases on the two first terms yield the criteria while matching the two phases of the last line of ( 15) yields Note that when these criteria are fulfilled, the following holds: As a result, the phases reduce to Note that we have no parameters left to adjust in order to make these phases identical-indeed, there will be a relative factor (−i) no matter what value of J we use.However, due to our work above the only problematic phases occur between the subspace that flips the output and that which does not.As a result, the phase can be corrected simply by applying a phase-gate on the outputqubit after the operation has finished.Combining this operation with some Hadamards to shift the output-qubit between the computational basis |↓ / ↑ and the basis |± where the flips occur, the full sequence now fulfils our goal of coherently detecting the sign of the Bell-states in the input.Before proceeding, let's briefly review the criteria that need to be fulfilled in order for the neuron to operate in the way explained above.In order for the approximate eigenstates presented in ( 13) and ( 14) to be accurate we need Additionally, the detuning-criteria that allows us to drive transitions in only one subspace reduces to B δ .
Combining this with the phase considerations above yields the requirements In other words we need the driving to be weak compared to the input-output coupling, which in turn needs to be weak compared to the coupling among the input-qubits, and this strong coupling needs to be of a Heisenberg-XXX type.In practice, it turns out that m in fact does not need to be that large for the scheme to work, probably due to the fact that δ scales like 2m and the detuning scales like 2δ.In other words, a more accurate criteria is that which is a much milder criteria on the size of m than the original one.This is supported by the fact that parameters such as (m, n) = (3, 82) is able to reach average fidelities of 99.07%.
It is worth noting that many of the higher-order effects neglected above can have a detrimental effect on the overall fidelity.This is especially true in relation to matching the relative phases of the different input states, since the neglected terms will tend to induce different second-order energy-shifts to the different inputs.As a result, it can at times be fruitful to depart from the criteria described above and tune the interaction-parameters slightly in order to obtain better overall fidelity.For instance, picking (m, n) = (2.987,81.99) instead of (3, 82) increases the fidelity of the operation from 99.07% to 99.59%.Even more remarkably, shifting parameters from (m, n) = (5, 80) to (4.985, 79.97) increases the average fidelity from 96.38% all the way to 99.10%, though achieving higher fidelities than this seem require a larger n to match the relatively large m.As a final aside, it is worth noting that the form of the input-output interaction presented in ( 11) is far from the oly one that would work.Indeed, the only essential part is that it takes the form with Ô3 an operator that acts on the third qubit and which breaks the degeneracy and sets up a spectrum with two distinct energy-eigenstates that we can subsequently drive transitions between.For instance, an interaction similar to the cross-resonance interaction favoured by IBM [27].
would work equally well if paired with driving of the form In fact, in this case the eigenstates that we would be inducing flips between would be |↓ and |↑ rather than the states |± , which means the Hadamards from the protocol in the main text would no longer be required.

III. FURTHER DETAILS ON BELL-STATE COMPARISON NETWORK
In this section, a few details regarding the Bell-state comparison network presented in the main text will be explored.Specifically, we will present some details on the implementation of the last layer of the network, and show how the nature of the comparison-task allows the size of the network to be scaled down, at a slight cost to the feed-forward-like structure of the network.

A. Final layer
As explained in the main text, most of the Bell-state comparison network simply consist of iterative applications of the two types of neuron building blocks.However, the final step of the network is lightly different, since it is no longer trying to determine if two bits are equal but rather trying to determine if they are both |↑ , corresponding to the qubits in the third layer having determined both that the phases are equal (blue qubit in |↑ -state) and that the excitation parities are equal (orange qubit in FIG.4: Schematic depiction of network for comparing pairs of Bell states.The left-most layer marked in red constitute the inputs to the network, with subsequent layers extracting and comparing information about either the phase (blue) or the excitation parity (orange) of the input states, with the result of the comparison stored in the green output qubit.
|↑ -state).In other words, the operation of the last layer of the network differs from the excitation-parity neuron in that the output should only be flipped if the inputs are in the state |↑ ↑ rather than being flipped for both the input |↑ ↑ and |↓ ↓1 .One way to achieve this functionality is to adjust the driving in the excitation-counting neuron.
To see how this works, we note first that the driving term used in this neuron can be written as At first, the new reduced driving of ( 17) may look more complicated than the original form in (16).However, it is possible to extract this type of driving from a term very similar to the one in ( 16) using a term corresponding to a local magnetic field on the output-qubit: With this term, flipping the output-qubit from |↓ to |↑ now costs the energy Ω ± 2β, depending on whether the input is in the state |↑ ↑ or |↓ ↓ .Adding the drive Note that in some platforms adding a local magnetic field of the type (18) would not increase the complexity of the protocol, since such energy-shifts between the computational states would be naturally present within the architecture.Indeed, such terms appear naturally in many implementations of superconducting qubits [16], and would need to be compensated by changing to a rotating picture in order to implement Hamiltonians of the form presented in the main text.
As with the two main types of neurons, it would be beneficial if the relative phases related to different inputs could be brought to match.Performing an analysis similar to the one in Sec.I yields that running the interactions above for the time τ = π A yields the time-evolution where |ξ ± are the one-excitation states also used in Sec.I.Note that making the phases of the first two states match through clever selection of parameters is not possiblewhatever we do, we cannot get rid of the factor −i that appear on the |↑ ↑ -state.Luckily, the usual trick of correcting this phase through a subsequent phase-gate on the output-qubit works just as well here as it did in Sec.I and II.Adding this correction, matching the phases reduce to the requirements Note that these phases are identical to some of the phases that needed to be matched when dealing with the excitation-parity neuron (see ( 8) ) when a phase-gate was applied to the output qubit of that system.From the discussion of that system we therefore already know a set of solutions: where l is the largest number in a Pythagorean triple that also contains k.However, looking closer at how this solution came about, we can note two things: Firstly, the problem of matching the phases in sec.(I) contained an additional constraint compared to our current problem.Indeed, the fact that β/A should be an integer originated from matching the phases of |↓ ↓ and |↑ ↑ , a set of phases that in this case are automatically identical once the factor of −i is taken care of.Secondly, we arrived at the solution (21) by assuming γ = 1, a requirement that was only necessary if we also wanted to operate with a phase-neuron on the same input-state.Both of these observations indicate that more general solutions than the one in (21) should exist to our phase-matching problem.Finding these more general solutions from ( 19) is relatively straightforward.From the matching of the phases on the |ξ ± -states we get Using the fact that this implies e i 1 2 √ J 2 +β 2 τ = (−1) l now yields the final criteria where the sign is the one appearing in the expression for J.
We can use this equation to either express γ in terms of β or express β in terms of γ.The first option is relatively straightforward, yielding simply analogeously to the expression in (10).The second option is a bit more involved.Squaring (22) yields the quadratic equation This has real solutions whenever in which case they can be expressed as where k is an integer.Thus because ( 22) implies ( 23), we know that β needs to be of this form to fulfil our phase-criteria.However, (23) does not in general imply (22), and thus it is not a priori obvious that all of the solutions in (25) will also be solutions to the original equation.Because the right hand side of ( 22) is real, a necessary condition is that the left hand side of this expression should also be real, or equivalently: Indeed, if this is the case you can move from the squared criterion to the original one by taking the square root.Thus β solves the original requirement for some sign of J if and only if it is of the form (25) and is smaller in norm than lA.Interestingly, this is automatically the case whenever β is real.In other words, it turns out that (24) implies (26).To see this, let x = s/l.The solutions then take the form The interval where this is real follows directly from (24): Determining the largest absolute value of the function (27) on this interval is now a question of simple calculus.
Taking the derivative and setting it zero yields Squaring this yields the fact that the function can only have local extrema when (2x − 1) 2 = 1, i.e. when 2x − 1 = ±1.At these points, the absolute value of the function reaches which is at most equal to one.Similarly, determining the value of the function on the boundary of the interval on which it is defined is straightforward and yields 1 + γ 2 − 1 2 , another number that is at most equal to one.Since we know that the largest absolute values that our function takes must be attained either at points with vanishing derivatives or at the boundaries of the interval on which it is defined, we can now conclude that the absolute value of our function never exceeds one-and thus that the requirement ( 26) is fulfilled.
B. Reduced network FIG.5: Schematic depiction of a network for comparing pairs of Bell states employing fewer qubits to do so than the one presented in the main text.The left-most layer marked in red constitute the inputs to the network, with subsequent layers extracting and comparing information about either the phase (blue) or the excitation parity (orange) of the input states, with the result of the comparison stored in the green output qubit.
The construction of the network presented in the main text was partially guided by the desire for a neuromorphic structure that iteratively feeds information forward, layer by layer, until it reaches the output qubit.As a part of this process, the phase and excitation-parity of both of the input states was read out and the resulting information stored in the second layer (see Fig. 4).However, this is quite a lot of information to extract and store considering we are not interested in the full nature of each Bellstate separately, but only in whether their properties are identical or not.Thus it would be desired that we could bypass this large second layer and move directly to the two qubits of the third layer.To see how this could be implemented, consider a situation where the second layer only has two qubits-one for phase and one for excitation-parity, as depicted in Fig. 5.Note that each of the qubits in the second layer are now connected to both of the input-states.The way this should be interpreted is that these neuron-functions should be run sequentially.Thus to compare the two phases, we would first run the phase-neuron protocol on the first input-state, and then once it finishes we would run it on the second input state as well.The effect of this would be that the blue qubit in the middle layer would be flipped an even number of times (0 or 2) if the phases are identical, and an odd number of times (i.e. 1) if they are not identical.Thus up to a simple NOT-gate the state of the blue qubit is identical to the state of the blue qubit in the third layer of the original network.Similarly, sequentially running the excitation-parity protocols results in the orange qubit in the middle layer of Fig. 5 being in the same state as the orange qubit in the third layer of the original network, up to a NOT-gate.Thus we have essentially bypassed the need for the second layer of the network.The main price we pay is that we either need to be able to address the two qubits in the middle layer in such a way that we can perform the aforementioned NOT-gates, or we need the final operation to be able to detect |↓ ↓ instead of |↑ ↑ .Looking to Sec.III A, we note that the latter solution only require a shift in the driving frequency from Ω+2β to Ω−2β combined with a brief reconsideration of the phases.A more subtle disadvantage is the fact that the reduced network requires the availability of a higher degree of tunable connectivity, since the qubit with the largest number of interactions now need 4 connections to other qubits rather than 3. Additionally, the more optimized structure could also be argued to be less neuromorphic, since setting the state of the qubits in the second layer requires multiple interactions with the input-data to be run in a fairly structured way rather than the protocol being defined simply by what kind of neuron a given qubit is the output of.Nevertheless, the savings in the number of qubits may make the reduced network a better candidate for practical applications of this type of scheme.

3 ,
the first term will then again resonantly induce the transitions |↑ ↑ |↓ ↔ |↑ ↑ |↑ , as predicted by our rule of thumb.On the other hand, the transitions within the |↓ ↓ |↑ / ↓ -subspace will cost ∆E = Ω − 2β, which does not fit with the driving-frequency of the second term.The conclusion that we can draw from our rule of thumb is in other words that the second term is detuned by an amount∆ FL = 1 |− (Ω + 2β) − (Ω − 2β)| = 2 |Ω|compared to the required value to drive resonant transitions |↓ ↓ |↓ ↔ |↓ ↓ |↑ .Picking Ω sufficiently large compared to the strength of the driving should therefore suppress the effect of the second term, leading to effective dynamics of the type we desire.
σ z to the Hamiltonian will induce resonant flipping of the output-qubit if the input is |Φ − or |Ψ − , while the same driving will be detuned by an amount ∆ = 2δ if the inputs are in the state |Φ + or |Ψ + .Assuming this detuning is large compared to the driving-strength B ensures that nothing happens in the latter case, and thus we have exactly what we want: A flipping of the state of the output-qubit if and only if the phases of the Bell-states of the input have a certain value (in this case: −1).Assuming we start the output-qubit in the state |+ , evolving the four possible inputs over a time τ = π ∆E t + h.c. in order for the combined term to resonantly drive the transitions that the operator Ô induce.Thus because a σ + 3 induce transitions costing ∆E = −2β in the |↓ ↓ |↓ / ↑subspace and ∆E = 2β in the |↑ ↑ |↓ / ↑ -subspace we can easily use this rule of thumb to identify which term drives which transitions.