Machine Learning for maximizing the memristivity of single and coupled quantum memristors

We propose machine learning (ML) methods to characterize the memristive properties of single and coupled quantum memristors. We show that maximizing the memristivity leads to large values in the degree of entanglement of two quantum memristors, unveiling the close relationship between quantum correlations and memory. Our results strengthen the possibility of using quantum memristors as key components of neuromorphic quantum computing.


Introduction
The memristor was proposed as the fourth basic circuit element, characterized by a flux-charge relationship [1,2].This device exhibits rich nonlinear properties and it is distinguished by a pinched hysteresis curve in the current-voltage (I/V) plane, which can be described by Kubo's response theory [3].Since the experimental implementation of a memristor in a doped semiconductor by HP Labs in 2008 [4], memristors have garnered significant interest in several areas, including analog computing [5] and neuromorphic computing [6].A notable application of memristors is the design of devices that mimic biological neural synapses [7] and neural networks [8].Furthermore, memristor-enabled neuromorphic computing goes beyond the traditional von Neumann computing paradigm, avoiding the von Neumann bottleneck, which is one of the fundamental limitations of current classical computers [9,10,11].
Quantum computing [12] aims to revolutionize computation by exploiting exclusively quantum phenomena to surpass the capabilities of classical computers, as we can see from recent breakthroughs [13,14,15,16,17].The merge between quantum computing and neuromorphic computing or neuromorphic quantum computation (NQC) [18,19,20] seeks to implement brain-inspired devices with quantum hardware and software, and may lead to groundbreaking technologies.Therefore, it is natural to wonder whether a quantum version of memristors, i.e., quantum memristors (QMs) [21], could become a significant component of neuromorphic quantum hardware similar to its classical counterpart.This question has motivated the theoretical proposal of quantum memristors in different platforms, such as quantum photonics [22,23], superconducting circuits [21,24,25,26,27], ion traps [28], and light-matter [29,30].Some recent experimental realizations are especially remarkable [31,32].
The use of quantum memristors for NQC applications need a deep understanding of how they can be connected and correlated.However, most proposals have been limited to single quantum memristor models, and further study is required for the case of coupling and scaling quantum memristors.In this context, [18] studied memristive dynamics of two-coupled quantum memristors concerning their entanglement properties and [19] a tripartite entanglement.These works show that the memristive properties and entanglement have an opposite behavior, providing the signs of a nontrivial role of quantum correlations in memristive devices.Nonetheless, there is more to explore in this direction since increasing the number of subsystems introduces quantum correlations that cannot be observed in bipartite systems, such as multipartite entanglement and entanglement monogamy [33,34].Addressing this point can be relevant for future applications, such as reservoir quantum computing (RQC) [35] where arrays of quantum memristors could compose the reservoir [31] which will require scaling quantum memristor arrays into quantum neural networks and neuromorphic quantum computers, as well as the design of devices with optimal memristive properties.
The optimal configuration of single and coupled QMs is needed for neuromorphic quantum technologies.During the last years, ML has been increasingly used for almost every conceivable problem where an optimal response is necessary, e.g., medical image classification [36], chatbots like ChatGPT [37], image generation by stable diffusion [38], finance [39,40], and more.In physics, some examples of application of ML include state characterization [41], noise reduction in CERN experiments [42] and faster simulations of PDE systems using Physics Informed Neural Networks (PINNs) [43].Due to the flexibility of ML techniques to solve a wide range of problems, seems to be natural the use of ML to design efficient memristive devices, approaching the usefulness of quantum memristors.
In this work, we study the use of ML models to find the optimal set of parameters which maximizes the memristive behavior of a single QM and a system composed of two-coupled QMs.We found that in the optimal case, there is strong evidence that supports the connection between quantum correlations and the memristive behavior.Specifically, an enhancement in the memristive properties, also means an enhancement in the quantum correlation.This helps to characterize quantum memristive devices accurately which will, in turn, take one step closer to implementable and useful neuromorphic quantum computing.
The rest of the paper is organized as follows.Sec. 2 deals with the models of single quantum memristor and two-coupled memristors.In Sec. 3, we describe the ML pipeline used for both cases, the ensemble methods used (Random Forests, Extra Trees, XGBoost and LightGBM), and finally, the data set generation.Sec. 4 reports the performance of the proposed models in terms of regression metrics, ending up the paper with the main conclusions of our work and proposals for further research.
All the code used, both for data generation and machine learning, is available at https:// github.com/carlos-hernani/QuantumMemristor.

Quantum Memristors
The memristor is a two-terminal device with resistive memory effects, in which the resistance depends on the history of charges across the device.The ideal memristor initially proposed by L. Chua is completely described by its state-dependent Ohm's law [1].Later the concept of memristor was extended to a more general class of systems called memristive systems [2], defined by the following equations: where u and y denote input and output variables, respectively, and s denotes a state variable.All variables are assumed to be dependent on time.The equations that characterize the ideal memristor are recovered by setting f (s, u, t) = f (s) and g(s, u, t) = g(u).The memristive equations written in this form are also called a state dependent Ohm's law when u and y correspond to current and voltage, and f is called memductance (memristance) when the input variable has units of current (voltage).
Quantum memristors are obtained by implementing the characteristic equations of a classical memristor with quantum observables of a quantum system.These equations can be the state dependent Ohm's law, or the generalized version for memristive systems.In principle, any device that satisfies these equations can be considered a quantum memristor, therefore they are not bound to any specific platform.We can define a quantum memristor analogously to their classical counterpart.A quantum memristor is a quantum system with observables ŷ and û whose expectation values ⟨ŷ⟩ and ⟨û⟩ follow the relationship Here, G ⟨x⟩, ⟨û⟩, t and F ⟨x⟩, ⟨û⟩, t are the quantum analog of the response and state variable function, respectively.
We consider quantum memristors composed of a conductance-asymmetric superconducting quantum interference device (CA-SQUID) connected in parallel to an inductor L ℓ .This forms a closed loop that is threaded by an external signal ϕ dℓ , as shown in Fig. 1(a).The Josephson junctions in the SQUID have two current contributions, a nondissipative current due to tunneling of Cooper pairs [44] and a dissipative current due to the tunneling of quasiparticles [45], which is of memristive nature.The Josephson junctions in the SQUID are made with different materials such that they have different conductance but the same critical current [26].In this way, by applying a bias flux of half a flux quantum Φ 0 /2 through the SQUID loop we can completely suppress the effective critical current.Additionally, we apply a bias flux ϕ d1 (t) on the loop enclosed by the inductance L 1 .Furthermore, two quantum memristors as described above can be coupled by either a capacitor or an inductor as shown in Fig. 1(b), such as system is described by the following Hamiltonian (for a detailed derivation see refs.[18]): where nℓ and φℓ represent the dimensionless charge and phase operators of the ℓth quantum memristor.
are the inductive energy with L −1 j,k the (j, k) element of the inverse of the inductance matrix, and φ 0 = ℏ/2e is the reduced quantum flux.Redefining the operators in terms of creation and annihilation operators as where g ℓ = E C,ℓ /32E L,ℓ , the Hamiltonian take the form with The energy loss of the admittance is described as a quasiparticle bath at zero temperature; this mechanism can be modeled with the time-dependent master equation (ℏ = 1): where Ĥ is the Hamiltonian of Eq. ( 5) and is the time-dependent decay rate, where we have considered spectral density of the quasiparticle bath S QP (ω ℓ ) = λω ℓ and the fluxoid quantization condition in the outer loop.We note that this timedependent decay rate can be driven by the external magnetic flux ϕ dℓ (t) = ϕ 0,ℓ + A sin(ω ℓ t).For more details about the effective decay rate see Ref. [27].
From the master equation above we can obtain the equations of motion for the number and phase operator as follows From the equations of motion we obtain the memristive variables, corresponding to the quasiparticle current ÎQP,ℓ (t) and voltage across the capacitor Vcap,ℓ (t) which can be expressed as: where is the memductance of each quantum memristor.The dynamics of the memristive variables define an hysteretic response characteristic of memristive behavior which depends on the initial state.In addition, it is assumed that the quantum memristors operate in the two-level approximation, ensured by the choice of initial state, which is parameterized as The system evolves according to Eq. ( 6) for a given initial state, and the memristive variables define a pinched hysteresis loop in the plane I/V.The area enclosed by the hysteresis loop is related to the memory effects of the device [46,47], which can be characterized by the form factor, defined as the ratio of the area enclosed by the hysteresis loop, A, and its corresponding perimeter P : which is invariant under scaling allowing to compare the memory effects in the I/V of any memristor.
In the case of a single quantum memristor, the memristive behavior and its corresponding hysteresis loop are mainly determined by two factors: the choice of the initial state v|Ψ(θ, η)⟩, and the amplitude of the spectral density S QP (ω) [18].When considering coupled quantum memristors, the memristive behavior is also influenced by the coupling capacitance C c and inductance L c .In particular, for coupled quantum memristors, the memristive behavior of each subsystem is highly sensitive to both the circuit parameters and the initial state.Furthermore, it has been shown that for particular instances, the quantum correlations between the coupled quantum memristors is directly related to the form factor, and therefore, the memristive behavior of the system.To the best of our knowledge, there has not yet been a study on the optimal configuration that maximizes the memristive behavior and how it relates to quantum correlations.

Proposed methodology
The main objective of this work is to analyze the dependence of the memristive behavior, characterized by the form factor, on the circuit parameters and to find its optimal configuration that maximizes the form factor.In the case of coupled quantum memristors, we are also interested in understanding the relationship between the optimal and sub-optimal configurations and the quantum correlations generated between the memristors.
For a single memristor, we consider the amplitude of the spectral density, represented by λ, and the angles θ and ϕ that determine the initial state according to the Bloch sphere parametrization.
In the case of coupled quantum memristors, we consider these quantities for each quantum memristor, represented by λ ℓ , θ ℓ , ϕ ℓ as well as the capacitive and inductive coupling C c and L c .From previous results, it has been determined that setting θ = π/2 yields the highest values of the form factor [18].As a result, we fix θ to this value throughout the rest of this work.
To tackle this problem we follow the pipeline shown in Fig. 2. The first step is data generation (Sec.3.1).Once we have the data we can start its exploratory analysis (Secs.3.2 and 3.3) before implementing the ML models (Sec.3.4).The results of these models are detailed in Sec. 4.

Data Generation
Data ML Models Results

Exploratory Analysis
Figure 2: The basic outline of the ML pipeline.
As explained in Sec. 2, quantum memristors have different tunable parameters.Our proposal is to make use of ML to find an accurate relationship between the parameters and the memristor behavior, in order to maximize memristivity, indirectly estimated by means of the form factor.This optimization leads, in turn, to a strong connection between quantum correlations and the form factor.
The main characteristics of a QM are its quantumness and its hysteresis loop.The area enclosed by the hysteresis curves can be related to the memory effects of a memristor.Besides, the physical properties and the maximum values of the voltage (input variable) are related to the perimeter of the hysteresis curve.In line with this, a good candidate to evaluate the memristive properties of the memristor is the form factor given by Eq. ( 11).
The form factor is a dimensionless quantity that measures the area enclosed by a given perimeter, where its maximal value F = 1 is obtained for a circle (maximal area).Meanwhile, the minimal value F = 0 is obtained for a line (minimal area).It allows us to compare the different curves without caring about the losses in the maximum voltage value in each loop.

Data set generation
Using the code for data generation at https://github.com/carlos-hernani/QuantumMemristor that implements Eq. ( 6) and obtains the memristive variables from Eq. ( 9) and Eq. ( 10), a random1 grid of samples is calculated, from which the form factor will be derived.
There are two data sets, one for the case of a single quantum memristor and another for the case of two-coupled quantum memristors.

Single Quantum Memristor
For the case of a single quantum memristor, we set C c and L c to zero and generated a data set of 2,000 samples with two QM parameters, λ and ϕ, using the form factor as target variable by calculating the time evolution of the system with up to 10 periods of the driving signal T = 2π/ω.The statistical description of the data set is shown at Table 1.
We also plot the form factor versus the QM parameters to see their dependency at Fig 3 .There is a straightforward relationship between the form factor and the parameters which, in turn, makes it an attainable problem to solve by machine learning, as we will see at Sec. 4.

Two-Coupled Memristors
For the case of two-coupled quantum memristors, we generated a data set of 15,000 samples with four QM parameters and the target variables, which are the form factors for both QMs (in this case they are the same as they share the same parameters).We evaluate the form factor by calculating the time evolution of the system with up to 10 periods of the driving signal T = 2π/ω ℓ .To make sure that the capacitance and the inductance can have zero values we used a parameter grid of 10x10x10x10.The statistical description of the data set is shown at Table 2.

Machine Learning Models
The first model used for the case of a single quantum memristor was a Support Vector Regressor (SVR) [48] using a Gaussian Kernel.This case is sufficiently simple that a SVR can achieve very good results in the R 2 -score for the test data set, even though these models are especially adequate when the feature space is large compared to the number of examples [48].SVRs are a generalization of Support Vector Machines (SVMs) [48], which try to solve classification problems by formulating them as convex optimization problems.In this manner, one has to find the suitable hyperplanes that classify correctly as many training samples as possible.In particular, SVRs work by creating a transformed data space in which the problem is more easily solvable and, ideally the problem is transformed into a linear one.That transformation between spaces is carried out by the so-called kernels.Gaussian, linear, and polynomial kernels were used in this experimentation.An SVR introduces a region in the hyperspace of the problem called ϵ-tube, within which, all predictions are considered as correct.
When dealing with two-coupled quantum memristors, more complex models were necessary to describe the behavior of the system accurately; in particular, we focused on tree-based ensemble methods.Ensemble methods involve combining the prediction of multiple individual models, known as base models, to generate a final prediction [49,50].These methods have proven to be an effective strategy for achieving higher accuracy and robustness.Ensemble methods offer several advantages over single models, including improved generalization, reduced overfitting, and increased stability [51].By combining the predictions from multiple models, ensemble methods can effectively mitigate biases and errors present in individual models, resulting in more robust and accurate predictions.The rest of this Section is dedicated to briefly describe four ensemble methods.

Random Forest
Random Forests (RFs) are a combination of tree predictors [52] such that each tree depends on the values of a random vector sampled independently and with the same distribution for all trees in the forest [53].The underlying principle behind RFs is that, being an ensemble method, the combination of multiple decision trees, where the splits are chosen to be optimal, helps in reducing overfitting and improves the overall predictive performance.By leveraging the randomness in both data sampling and feature selection, RFs achieve a balance between variance and bias, making it robust and effective in handling complex problems.

Extra-Trees
Extra-trees [54], also called Extremely Randomized Trees (ERTs), is another tree-based ensemble method where the algorithm builds an ensemble of trees where the node splitting is done fully at random and uses the whole learning sample, rather than a subset, to grow the trees [54].
The main differences between ERTs and RFs are that ERTs make use of the whole data set to train trees whereas RFs is based on bagging, i.e. , using randomly selected subsets of the whole training set with repetition.Also, ERTs make the node splits fully at random in contrast to RFs where the splits are done using an optimality criteria.This last difference makes ERTs faster to train.

Extra-Gradient Boosting
Extra-Gradient Boosting (XGBoost) is a popular and efficient open-source implementation of the gradient-boosted decision tree algorithm (GBDT) that combines boosting and gradient-descent techniques to produce accurate predictive models.Gradient boosting is a supervised learning algorithm, which attempts to accurately predict a target variable by combining the estimates of a set of simpler, weaker models.When using gradient boosting for regression, the weak learners are regression trees, and each regression tree maps an input data point to one of its leaves that contains a continuous score.XGBoost minimizes a regularized (L1 and L2) objective function that combines a convex loss function (based on the difference between the predicted and target outputs) and a penalty term for model complexity (in other words, the regression tree functions).
The training proceeds iteratively, adding new trees that predict the residuals or errors of prior trees that are then combined with previous trees to make the final prediction.It is called gradient boosting because it uses a gradient descent algorithm to minimize the loss when adding new models [55].

LightGBM
The last ensemble method explained in this work is LightGBM [56], a powerful gradient boosting framework that is highly scalable and efficient even for large data sets thanks to optimizations that enable faster training times and memory efficiency.
LightGBM is an optimized implementation of GBDT.One of the main problems is that for data sets with large number of instances and features, GBDT needs to scan all the data instances to estimate the information gain of all possible split points.The solution, proposed in [56], is two-fold, namely, Gradient-based One-Sided Sampling (GOSS) and Exclusive Feature Bundling (EFB).GOSS excludes a significant proportion of data instances with small gradients, and only uses the rest to estimate the information gain.EFB bundles mutually exclusive features to reduce the number of features.With these two optimizations, the training process is sped up while maintaining almost the same accuracy.

Results and discussion
This Section shows that ML models can achieve a high performance at predicting the value of the form factor for both cases, a single QM and two-coupled QMs.In particular, it must be emphasized that, for the case of a single QM, almost perfect results can be obtained, with a R2 -score ∼ 0.998 (see Table 3).Thus, a trained lightweight machine learning model such as LightGBM (LGBM) can be used for faster calculations of form factor for this particular case instead of the slower numerical calculation.
The ML algorithms listed in previous sections were trained sequentially over the same training sets and evaluated over the testing sets.The data was split between training and test sets following a proportion of 2/3 and 1/3 and a fixed random state to be able to reproduce the experiment 2 .
As mentioned in Section 3, different ML methods achieved high R 2 -score values, most of them ensemble methods.The reason for choosing LightGBM over the other predictors shown at Tables 3 and 4 (see highlighted LGBM in bold) is that LightGBM has almost the highest value of our performance metric and faster training times.Additionally, LightGBM has other interesting fea- tures that make it our preferable option.First, as said before, the faster training allows us to test several iterations of the ML pipeline efficiently.Next, the high scalability thanks to the support of parallel, distributed and GPU learning with lower memory usage.This enhances the feasibility of training large data sets, which is expected for future research where three or more QMs might be coupled.While other models may keep reasonable scores, the training time will worsen greatly.See Tables 3 and 4 for a comparison between models both in metric scores and time taken for training.
For the case of a single quantum memristor, we find that the optimal configuration that yields the highest value of form factor, corresponds to θ = π/2, ϕ = 1.5309 and λ = 2.1387.Fig. 5 shows the corresponding hysteresis curve and form factor over time of the optimal case for a single memristor.This case is characterized by a very slow decay and stable hysteresis curve.
For the case of coupled quantum memristors the hysteresis loop in the I/V plane can change significantly over each period of the driving signal, and it is nontrivial to compare the dynamics corresponding to different configurations.We consider the optimal configuration, derived from the LightGBM model and which maximizes the form factor and compare it with the configuration that yields the lowest form factor according to our models, which we call sub-optimal configuration.The hysteresis curves of the optimal and sub-optimal cases are shown in Fig. 6.As can be seen, the optimal configuration preserves much better the shape of the memristive hysteresis curve when compared with the sub-optimal case.It is interesting that for the optimal configuration of the coupled case, the value of lambda and ϕ coincides with the case of a single quantum memristor.
In Fig. 7 (a) we show the comparison of the form factor calculated for both the optimal and suboptimal configurations over the course of 20 periods of the driving signal.The results clearly demonstrate that the form factor for the optimal configuration consistently exceeds that of the sub-optimal configuration throughout the entire duration of the system's evolution.
In addition, we examine the quantum correlations generated in the system by measuring the concurrence between the quantum memristors.Concurrence is an entanglement monotone, defined for a mixed state of two two-level systems.It is calculated using the following formula: Figure 6: Pinched hysteresis curves of identical quantum memristors as a function of time for 10 periods of the driving signal.The optimal configuration, labeled as 'optimal', is compared with the configuration that yields the smallest form factor over time, denoted as 'sub-optimal'.Time is in units of the period of the driving signal T = 2π/ω ℓ The form factor may change significantly between periods, but the optimal configuration attains a higher form factor over the course of the evolution.Also, the optimal configuration, displays high and long lasting entanglement, conversely, the sub-optimal configuration displays smaller values of concurrence which decay much faster.where ϵ i are the eigenvalues in decreasing order of the Hermitian matrix √ ρρ √ ρ, with ρ = σ y ⊗ σ y ρ * σ y ⊗ σ y .Here, complex conjugation is taken in the eigenbasis of σ z .Fig. 7 (b) shows the concurrence between the quantum memristors as a function of time for 20 periods of the driving signal, where we compare the optimal and sub-optimal configuration.Notice that maximizing the memory effects as measured by the form factor leads to high entanglement during the time evolution of the system.In contrast, the configuration that minimizes the form factor has significantly less entanglement which decays much faster than the optimal configuration.This is remarkable since it means that maximizing the form factor leads to a case with very high quantum correlations that can persist in high values for several periods of the driving signal.This is a separate and stronger result of the relation between memristive behavior and quantum correlations in coupled quantum memristors than that reported in [18].

Conclusions
We have presented a ML approach to accurately model the memristivity for maximizing the memristive behavior of systems formed by a single QM and two coupled QMs.The high performance achieved by different ML models lays bare the robustness of the proposed approach, i.e., predicting and optimizing the memristive behavior is attainable and reliable.
An additional advantage of ML stems from its capacity to allow for generalizations when exploring the parameter space.Therefore, its application surpasses the usual approach of analyzing and understanding the system that produces a given form factor since ML can generate the param-eter configuration for a given form factor, means that is easy to check different hypothesis and the study of extremal case, for example maximizing memristive properties.This also involves a considrable reduction in computational costs.
Interestingly, in the optimal configuration, we note that the form factor surpasses 0.5.This is the maximal value for symmetric hysteresis loops, i.e. both lobs with the same shape, revealing that for optimal configurations the system abandon a symmetric dynamics.We also observe that the amount of quantum correlation in the optimal case increases, yielding peaks close to 1.This suggests that, during the dynamics in the optimal case, the coupled memristor periodically migrates from unentangled to highly entangled states.
An extension to tripartite and multipartite quantum memristors, where different kinds of quantum correlations emerge, may have to be carefully considered.Moreover, due to the non-trivial enhancement of quantum correlations, it looks promising to study the influence of memristor-based protocols on quantum reservoir computing and quantum neural networks.

Figure 1 :
Figure 1: Circuit diagram of (a) a single quantum memristor and (b) two quantum memristors coupled by either a capacitor, with capacitance C c , or by an inductor, of inductance L c .

Figure 3 :
Figure 3: Form factor plotted versus the QM parameters.

Figure 4 :
Figure 4: Form factor plotted versus all the parameters of the system of two coupled QM.

Figure 5 :
Figure 5: (a) Hysteresis curve of a single quantum memristor in the optimal configuration over 10 periods of the driving signal.(b) Form factor of the associated hysteresis curve, the form factor stays constant over time since it is invariant to decay.Time is in units of the period of the driving signal T = 2π/ω ℓ

Figure 7 :
Figure 7: (a) Form factor of the hysteresis curves of Fig. 6 as a function of time.(b) Entanglement between the quantum memristors measured by concurrence as a function of time for 20 periods of the driving signal T = 2π/ω ℓ .The form factor may change significantly between periods, but the optimal configuration attains a higher form factor over the course of the evolution.Also, the optimal configuration, displays high and long lasting entanglement, conversely, the sub-optimal configuration displays smaller values of concurrence which decay much faster.

Table 1 :
Quartile description of single quantum memristor parameters and form factor.

Table 2 :
Quartile description of the two-coupled QMs parameters and form factor. factor and parameters.ML still perform well but not as accurately, as in the case of the single QM case, as shown in Sec. 4.
We also plotted the form factor versus all parameters to see their dependency at Fig 4.Now we can see that the noise is more relevant than for one QM but it is still clear that there is a relation-ship between form

Table 3 :
Machine learning model performance for a single QM.

Table 4 :
Machine learning model performance for two-coupled QMs.