We propose a method to build quantum memristors in quantum photonic platforms. We first design an effective beam splitter, which is tunable in real time, by means of a Mach-Zehnder-type array with two equal 50:50 beam splitters and a tunable retarder, which allows us to control its reflectivity. Then, we show that this tunable beam splitter, when equipped with weak measurements and classical feedback, behaves as a quantum memristor. Indeed, in order to prove its quantumness, we show how to codify quantum information in the coherent beams. Moreover, we estimate the memory capability of the quantum memristor. Finally, we show the feasibility of the proposed setup in integrated quantum photonics.

## INTRODUCTION

Circuit elements whose dynamics intrinsically depends on their past evolution^{1–3} promise to induce a novel approach in information processing and neuromorphic computing^{4–7} due to their passive storage capabilities. These history-dependent circuit elements can be roughly classified as purely dissipative, such as memristors, or both dissipative and non-dissipative, such as memcapacitors and meminductors.^{3,17} A classical memristor is a resistor whose resistance depends on the record of electrical charges which crossed through it.^{1} The information about the electrical history is contained in the physical configuration of the memristor and summarized in its internal state variable *μ* such that in the (voltage-controlled) memristor *I*–*V* relationship appears as^{3}

where the state-variable dynamics, encoded in the real-valued function *G*(*μ*(*t*), *V*(*t*)), and the state-variable-dependent conductance function *F*(*μ*(*t*)) > 0 lead to a characteristic pinched hysteresis loop of a memristor when a periodic driving is applied.^{8} Memristor technology is currently a promising paradigm to replace the medium term computing architectures based on transistors for certain specific tasks because of the low energy consumption.^{9} Indeed, they are energetically more efficient,^{10} and the presence of memory seems to make them more powerful for key machine learning tasks, such as image recognition.^{9,11–14}

The quantization of these devices with memory, especially the memristor, is a complicated challenge which has only recently been achieved.^{15–17} The difficulty lies on the fact that it is necessary to engineer an open quantum system whose classical limit corresponds to the general dynamics given by Eqs. (1). This question was addressed in Ref. 15 by replacing the memristor by a tunable resistor, a weak-measurement protocol, and classical feedback acting on the system-resistor coupling. It was proven that this system behaves in the classical limit following Eqs. (1). Additionally, it was proven that the dynamics of this composed system is genuinely quantum and, therefore, might be used for quantum information tasks. Afterwards, an implementation of quantum memristors in superconducting circuits was proposed,^{16} making use of the fact that a memristive behavior emerges naturally in the presence of Josephson junctions.^{18}

However, a memristive behavior can be extended to a more general framework beyond charges and fluxes. Indeed, a memristive behavior is characterized by non-Markovian history-dependent dynamics, which produces the characteristic pinched hysteresis loops when observables of the input and output states are depicted.^{19,20} Additionally, we call these devices quantum memristors when the dynamics cannot be described for all states by means of a classical process. They can be used as building blocks for the simulation of complex non-Markovian quantum dynamics or for an efficient (in terms of resources) codification of quantum machine leaning protocols, mimicking the classical case.^{9,11–14}

In this article, we construct the first quantum memristor in quantum photonics, codifying the quantum information into different quantum states of the photons as depicted in Fig. 1. By showing that the fundamental elements which constitute a quantum memristor, namely, a tunable dissipative element, weak measurements, and classical feedback,^{15} can be straightforwardly constructed in quantum photonics, we study the dynamics of different initial quantum states and demonstrate the presence of prototypical hysteresis loops. We also compute the persistence of the memory of these devices. We expect that our formalism will provide a toolbox for implementing quantum machine learning in quantum photonics.

In order to build a photonics quantum memristor, we start by constructing a beam splitter with regulable transmittivity, which will play the role of a tunable coupling to the environment. To achieve it, we use a Mach-Zehnder array with two 50:50 beam splitters, a retarder, which introduces a phase *θ* between arms, and two final compensating phase-shifters (see Fig. 2). It can be proven that this construction is equivalent to a beam splitter with an arbitrary reflectivity. Indeed,

Here, Θ = *π* + *θ* − 2*ϕ*_{T} is the effective reflectivity of the beam splitter operator, defined as $B(\theta ,\varphi )=exp\theta 2(a1\u2020a2ei\varphi \u2212a1a2\u2020e\u2212i\varphi )$, *a*_{1} and *a*_{2} are the annihilation operators in paths 1 and 2, respectively, and *ã* is the annihilation operator in path 1 after the first 50:50 beam splitter. Notice that the phase introduced by the retarder can be straightforwardly controlled in time, and thus, this construction is suitable for our purposes. In order to prove this result, we only need the expression of a 50:50 beam splitter with transmitted and reflected phases *ϕ*_{T} and *ϕ*_{R}, respectively, so

which is nothing but $ei\theta 2(b1\u2020b1+b2\u2020b2)B(\Theta ,\Phi T,\Phi R)$, where the parameters are Θ = *π* + *θ* − 2*ϕ*_{T}, $\Phi T=\varphi T+\pi 2$, and Φ_{R} = *ϕ*_{R}, which is an invertible system. The phase difference between the transmitted and reflected phases is $\Phi =\Phi T\u2212\Phi R=\varphi T\u2212\varphi R+\pi 2=\varphi +\pi 2$, which proves Eq. (2). Now that we can construct an in-time tunable beam splitter, let us study the effect on different initial states, analyzing the hysteretic response and the quantum dynamics of such systems.

## COHERENT STATES

Let us start by studying the output of two coherent states after an arbitrary beam splitter,^{21} which is given by $B(\theta ,\varphi )Da1(\alpha )Da2(\beta )|0,0=Db1(\alpha \u2061cos\theta 2+\beta \u2061sin\theta 2ei\varphi )Db2(\beta \u2061cos\theta 2\u2212\alpha \u2061sin\theta 2e\u2212i\varphi )|0,0$. Now, we must prove that, when equipped with measurements and feedback, this system shows a pinched hysteresis behavior and, thus, that it can be a memristor. Let us consider as input states a coherent state |*α*⟩ in beam *a*_{1} and vacuum in beam *a*_{2}, so the outcome states are $|\alpha \u2061cos\theta 2b1$ and $|\alpha \u2061sin\theta 2b2$. For the sake of simplicity, we have assumed that *ϕ* = *π*, something which can be achieved with an additional phase shifter in the outcome of beam *b*_{2}. As we are working with coherent states, we will consider the mean value $\u27e8xin\u27e9a1=Re(\alpha )$ of the input beam *a*_{1} as the independent variable. Assuming a displacement in the *x*-direction, then $\alpha \u2208R$. A memristor is a dissipative element, so we will consider an outcoming photon number in beam *b*_{1} as the dependent variable, while the beam *b*_{2} can be interpreted as losses into a zero-temperature bath. Provided that there is no entanglement between both paths, we make use of outcome beam *b*_{2} to measure $\u27e8nout\u27e9b2=|\alpha |2\u2061sin2\theta 2$ and update the value of reflectivity of the beam splitter using phase *θ*. On the other hand, $\u27e8nout\u27e9b1=|\alpha |2\u2061cos2\theta 2$. Altogether, we can write the following equations for the memristor:

In our case, we pumped the system with a periodic coherent state fulfilling $\u27e8xin\u27e9a1=\u27e8xinmax\u27e9a1\u2061cos(\omega t)$. As $\u27e8xinmax\u27e9a1=\alpha \u2208R$, we have $f(\theta ,\u27e8xin\u27e9a1)=\u27e8xin\u27e9a1\u2061cos2\theta 2$, which may be interpreted as the transmitted intensity per unit of initial displacement. The function $g(\theta ,\u27e8xin\u27e9a1)$, which updates the reflectivity of the beam splitter, can be chosen freely. In our case, for illustrative proposes, we will select a linear behavior of $\theta \u0307=\omega 0x0\u27e8xin\u27e9a1$. In Fig. 3, we have depicted the resulting hysteresis loop when plotting $\u27e8n^out\u27e9b1$*vs*$\u27e8xin\u27e9a1$. As expected, this is a pinched hysteresis loop with an enclosed area decreasing with the frequency of the driving, which shows that this system behaves as a memristor in these variables. As discussed below, this dynamics is deeply related with refractive optical bistability, which makes use of an optical mechanism to change the refractive index inversely to the intensity of the light source,^{22} but the classical feedback in our proposal is flexible, and we can change the refractive index arbitrarily.

The area of the hysteresis loop has been proposed as a natural measure of the persistence of the memory in the memristor.^{16} For the general memristor given by Eqs. (1), this area is given by

where the first term in the integrand corresponds to the response related to the selected memory variable and the second term accounts for any remaining explicit time dependence of the conductance. Applying this result to Eqs. (3), we obtain that the area is given by $A=\pi \u27e8xinmax\u27e9a122x0\omega \omega 0J2\u27e8xinmax\u27e9a1\omega 0x0\omega $, where *J*_{2}(*x*) is the Bessel function of the second order. This formula is valid for $\omega \u2265\u27e8xinmax\u27e9a1\omega 0x0\pi $ since the curve suffers additional crosses for smaller frequencies and it must be computed more carefully (in fact, if $\omega <\u27e8xinmax\u27e9a1\omega 0nx0\pi $, $0<n\u2208N$, each bubble suffers *n* crossings, generating *n* + 1 sub-loops). For large frequencies, this area decreases polynomially as $A\u223c\pi \u27e8xinmax\u27e9a14\omega 0x0\omega +O(\omega \u22123)$, so the area decays slowly and memristive behavior is resilient for a large window of frequencies.

## SQUEEZED STATES

Let us consider the situation in which the inputs are a squeezed state with squeezing *ζ* = *re*^{iφ} and a vacuum state.^{29} We can compute the output modes in the Heisenberg picture, which are given for a beam splitter with transmitted and reflective phases *ϕ*_{T} and *ϕ*_{R} by

In this case, it is straightforward to compute the number of photons in both output beams so that $\u27e8nout\u27e9b1=sinh2\u2061r\u2009cos2\theta 2$ and $\u27e8nout\u27e9b2=sinh2\u2061r\u2009sin2\theta 2$. As an independent variable, we choose the variance $\u27e8xin2\u27e9a1$, which characterizes a squeezed state and is given by $\u27e8xin2\u27e9a1=12(1+sinh2\u2061r\u2212sinh2r\u2009cos\u2061\phi )$, where we have taken $\u27e8xvac2\u27e9a1=12$ for the vacuum. Hence, the function $f(\theta ,\u27e8xin2\u27e9b1)$ is

with *φ* = 0, squeezing in the *x* quadrature. We choose $g(\theta ,\u27e8xin2\u27e9b1)=\xb1\omega 0x0\u27e8x02\u27e9\u2212\u27e8xin2\u27e9b1$, where the sign is chosen depending on the angle, and drive the squeezing below the vacuum variance, so $\u27e8xin2\u27e9b1=12(1\u2212\alpha \u2061cos2\u2061\omega t)$, with 0 < *α* < 1. Hence, $\theta (t)=\theta 0+\alpha \omega 022x02\omega 2sin\u2061\omega t$. The pinched hysteresis loop is depicted in Fig. 4.

The area can be computed again by using Eq. (4), but in this case, there is no analytical expression. However, the asymptotic expression of the area for large frequencies *ω* ≫ 1 and strong squeezing *α* ≃ 1 can be computed as $A\u223c\pi 162\omega 1\u2212\alpha $. Therefore, *A* vanishes in the high-frequency regime as $O(\omega \u22121)$, which agrees with Fig. 4 and also shows resilience of the memory with the frequency.

The dynamics of the beam splitter is quantum when working with squeezed states, and it cannot be simulated by an equivalent classical dynamics. The final state without updating the reflectivity of the beam splitter is given by $\rho f=tr2[B(\theta ,\varphi )S1(\zeta )|00\u27e9\u27e800|S1\u2020(\zeta )B(\theta ,\varphi )\u2020]$, and the quantum information may be codified in continuous variables.^{30}

## FOCK STATES

A paradigmatic case of quantum states to codify quantum information corresponds to Fock states. Let us consider a qubit state encoded in a superposition |Ψ⟩ = *e*^{iα} cos *ϕ* |0⟩ + sin *ϕ* |1⟩ in channel 1 and the vacuum in input channel 2, as before. Then, the beam splitter yields *B*(*θ*, *φ*)|00⟩ = |00⟩ and $B(\theta ,\phi )|10=(cos\theta 2|10\u2212ei\phi \u2061sin\theta 2|01)$.^{21} Hence, by linearity, the quantum superposition |Ψ⟩ yields

Let us now prove the memristive behavior of this construction. In order to get it, we have that the mean value of *x* in the initial state |Ψ⟩ is given by $\u27e8xin\u27e9a1=12sin(2\varphi )$, while the intensity of light coming out through channel 1 is given by $\u27e8nout\u27e9b1=sin2\varphi \u2061sin2\theta 2$. Straightforwardly, one obtains $\u27e8nout\u27e9b2=sin2\u2061\varphi \u2061cos2\theta 2$. Let us consider the same dynamical equation for the internal variable as in the previous cases $\theta \u0307=g(\theta ,\u27e8xin\u27e9a1)=2\omega 0\u27e8xin\u27e9a1=\omega 0\u2061sin\u20612\u2061\omega t$. Then, the hysteresis loops generated, which are valid for frequencies $\omega >\omega 0(4n\u22121)\pi $, $0\u2264n\u2208N$, are depicted in Fig. 5. For lower frequencies *n* crosses appear, which generates *n* + 1 sub-loops. Different from the previous cases, the hysteresis loops are not pinched, which means that the memristor is not passive and the energy introduced only vanishes when the initial state is |0⟩. Additionally, this fact also reflects the fact that the area asymptotically approaches to a constant for high frequencies $A\u223c\pi 42+\pi \omega 082\omega $. This robustness could be a useful resource for quantum information processing.

Let us study the final state in channel 1 when we measure projectively the number of photons in channel 2 given by Eq. (6). If we measure Fock state |1⟩, then the final state in channel 1 is simply |0⟩. Otherwise, if we measure Fock state |0⟩ in channel 2, the final state in channel 1 is $ei\alpha \u2061cos\u2061\varphi 1\u2212sin2\u2061\varphi \u2061sin2\theta 2|0+i\u2061sin\u2061\varphi ei\theta 2\u2061sin\theta 21\u2212sin2\u2061\varphi \u2061sin2\theta 2|1$, which means that the amplitudes of the initial qubit may be modified by means of the reflectivity of the beam splitter. Therefore, this is a natural candidate to be considered for (digital qubit-based) quantum information processing, by creating multiple copies of the same initial state. A possible relevant application could be the simulation of non-Markovian quantum dynamics by considering quantum feedback and *n* Fock states in input channel 1.^{32} The reflectivity of the beam splitter should be updated depending on the environment that we want to simulate.

## OPTICAL BISTABILITY

Optical bistability is a property of optical devices to show two resonant states, both stable and dependent on the input state. In other words, two different output intensities are possible for a given input intensity, and we need to know the previous states in order to determine which is the right one (non-Markovianity).^{22} This property is characterized by the presence of a hysteresis loop when the output intensity is plotted versus a periodic input intensity. Particularly, refractive bistability makes use of changes in the refractive index of the optical device, depending inversely on the intensity of the source light to produce such hysteresis loops with coherent states. This is exactly what we are producing here with different *quantum* input states, in such a way that the dynamics shows optical bistability/memristive behavior but must be described quantum mechanically due to the presence of entanglement.^{31} Consequently, quantum information and processing may be encoded in this process, combined with the intrinsic memory (non-Markovianity) of the quantum memristor. Indeed, our system shows all the main elements required for the quantum memristor described in Ref. 15.

## IMPLEMENTATION IN QUANTUM PHOTONICS

The technology for the implementation of our proposal in photonic quantum technology, as, for example, integrated quantum photonics, is currently available. Indeed, fully reconfigurable two-qubit gates^{33} can be directly applied to produce our basic unit of quantum memristors. Moreover, the ease of fabrication of a wide variety of chip designs will allow for establishing a network of quantum memristors based on photonic-chip technology, which could give rise to scalable neuromorphic quantum computing.

There are important differences between the behavior of quantum memristors in superconducting circuits and in quantum photonics. For instance, if we drive a superconducting quantum memristor with an AC voltage/current source which is always positive, for instance, *I*(*t*) = *I*_{0} sin^{2}(*ωt*), a situation closer to our case in quantum photonics, since the photon intensity is always non-negative, then the behaviors are opposed. Instead of just making half of the loop, as one naively could expect, the area of the loop decreases in time until it collapses to a resistive line. The reason is that the resistance can never decrease without negative currents, so it grows until a saturation point in which the memristor does no longer learn and becomes a resistor.

## CONCLUSIONS

By using the fundamental elements for the quantization of a memristor, namely, a tunable dissipative environment, weak measurements, and classical feedback, we have extended the concept of quantum memristors from superconducting circuits to quantum photonics, showing that all these elements are present in current technology. We have studied the dynamics of this photonics quantum memristor with respect to different paradigmatic initial quantum states, showing the prototypical hysteresis loops, computing the corresponding area, and proving that these dynamics are quantum for squeezed states and Fock states. Finally, we have briefly discussed the implementation in integrated quantum photonics.

In a long term vision, we expect that these quantum devices can be used as building blocks for quantum machine learning and neural networks^{34–37} and in the simulation of quantum artificial life.^{26,38,39} These kinds of quantum machine learning algorithms for which these building blocks could be useful are diverse and range from nonlinear quantum neural networks to supervised learning, unsupervised learning, and elements of quantum reinforcement learning. They could also be employed as ingredients of quantum artificial living systems. The main appeal of these systems is that they are fully quantum and at the same time, as they provide nonlinear behavior, highly desirable in the complexity of biomimetic systems and classical learning protocols.

## ACKNOWLEDGMENTS

We thank G. Gatti, R. Sweke, and F. Flamini for fruitful discussions. This work was supported by Spanish MINECO/FEDER FIS2015-69983-P, Ramón y Cajal Grant No. RYC-2012-11391, and Basque Government IT986-16.