Non-volatile resistive switching mechanism in single-layer MoS2 memristors: insights from ab initio modelling of Au and MoS2 interfaces

Non-volatile memristive devices based on two-dimensional (2D) layered materials provide an attractive alternative to conventional flash memory chips. Single-layer semiconductors, such as monolayer molybdenum disulphide (ML-MoS2), enable the aggressive downscaling of devices towards greater system integration density. The “atomristor”, the most compact device to date, has been shown to undergo a resistive switching between its high-resistance (HRS) and low-resistance (LRS) states of several orders of magnitude. The main hypothesis behind its working mechanism relies on the migration of sulphur vacancies in the proximity of the metal contact during device operation, thus inducing the variation of the Schottky barrier at the metal–semiconductor interface. However, the interface physics is not yet fully understood: other hypotheses were proposed, involving the migration of metal atoms from the electrode. In this work, we aim to elucidate the mechanism of the resistive switching in the atomristor. We carry out density functional theory (DFT) simulations on model Au and ML-MoS2 interfaces with and without the presence of point defects, either vacancies or substitutions. To construct realistic interfaces, we combine DFT with Green's function surface simulations. Our findings reveal that it is not the mere presence of S vacancies but rather the migration of Au atoms from the electrode to MoS2 that modulate the interface barrier. Indeed, Au atoms act as conductive “bridges”, thus facilitating the flow of charge between the two materials.


Introduction
Memristors are emerging nanoelectronic devices whose nonvolatile properties could enable super-fast and ultra-low power memory chips. 1,2 Additionally, memristive devices could also be employed for data encryption 3,4 and as synaptic units in the context of brain-inspired (neuromorphic) computing technologies. [5][6][7][8] Memory devices beyond the conventional silicon ash storage, such as resistive random access memories (RRAMs), are typically composed of a core material (i.e., a metal oxide) sandwiched between two metal electrodes. 9,10 At the device level, the modulation of the electrical resistance (resistive switching) is achieved by applying external electric stimuli. At the material level, the working mechanism of RRAMs involves the formation and rupture of conductive laments of either internal ions or ionic vacancies in the oxide channel, mediated by the electric eld. 11,12 Such a conductive lament is then able to bridge (decouple) the top and bottom electrodes, thus allowing (hindering) electrical charge to ow through the device.
Recently, layered two-dimensional (2D) materials have also been used as novel core materials to develop and fabricate memory devices. 7,8,13,14 For instance, non-volatile resistive switching has been observed in devices based on graphene and derivatives, 15,16 and on transition metal dichalcogenides (TMDs), such as molybdenum disulphide (MoS 2 ). Similarly to graphene, MoS 2 can be thinned down to a single layer, which shows several desirable mechanical, electrical, and optical properties, thus making it the ideal candidate to be used in a wide range of (opto)electronic devices. [17][18][19][20][21] Surprisingly, recent work revealed that vertical 2D memristors could also work by employing only one single layer of MoS 2 sandwiched between two Au electrodes. 22,23 Such a compact device, also known as "atomristor", has been shown to function at low voltages (#1 V), thus having the great advantage of being low-power while enabling denser system integration. Moreover, the device retained its properties even aer several bending cycles, making it suitable to be used in exible electronics.
Although other examples of memristors based on single (or few) layer(s) of MoS 2 have been reported, the mechanism of the resistive switching in these devices is still not well understood. In general, several factors are thought to come into play, such as the device architecture, the nature of the metal electrodes, whether MoS 2 is employed as multi-layer, single-layer or fewlayer, its crystallinity, and if the material has been somehow functionalized. 24 For instance, the formation of a conductive lament has been hypothesized in a recent memtransistor device based on multilayer MoS 2 and with Ag electrodes, 25 as well as in another vertical device based on bilayer MoS 2 sandwiched between Cu and Au electrodes. 26 In both cases, the conductive lament has been attributed to ions migrating from the Ag and Cu active electrodes. Sangwan et al. 27 reported a lateral two-terminal device in which the resistive switching was mediated by the presence and orientation of grain boundaries in monolayer (ML) MoS 2 . Similarly, Wang et al. 28 reported a top-gated memory device with polycrystalline MoS 2 as the channel, in which the proposed working mechanism involves the migration of sulphur defects (mainly di-vacancies) across the grain boundaries. S vacancies oen occur in MoS 2 samples obtained by chemical vapour deposition (CVD) and following annealing, and can reach very high densities: typically, on the order of 10 13 cm −2 . 29 With such a high defect density, it is clear that the material is far from being pristine.
It appears that, regardless of the device architecture, S vacancies inevitably occurring in MoS 2 are thought to be crucial to trigger the non-volatile resistive switching. Indeed, the main hypothesis behind the working mechanism of the atomristor involves the migration of S vacancies, possibly mediated by the electric eld and/or temperature, which diffuse perpendicularly to the electrodes forming lament-like nano-conductive links. 22,30,31 Then, the conductive links modulate the Schottky barrier at the electrode interface. Indeed, an impressive switch of several orders of magnitude was observed from the initial high-resistance state (HRS) to the low-resistance state (LRS). Moreover, devices based on ML-MoS 2 with multilevel resistive switching have also been reported. 30 It is important to point out that such a mechanism is rather unique, and it is different from that occurring in oxide-based devices. Recently, the hypothesis behind the working mechanism of the atomristor has been challenged by experimental studies suggesting that such a signicant variation of the electrical resistance is not due to S vacancies alone, but rather to Au atoms migrating from the metal electrode and lling the S vacancies. 32,33 This is corroborated by the fact that Au electrodes are known to easily feature adatoms on the surface. 34 This paper aims to contribute towards the better understanding of the non-volatile resistive switching mechanism in memristor devices based on ML-MoS 2 . Given the hypotheses currently at study, both involving migration and diffusion of atoms at the interface between MoS 2 and the Au electrode, we carry out atomistic computer simulations within the framework of density functional theory (DFT). Such a simulation approach has been already used to study similar systems and provided invaluable insights into the chemistry and physics of interfaces. [35][36][37][38][39] Here, we construct realistic Au/ML-MoS 2 model interfaces and we investigate how the presence of defects and Au adatoms at the materials' interface impact the complex physics of memristors. To realistically simulate semi-innite metal electrodes rather than metal slabs, we employ the Green's function surface model approach. We successfully used this simulation framework in a previous work on defective ML-MoS 2 interfaces. 39 With our combined DFT-Green's function surface simulations, we aim to provide the necessary theoretical justication to the hypotheses of the non-volatile resistive switching mechanism in single-layer MoS 2 memristors. This paper is organized as follows: in the following section (Simulations details), we provide an overview of our theoretical approach and simulation setup. Then, in Results and discussion, we present the results of our simulations with a discussion in the context of the atomristor. The nal section contains the Conclusions.

Simulation details
In this work, we focused on defective ML-MoS 2 either with point defects or Au adatoms in top contact with the Au(111) electrode. First, we looked at the ideal defect-free interface, in which we initially introduced one single point defect (either one S vacancy or one Au atom lling such vacancy). Then, we systematically increased the concentration of such defects and we varied their position to assess the effect of clustering. From this point onward, unless otherwise specied, we will simply refer to MoS 2 to indicate a single-layer structure. Also, we will refer to each Au/ MoS 2 interface with the name of the defect introduced therein: for instance, V S and Au S correspond to interfaces with one S vacancy and one Au atom lling such a vacancy, respectively. To increase the concentration of defects, we doubled and multiplied by four the number of both S vacancies and Au atoms per unit cell: 2 × V S and 2 × Au S , and 4 × V S and 4 × Au S . We point out that here defects were randomly introduced without any clustering. However, we also investigated the effect of defect clustering, and we considered S di-vacancies either in-plane (V P S2 ) or axial (V A S2 ). Equally, we considered axial and in-plane clusters of Au atoms: Au2 A S2 and Au2 P S2 , respectively. Finally, we considered a large 4-atom cluster of S vacancies (V S4 ).
We constructed Au/MoS 2 interfaces by matching the crystal lattice of Au(111) to that of MoS 2 , which led to a small unavoidable mean absolute strain of ∼3% in the Au electrode. The structure of MoS 2 was kept free of any strain and with a calculated in-plane lattice constant of 3.16 Å, which matches very well with experimental data. 40 It is worth noting that strain on the Au electrode may vary the local registry between Au and MoS 2 lattices, 36 and consequently may also affect the computed average interface distances. Nevertheless, as we will discuss in the following section, our results compare well with experimental data 22 and are well within the range of values found in other computational studies in the literature. 36,37,41 To construct such interfaces, we considered a 3 × 3 orthorhombic MoS 2 supercell, thus allowing us to keep the concentration of single point defects in the experimental range of ∼10 13 cm −2 (equal to a defect density of 2.7%). Such a concentration corresponds to having one single point defect per unit cell, whereas when having two and four the defect density becomes 5.5 and 11%, respectively. The orthorhombic simulation cells of the interfaces had the following dimensions: a = 16.4219 Å, b = 9.4812 Å, and c = 45.5679 Å. A representative interface structure is shown in Fig. 1. Finally, we point out that effects arising from the Moiré pattern between Au(111) and MoS 2 , as well as the herringbone reconstruction of Au, were not taken into consideration in our simulations.
Atomistic simulations were carried out in the framework of density functional theory (DFT) with QuantumATK atomic-scale modelling soware. 42,43 All our spin-polarized calculations were performed in vacuum using the Perdew-Burke-Ernzerhof (PBE) exchange-correlation functional, 44 and to model core electrons we used norm-conserving pseudopotentials from the Pseudo-Dojo library. 45 The linear combination of atomic orbitals (LCAO) approach was used throughout the work. Upon validation of the simulation settings, 39 we chose a density-mesh cut-off of 150 Ry and the QuantumATK-optimized Medium basis set. A k-point mesh dened by a 2 × 3 Monkhorst-Pack (MP) grid 46 was used to carry out geometry optimizations, which we increased up to 8 × 12 when computing device density of states (DOS). Geometry optimizations were converged with a maximum allowed atomic force threshold of 0.05 eV Å −1 . To take into account long-range dispersion interactions, all the simulations were carried out by including the Grimme's D2 dispersion correction. 47 Au/MoS 2 interfaces were modelled via the Green's function surface approach as implemented in QuantumATK, which allowed us to construct semi-innite (fully periodic in one direction) Au surfaces rather than rely on metal slabs. 48 To carry out such simulations, we considered six atomic layers of Au coupled with MoS 2 , to which we imposed Dirichlet boundary conditions in the direction of the bulk Au electrode and Neumann boundary conditions in the vacuum direction (see Fig. 1). A total of 138 kpoints along the direction of the Au electrode were chosen.
Adhesion energies (E ad ) of MoS 2 (pristine and defective) on the Au electrode were computed as: where E Au/MoS 2 is the total energy of the Au/MoS 2 interface, whereas E MoS 2 and E Au are the total energies of the isolated MoS 2 and Au fragments, respectively. As we carried out our simulations by using the LCAO approach with localized orbitals, we took into account the basis set superposition error (BSSE) by including the counterpoise correction 49 in our total energy calculations.

Results and discussion
Here, we discuss on the quality of Au/MoS 2 contacts by looking at their optimized interface structures, by computing gures of merit to assess their stability, and by predicting their tunnelling probabilities of electrons.

Structures and stability of defective interfaces
In this part of the work, we focus on the stability of defective interfaces with respect to the pristine case by looking ad their DFT-optimized geometries and by computing adhesion energies (per surface Au atom). The atomic structure of selected interfaces are shown in Fig. 2, whereas average interface distances (d Au-MoS 2 ) and adhesion energies are presented in Table 1. For each interface, we decomposed the total E ad into its dispersion (E disp ad ) and electrostatic (E elec ad ) contributions. By looking at the optimized structure of the ideal defect-free interface, it is evident that there exist no chemical bonds between Au and MoS 2 : with an average d Au-MoS 2 of 2.71 Å, the interaction between Au and defect-free MoS 2 is mainly driven by dispersion forces (van der Waals gap). This is corroborated by the E ad of the interface, whose major contribution is given by E disp ad with a small electrostatic repulsion. The weak interaction between Au and pristine MoS 2 has been widely reported in the literature with theoretical simulations 36,41,50 and in our previous work. 39 However, experimental CVD-MoS 2 samples are far from being pristine, and are mainly characterized by the presence of S vacancies. Our simulations show that such a defect at 2.7% density (approximately as in experimental samples 29 ) does not signicantly change the weak Au/MoS 2 interaction: d Au-MoS 2 (2.73 Å) is comparable with that of the pristine interface, and the adhesion energy is still mainly given by weak dispersion forces. It is worth noting that the vdW gap between Au and CVD-MoS 2 is also observed experimentally by looking at atomic resolution TEM images. 22,51 Moreover, the size of the vdW gap that can be extracted by TEM images compares reasonably well with our computed value, thus further conrming our results. We then lled the S vacancy by introducing one Au atom and we optimized the full interface. By doing so, we considered the extra Au atom to be originally adsorbed on the metal electrode (extra adatom). Our simulations revealed that the bond length between Au and the Mo atoms of MoS 2 is much longer than that between S and Mo (see Fig. 3) in the same material. We found the Au-Mo bond length to be 2.81 Å, which is 0.40 Å longer than the typical Mo-S bond length (2.41 Å). Thus, the Au atom sticks out of the basal plane of MoS 2 , allowing it to simultaneously bond also with the Au electrode. We found the bond lengths between the extra Au atom in MoS 2 and the four closest Au atoms of the metal electrode to range between 3.15 and 2.70 Å (see Fig. 3). Interestingly, we point out that the Au-Au bond length in the electrode is 2.73 Å. The formation of a chemical bond between the extra Au atom and the metal electrode is further corroborated by the electron localization function (ELF), which we plotted in Fig. 3, and by the electron density difference (EDD) maps in Fig. 4. From the ELF plot, it is evident that there is a non-zero probability to locate electrons between the extra Au and the atoms of the electrode, whereas no direct chemical bonds are observed between S atoms and the metal electrode. Furthermore, EDD maps show a signicant charge redistribution on the extra Au atom, whereas with pristine MoS 2 and V S only a limited charge redistribution is found at the materials' Fig. 2 Optimized geometries with DFT of selected Au/MoS 2 interfaces considered in this work. The pictures were taken in the vicinity of the contact area between the two materials. Interfaces V P S2 and V S4 refer to MoS 2 with clusters of two and four S vacancies, although following geometry optimization such clusters were fully filled by Au atoms migrating from the above electrode. interface. Overall, the average d Au-MoS 2 in Au S is comparable to that of the defect-free interface, although we point out that we observed a small rearrangement of the Au atoms of the electrode due to the presence of the extra Au atom above the basal plane of MoS 2 . Finally, the stronger interaction between MoS 2 and the metal electrode is also corroborated by the stronger E ad , in which, in addition to the dispersion contribution, we also found a small electrostatic attraction (see Table 1). In conclusion, our simulations suggest that the extra Au atom that lls the S vacancy is able to act as a physical "bridge" between MoS 2 and the metal electrode. Then, we increased the concentration of both S vacancies and Au substitutions in MoS 2 . To do so, we doubled and multiplied by four the number of these defects in the simulation cell, resulting in a defect density of 5.5 and 11%, respectively. To avoid articial clustering, we introduced defects randomly. Once again, we found a limited interaction between the metal electrode and MoS 2 in both 2 × V S and 4 × V S , suggesting that even at much higher concentrations the interface is characterized by a vdW gap. However, we observed a small (but negligible) decrease of d Au-MoS 2 , from 2.71 Å (pristine interface) to 2.70 Å and 2.67 Å for 2 × V S and 4 × V S , respectively. The weak interaction is also conrmed by E ad , whose value did not vary with respect to the pristine interface even at 11% density of S vacancies. On the contrary, we found that increasing the concentration of substitutional Au atoms leads to a signicant increase in the electrode/MoS 2 interaction. This is evident by looking at E ad , which increased from −0.42 eV in Au S to −0.49 eV and −0.64 eV in 2 × Au S and 4 × Au S , respectively. Interestingly, we point out that the E ad in 4 × Au S is essentially two times that in 4 × V S . It is also worth noting that the electrostatic attraction contribution in the adhesion energy increases with respect to the concentration of substitutional Au atoms: at the highest Au defect density, it accounts for roughly 30% of the total E ad . This is further proof of the capability of substitutional Au atoms to couple the metal electrode to MoS 2 by forming strong chemical bonds simultaneously with both materials. On the contrary, increasing the concentration of S vacancies does not lead to any signicant change. Finally, we found a slight increase of d Au-MoS 2 up to 2.76 Å at 11% defect density, which is the result of the atomic rearrangement of the surface Au atoms of the electrode when in contact with the substitutional Au atoms in MoS 2 .
Finally, we considered small and bigger clusters of defects at the Au/MoS 2 interface. This is relevant, as S vacancies in MoS 2 have been shown to be rather mobile and thus possibly prone to clustering. [52][53][54] Our computed formation energies of defects also corroborate this (see Table S1 in the ESI †). Au atoms migrating from the electrodes may then ll such clusters, forming in turn Au clusters. Here, we focused on S di-vacancy and substitutional Au either in or out of plane MoS 2 . Moreover, we also considered a large 4-atom cluster of S vacancies. We found that both V A S2 and Au2 A S2 interfaces (i.e., with axial defects) are characterized by the same E ad and roughly the same d Au-MoS 2 of their corresponding V S and Au S interfaces. This is justied by effectively having only one defect in MoS 2 in contact with the Au electrode, whereas the other is on the opposite side of the material in contact with the vacuum. Therefore, these results suggest that defects on the opposite (bottom) surface of the material have very little or no effect on the structure and the interface energetics of the (top) Au/MoS 2 contact. In the presence of both top and bottom contacts, each vacancy will then play the same role with the Au electrode in proximity. On the contrary, when we coupled MoS 2 with in-plane clusters of two and four S vacancies with the metal electrode, we observed the strong tendency of the Au atoms at the bottom layer of the electrode to migrate and ll such clusters, in accordance with previous studies in the literature. 35 Remarkably, we found that even a small cluster of two S vacancies was enough to cause the Au electrode to partially collapse on MoS 2 . We point out that this was not the case when we randomly introduced the same number of S vacancies per unit cell without any clustering, meaning that their relative position can dramatically change the interaction between materials at their interface. Interestingly, when looking at the structures of both V P S2 and V S4 we observed the tendency of the collapsed Au atoms to reorganize and form small metal clusters, rather than just sit in the position of S vacancies. Indeed, from Fig. 5 one can observe that the Au-Au bond lengths are in every case smaller than the typical distance of 3.16 Å of S vacancies. As expected, the computed E ad Fig. 4 Electron density difference (EDD) maps of the pristine, V S , and Au S interfaces in the vicinity of the contact area. Green colour corresponds to electron loss, whereas mauve colour to electron enrichment. The isovalue was set to 0.002 eV Å −3 . of both interfaces are very high, conrming the strong interaction between MoS 2 and the collapsed Au electrode. The nal interface considered in this work was Au2 P S2 , which essentially corresponds to the situation in which two Au atoms adsorbed on the metal electrode migrate to ll a small cluster of two S vacancies (or two substitutional Au atoms migrate on the MoS 2 surface to eventually coalesce). For this interface, we found the same values of both d Au-MoS 2 and E ad as in 2 × Au S , suggesting that when no collapse of the electrode occurs the relative position of substitutional Au atoms has little inuence on the quality of the contact.

Tunnelling probabilities of defective interfaces
So far, we have only looked at the structural properties of interfaces. In this part of the work, for each interface considered in this study, we computed electron tunnelling barriers and probabilities as an estimate of the charge transport across the Au/MoS 2 contact. In device contacts where no chemical bonding occurs between the metal and the semiconductor (as in the structures here considered), a tunnelling barrier is always present. 50,55 Its magnitude correlates with the contact resistance: a high tunnelling barrier implies a low probability of electrons to cross the metal-semiconductor interface, and thus an expected high contact resistance. To extract the tunnelling probability, we computed the plane averaged effective potential (V eff ) across the interface of every Au/MoS 2 contact considered in this work, and we projected it in the direction of the interface between the two materials. This quantity is shown in Fig. 6, which refers to the defect-free situation. The barrier height (F TB ) is essentially the difference between V eff in the Au electrode and at the interface, as highlighted in the gure. DL is instead the barrier width. Although both F TB and DL can provide a rst estimate of how intimate (or poor) the metalsemiconductor contact is, the tunnelling probability (T) provides a better quantitative gure of merit. We computed T by integrating V eff between the limits dened by the barrier width (see Fig. 6): (2) In the above equation, m and ħ are the electron effective mass and the reduced Planck's constant, respectively.
The computed barrier widths, heights, and the tunnelling probabilities are summarized in Table 2. As we found in our previous work, 39 the tunnelling probability in the defect-free interface is close to 40%. This quantity slightly decreases to 38-39% when introducing S vacancies, suggesting the worsening of the contact quality regardless of the defect concentration. Thus, with a lower value of T such defective interfaces are expected to have an even larger contact resistance compared to the pristine interface. On the other hand, Au substitution was found to increase the tunnelling probability of the interface from 44.9% at the lowest concentration (Au S ) up to 71.1% at the highest concentration (4 × Au S ). Interestingly, T correlates very well with the Au concentration, whereas we observed no correlation when increasing the concentration of S vacancies in MoS 2 , at least until the maximum defect density here considered (11%). This suggests that S vacancies do not play any signicant active role in the coupling between MoS 2 and the electrode. On the contrary, the effect of Au concentration in the tunnelling probability is evident, suggesting a constant improvement of the electron injection rate as more conductive  "bridges" are generated at the interface. It is also worth noting that the value of T in 2 × Au S and Au2 P S2 is comparable (50.5 and 50.9%, respectively), whereas in V P S2 (i.e., when the electrode collapses) T is 54%. These results suggest that, at equal concentrations of substitutional Au atoms: (i) when the extra Au atoms derive from the Au electrode as adsorbed adatoms, the effect of clustering on the electron injection rate is negligible; (ii) when the extra Au atoms derive from the collapsed electrode, the tunnelling probability is higher. This can also be observed when comparing values of T in 4 × Au S against V S4 (i.e., when the electron collapses): 71.1 and 89.6%, respectively. We believe this effect to be due to the signicant atomic distortion of the Au electrode upon its collapse on MoS 2 , which effectively leads to a shorter average interface distance than that observed when randomly distributing substitutional Au atoms at the materials' interface.

Electronic structure of MoS 2 in defective interfaces
To investigate how the electronic properties of MoS 2 within the contact change due to the presence of defects, we computed the density of states (DOS) of selected interfaces, projected onto the Mo-4d and S-3p orbitals of MoS 2 . The projected DOS (PDOS) plots are shown in Fig. 7.
As expected, the pristine MoS 2 retains its band gap also in the presence of the Au electrode. We computed its value to be ∼1.75 eV, in excellent agreement with experimental data. 20 We note, however, the shi of the Fermi level towards the conduction band, indicating the n-type doping effect of the Au electrode. In general, the presence of S vacancies does not change the current picture: the material retains its semiconducting properties, although we observed the formation of intra-gap states in the proximity of the conduction band. At a defect density of 11% (4 × V S ), several intra-gap states merging with the conduction band of MoS 2 are observed. Nevertheless, the Fermi level of the system is still found within the material's band gap, although being very close to the new conduction band edge.
The presence of substitutional Au atoms also leads to intragap states close to the conduction band edge of MoS 2 .
Interestingly, at the high defect density of 11% (4 × Au S ) we found such intra-gap states to cross the Fermi level of MoS 2 , suggesting the metallization of the material. We point out that this is consistent with our previous results on adhesion energies and tunnelling probabilities, which both pointed towards the enhanced interaction between the electrode and MoS 2 , and thus to an intimate device contact. We observed the metallization of MoS 2 also in both V P S2 and V S4 , where our simulations showed the collapse of the Au electrode. Notably, the PDOS of V S4 shows the complete vanishing of the material's band gap, which indeed correlates with the highest value of T (89.6%) computed in this work, among all the interfaces considered.
Overall, our results show that substitutional Au atoms at higher concentrations cause MoS 2 to switch from a semiconductor to a metal, and this is expected to signicantly  change the resistance at the device contact (see Table 2). Also, we could conrm that the conduction in the LRS of the atomristor is indeed metallic, as it was previously argued by experimental studies. 22,30

Mechanism of the resistive switching
Based on the results presented so far, we propose the following steps behind the resistive switching in vertical Au/MoS 2 /Au memristors: 1. CVD-MoS 2 with its typical S vacancy density (∼10 13 cm −2 ) is in contact with the Au electrode. This is well represented by the interface V S , as shown in Fig. 8. 2. As the device is switched on for the rst time, extra S vacancies are generated due to either the presence of the electric eld or the increase in the local temperature. This situation corresponds to the HRS. Among the interface structures considered in this study, 4 × V S (T = 38.2%) would correspond to the best case scenario in which the highest density of S vacancies is obtained (see Fig. 8).
3. Extra Au atoms migrate from the electrode to MoS 2 , where they are able to ll the S vacancies. The Au migration may be due to both the electric eld and the Joule heating caused by it.
The computed charge distribution of selected interfaces (see Fig. S1 in the ESI †) shows that extra Au atoms assume a positive partial charge, thus conrming the susceptibility of such atoms to the electric eld. The substitutional Au atoms in MoS 2 act as conductive "bridges", thus allowing electrons to easily ow across the contact. In this situation, MoS 2 becomes metallic and this corresponds to the LRS. Assuming the highest density of S vacancies, the LRS is best represented by the interface 4 × Au S (T = 71.1%), as can be seen in Fig. 8.
4. To reset the device, an opposite electric eld may be applied, forcing substitutional Au atoms to migrate back to the metal electrode, thus restoring the HRS.
In this picture, we note that extra Au atoms may derive either from adatoms adsorbed on the Au(111) surface or directly from the electrode upon its collapse on MoS 2 , provided a (small or large) cluster of S vacancies is present on the material's surface.
As previously discussed, clusters of vacancies may form due to the mobility of S vacancies in MoS 2 . This process is usually aided by the presence of the electric eld or the increase in the local temperature due to self-heating in the device. Assuming the collapse of the Au electrode, resetting the device may not always be possible: very high temperatures and a high electric eld may both be needed. This suggests that the electrode collapse could lead to a failure mechanism in which the device is stuck in the LRS. The formation of clusters of S vacancies may then be detrimental.

Conclusions
To conclude, by means of a computational modelling approach which combines DFT and Green's function surface simulations, we unravelled the physics of the resistive switching in vertical memristors based on single-layer MoS 2 and Au electrodes. To achieve this, we carried out several ab initio simulations of pristine and defective Au/MoS 2 interfaces with either S vacancies or substitutional Au atoms. Also, we varied the concentration of such defects and we considered the formation of defect clusters. To shed light onto the memristive mechanism, we explored the impact of defects on the structural and electronic properties of interfaces, and on their tunnelling probabilities.
Our simulations revealed that the switch between HRS and LRS in MoS 2 -based memristors is not due to the mere presence of S vacancies in CVD-MoS 2 , but rather to the migration of Au atoms from the metal electrode to MoS 2 . When migrating, these extra Au atoms occupy the position of the S vacancies and are able to act not only as physical but also as conductive "bridges" between the two materials, enhancing the transfer of electrons from the electrode to MoS 2 . Based on such ndings, we believe that the HRS corresponds to the situation in which only S vacancies are present in the material, whereas the LRS is achieved when a sufficient number of Au atoms have migrated and lled the S vacancies in MoS 2 , which then becomes metallic. This hypothesis is corroborated by the interface geometries, clearly showing the extra Au atoms to simultaneously bind with MoS 2 and the Au electrode. Also, the computed tunnelling probabilities of electrons are signicantly higher only in the presence of substitutional Au atoms in MoS 2 . On the contrary, when only S vacancies are present in the material the tunnelling probability is low and comparable to that of the defect-free interface. The PDOS plots of the interfaces conrm this, and show the metallization of MoS 2 at higher concentrations of substitutional Au atoms. We also found that extra Au atoms may derive either from adatoms adsorbed on the Au surface, or directly from the electrode upon its collapse on MoS 2 . The electrode collapse was observed only if clusters of S vacancies are present in the material and could lead to a failure mechanism in which the device is stuck in the LRS.
We point out that the results presented in this work not only support the experimental ndings in the literature, but also provide a theoretical understanding of the resistive switching mechanism in vertical Au/MoS 2 /Au memristors. We hope our work will contribute towards the optimal design and development of 2D memristors. Fig. 8 Illustration of the proposed resistive switching mechanism and the possible Au/MoS 2 interfaces involved. Here, we propose the electric field (E) and/or temperature (t) as key quantities to generate extra S vacancies and to force the migration of Au atoms from (to) the metal electrode.