Vladimir Prudkovskiy

Imane Arbouch

Anne Léaustic

Pei Yu
email: pei.yu@universite-paris-saclay.fr

Colin Van Dyck

David Guérin

Stéphane Lenfant

Talal Mallah

Jérôme Cornil
email: jerome.cornil@umons.ac.bedominique.vuillaume@iemn.fr

Dominique Vuillaume
email: dominique.vuillaume@iemn.fr

Anne Léaus

Terphenylthiazole-based self-assembled monolayers on cobalt with high conductance photo-switching ratio for spintronics

Keywords: molecular photo-switch, electron transport, conduc've-AFM, DFT/ NEGF self-assembled monolayer, molecular spintronics

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

INTRODUCTION.

The use of photochromic and electrochromic ac've molecules in molecular junc'ons allows modula'ng the electron-and magneto-transport response of these junc'ons using light or electric field. [1][2][3][4][5] When these molecules are assembled on ferromagne'c (FM) electrodes, the spin-polarized electron transport through the FM/molecules/FM junc'ons is expected to depend on the conforma'on of the molecules and on the molecule/electrode atomic contact geometry, as evaluated from theore'cal studies. [6][7][8] For instance, a huge increase of the magnetoresistance (MR) ra'o was calculated for an azobenzene-based molecular junc'on (from 65% for the cis conforma'on to 2700% for the trans conforma'on); 8 moreover, the voltage dependence of the MR is significantly different for a dithienylethene molecule in its open and closed forms. 7 These studies suggest new approaches to control the spin-polarized electron transport at the molecule-ferromagne'c hybrid interfaces. The building of new device func'onali'es beyond conven'onal spintronics by designing ac've metal/ func'onal molecule combina'ons is highly desirable to exploit this unique tailoring opportunity offered by chemistry. However, the experimental demonstra'on of such electro-op'cal molecular spintronic devices is lacking.

We have recently reported the op'cally induced conductance switching at the nanoscale (via conduc've-AFM measurements) of diarylethene deriva'ves in self-assembled monolayers (SAMs) on La 0.7 Sr 0.3 MnO 3 electrodes; 9 we observed a weak current (I) switching of the diarylethene molecular junc'ons (closed form/ open form conductance ra'o I(closed)/I(open)=R c/o <8), partly hidden under some condi'ons by the op'cally induced conductance switching of the La 0.7 Sr 0.3 MnO 3 substrate. We have measured a slightly higher conductance ra'o (between the cis/trans isomers) of about 20 for azobenzene deriva'ves on Co. 10 These performances are lower than those of the same self-assembled monolayers on gold electrodes for which conductance ra'os up to ≈7x10 3 were measured for azobenzene deriva'ves 4 and R c/o ≈ 100 were calculated and measured for diarylethene deriva'ves. 11,12 Here, we report an unprecedented R c/o up to ≈ 380 for terphenylthiazolebased SAMs on Co. Two thiazole-based terarylene molecules, (scheme 1, referred to as TPT(A) and TPT(B) in the following) were designed, synthesized and the electron transport proper'es of SAMs on Au and Co were measured by conduc've atomic force microscopy (CAFM in air and UHV, respec'vely). At a theore'cal level, we carried out first principle calcula'ons on these molecular junc'ons by means of the state-of-the art Non-Equilibrium Green's Func'on method (NEGF) combined with Density Func'onal Theory (DFT). 13 The transmission spectra at different biases are calculated for the various TPT(B)based molecular junc'ons and I-V curves simulated using the Landauer Büoker formalism within the coherent transport regime. 14 The experimental and theore'cal data are consistent and lead to the main conclusions that: (i) TPT(B) based junc'ons exhibit higher R c/o compared to TPT(A) junc'ons on both Au and Co (by a factor ≈ 2-2.5); (ii) the TPT SAMs on Co yield higher R c/o than their counterparts on Au (by a factor ≈ 20-25) and (iii) TPT(B) SAMs on Co exhibit the highest R c/o ra'o (≈195-380 from experiments, ≈110-290 from theory). The laaer finding is ra'onalized by a strong coupling between the closed form of the TPT(B) molecule and the Co electrode manifested by a resonant transmission peak with a large broadening at the Fermi level of the Co electrode.

Scheme 1. Photochemical transforma;on of terphenylthiazole molecules TPT( A) and TPT(B).

Experimental Results

We have chosen to work with two thiol func'onalized thiazole-based terarylenes (molecules TPT(A) and TPT(B)) that share the same photochromic core structure, but differ with the posi'on of the anchoring group with respect to the central thiazole (Scheme 1). Terarylenes are known to possess generally good and widely tunable photochromic proper'es. [15][16][17][18][19] Moreover, unlike classic diarylethenes with standard ethene bridges (perfluorocyclopentene, maleimide etc.), 1,20 terarylenes offer addi'onal flexibility in terms of func'onaliza'on with the central aryl site. [21][22][23] The choice of thiazole as aryl over the much more documented thiophene is mo'vated by the fact that thiazole-based terarylenes are known to be thermally more stable in their closed form than their thiophene-based counterparts. 15 Finally, the use of thiazole (or thiophene) as the central ethene moiety introduces a dissymmetry within the molecular switch, absent for classic diarylethenes. Even though the op'cal proper'es of the two molecules are expected to be quite similar both in their open and closed forms in the isolated state, it is interes'ng to inves'gate how such a subtle dissymmetry could affect the transport proper'es in junc'ons. The detailed syntheses of the two new thiazole-based photoswitches and their full characteriza'ons using standard techniques can be found in the Suppor'ng Informa'on (sec'on 1). We checked the photo-switching of the two molecules in solu'on (µM in CH 2 Cl 2 ) by UV-vis spectroscopy. The two molecules display the expected photochromic proper'es and can be reversibly and cleanly switched between a colorless open form and a deeply colored closed form, with very similar spectral evolu'ons (see in the Suppor'ng Informa'on).

We fabricated the SAMs on freshly prepared template-stripped TS Au and evaporated Co surfaces from diluted millimolar solu'ons of TPT(A) and TPT(B) in ethanol/tetrahydrofuran (EtOH/THF 80:20 v/v) (see methods and sec'on 2 in the Suppor'ng Informa'on). The thicknesses of the SAMs measured by ellipsometry are 9-10 ± 2 Å for TPT(A) and TPT(B) on TS Au. Given the theore'cal es'mated length of the molecule of 16.3 Å (in agreement with X-ray crystallography data) 15 we es'mate a molecular 'lt angle of ≈ 54 ± 9° in these SAMs. On Co substrate, the thickness measurements are less reliable because of the slightly higher roughness of the Co surface (≈0.8 nm 24 vs. ≈0.4 nm for our TS Au surface 25,26 ) and the need to use a specific sealed cell under dry N 2 (see methods and sec'on 4 in the Suppor'ng Informa'on). We grossly es'mate a thickness between 6 and 17 Å for TPT(A) SAM (i.e. 11.5 ± 5.5 Å) and 12 -22 Å (17 ± 5 Å) for the TPT(B) SAMs.

The analysis of the X-ray Photoelectron Spectroscopy (XPS) data of SAMs of TPT(A) and TPT(B) on TS Au shows the presence of C, N and S in the SAMs. The C 1s major peak at 284.8 eV (sec'on 5 in the Suppor'ng Informa'on) corresponds to C-C, C-N and C-S bonds. The shoulder observed at 286.2 eV is assigned to the three S-C=N carbons of the thiazole rings. 27 The S 2p region shows two doublets (S 2p 1/2 and S 2p 3/2 ) associated to the S-C and S-Au bonds (sec'on 5 in the Suppor'ng Informa'on) and the amplitude ra'os [S-Au]/[S-C] are ≈ 0.4-0.5, slightly higher than the expected ra'o of 1/3. For both molecules, in addi'on to the main N 1s peak associated to the C=N bond, a second peak is also observed and is likely associated to a "coordinated-like" form (C=N...Au) of nitrogen (sec'on 5 in the Suppor'ng Informa'on). This N 1s peak spliong is observed when the N atoms interact with a metal surface, [28][29][30] a possible situa'on considering the large 'lt angle of the molecules inferred from thickness measurements and calcula'ons (geometry op'miza'on, vide infra). This "coordinated-like" peak is further used as a fingerprint of a strong interac'on between the molecule and the substrate in correla'on with the electron transport proper'es of the molecular junc'ons (vide infra). Interes'ngly, the ra'o of the peak amplitude [C=N...Au]/[N=C] is higher for TPT(B) than for TPT(A): 0.74 vs. 0.34, respec'vely (Fig. S5 and Table S1 in the Suppor'ng informa'on). This feature is likely related with the asymmetry of the two molecules (vide infra, sec'on theory and discussion). The XPS spectra of the SAMs of TPT(A) and TPT(B) on Co show the presence of C, N and S elements. As for the molecules on TS Au, the C 1s peak is composed of C-C, C-N and C-S signals (sec'on 5 in the Suppor'ng Informa'on). In the S 2p region (sec'on 5 in the Suppor'ng Informa'on), we observe the contribu'on of S-C and S-Co bonds and the amplitude ra'o [S-Co]/ [S-C] ≈ 0.5-0.6 is higher than the expected value of 1/3. This feature again suggests that more than one S atom is bound to the Co, a situa'on that cannot be excluded because of the large 'lt angle of the molecule that is consistent with the geometry op'miza'on calcula'ons (vide infra). The N 1s region (sec'on 5 in the Suppor'ng Informa'on) also shows the two peaks of the C=N bonds and the illumina'on (see methods and Suppor'ng Informa'on: sec'on 6 for CAFM and sec'on 7 for illumina'on condi'ons). In the presented dataset, we removed the I-V traces reaching the sensi'vity limit of the apparatus (almost flat I-V traces and/or displaying random staircase behavior in the range of 0.1 to few pA), those reaching the satura'ng current of the preamplifier during the voltage scan and those with large and abrupt changes in the measured current (CAFM 'p contact issue) -see sec'on 6 in the Suppor'ng Informa'on (Figs. S7 andS8). The datasets are shown as 2D-histograms (heat maps) and the red line is the calculated mean Ī-V curve (the same datasets ploaed in regular style, not as a heat map, are also given in sec'on 6 of the Suppor'ng Informa'on; Figs. S9). We observe that the TPT(A) molecules have a higher conductance in the closed form (TPT(A)-c) azer UV-light exposure than in the open (TPT(A)-o) form (Figs. 1a and1b), as already observed for other diarylethene deriva'ves. 1,2,11,12 The histograms of the currents taken at 0.5V (in blue) and -0.5V (in red) are shown in Figs 1d-1f. They are fiaed by a log-normal distribu'on. Table 1 summarizes the fiaed values of the log-mean current (log-Ī) and the log-standard devia'on (log-σ) for the pris'ne molecular junc'ons and azer UV and visible light irradia'on and Fig. 5 shows the evolu'on of the mean current. We calculate the mean on/off (closed/open) current ra'os R c/o (TPT(A)-Co) ≈ 150-180 at both 0.5V and -0.5V as the ra'o of the mean current values of the histograms azer UV irradia'on and of the pris'ne SAMs. We also calculated the R c/o -V curve from the ra'o of the corresponding mean Ī-V curves in Figs. 1a and1b (R c/o (V)=Ī UV (V)/ Ī pris'ne (V)) and found values of the same order of magnitude (107-214) over the whole voltage range (Fig. S10, sec'on 6 in the Suppor'ng informa'on). Figure 2 shows the dataset for the TPT(B) molecules on Co. We observe the same trends as for the TPT(A) molecules, although the closed/open current ra'o is slightly larger, R c/o (TPT(A)-Co) ≈ 320 and 250 at 0.5V and -0.5V (and 195-380 for the en're voltage range, Fig. S9 sec'on 6 in the Suppor'ng Informa'on) considering the HC (high current) peak for the closed form in the measured current distribu'on (Fig. 2e). We note, however, two differences for the SAMs of TPT(B) on Co : (i) we observe a larger current dispersion; and (ii) the open to close transforma'on is not complete. The current histogram in Fig. 2e shows that a frac'on (about 50 % of the counts, as es'mated from the calculated areas under the LC and HC peaks) is reminiscent of the open state in view of a second peak (low current peak, LC peak) centered in the 0.1-1 nA range as for the pris'ne SAM and azer white light exposure. The large dispersion of current and the presence of two peaks in some cases can also be due to disorder induced by a slightly higher roughness of the Co electrode compared to Au as demonstrated by a series of electron transport measurements on electrodes with various controlled topography. 32 Finally, we note that TPT(B) molecules have a larger c/o current ra'o than TPT(A) molecules, in agreement with the theore'cal results (vide infra). We also note that the open to close switching is reversible under white light illumina'on for the two molecular junc'ons (we have not done a detailed cyclability study, but the molecules were photoswitched open/closed twice). The lack of a complete pho'zomeriza'on for TPT(B) on Co may be ra'onalized by the increase in accessible excited states origina'ng from the strong coupling to the Co metal surface (vide infra, theory sec'on). 33 For comparison purpose, we also characterize by CAFM (in air) the electron transport proper'es of the TPT SAMs on TS Au substrates (see methods and sec'on 6 in the Suppor'ng Informa'on). Figures 3 and4 show the 2D I-V histograms of the molecular junc'ons of TPT(A) and TPT(B) on an TS Au substrate (methods and sec'on 6 in the Suppor'ng Informa'on). As for the SAMs on Co, we s'll observe that the conductance of the SAM is higher with the molecules in the closed form than in the open form. The main difference is that the closed/ open current ra'os are lower for the SAMs on gold than on Co, for both molecules. We obtain R c/o (TPT(A)-Au) ≈ 7 at 0.5 V and -0.5 V (Fig. 3) (and the same value, 6-8, in the whole voltage range -Fig. S9, sec'on 6 Suppor'ng Informa'on) and a current ra'o R c/o (TPT(B)-Au) ≈ 16 at 0.5 V and 14 at -0.5 V for TPT(B) with a value between 9 and 18 for the whole voltage range (Fig. S10, sec'on 6 in the Suppor'ng Informa'on). We s'll measure a slightly higher closed/open conductance ra'o for the TPT(B) than for TPT(A) molecules (as for the SAMs on Co). Figure 5 and Table 1 summarize the evolu'on of the mean current Ī for the four molecular junc'ons. shown on the figures. The red line is the mean Ī current. Histograms of the currents at 0.5V and -0.5V for (d) pris;ne SAM of TPT(A), (e) aTer UV irradia;on, (f) aTer visible light irradia;on. The fit parameters of the log-normal distribu;on, log-Ī (log-mean current) and log-σ (log-standard devia;on), are given in the figures and summarized in Table 1. shown on the figures. The red line is the mean Ī current. Histograms of the currents at 0.5V and -0.5V for (d) pris;ne SAM of TPT(B), (e) aTer UV irradia;on, (f) aTer visible light irradia;on. The fit parameters of the log-normal distribu;on, log-Ī (log-mean current) and log-σ (log-standard devia;on), are given in the figures and summarized in Table 1. shown on the figures. The red line is the mean Ī current. Histograms of the currents at 0.5V and -0.5V for (d) pris;ne SAM of TPT(A), (e) aTer UV irradia;on, (f) aTer visible light irradia;on. The fit parameters of the log-normal distribu;on, log-Ī (log-mean current) and log-σ (log-standard devia;on), are given in the figures and summarized in Table 1. shown on the figures. The red line is the mean Ī current. Histograms of the currents at 0.5V and -0.5V for (d) pris;ne SAM of TPT(B), (e) aTer UV irradia;on, (f) aTer visible light irradia;on. The fit parameters of the log-normal distribu;on, log-Ī (log-mean current) and log-σ (log-standard devia;on), are given in the figures and summarized in Table 1. Suppor'ng Informa'on). Briefly, all the I-V curves in the datasets shown in Figs. 1 to 4 are individually fiaed by the usual SEL equa'on: 34 (1)

with N the number of molecules in the junc'on, e the electron charge, h the Planck's constant. The fiaed parameters are ε 0 the energy posi'on (with respect to the Fermi energy of electrodes) of the molecular orbital involved in the electron transport, Γ 1 and Γ 2 the coupling energy between the molecules and the two electron reservoirs (electrodes). We limited the fits to a voltage window -0.5 V to 0.5 V for the best accurate fits (see sec'on 6 in the Suppor'ng Informa'on for details on the fit protocol, Figs. S11 andS12) and also mainly because above |0.5|V the HOMO and LUMO levels of the closed form of TPTs start to contribute to the electron transport (theory sec'on, vide infra), a case not consistent with the SEL. This model assumes that the molecular orbital broadening is described by a Lorentzian or Breit-Wigner distribu'on. 34,35 This is clearly not the case for the TPT molecules on Co (theory sec'on, vide infra) and the SEL model was not used in this case. The exact number of molecules, N, varies with the details of the 'p shape, loading force, Young modulus of the SAMs. We have used N = 10 for all the fits (see sec'on 6 in the Suppor'ng Informa'on). The use of N as a mul'plica'on factor in Eq. ( 1) means that we neglect the intermolecular interac'ons, [36][37][38] so that the fiaed values of Γ 1 and Γ 2 can only be used for a rela've/qualita've comparison between the two states of the same junc'on and not for a quan'ta've comparison with theory or other experiments such as single-molecule measurements.

Figures 6 and7 give the distribu'ons of the parameters ε 0 , Γ 1 and Γ 2 extracted by fiong Eq. 1 on the datasets of TPT(A) and TPT(B) on TS Au shown in

I = N 8e h Γ 1 Γ 2 Γ 1 + Γ 2 arctan 2ε 0 + eV Γ 1 -Γ 2 Γ 1 + Γ 2 + eV 2(Γ 1 + Γ 2 ) -arctan 2ε 0 + eV Γ 1 -Γ 2 Γ 1 + Γ 2 -eV 2(Γ 1 + Γ 2 ) ⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ ⎥ ⎥
Figs. 3 and4, as well as the fit by a Gaussian distribu'on giving the mean values of these parameters. Typical fits of this model on the mean Ī-V curves for each sample and the three condi'ons (pris'ne, UV and visible light exposures) are also given sec'on 6 in the Suppor'ng Informa'on (Fig. S12). In both cases, the energy Electronic structure, transport calcula9ons and discussion.

The geometric structures of the TPT deriva'ves in their open and closed forms were first op'mized in the gas phase at DFT level, with the B3LYP func'onal 41 and a 6-31 G (d,p) 42 basis set with the Gaussian09 sozware. [START_REF] Frisch | Gaussian 09, revision A.02[END_REF] The relaxed molecules and the spin generalized gradient approxima'on (SGGA) [START_REF] Perdew | [END_REF] for Au-TPT and Co-TPT SAMs, respec'vely as implemented in the QuantumATK sozware. 45,46 The valence electrons are described within the LCAO approxima'on, with a single zeta plus polariza'on basis set (SZP) for metal atoms and a double zeta plus polariza'on basis set (DZP) for the other atoms. The core electrons are described by the norm-conserving Troullier-Mar'ns pseudopoten'als. 47 A density mesh cutoff of 100 Ha and a (5×5×1) k sampling were used in all relaxa'ons. Once the SAM geometries are op'mized, a second gold electrode is added on the top side of the molecular layer to build the Au-TPT/Au and Co-TPT/Au junc'ons (Figs. 8 and 11). Albeit a PtIr 'p is used in the experiments, a gold one is used for the calcula'ons as validated in our previous work. 10 A van der Waals contact is assumed between the molecular layer and the top electrode, with an interatomic distance determined as the sum of the van der Waals radii of the hydrogen and gold atoms (2.86 Å). Noteworthy, a layer of gold (pla'num) ghost atoms has been added on the top layer of the gold (cobalt) electrodes at a distance of 1.7 (1.6 Å) away so that the work func'on of the clean Au(111) (Co(111)) surface of 5.25

(5.07 eV) eV matches the experimental value and previous theore'cal studies. 10,[48][49][50][51] The transmission spectra of the TPT junc'ons were calculated by the combina'on of DFT with the Non-Equilibrium Green's Func'on method (NEGF), 13 as implemented in QuantumATK Q-2019.12-SP1 (see methods). 52 Finally, the I-V characteris'cs were calculated on the basis of the Landauer-Büoker formalism, which links the transmission spectrum to the current in a coherent transport regime (more details in the Suppor'ng Informa'on). 14

Au-TPT/Au molecular junc?ons.

The relaxed Au-TPT/Au junc'ons (Fig. 8) exhibit a 'lt angle of ≈50 ± 5°, with a junc'on thickness between 12.5 Å and 13.63 Å, in good agreement with the ellipsometry data (9-10 ± 2 Å). These geometries are also consistent with the appearance in the XPS spectra of the signature of N atoms interac'ng with the substrate (the "coordinated-like" peak, vide supra) and a larger than expected contribu'on of S-Au bonds (vide supra and in the Suppor'ng Informa'on). For a more realis'c comparison between theory and experiments, the I-V curves and the voltage-dependent ra'os R c/o (V) were simulated by using the Landauer-Büoker formula 14 through the integra'on of the transmission spectrum calculated in a self-consistent way for each bias from 0V to 0.75 V (see Suppor'ng Informa'on). The simulated I-V curves (Fig. 10a) demonstrate that for We have ploaed the evolu'on of HOMO level with respect to the average Fermi level of the electrodes as a func'on of the applied voltage for the Au-TPT/ Au junc'ons (see Figure S17 in the Suppor'ng Informa'on). We found that the

Co-TPT/Au molecular junc?ons.

The relaxed Co-TPT/Au junc'ons displayed in Fig. 11 The transmission spectra at zero bias for Co-TPT/Au junc'ons are illustrated in Fig. 12. The transmission spectra were calculated for spin-up and spin-down electrons (see Fig. S20 in the Suppor'ng Informa'on). However, since we have not performed spin-polarized current measurements, we report in Fig.

12 the total transmission spectra (spin up + spin down). As for Au-TPT/Au junc'ons, the closed forms exhibit a higher conductance compared to open forms with R c/o ra'o of 37 and 288 for Co-TPT(A)/Au and Co-TPT(B)/Au junc'ons, respec'vely. We also simulated the I-V curves for the Co-TPT/Au junc'ons (Fig. 13a) and the bias-dependent R c/o under bias from 0.25 V to 0.75 V in first approxima'on by integra'ng the transmission spectra calculated at zero bias (see Suppor'ng Informa'on). This is mo'vated by the fact that calcula'ons with Co electrodes are much more 'me consuming due to the need for spin-polarized calcula'ons. We have found by comparing zero-bias vs. finite-bias voltage calcula'ons for the two molecules on Au that the discrepancy associated to the 13b and Table 3), which is in good agreement with experiment (≈2 at 0.5V). The approxima'on made by simula'ng the I-V curves from the transmission spectra calculated at zero bias may explain why TPT(A) does not exhibit in the calcula'ons a R c/o value as high as that found from experiment (155 at 0.5V, Table 1). It is difficult to plainly explain the stronger coupling of cobalt compared to gold. However, this feature may be origina'ng from the different character and strength of hybridiza'on between the molecular orbitals and the bands of the metal surface. In the case of cobalt, the molecules are strongly chemisorbed through the hybridiza'on between the d-Co states and the p-orbitals of the molecules, whereas a weaker hybridiza'on between the s-Au states and the porbitals of the molecules is taking place in the case of a gold surface.

Interes'ngly, several studies have also no'ced a strong coupling between organic molecules and cobalt, [57][58][59] an interes'ng trend that could be confirmed by

Conclusion.

Molecular

Methods

Synthesis and sample fabrica?on.

Molecule synthesis. The two new photochromic terphenylthiazoles (TPT) A and B were prepared according to the synthe'c routes described in details in the Physical Electronics 5600 spectrometer fiaed in an UHV chamber with a residual pressure of 3x10 -10 mbar. The measurements were done using standard procedures (sec'on 5 in the Suppor'ng Informa'on).

CAFM in ambient condi?ons. We measured the electron transport proper'es at the nanoscale by CAFM (ICON, Bruker) at room temperature using a 'p probe in pla'num/iridium (with loading force of ca. 15 nN). We used a "blind" mode to measure the current-voltage (I-V) curves and the current histograms: a square grid of 10×10 was defined with a pitch of 50 to 100 nm. At each point, the I-V curve is acquired leading to the measurements of 100 traces per grid. This process was repeated several 'mes at different places (randomly chosen) on the sample, and up to several thousand of I-V traces were used to construct the current-voltage histograms (sec'on 6 in the Suppor'ng Informa'on).

UHV CAFM measurements.

The CAFM experiments on SAMs under UHV (pressure 10 -11 -10 -9 mbar) were performed at room temperature using a VT-SPM microscope (Scienta Omicron).

CAFM imaging and local current-voltage (I-V) spectroscopy were carried out using pla'num-iridium coated probes. Typically, up to few hundreds of I-V traces were recorded at a loading force of ca. 15 nN (sec'on 6 in the Suppor'ng Informa'on).

Irradia?on setup of the photochromic TPT SAMs.

A power LED (M365F1 from Thorlabs) was used for the UV light irradia'on at 365 nm for the CAFM measurements in air. A chromatographic UV lamp (365 nm) was used for the measurements with the UHV CAFM. For the visible light irradia'on, we used a white light halogen lamp (Leica CLS150X). Since the light source to sample distance is not the same for the CAFM in air and in UHV, the irradia'on 'me was adjusted to subject the samples to about the same photon density (sec'on 7 in the Suppor'ng Informa'on).

Calcula?ons of the electronic structures.

For the DFT/NEGF calcula'ons with QuantumATK, the exchange-correla'on poten'al is described with the GGA.PBE (SGGA.PBE) func'onal [START_REF] Perdew | [END_REF]46 for Au-TPT/Au (Co-TPT/Au) junc'ons. The Brillouin zone was sampled with a (5×5×100) ksampling, a mesh cutoff of 80 Ha and a temperature of 300 K. We expand the valence electrons in a single zeta plus polariza'on basis set (SZP) for metal atoms and a double zeta polariza'on basis set (DZP) for the other atoms, except for the pla'num ghost atoms that are described by a medium basis set and a

PseudoDojo poten'al. The core electrons are frozen and described by the normconserving Troullier-Mar'ns pseudopoten'als. 47 These parameters have been carefully tested to ensure the convergence of the computed transmission spectra.

Associated content

The Suppor'ng Informa'on is available free of charge at xxxxxx: detailed

Scheme S1

2-(4-Br-phenyl)-thiazole 1 The solu'on turned immediately brown and the solu'on was warmed to RT and lek overnight. Aqueous NH 4 Cl solu'on (1M, 20 ml) and then diethyl ether (20 ml) were added and s'rred a few minutes before the organic phase was collected.

The aqueous phase was extracted with diethyl ether (20 ml) and combined organic phase was washed with water (40 ml) and dried over Na 2 SO 4 . Aker evapora'on of the solvents, the solid residue was submiled to column chromatography (silica gel, dichloromethane) to yield thiazole 7 as a light yellow, crystalline solid (755 mg, yield 85%). The 'tle compound was prepared using a reported method via a palladiumcatalyzed cross-coupling reac'on through a direct C-H ac'va'on of thiazole. 4 Bisthiazole 1 5 (290 mg, 0.87 mmol), thiazole 2 (304 mg, 0.88 mmol), pivalic acid (34 mg, 0.33 mmol), P(tBu) 2 Me.HBF 4 , 30 mg, 0.12 mmol), Pd(OAc) 2 (23 mg, 0.1 mmol) and Cs 2 CO 3 (567 mg, 1.74 mmol) were purged before xylene (5 ml) was introduced under argon. The mixture was refluxed overnight under argon, and dichloromethane (20 ml) then water (20 ml) were added into the mixture at RT.

The aqueous phase was extracted with dichloromethane (4x20 ml) and combined organic phase was washed with water (40 ml) and dried over Na 2 SO 4 . Aker evapora'on of the solvents, the residue was purified by column chromatography (silica gel, dichloromethane). The photochromic frac'on was evaporated under reduced pressure and the residue was taken in methanol (10 ml) and triturated.

The resul'ng solid was filtered and washed with methanol and dried under vacuum to give terphenylthiazole 3 a light yellow solid (448 mg, yield 86%). The deprotec'on of terbutyl thiol and its protec'on by acetyl group was carried out using BBr 3 and AcCl according to known literature method. 6 Terphenylthiazole 3 (300 mg, 0.5 mmol) was purged before addi'on of dry toluene (5 ml) followed by acetyl chloride (300 µl, 4.2 mmol). BBr 3 solu'on (1M in dichloromethane, 2.6 ml) was added under Argon at 0°C and the mixture s'rred at that temperature then at RT overnight. Water (10 ml) was slowly added to destroy the excess of BBr 3 and mixture was then extracted with dichloromethane (2x20 ml). Combined organic phase was washed with brine (30 ml) and dried over Na 2 SO 4 . Aker evapora'on of the solvent, the residue was purified by column chromatography (silica gel, DCM to 2-3% Et 2 O) and the frac'on containing terphenylthiazole 3 was evaporated under reduced pressure to give a gum-like solid, which was taken up with MeOH (10 ml) and s'rred at RT to give the 'tle compound as an off-white solid (188 mg, yield 65%). Water (30 ml) and chloroform (30 ml) were added and organic phase collected.

The aqueous phase was extracted with chloroform (25 ml), and combined organic phase was washed with water (50 ml) and dried over Na 2 SO 4. Evapora'on of the solvents led to a brown oil, to which MeOH (10 ml) was added and s'rred at RT un'l a crystalline solid was formed. Aker filtra'on and washing with MeOH bisthiazole 4 was obtained as a slightly blueish solid (due to the presence of a very few closed form) (550 mg, 87% yield), which was pure enough for the next step. (30 mg, 0.13 mmol) and Cs 2 CO 3 (720 mg, 2.2 mmol) were purged before xylene (7 ml) was introduced under argon. The mixture was refluxed overnight under argon, and dichloromethane (30 ml) then water (30 ml) were added into the mixture at RT. The aqueous phase was extracted with dichloromethane (2x25 ml) and combined organic phase was washed with water (40 ml) and dried over Na 2 SO 4 . Aker evapora'on of the solvents and the solid residue was s'rred with MeOH (15 ml) overnight to give thiazole 5 as an off-white solid, which was used for the next step without further purifica'on (600 mg, 91% yield). Terphenylthiazole 5 (302 mg, 0.5 mmol) was purged before addi'on of dry toluene (5 ml) followed by acetyl chloride (300 µl, 4.2 mmol). BBr 3 solu'on (1M in dichloromethane, 2.6 ml) was added under Argon at 0°C and the mixture was then s'rred at RT overnight. Water (10 ml) was slowly added to destroy the excess of BBr 3 and mixture was then extracted with dichloromethane (2X20 ml).

Combined organic phase was washed with brine (30 ml) and dried over Na 2 SO 4 .

Aker evapora'on of the solvent, the residue was purified by column chromatography (silica gel, DCM to 2-3% Et 2 O) and the frac'on containing terphenylthiazole 3 was evaporated under reduced pressure to give a greenish oil, which was taken up with MeOH (10 ml) and s'rred at RT to give the 'tle compound as light cream solid (206 mg, yield 70%).

Sec$on 2. Electrodes and SAMs fabrica$on.

General condi,ons of the process.

To prevent oxida/on of the cobalt substrates, all the prepara/on of samples (i.e.

from metal deposi/on to gra<ing of SAMs) was carried out in a nitrogen MBRAUN glovebox (H 2 O and O 2 levels below 5 ppm). The glassware was oven dried at 120°C overnight before inser/on inside the glovebox to remove residual adsorbed water. The solvents used for the prepara/on of SAMs (absolute ethanol, tetrahydrofuran) were all purchased anhydrous from Sigma Aldrich.

They were stored for 5 days over freshly ac/vated 4 Å molecular sieves (ac/va/on for 18h at 150°C under vacuum), then they were degassed with nitrogen for at least 15 min.

Bo4om metal electrode fabrica,on.

Ultraflat template-stripped gold surfaces ( TS Au), with rms roughness of ∼0.4 nm were prepared according to the method developed by the Whitesides group. 9,10 In brief, a 300-500 nm thick Au film was evaporated on a very flat silicon wafer covered by its na/ve SiO 2 (rms roughness of ~0.4 nm), which was previously carefully cleaned by piranha solu/on (30 min in 7:

3 H 2 SO 4 /H 2 O 2 (v/v); Cau,on:
Piranha solu/on is a strong oxidizer and reacts exothermically with organics), rinsed with deionized (DI) water, and dried under a stream of nitrogen. Clean 10x10 mm pieces of glass slide (ultrasonicated in acetone for 5 min, ultrasonicated in 2-propanol for 5 min, and UV irradiated in ozone for 10 min)

were glued on the evaporated Au film (UV-polymerizable glue, NOA61 from Epotecny), then mechanically peeled off providing the TS Au film agached on the glass side (Au film is cut with a razor blade around the glass piece).

Cobalt substrates were prepared by evapora/ng about 40 nm of cobalt on cleaved (12×10 mm) highly phosphorus-doped n-Si(100) substrates, resis/vity < 5.10 -3 Ω.cm (from Siltronix), covered by na/ve oxide, cleaned by 5 min sonica/on in acetone and isopropanol, then rinsed with isopropanol and dried under N 2 flow. The evapora/on of 99.99% purity cobalt pellets (Neyco) was realized by Joule effect in a vacuum evapora/on system (Edwards Auto306) placed inside the glovebox. The cobalt deposi/on was realized under a 10 -6 mbar vacuum and at a low rate deposi/on between 2 and 5 Å/s in order to minimize roughness.

Self-assembled monolayers of TPT.

SAMs of the open forms of TPT(A) and TPT(B) on gold and cobalt were prepared from the acetyl-protected thiols by spontaneous assembly at metal surfaces via Au-S or Co-S bonds (see XPS sec/on), without deprotec/on. Indeed thioacetates are known to undergo spontaneous deprotec/on at various metal surfaces like gold or silver. 11,12 The freshly peeled off TS Au samples were immediately immersed in millimolar solu/ons of TPT in anhydrous ethanol/THF (80:20 v/v) for 3 days in the dark. This solvent mixture was compa/ble with the TS Au glue. Then samples were rinsed with degassed anhydrous THF and dried under N 2 stream. In a glovebox, the freshly evaporated Co substrates were immediately immersed in millimolar solu/ons of TPT in anhydrous ethanol/THF (80:20 v/v) for 1 day in the dark. Then samples were rinsed with degassed anhydrous ethanol, dried under N 2 stream and stored in the glovebox.

Sec$on 3. UV-vis spectroscopy.

The reversible isomeriza/on "open to close" of TPT molecules was checked by UV-vis spectroscopy in solu/on (∼µM in CH 2 Cl 2 ). UV-Vis absorp/on spectra were recorded on a Lambda 800 Perkin-Elmer spectrometer. For the UV irradia/on of the solu/ons, we used a 365 nm chromatography lamp (Vilbert Lourmat, light intensity : 2 mW/cm 2 at 1 cm distance). For visible irradia/on we used a halogen lamp (LEICA model CLS 150X) centered at 600 nm (light intensity : 220 mW/cm 2 at 1 cm distance). This experiment performed on µM solu/ons of TPT(A) and TPT(B) in DCM shows (Fig. S1) that, as expected, irradia/on at 365 nm produces a strong absorp/on peak centered at 600-630nm corresponding to the forma/on of the closed form with the π-conjuga/on extended throughout the molecule.

The photosta/onary state is reached a<er ∼10 min of UV irradia/on. Then irradia/on at 650 nm causes disappearance of the 600-630 nm band and return to the open form. Return to the ini/al condi/ons is achieved by a short irradia/on in visible light (10-20s). The reversibility, tested for TPT(A), is par/cularly good a<er several irradia/on cycles (inset Fig. S1).

Figure S1. UV-vis absorbance spectra of TPT(A) (top) and TPT(B) (boOom) in DCM

aPer 4 successive irradia:on cycles (2 min for each irradia:on step in UV then 2 min in visible light). The pris:ne state is given at t0. Note that t2 curve is almost not visible here because superimposed on t0 and t4. In the insert at the top right is the absorbance of TPT(A) at 600 nm measured aPer several irradia:on cycles. Sec$on 4. Spectroscopic ellipsometry.

We recorded spectroscopic ellipsometry data (on ca. 1 cm 2 samples) in the visible range using a UVISEL (Horiba Jobin Yvon) spectroscopic ellipsometer equipped with DeltaPsi 2 data analysis soGware. The system acquired a spectrum ranging from 2 to 4.5 eV (corresponding to 300-750 nm) with intervals of 0.1 eV (or 15 nm). For the measurement in air (SAMs on Au), data were taken at an angle of incidence of 70°, and the compensator was set at 45°. We fit the data by a regression analysis to a film-on-substrate model as described by their thickness and their complex refracZve indexes. First, a background for the substrate before monolayer deposiZon was recorded. We acquired three reference spectra at three different places of the surface spaced of few mm.dSecondly, aGer the monolayer deposiZon, we acquired once again three spectra at three different places of the surface and we used a 2-layer model (substrate/SAM) to fit the measured data and to determine the SAM thickness. We employed the previously measured opZcal properZes of the substrate (background), and we fixed the refracZve index of the organic monolayer at 1.50. 13 We note that a change from 1.50 to 1.55 would result in less than a 1 Å error for a thickness less than 30 Å. The three spectra measured on the sample were fi^ed separately using each of the three reference spectra, giving nine values for the SAM thickness. We calculated the mean value from this nine thickness values and the thickness incerZtude corresponding to the standard deviaZon. Overall, we esZmated the accuracy of the SAM thickness measurements at ± 2 Å. 14 For SAM on Co using the cell filled with N 2 , data were taken at an angle of incidence of 60 ± 1° while the compensator was set at 45°. However, due to the rough Co surface and the use of the cell, the fits with a fixed angle of incidence at 60°C

systemaZcally give low values of thicknesses. The fits with this angle as an addiZonal fit parameter give higher values. Consequently, the thicknesses are given with a larger uncertainty (error bar) compared to SAM on Au.

Sec$on 5. XPS measurements.

High resoluZon XPS spectra were recorded with a monochromaZc Al Kα X-ray source (hυ = 1486.6 eV), a detecZon angle of 45° as referenced to the sample surface, an analyzer entrance slit width of 400 µm and with an analyzer pass energy of 12 eV. In these condiZons, the overall resoluZon as measured from the full-width half-maximum (FWHM) of the Ag 3d5/2 line is 0.55 eV. Background was subtracted by the Shirley method. 15 The peaks were decomposed using Voigt funcZons and a least squares minimizaZon procedure. Binding energies were referenced to the C 1s BE, set at 284.8 eV.

TPT(A) and TPT(B) SAMs on TS Au.

The C 1s peak at 284.8 eV (Fig. S3) corresponds to C-C, C-N and C-S bonds. The shoulder observed at 286.2 eV is assigned to the three C=N-S bonds. 16 The S 2p region shows two doublets (S 2p 1/2 and S 2p 3/2 ) associated to the S-C (S 2p 1/2 at 165.4 eV, S 2p 3/2 at 164.3 eV) and S-Au (S 2p 1/2 at 162.9 eV, S 2p 3/2 at 161.8eV) bonds (Fig. S3). These doublets are separated by 1.2 eV as expected with an amplitude raZo [S 2p 1/2 ]/[ S 2p 3/2 ] of 1/2. The amplitude raZos [S-Au]/[S-C] are 0.42 for TPT(A) and 0.5 for TPT(B), slightly higher than the 1/3 expected raZo. A small peak at higher energy (≈ 168 eV) is associated to oxidized sulfur (SO x ). For both molecules, the N 1s region (Fig. S5) shows two peaks corresponding to "pyridine-like" nitrogen (C=N) and "coordinated-like" nitrogen (C=N...Au) at 398.6

eV and 400 eV, respecZvely. 17 The piridinic and coordinated-like designaZons are oGen used in the literature to describe the components of N 1s signals in Ndoped carbons. 18 This N 1s peak spliqng is observed when the N atoms interact with a metal surface. 19 The raZo of the peak amplitudes [C=N...Au]/[N=C] is higher for TPT(B) (see Table S1) than for TPT(A) indicaZng that more N atoms are interacZng with the metal electrode for TPT(B) SAM than for the TPT(A) SAM.

TPT(A) and TPT(B) SAMs on Co.

The XPS spectra of TPT(A) and TPT(B) on Co show all the C, N and S elements. As for the molecules on TS Au, the major peak at 284.8 eV is composed of C-C, C-N and C-S components and a shoulder observed at 286.2 eV is assigned to the three S-C=N carbons (Fig. S4). In the S 2p region (Fig. S4 Sec$on 6. CAFM measurements.

CAFM in air.

Current-voltage characterisZcs were measured by conducZve atomic force microscopy (Icon, Bruker), using PtIr coated Zp (SCM-PIC from Bruker, 0.2 N/m spring constant). To form the molecular juncZon, the conducZve Zp was located at a staZonary contact point on the SAM surface at controlled loading force (∼ 15 nN). The voltage was applied on the substrate. The CAFM Zp is located at different places on the sample (typically on an array of staZonary contact points spaced of 50-100 nm), at a fixed loading force and the I-V characterisZcs were acquired directly by varying voltage for each contact point. The I-V characterisZcs were not averaged between successive measurements and typically between few hundreds and a thousand I-V measurements were acquired on each sample.

CAFM in UHV.

CAFM in UHV (10 -11 -10 -9 mbar) were carried out at room temperature with a VT-SPM microscope (Scienta Omicron) and using PtIr coated probes SCM-PIC-V2

(Bruker), Zp radius R = 25 nm, spring constant k = 0.1 N/m. In all our measurements, bias (V) was applied on the substrate and the current was recorded with an external DLPCA-200 amplifier (FEMTO). Hundreds to thousands IV traces were acquired using the same protocol as for CAFM measurements in air.

Loading force and CAFM =p contact area.

The load force was set at ∼ 15 nN for all the I-V measurements, a lower value leading to too many contact instabiliZes during the I-V measurements. Albeit = 204 GPa and ν Zp = 0.37 using a rule of mixture with the known material data. 28 These parameters for the DAE SAM are not known and, in general, they are not easily determined in such a monolayer material. Thus, we consider the value of an effecZve Young modulus of the SAM E* SAM = 38 GPa as determined for the "model system" alkylthiol SAMs from a combined mechanic and electron transport study. 22 With these parameters, we esZmate a = 2 -2.6 nm (contact area = 13.2 -21 nm 2 ) and δ = 0.16 -0.26 nm. With a molecular packing density between 1 to 2 nm 2 /molecule (as esZmated from the Zlt angle and theoreZcal

a 2 = 3RF 4E * ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 2/3 δ = 9 16R ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 1/3 F E * ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 2/3 E * = 1 E SAM * + 1 E tip * ⎛ ⎝ ⎜ ⎜ ⎞ ⎠ ⎟ ⎟ -1 = 1-ν SAM 2 E SAM + 1-ν tip 2 E tip ⎛ ⎝ ⎜ ⎜ ⎞ ⎠ ⎟ ⎟ -1
configuraZon opZmizaZon, see theory secZon), we infer that about 10 molecules are measured in the TPT/PtIr juncZon, thus we used N=10 in all the I-V fit using Eq. 1 (main text).

Data analysis.

Before to construct the current histograms and fit the I-V curves with the one energy-level model, the raw set of IV data is analyzed and some I-V curves were discarded from the analysis:

-At high current, the I-V traces that reached the saturaZng current during the voltage scan (the compliance level of the trans-impedance amplifier, typically 5x10 -9 A in Figs. S6 andS7, depending on the gain of the amplifier) and/or I-V traces displaying large and abrupt steps during the scan (contact instabiliZes).

-At low current, the I-V traces that reached the sensiZvity limit (almost flat I-V traces) and displayed random staircase behavior (due to the sensiZvity limit of both the trans-impedance amplifier and the resoluZon of the ADC (analog-digital converter), Fig. S7. A typical example of such treatment is shown in Fig. S6. The "measurement yield" for the four samples is summarized in Table S2. posiZon (with respect to the Fermi energy of electrodes) of the molecular orbital involved in the electron transport, Γ 1 and Γ 2 the coupling energy between the molecules and the two electrodes. The fits were done with the rouZne included in ORIGIN soGware, using the method of least squares and the Levenberg Marquardt iteraZon algorithm.

The SEL model is a low temperature approximaZon albeit it can be used at room temperature for voltages below the resonant transport condiZons 29,30 since the temperature broadening of the Fermi funcZon is not taken into account. Moreover, a possible voltage dependance of ε 0 is also neglected. 31 It is known that the value of ε 0 given by the fit of the SEL model depends on the voltage window used for the fit. [29][30][31] This feature is confirmed (Fig. S10) showing that unreliable values are obtained with a too low voltage range (i.e. the SEL model is not reliable in the linear regime of the I-V curves) and not applicable when the voltage is high enough to bring the electrode Fermi energy close to molecular orbital (near resonant transport), here for a voltage window -0.7/0.7 V where all the values of ε0 collapse. In the voltage windows -0.3/0.3 V to -0.6/0.6V we clearly observe a lowering of ε0 upon UV illuminaZon by around 0.1 eV for TPT(A) and 0.13 eV for TPT(B) -on average, a behavior also confirmed by the TVS (transient voltage spectroscopy) method (vide infra, Fig. S11). [32][33][34][35][36][37] For these reasons we limited the fits to a voltage window -0.5 V to 0.5 V to analyze the complete datasets shown in Figs. 34(main text). To construct the histograms of the values of ε 0 , Γ 1 and Γ 2 (Figs. 6 and7), we discarded the cases for which the fits were not converging of not accurate enough (i.e. R-squared < 0.95). Typical fits on the mean Ī-V curves are shown in Fig. S11 for the two samples on TS Au and the three condiZons (prisZne, aGer UV light, aGer white light). The same mean Ī-V curves are also analysed by TVS, ploqng V 2 /I (in absolute value) versus V (Fig. S12), 38 and determining the transiZon voltages (V T+ and V T-) for both voltage polariZes, i.e. the voltage at the maximum of V 2 /I. This threshold voltage indicates the transiZon between off-resonant (below V T ) and resonant (above V T ) transport regime in the molecular juncZons. The values of ε 0 are esZmated by: 36 (S4)

and they are marked in Fig. S12. They are in good agreement with the SEL fits (Fig. S11). Sec$on 7. Illumina$on setup.

We used a power LED (M365FP1 from Thorlabs) for UV light irradiaZon (CAFM in air). This LED has a wavelength centered at 365 nm (close to the absorbance

ε 0 = 2 e V T+ V T- V T+ 2 +10 V T+ V T- 3 +V T-
peak, see Fig. S1) and a bandwidth of 8 nm. An opZcal fiber was brought close (ca. 1 cm) to the sample in the CAFM setup (opZcal power density at the sample locaZon ca. 27 mW/cm 2 ). A chromatographic UV lamp (Vilbert-Lourmat, with a sharp peak at 365 nm and a background centered at 350 nm, BWHM: ∼330-370 nm) was used for the measurements with the UHV CAFM and the irradiaZon of the sample was performed in the entry lock (P = 10 -6 mbar N 2 ) of the instrument (opZcal power density at the sample locaZon, ca. 10 cm is ca. 0.65 mW/cm 2 ). For the visible light irradiaZon, we used a white light halogen lamp (Leica CLS150X) with a bandwidth centered at 600 nm (BWHM: ∼500-700 nm), matching the absorbance peak of the closed form of TPT (Fig. S1) (opZcal power density at the sample locaZon: ca. 220 mW/cm 2 in air at ca. 1 cm and ca. 13 mW/cm 2 at 10 cm for the experiments in UHV). Under these condiZons, the samples were exposed to light for 1-3 h in air and 10-15 h in UHV, corresponding to almost the same photon density received by the sample, typically ∼ 10 20 photons/cm 2 . These condiZons correspond to photostaZonnary states and we did not observe significant CAFM current variaZons with longer duraZon of light exposure.

Sec$on 8. Theore$cal methods and addi$onal calcula$ons.

Simulated I-V curves.

The I-V characteris'cs have been calculated on the basis of the Landauer-Bütker formalism, which links the transmission spectrum to the current in a coherent transport regime. 39 When a bias is applied, the current is calculated via the integra'on of the transmission spectrum within a bias window defined by a Fermi-Dirac sta's'cs in the lek and right electrodes:

where T(E) is the transmission spectrum, E the incident electron energy, f the Fermi func'on, µ R/L the chemical poten'al of the right/lek electrode, T R/L the (S5)

I(V ) = 2e h ∫ T (E ) [ f ( E -μ R k B T R ) -f ( E -μ L k B T L ) ] d E
temperature of the right/lek electrode set here to 300K, k B the Boltzmann constant, e the elementary charge, h the Planck constant and V the applied bias.

It is important to note that for an accurate es'ma'on of the current, the transmission spectrum T(E) should be calculated in a self-consistent way for each bias. Thus, the current-voltage proper'es and the R c/o of the Au-TPT/Au junc'ons were predicted by using the transmission calculated at each bias, which is not too probihi've at the computa'onal level. However, it is possible to obtain a reasonable approxima'on for the current at low bias by using the transmission spectrum at zero bias. This approxima'on is required for Co-TPT/Au junc'ons with a large unit cell and a spin-polarized electrode because the self-consistent calcula'ons become very 'me consuming. Accordingly, the current-voltage proper'es of Co-PTP/Au and the corresponding R c/o were predicted by using the transmission calculated at zero bias.

Lorentzian fi:ng: Γ broadening of Au-TPT(A)/Au juncGon transmission peaks.

Charge transfer at the interface.

The charge rearrangement upon bond forma'on between the metal surface and the molecule 40 is defined as the difference between the plane averaged charge density of the full metal-SAM system, ρ sys and the sum of the density of the isolated subsystems, the free metal surface ρ slab and the free-standing molecules ρ SAM :

For a deeper understanding of the implica'ons of the charge rearrangements at the metal-SAM interface, we calculate the net charge transfer at the interface (ΔQ) by integra'ng the charge density redistribu'on (Δρ) along the z normal axis.

(S6)

--

∆ ρ(z) = ρ sys ρ slab ρ SAM (S7) ∆ Q(z) = ∫ z 0 ∆ ρ(z)d z
This gives the total amount of charge transferred from the lek to the right of a plane lying at the posi'on z. Here, the electronic density of the free metal surface (the isolated molecule) is calculated by removing the molecule (metal surface) from the func'onalized system while keeping the same geometry as in the full system. Note that we describe here the chemisorp'on process in a radical scenario depic'ng the forma'on of a covalent bond between the molecule in its radical form and the metal surface. [40][41][42]

Zero-bias vs. finite bias voltage transmission spectra.

We have calculated the closed/open ra'o for Au-TPT/Au systems on the basis of the zero transmission spectra (see Table S3 below).

Table S3. Closed/open ra$os (R c/o ) for the Au-TPT(A)/Au and Au-TPT(B)/Au junc$ons calculated using voltage-dependent transmission spectra (finite-bias) versus the zero-bias transmission spectra.

By using the zero transmission spectrum, we obtain the same trend as with the finite-bias calcula'ons: the Au-TPT(B) exhibits higher closed/open ra'o compared to Au-TPT(A). However, the discrepancy associated t the use of the zero transmission spectra for es'ma'ng the closed/open ra'o magnitude is sensi've to the voltage and the studied system (TPT(A) or TPT(B)), with a reasonable agreement found at 0.25V and 0.5V between the two op'ons. We could then conclude it is reasonable to use the zero-bias transmission to compare with experimental results measured at 0.5V. However, we consider these results obtained for a gold substrate are not directly transferrable to cobalt substrates. In fact, the TPT molecules exhibit a stronger coupling to cobalt that could result in a very different voltage drop. In other words, the magnitude of the discrepancy between the zero and the nonequilibrium transmissions highly depends on the inves'gated junc'on.

[

  C=N...Co] one but the ra'o of the amplitudes is different for the TPT(B), [C=N...Co]/[N=C]=1.24, and TPT(A) molecules, [C=N...Co]/[N=C]=0.39. As for the SAMs on Au, this is most likely aaributed due to the interac'on of N atoms with the surface resul'ng from the large molecule 'lt. Both on Au and Co, these ra'os thus point out to a higher concentra'on of N atoms interac'ng with the surface for TPT(B) than TPT(A), highligh'ng a difference in the interac'on of the two isomers with the substrates. Finally, the O 1s region reveals (Fig. S6 in the Suppor'ng Informa'on) a residual oxidized Co 31 as in our previous work on azobenzene deriva'ves on Co (Fig. S3 in Ref. 10), albeit the protocol and precau'ons used during the grazing and measurements.

Figure 1

 1 Figure 1 shows the dataset of measured current-voltage (I-V) curves of the SAMs of TPT(A) on Co, measured by CAFM in UHV for (a) the pris'ne SAM (as fabricated with open form), (b) azer UV light illumina'on and (c) azer white light

Figure 1 .

 1 Figure 1. 2D histograms of the current-voltage (I-V) curves: (a) pris;ne SAM of TPT(A) on Co, (b) aTer UV irradia;on, (c) aTer visible light irradia;on. The

Figure 2 .

 2 Figure 2. 2D histograms of the current-voltage (I-V) curves: (a) pris;ne SAM of TPT(B) on Co, (b) aTer UV irradia;on, (c) aTer visible light irradia;on. The

Figure 3 .

 3 Figure 3. 2D histograms of the current-voltage (I-V) curves: (a) pris;ne SAM of TPT(A) on TS Au, (b) aTer UV irradia;on, (c) aTer visible light irradia;on. The

Figure 4 .

 4 Figure 4. 2D histograms of the current-voltage (I-V) curves: (a) pris;ne SAM of TPT(B) on TS Au, (b) aTer UV irradia;on, (c) aTer visible light irradia;on. The

Figure 5 .

 5 Figure 5. Evolu;on of the mean current Ī (deduced from the log-normal fits of the current distribu;ons in Figs. 1-4) at 0.5 V and -0.5 V for the four molecular junc;ons (see inset) and under the three condi;ons: pris;ne, aTer UV and visible light illumina;on.

  gap between the resonant and the Fermi levels is lowered upon switching from the open to the closed form of the molecules: from 0.49 eV to 0.4 eV for TPT(A)-o and TPT(A)-c and from 0.52 eV for TPT(B)-o to 0.34 eV for TPT(B)-c. The energy level is lowered by 0.10-0.18 eV with a more important effect for TPT(B) molecules. The increase of the current for the closed form is also due to a significant increase of the molecule-electrode coupling by a factor ≈3.5; the average coupling energies, Γ1 and Γ2, increase from 0.11-0.20 meV (open form), to 0.46-0.59 meV (closed form) with a larger distribu'on in this laaer case (Figs. 6df and Figs. 7d-f) -(the data are summarized in Table2). Albeit the fact that the electrode-molecule interfaces are different chemically and physically (chemical grazing on flat and large area Au surface on one side, nanoscale mechanical contact with PtIr 'p on the other side), the I-Vs are quite symmetrical (and thus the SEL model gives almost the same values of Γ1 and Γ 2 ). However, it was shown that asymmetrical molecule-electrode couplings do not systema'cally result in asymmetrical I-Vs.39, 40

Figure 6 .

 6 Figure 6. Histograms of the fibed energy ε 0 , Γ 1 and Γ 2 for the TPT(A) molecules on TS Au : (a,d) pris;ne sample, (b,e) aTer UV light illumina;on and (c,f) aTer white light illumina;on.

Figure 7 .

 7 Figure 7. Histograms of the fibed energy ε 0 , Γ 1 and Γ 2 for the TPT(B) molecules on TS Au : (a,d) pris;ne sample, (b,e) aTer UV light illumina;on and (c,f) aTer white light illumina;on.

  are then 'lted to fit the measured SAM thickness when chemisorbed on the Au(111) and Co(111) cobalt surfaces through the sulfur anchoring atom. The unit cell of the Au (Co) surface is modeled by a slab of five layers with 4 × 5 gold (5 × 6 cobalt) atoms in each layer and laoce parameters: a= 11.53 Å (12.56 Å), b= 14.42 Å (15.08 Å) and α= 120°. With one molecule per unit cell, this corresponds to a theore'cal area per molecule of 144.04 Å 2 (164.10 Å 2 ). A vacuum region of 30 Åis introduced above the surface and 10 Å below it. The geometry of the interface was then op'mized by relaxing the molecules forming the SAMs and the top two metal layers un'l forces are below 0.025 eV/Å. The convergence criterion associated with the Self-Consistent Field (SCF) loop is that the energy difference must be smaller than 2x10-5 Ha. For this relaxa'on, we use the Perdew-Burke-Ernzerhof (PBE) func'onal within the generalized gradient approxima'on (GGA)

Figure 8 .

 8 Figure 8. Op;mized Au-TPT/Au junc;ons. The calculated junc;on thickness is also marked. The ghost atoms have been removed for beber visibility.

Figure 9 .

 9 Figure 9. Log scale plot of the transmission spectra at zero bias for (a) Au-TPT(A)/ Au and (b) Au-TPT(B)/Au junc;ons in their closed and open forms. The calculated values of R c/o are 26.5 and 69 for TPT(A) and TPT(B), respec;vely.

  both Au-TPT(A)/Au and Au-TPT(B)/Au junc'ons, the closed isomers exhibit higher current values compared to those of the open isomers. The theore'cal R c/o ra'o here described as I(closed)/I(open), with I(closed) and I(open) the current through the closed and open from, was also calculated (Fig. 10b and

  magnitudes of the individual R c/o also show the same trends as the experimental values (around 20 and 50 theore'cally versus ≈7 and ≈15 experimentally for TPT(A) and TPT(B), respec'vely). Noteworthy, the higher slope that appears beyond 0.5V in Fig. 10b is explained by the incorpora'on of the LUMO transmission peak of the closed forms in the transmission window; this cannot occur with the LUMO transmission peak associated with the open form that has higher energy. This feature significantly increases the current value for closed forms and accordingly R c/o . This result is consistent with the experimental R c/o (V) values (Fig. S10 especially for the TPT(B)-Au junc'ons, Suppor'ng Informa'on). It validates the choice to restrict the fits of the SEL model in the voltage window -0.5 to 0.5V to avoid the contribu'on of a second energy level not included in this model (see sec'on 6, Suppor'ng Informa'on).

Figure 10 .

 10 Figure 10. (a) Current-voltage curves for Au-TPT(A)/Au (green) and Au-TPT(B)/Au (orange) junc;ons in the open (dashed lines) and closed (solid lines) forms. (b)Corresponding closed/open ra;os calculated as a func;on of the bias.

  offset of the HOMO level tends to increase with the bias and that the open forms exhibit a deeper HOMO level compared to the closed counterparts by an average value of 0.16 eV and 0.22 eV for Au-TPT(A)/Au and Au-TPT(B)/Au junc'ons, respec'vely. This agrees well with the fiong done using the SEL, showing a similar voltage-dependent evolu'on and a higher energy gap between the HOMO resonance and the Fermi level for the open forms compared to the closed ones by 0.10-0.18 eV (see Fig.S11in the Suppor'ng Informa'on).

Figure 11 .

 11 Figure 11. Op;mized Co-DAE/Au junc;ons. The calculated junc;on thickness is also marked. The ghost atoms have been removed for beber visibility.

  use of the zero transmission spectra for es'ma'ng the closed/open ra'o magnitude can be sensi've to the bias and the inves'gated junc'ons, see sec'on 8 in the suppor'ng informa'on. The trends obtained for Co-TPT/Au junc'ons at equilibrium might thus evolve with bias, however, these trends, i.e. a higher closed/open ra'o for the Co-TPT(B)/Au junc'on than for the Co-TPT(A)/Au one, are similar, see sec'on 8 in the suppor'ng informa'on. The Co-TPT(B)/Au junc'on exhibits a higher R c/o than Co-TPT(A)/Au by a factor of 3.6 at 0.5 V (Fig.

Figure 12 .

 12 Figure 12. Log scale plot of the transmission spectra (spin up + spin down) at zero bias for (a) Co-TPT(A)/Au and (b) Co-TPT(B)/Au junc;ons in their closed and open forms. The calculated values of R c/o are 37 and 288 for TPT(A) and TPT(B), respec;vely.

Figure 13 .

 13 Figure 13. (a) Current-voltage curves for the Co-TPT(A)/Au (violet) and Co-TPT(B)/ Au (brown) junc;ons in the open (dashed lines) and closed (solid lines) forms. (b) Corresponding closed/open ra;os (R c/o ) calculated as a func;on of the voltage. The I-V curves and R c/o of the Co-TPT/Au junc;ons are calculated in first approxima;on by integra;ng the transmission at zero bias in different voltage ranges (see Suppor;ng Informa;on).

  inves'ga'ng other Co-molecule systems.To further shed light on the conductance of the actual Co-TPT/Au junc'ons, we have also simulated the transmission spectra in the non 'lted configura'on (see Fig.S22in the Suppor'ng Informa'on). The results confirm the previous findings: the Co-TPT(B)/Au junc'on exhibits R c/o twice as large compared to the Co-TPT(A)/Au junc'on and the R c/o of TPT is higher on the Co electrode compared to the same molecule on the Au electrode. However, the calculated R c/o (15.7 for Co-TPT(A)/Au and 33.5 for Co-TPT(B)/Au) are not as high as the R c/o values obtained from experiments and the simulated transmission spectra of the lying-down configura'ons. Moreover, for both Co-TPT(A)/Au and Co-TPT(B)/Au junc'ons, the simulated transmission spectra of the non 'lted configura'ons (Fig. S23 in the Suppor'ng Informa'on) show a weak energy shiz of the HOMO transmission peak upon isomeriza'on (0.20 eV) accompanied by a smaller broadening as a result of the weaker coupling with the Co electrode.Thus this "non 'lted" configura'on can be discarded to explain the main experimental results. However, this "non 'lted" situa'on has been encountered in another batch of TPT(B) on Co for which the XPS data showed a very weak "coordinated-like" N 1s peak (Fig.S5, batch#2), i.e. weak molecule/electrode coupling, and the CAFM measurements (Fig.S24) yielded a weak value of R c/o of about 15-25. Thus, this "counter experiment" comforts the conclusion that the high values of the R c/o ra'os are related to the strong 'lt of the molecules allowing the N atoms to interact with the electrode, and that the TPT(B) molecule favors this interac'on with the anchoring group (thiol) lying the same side as two N atoms of the thiazole units (instead of only one N atom for the TPT(A) molecule).

  junc'ons of two slightly different terphenylthiazoles on Co electrodes showed high photo-switching conduc'on ra'os between the closed and open forms (150 to 380), about 20 'mes larger than for the same molecular junc'ons on Au. The highest ra'os are obtained when the thiol group is on the same side as the 2 N atoms of the thiazole units, a situa'on which favors the coupling of these N atoms with the metal electrode. The experimental results are consolidated and ra'onalized by first principle calcula'ons. These high ra'os are due to a transi'on from a HOMO mediated off-resonance electron transport (open form) to a LUMO mediated (quasi-) resonant electron transport for the closed form. This behavior (not observed on Au electrodes) is related to the strong coupling and a favorable level alignment for the closed form of the molecules on the Co electrode, highligh'ng both the role of the chemical nature of the electrode and the effect of interfacial geometry on tuning the transport behavior in molecular junc'ons.

  photochromic terphenylthiazoles A and B were prepared according to the synthe'c routes shown in Scheme 1.

Thiazole 4

 4 was prepared by Suzuki cross-coupling between thiazole 2 and 2phenyl-4-(4,4,5,5-tetramethyl[1,3,2]dioxaborolan-2-yl)-thiazole7 (2-Ph-4-Bpinthiazole). Thiazole 2 (512 mg, 1.5 mmol), 2-Ph-4-Bpin-thiazole (525 mg, 1.83 mmol), Pd(PPh 3 ) 4 (72 mg, 0.062 mmol) and CsF (570 mg, 3.75 mmol) were purged before anhydrous dioxane (30 ml) was introduced under argon. The mixture was heated and refluxed under Argon for ca 6 hours and cooled to RT.

  ), we observe the contribuZon of S-C and S-Co bonds (S 2p 3/2 at 164.3 eV, S 2p 1/2 at 165.4 eV for S-C and S 2p 1/2 at 163.7 eV, S 2p 3/2 at 162.6 eV for S-Co). As for the SAMs on Au, the amplitude raZos [S-Co]/[S-C] ∼ 0.5-0.6 are higher than the expected 1/3 raZo. Albeit the protocol and precauZons used during the graGing and measurements, the O 1s region reveals a residual oxidized Co 20 as in our previous work on azobenzene derivaZves on Co (Fig. S3 in Ref. 21). The N 1s region (Fig. S5) shows the two peaks of the C=N bonds (398.6 eV) and the C=N...Co one (400 eV) 17 with raZos of amplitude [C=N...Co]/[N=C] larger for the TPT(B) than for TPT(B) molecules (TableS1). As for the SAMs on Au, this may be due to interacZon of N with the surface (large molecule Zlt). However, we have also observed (in another batch #2) a case with a low [C=N...Co]/[N=C] raZo which was inferred to a "non Zlted" molecule configuraZon (see discussion secZon in the main text) for which the N atoms are away from the surface and consequently, only the pyridinic form N=C is detected by XPS.

Figure S2 .

 S2 Figure S2. XPS survey spectra of the TPT SAMs on Au and Co.

Figure S3 .

 S3 Figure S3. XPS spectra of the TPT(A)-Au and TPT(B)-Au samples: C 1s and S 2pregions.

Figure S4 .

 S4 Figure S4. XPS spectra of the TPT(A)-Co and TPT(B)-Co samples: C 1s and S 2pregions.

Figure S5 .

 S5 Figure S5. XPS spectra of the TPT(A) and TPT(B) SAMs on Au and Co sample: N 1sregions.

Figure S6 .

 S6 Figure S6. XPS spectra of theTPT(B) SAMs on Co sample: O 1s regions. The two peaks are mainly assigned to oxidized Co.20

  larger than the usual load force (2-5 nN) used for CAFM on SAMs, this value is below the limit of about 60-70 nN at which the SAMs start to suffer from severe degradaZons. For example, a detailed study (Ref.22) showed a limited straininduced deformaZon of the monolayer (≲ 0.3 nm) at this used load force. The same conclusion was confirmed by our own study comparing mechanical and electrical properZes of alkylthiol SAMs on flat Au surfaces and Zny Au nanodots.23 Considering: (i) the area per molecule on the surface (as esZmated for the thickness measurement and calculated geometry opZmizaZon -see theory secZon), and (ii) the esZmated CAFM Zp contact surface (see below), we esZmate N as follows. As usually reported in literature22,[24][25][26] the contact radius, a, between the CAFM Zp and the SAM surface, and the SAM elasZc deformaZon, δ, are esZmated from a Hertzian model: 27(S1) (S2) with F the Zp load force (15 nN), R the Zp radius (25 nm) and E* the reduced effecZve Young modulus defined as: (S3) In this equaZon, E SAM/Zp and ν SAM/Zp are the Young modulus and the Poisson raZo of the SAM and C-AFM Zp, respecZvely. For the Pt/Ir (90%/10%) Zp, we have E Zp

Figure S7 .

 S7 Figure S7. Comparison of the complete set of I-V traces (400 IVs) measured on the TPT(A)-Au pris:ne sample. The light red areas show the IVs traces discarded (see text) from the analysis, leading to 329 useful IVs.

Figure S8 .

 S8 Figure S8. Typical examples of I-V curves discarded from the data analysis.

Figure S9 .

 S9 Figure S9. Datasets of the I-V measurements (semi-log scale) for the Au-TPT(A) and TPT(B) SAMs (pris:ne, aPer UV light illumina:on and visible light illumina:on). The red lines are the mean Ī-V curves.

Figure S11 .

 S11 Figure S11. Values of ε 0 obtained with SEL model fiOed on the mean Ī-V curves for the two molecules on TS Au (pris:ne and aPer UV illumina:on) with increasing voltage windows (-0.1/0.1 V to -0.7/0.7 V) for the fits.

Figure S12 .

 S12 Figure S12. One energy level model fits on the mean current-voltage curves.

Figure S13 .

 S13 Figure S13. Typical TVS plots (|V 2 /I|) vs. V. (a) TPT(A)-Au (blue) and TPT(B)-Au (red) in the pris:ne sate (open), (b) same samples aPer UV illumina:on (closed state). The thresholds V T+ and V T-are indicated by the cross (with value) as well as the es:mated values of ε 0 using Eq. (S4).

Figure S14 .

 S14 Figure S14. Lorentzian fiGng of the transmission peak of Au-TPT(A)/Au juncKon in both closed and open forms. The fiMed Γ marked by an arrow indicates that the closed form exhibits larger broadening (100 meV) compared to open form (45 meV).

Figure S15 .

 S15 Figure S15. Op$mized Au-TPT/Au junc$ons in a non $lted configura$on. The calculated junc$on thickness is also marked. The small brown atoms refer to the gold ghost atoms.

Figure S16 .

 S16 Figure S16. Log scale plot of the transmission spectra at zero bias for non $lted (a) Au-TPT(A)/Au and (b) Au-TPT(B)/Au junc$ons in their closed and open forms. The calculated R c/o are 8.1 and 16.1, respec$vely.

Figure S18 .

 S18 Figure S18. Plane averaged charge density (top) and cumula$ve charge transfer (boOom) along the normal axis to the metal surface for Au-TPT (leQ) and Co-TPT(right). The dashed straight ver$cal lines represent the posi$on of the first Au (Co) layer and S anchoring atom.

Figure S19 .

 S19 Figure S19. Cumula$ve charge transfer along the normal axis to the metal surface for Au-TPT versus Co-TPT SAMs. The net charge transfer between the metal surface and TPT molecules is significantly larger for Co-TPT SAMs compared to Au-TPT SAMs.

Figure S20 .

 S20 Figure S20. Log scale plot of the spin up (solid line) and spin down (dashed line) transmission spectra at zero bias for (a) Co-TPT(A)/Au and (b) Co-TPT(B)/Au junc$ons in their closed and open forms.

Figure S21 .

 S21 Figure S21. Closer view of Co-TPT interfaces: (a) and (b) TPT(A) molecule with only one N atom of the thiazole interac$on with the Co surface, (c) and (d) TPT(B)molecule with 2 N atoms of the thiazole units interac$ng with the Co surface.

Figure S22 .

 S22 Figure S22. Op$mized non $lted Co-TPT/Au junc$ons. The calculated junc$on thickness is also marked. The small brown (green) atoms refer to gold (pla$num) ghost atoms.

Figure S23 .

 S23 Figure S23. Log scale plot of the transmission spectra at zero bias for non $lted (a) Co-TPT(A)/Au and (b) Co-TPT(B)/Au junc$ons in their closed and open forms. The calculated R c/o are 15.7 and 33.5, respec$vely.

Table 1 . Parameter values of the log-normal distribu;ons fibed on the current

 1

	histograms taken at 0.5 V and -0.5 V : log-mean current (log-Ī), the log-standard
	devia;on (log-σ), mean current Ī and corresponding closed/open current ra;os
	(R c/o ) calculated as the ra;os of the current aTer UV light irradia;on (HC peak in
	the case of TPT(B)-Co sample) over those for the pris;ne (open form) samples.
	We analyzed the I-V curves by a simple analy'cal model: the single energy
	level (SEL) model, which assumes that the electron transport through the
	molecular junc'on is mediated by only one molecular orbital (sec'on 6 in the

TPT(A)-Co pris9ne UV vis TPT(B)-Co pris9ne UV vis log-Ī ± log-σ at 0.5V at -0.5V

						HC peak
		-10.64 ± 0.72	-8.45 ± 0.78	-9.85 ± 0.61	-9.55 ±1.35	-7.05 ± 0.24	-9.39 ± 0.88
		-10.86 ± 0.74	-8.60 ± 0.86	-10.01 ± 0.75	-9.34 ± 1.18	-6.95 ± 0.31	-9.41 ± 0.88
						LC peak
						-8.98 ±1.20
						-8.72 ± 1.27
	Ī(A)					HC peak
	at 0.5V	2.3x10 -11	3.6x10 -9	1.4x10 -10	2.8x10 -10	8.9x10 -8	4.0x10 -10
	at -0.5V	1.4x10 -11	2.5x10 -9	9.8x10 -11	4.6x10 -10	1.1x10 -7	3.9x10 -10
						LC peak
						1.1x10 -9
						1.9x10 -9
	Rc/o
	at 0.5V		155			318
	at -0.5V		182			245

Table 2 .

 2 Values

(and their standard varia;ons) for the Gaussian fits to determine the energy posi;on ε 0 (with respect to the Fermi energy of electrodes) of the molecular orbital involved in the electron transport, Γ 1 and Γ 2 the coupling energy between the molecules and the two electrodes.

TPT(A)

-Au pris9ne UV vis TPT(B)-Au pris9ne UV vis ε0 (eV)

		0.49 ± 0.09	0.40 ± 0.07	0.49 ± 0.09	0.52 ± 0.07	0.34 ± 0.07	0.51 ± 0.09
	Γ1 (meV)	0.14 ± 0.24	0.50 ± 0.43	0.11 ± 0.23	0.16 ± 0.08	0.46 ± 0.41	0.10 ± 0.18
	Γ2 (meV)	0.16 ± 0.24	0.49 ±0.40	0.17 ± 0.17	0.20 ± 0.11	0.59 ± 0.43	0.18 ± 0.18

Table 3

 3

). As predicted from the transmission at zero bias, the Au-TPT(B)/Au junc'on exhibits higher R c/o compared to Au-TPT(A)/Au by a factor of 2.6 at 0.5 V, in excellent agreement with experiments (i.e. ≈2.3 at 0.5V, Figs

6,7

and Table

1

). The

Table 3 .

 3 Closed/open ra;os (R c/o ) for both Au-TPT/Au and Co-TPT/Au junc;ons

calculated at the Fermi level (0 V) and at several voltages.

Table S1 .

 S1 Area of the two N 1s peaks, ra:o of the peak amplitude and binding energy of the two peaks (M = Au or Co).

		Pyridinic-like Area	Coordinated-like Area	[C=N...M]/[N=C]	BE (eV)
	TPT(A)-Au	1647	555	0.34	398.6, 400.7
	TPT(B)-Au	1085	807	0.74	398.6, 400.6
	TPT(A)-Co	719	283	0.39	398.6, 400.3
	TPT(B)-Co #1	609	757	1.24	398.6, 400.0
	TPT(B)-Co #2	1939	111	0.06	398.6, 400.0

Table S2 .

 S2 Measurement yield.

Voltage dependent R c/o .

Figure S10. Closed/open current ra:o versus voltage R c/o (V)=Ī UV (V)/ Ī pris:ne (V) for

the four samples.

Fit of the energy level model.

		Complete set	Analyzed set
	Au-TPT(A) pris9ne/UV/vis	400/400/400	329/170/66
	Au-TPT(B) pris9ne/UV/vis	400/400/400	266/291/96
	Co-TPT(A) pris9ne/UV/vis	400/400/400	141/364/185
	Co-TPT(B) pris9ne/UV/vis	625/1250/625	225/514/107
	All the I-V traces in Figs. 3-4 (main text) were fi^ed individually with the single
	energy-level (SEL) model (Eq. 1, main text) with 3 fit parameters: ε 0 the energy

HNMR (CDCl 3 ): 8.11 (s, 1H), 8.02-8.05 (m,

2H), 7.99 (d, J = 8.6 Hz, 2H), 7.63 (d, J =

Acknowledgements.

This work has been financially supported by the French Na'onal Research Agency (ANR), project SPINFUN ANR-17-CE24-0004. We acknowledge D. Deresmes for his valuable help with the UHV CAFM instrument, Xavier Wallart for the XPS measurements, Y. Deblock for ellipsometry. The IEMN clean-room fabrica'on and SPM characteriza'on facili'es are partly supported by renatech. The work of I.A. is supported by the Belgian Na'onal Fund for Scien'fic Research (F.R.S.-FNRS) thanks to the project SPINFUN (Conven'on T.0054.20). We also acknowledge the Consor'um des Équipements de Calcul Intensif (CÉCI) funded by the Belgian Na'onal Fund for Scien'fic Research (F.R.S.-FNRS) for providing the computa'onal resources. J.C. is an FNRS research director.

Suppor'ng Informa'on (sec'on 1). These air-sensi've syntheses were performed under argon using standard Schlenk techniques.

Bobom metal electrode fabrica;on. Template stripped gold ( TS Au) substrates were prepared according to the method reported by the Whiteside group. 60,61 In brief, a 300-500 nm thick Au film is evaporated on a very flat silicon wafer covered by its na've SiO 2 and then transferred to a glued clean glass piece which is mechanically stripped with the Au film aaached on the glass piece, leong exposed a very flat (RMS roughness of 0.4 nm, the same as the star'ng SiO 2 surface used as the template). We prepared cobalt substrates by evapora'ng about 40 nm of cobalt on highly-doped n-Si(100) substrates with a vacuum evapora'on system installed inside the glovebox. See more details sec'on 2 in the Suppor'ng Informa'on.

Self-assembled monolayers. The SAMs on TS Au and Co were fabricated by dipping the freshly prepared metal substrate in a solu'on of TPT molecules in anhydrous EtOH/THF (80/20) at 0.2mM for 1 day in the dark (sec'on 2 in the Suppor'ng Informa'on).

Transfer under controlled atmosphere (SAMs on Co only).

The transfer of the samples from the glovebox to the CAFM and the X-ray Photoelectron Spectroscopy (XPS) instrument under UHV was carried out in a homemade herme'c transport container under overpressure of N 2 .

Spectroscopic ellipsometry.

The thickness of the SAMs was measured by spectroscopic ellipsometry (UVISEL ellipsometer (HORIBA), sec'on 4 in the Suppor'ng Informa'on). To avoid the oxida'on of the cobalt, the samples were placed in a sealed cell (HORIBA) filled with the N 2 atmosphere of the glovebox. TPT SAMs on TS Au were measured in ambient condi'ons.

XPS measurements.

XPS experiments were performed to analyze the chemical composi'on of the SAMs and to check the residual oxida'on state of the cobalt surface. We used a Author Contribu?ons V.P. and D.G. fabricated the SAMs, performed and analyzed the physico-chemical characteriza'ons. V.P. performed all the CAFM measurements (in air and UHV).

Note

The authors declare no compe'ng financial interest.

SUPPORTING INFORMATION

Sec$on 1. Synthesis and NMR characteriza$on.

Air-sensi've syntheses were performed under argon using standard Schlenk techniques. Chemicals and solvents were used as received unless otherwise stated. Anhydrous solvents, when necessary, were dried using standard methods.

Thin layer chromatography (TLC) was performed on silica gel 60 F 254 while column chromatography was carried out on silica gel (0.063-0.2 mm). The two new


Maxime Gautier
email: maxime.gautier@irccyn.ec-nantes.fr

Minh Tu Pham

Wisama Khalil

Philippe Lemoine

Philippe Poignet

SICOMAT : a system for SImulation and COntrol analysis of MAchine Tools

Keywords: Modeling, Model reduction, Control, Simulation, Mechatronics, Machine tool

Introduction

The need for the manufacturer to reduce the cost for designing and evaluating a prototype goes through the definition of a good simulation tool. Therefore we develop a simulation environment able to guide the designer in the choice of the components interfering in the complete mechatronic system i.e. flexible mechanical structures, actuators, sensors and controllers.

The ever increasing joint speed and acceleration of machine tools leads to develop accurate models taking into account elasticity of structure and joints. A good compromise between the complexity of a distributed elasticity approach as finite element model and the simplicity of neglecting the elasticity with a rigid body model is to consider a multi-body model with lumped elasticities and rigid bodies based on a technology analysis of the system's components [BAR 95]. A block diagram and a linear state space description of one axis or several decoupled axes are implemented. A description of multi-body systems based on the robotic formalism is also implemented [KHA 00]. The originality of this approach is to provide a systematic method to automatically calculate the geometric, kinematic and dynamic models of coupled or decoupled multi-axes machine tools, whatever the number of rigid and elastic degrees of freedom (dof) of the system.

Moreover the software contains several tools to completely study a given structure from the modeling (modal analysis toolbox and model reduction toolbox) to the control simulation. An other significant point of this package is the possibility to tune the controller gains considering the computer numerical controller (CNC) components (PID with feedforward controller structure, delays, quantization), the mechanical structure and the drive chain components included in the simulator. Two methods are available in SICOMAT. The first one is a time approach based on interactively calibrating step responses. The second one is based on a frequency automatic approach, which guarantees stability margins for a given closed loop bandwidth using optimization techniques. [POI 99], [PHA 00].

The paper is organized as follows: section 2 describes the global environment of the simulator and the structure modeling, section 3 presents the different toolboxes available in the simulator: model reduction, modal analysis, control design techniques (time and frequency approaches). Finally, section 4 gives an example of a high-speed machine with a linear direct drive axis.

Description of SICOMAT

Main menu of the simulator

SICOMAT is designed to easily set up the simulation environment (mechanical model, CNC, actuators and sensors model) as well as the parameter values, such as the number of masses and springs for the mechanics, the geometrical and inertial parameters, the representation of the mechanical structure with linear state-space model or with simulink blocks or with robotics formalism [KHA 00]. The user may select the desired components in a data base that contains commonly used motors, gearboxes, transmissions and so on, or define his own components. The electric actuators dynamics and saturations, the effect of delays and quantization due to CNC are also considered [POI 99].

The software is entirely boxes-driven and enables the user to design and modify a virtual prototype and to easily check its performances in a CAD approach without the need of the real prototype. The main window of the simulator is shown on figure 1. Clicking on the 'OK' button runs the automatic calculation of the Simulink blocks which are linked together and associated with Matlab routines to simulate the system while tracking different trajectories (straight line, circular interpolation, …), to perform frequency and time analysis and to display results. An example of a single axis is represented on figure 2.

Trajectory generator

Th

erivatives according to the kinematic constraints on jer profile which ensures the continuity of the joint position, velocity and acceleration.

The simulation of tracking a Cartesian trajectory is started using the Simulink commands. A trajectory generator computes the position, velocity, acceleration and jerk on each axis according to a desired time law. The user may select between a straight line trajectory, a circular trajectory, an angle crossing with a circular or B-Spline connection. e trajectory generator plans the time depending curvilinear abscissa trajectory s(t) and its d k, acceleration and velocity. Two laws are implemented in SICOMAT. The first one is a modified bang-bang acceleration profile which gives a bounded jerk. The second one is a bang-bang jerk

Modeling of the mechanics

Description of the system

The example of a machine composed of a motor, a transmission gearing with two driving wheels and a belt is given to illustrate the modeling methods, figure 3. The motion transformation from rotation to translation is achieved with a rack and a gearwheel. In this example, the model is simplified to 2 Masses and one Stiffness (2M1S), but more accurate models are available in the simulator.

Γ mot θ m J m m c J pig x M θ pig θ pm x cre J pm J pc θ pc m cre k 11eq

Figure 3: An example of a machine axis

The following notations are used, figure 3:

 mot Γ is the driving torque.  m m
J , θ are the inertia and the angular position of the rotor of the motor respectively.  are the inertia, the angular and linear positions and the radius of the driving wheel supported by the motor shaft respectively, with :

pm pm pm pm J , ,x ,R θ pm pm pm x R = θ 
are respectively the inertia, the angular and linear positions and the radius of the driving wheel supported by the rack and gearwheel, with :

pc pc pc pc J , , x , R θ pc pc pc x R = θ  pc b pm R n R =
is the ratio of the belt transmission, x and x 11eq f is the global viscous friction coefficient between the load and the motor.

Linear state space model

The state space model can be obtained from the Lagrangian equation as recalled here :

M X X K X F + μ + =   [1]
X is the (nx1) vector of degrees of freedom of the system, n is the number of degrees of freedom F is the vector of driving forces, μ is the damping matrix, M and K are the mass and stiffness matrices respectively.

In the case of the example, Eq.[1] is written with :

m M X x θ   =     , [2] mot F 0 Γ  =      11eq 12eq J 0 M 0 M   =     , ( ) pig apig pc 12eq cre load 2 pig J J J M m M R + + = + + [3] 2 11eq m am pm c pm J J J J m R = + + + , is the inertia of the motor shaft. [4] am J 11eq 11eq 11eq 2 11eq pig pig 2 b b 11eq pig 12eq f b f f R R n n f R n +   μ + -     μ =   - μ       , 11eq 11eq 2 pig pig 2 b b 11eq pig 11eq b k k R R n n K k R k n   -     =   -       [5]
Multiplying Eq.[1] by the inverse of the mass matrix leads to :

1 1 X M X M K X M - - = - μ - +   1 F - n 1 B -   =     [6]
And the state equation follows:

z A z B F = +  [7] X z X   =      is the state vector. [8] n n 1 1 0 I 0 A , M K M M - -   =   - - μ   [9]
I n is the (nxn) identity matrix. 0 n is the (nxn) matrix of zeros. This description uses the elementary block diagrams of the software Simulink. The user draws the model just as with pencil and paper by using click-and-drag mouse operations. This method avoids to express differential equations in a language or program. Simulink includes a comprehensive library of sinks, sources, connectors, linear and nonlinear components. This approach provides a graphical insight which can facilitate the understanding of the model, but it is limited, for sake of simplicity, to models from the rigid one to the 8 Masses and 7 Springs models. The block diagrams of the example Eq.[1],...,Eq.[5], equivalent to the state equation Eq.[7], is given on figure 4.

Simulink block diagrams

Robotics formalism

Another aspect of SICOMAT is to propose an original method of description based on robotics formalism. [KHA 00] proposes to adapt methods, which are derived from robotic in order to provide systematic and automatic model for system with lumped elasticities. One main application of the method concerns high-speed machine tools and robots with elastic joints. The method can provide the kinematic and dynamic models of such systems. To achieve this goal the method adapts some well-known tools and notations, which are widely used for rigid robots. The technique consists on using a description based on the modified Denavit-Hartenberg (MDH) [KHA 86] to define the kinematic of the system. Given the robot geometric parameters and its dynamic parameters, the geometric, the kinematic and the dynamic models are calculated automatically by the SYMORO (SYmbolic MOdelling of RObots) software package [KHA 97]. This software provides the different models under C or Matlab code useable directly in the MATLAB / SIMULINK environment.

It should be noticed that for identification purpose, the standard dynamic model can be rewritten in terms of a minimal set of parameters called the base inertial parameters which are the only parameters that can be identified [GAU 91]. These parameters can be obtained from the classical inertial parameters by eliminating those, which have no effect on the dynamic model and by regrouping some others. This procedure reduces the complexity of the dynamic model and will be used systematically hereafter in order to decrease the simulation time. Using the base parameters SYMORO calculates the minimal dynamic model used for simulation or control.

Electrical drive modeling

Most of actual machine tool actuators are synchronous motors with PWM converters and include current loop with field oriented control in the d-q frame. Thus it is assumed that the current loop can be modeled on q axis by a first order transfer function, between the current setpoint and the driving torque. The saturation of the current reference and the supplied voltage are simulated as shown on figure 5, taking into account the effect of the electromotive force (back emf E). G i is the static gain of the current loop, T cur is the time constant, which approximates the current loop dynamics, such as 1/T cur is the cutoff frequency (rd/s) for the -45° phase shift, kt is the motor torque constant, L and R are the stator induct T s 1 + current closed loop including the power ance and resistance respectively.

Computer Numerical Control (CNC)

The controllers implemented in industrial CNC are usually based on a cascade structure with a fast inner loop for torque control and outer loops for speed and position control. This structure improves the robustness of the controller with respect to the disturbances and modeling errors. The speed control loop is classically implemented with proportional and integral (PI) controllers (PI or IP structure) with anti-windup strategy, figure 6.

s the first order model of the l tuning of a machine with SICOMAT of a machine tool usually contains a motor, a drive pulley or a gea ox and a transmission, which can be a ball-screw gear, a drive pulley or a rack load. Manufacturer's data are given in files regrouped in a atabase. The names of the files needed for a model are given and can be modified wit he main simulator, figure 2, is automatically built from four elementary en in a library: the trajectory generator, the power converter, e controller and the mechanical structure. These blocks can be changed to modify the x or discrete time control laws, poles placement method, tim

Analysis and contro

Four boxes are all user-selectable on figure 2.

• Modify Parameters

The drive chain rb and gearwheel, and a d h this function.

• Modify Scheme T Simulink schemes giv th simulator, taking new ones from the library.

• Save Model bo

Any new or modified simulator can be saved as a new simulator.

• Analysis box

This box is dedicated to analyze the flexible modes of the mechanical structure, to reduce the model order, to compute the time and frequency responses and to optimize the controller tuning. Clicking on this box opens the following menu: The components of the eigen vectors are also calculated to be interpreted ch degree of freedom on the system. This is a help to see the dominant modes of the model and to choose the proper bandwidth for the controller.

3.2.

ate tuning. There are two basic approaches of des

Modal analysis of the System

The "undamped system" function calculates the natural frequencies as the eigen values of (M -1 K) which defines the undamped system (μ=0, Eq.[1]). The "damped system" function calculates the damping coefficients and the natural frequencies of as the contribution of ea

Controller tuning

Initial tuning on a simplified rigid model

The user problem is then to tune the controller gains considering both the CNC components and the mechanical structure. A significant point of SICOMAT is to propose an automatic tuning procedure composed of two steps. Firstly gain values are calculated using a simplified rigid model. Secondly these values initialize an optimization procedure which uses the complete model implemented in the simulator to perform an accur igning the digital controller: the direct discrete-time design or the continuous controller redesign [LEW 92]. We choose the second one because it allows continuous time techniques to be used, specially the design in the frequency domain which ensures stability margins.

Firstly, a continuous time control law is defined. Secondly it is discretized and then it is approximated by continuous transfer function, such that the gains can be calculated with a continuous controller which ct of digital control in the bandwidth of the closed loop. Details can be found in [POI 99], [PHA 00]. A first, the gains Kp, Ti of the speed loop, figure 6, are tuned in order to get a phase margin mv

Accurate tuning of the controller taking into account the complete model

These values initialize next an optimization procedure using the full model to perform an accurate tuning. At this stage, the complete model implemented in the simulator is taken into account: lumped model of the flexible mechanics, digital control and location of measurements. The 'dlinmod' Matlab procedure automatically calculates high order discrete transfer functions which makes impossible to get analytical expressions for the gains. They are calculated with optimization techniques, using the procedure 'fmins', based on the Nelder-Mead simplex method [MAT 98] in order to satisfy the phase margins and bandwidths. In case of the complete model, the delays and the oscillatory poles and zero introduced by the numerical control and the flexible mechanics make the gains tun

0 -90 -180 ϕ mv Arg [°] | | [dB] ω v180 2.3dB (M G v ) dB

A time approach design

As an alternative to the automatic and optimized gain tuning, a time approach proposed by NC manufacturers is implemented in SICOMAT. The method consists on simulating step responses tuning the parameters of the controller successively. At each iteration, the simulator performs a simulation with the new values of the parameters of the controller.

The first step is the tuning of the speed loop. The integral gain is fixed to a large value (0.5s) in order to move the integral effect to low frequencies, outside off the velocity bandwidth. The proportional gain is adjusted running simulations of the velocity closed loop in order to get a step response overshoot close to 10%. Then the integral gain is adjusted to get a step response overshoot between 20% and 40%.

The second step is to adjust the proportional gain of the position controller in order to get a desired overshoot. At each iteration SICOMAT provides numerical information on the time rising and the overshoot.

Model reduction

The mathematical models obtained with SICOMAT are often highly order because they take account the dynamics of rigid bodies, the elasticity of bodies and mechanical transmission, the dynamics of electric actuators, the effect of numerical control as delays. One difficulties in designing controller for complex systems lies in the problem to represent a complex model by a equivalent model which has a smaller number of degrees of freedom (dof). Three methods are implemented in SICOMAT:

i) The first one is based on the calculation of the eigenvalues and eigenvectors of A matrix Eq.[7], which are sorted in order to cancel the m fastest modes of A with matching static gain. The state of the reduced model has lost its physical meaning with respect to the dof defined by the initial state vector Eq.[8].

ii) The second one uses the partial Gramian operators in order to take into account some controllability and observability aspects of the system [CAM 98], [SAF 89], [GLO 84], [MOO 81]. This method keeps the drawback of the interpretation of the dof of the reduced model.

iii) The aim of the third one is to keep the most significant dof of the reduced model among those of the initial state vector X Eq.[1], as a result of a technological analysis of the mechanical system. The reduced model is then calculated by regrouping serial or parallel masses and stiffnesses of the full model with very simple rules. This method is quite less accurate than the first two ones from a system analysis point of view, but keeps an interesting physical meaning.

Analysis and simulation of a 5M4S model

Description of the system

SICOMAT has been devoted to a large number of industrial cases. As an example, a model composed of 5 masses and 4 springs (noted 5M4S) will be considered in this paper (figure 11). This model represents a single axis composed of a bed, a double linear synchronous motor, a linear scale and a load, which may be moved on a perpendicular axis. The two motor's primary are mounted like a gantry type, but very close side to side on a very rigid structure in order for the gantry to be considered as only one equivalent motor. vmotor is the viscous friction coefficient between primary and secondary part of the linear drive,

Mechanical flexible mode analysis

The frequency analysis toolbox gives the mechanical frequencies, the pulsation and the damping coefficients of the system. We observe in this example (figure 12) a first mode near from f meca =80Hz. The bandwidths of velocity and position loop can be then respectably choose equal to ( ) and (

). The controller tuning is performed in order to achieve the desired phase margins. By selecting in the design controller toolbox, the frequency optimization procedure described in the section 3.3.2, the following parameters ( The performances obtained with this set of parameters, in term of bandwidth are a phase margin for the speed loop of mv 45 ϕ = °mp 80 with a bandwidth of . For the position loop, we obtained vit =126 rad/s ω ϕ = ° with a bandwidth of . pos =33.5 rad/s ω

Conclusion

This paper presents the software package SICOMAT, which is devoted for the simulation and the prediction of the closed loop performances of high-speed machine tool axis. The simulations are carried out in the Matlab/Simulink environment. Several toolboxes give the user the opportunity to completely model and analyze its process. The most important contribution for the modeling is the mechanical modeling, which is based on a multi-body structure model with lumped masses and elasticities. The analysis is performed through the calculation of the

Figure 1 :

 1 Figure 1: Main window of the simulator Several mechanical models are implemented in the library of SICOMAT. They are chosen through 3 boxes, figure 1. The box 'Number of axis' allows to choose machines with one or two decoupled linear axis, or with two coupled axes. The boxes 'Model on X axis' and 'Model on Y axis' define the number of masses (M) and springs(S) of the lumped model for each axis respectively. The boxes 'Description on X axis' and 'Description on Y axis' allow to choose between a block diagram or a steady state-space or a robotic formalism description of the mechanical model. In

Figure 2 :

 2 Figure 2: Example of a single axis.

  are respectively the linear position and the mass of the rack.  M x stands for the load position.  load M is the load mass. Internal material damping, viscous and Coulomb friction forces are also considered :

Figure 4 :

 4 Figure 4: Example 2m1s implemented as a simulink block diagram

Figure 5 :

 5 Figure 5: Amplifier and motor model with current and voltage saturations

Figure 6 :

 6 Figure 6: Speed Controller

Figure 7 :

 7 Figure 7: Position Controller Several aspects of the control are considered in the simulator such as continuous e or frequency approaches.

Figure 8 :

 8 Figure 8: Functions of the Analysis box

  Fig

Figure 10 :

 10 Figure 10: Fail of speed loop transfer gain margin

Figure 11 :

 11 Figure 11: 5M4S Model for a high speed machine tool axisThe primary part is a short moving coil assembly and the secondary part is a long permanent magnet assembly. The notations used on figure11 are:

  friction force between primary and secondary part of the linear drive.These simulations are carried out with the following parameters for the 5M4S model:

Figure 12 :

 12 Figure 12: Frequency analysis of the system

Figure 13 :

 13 Figure 13: Frequency and time responses of the speed loop

Figure 14 :

 14 Figure 14: frequency and time responses of the position loop

Table 1 :

 1 table 1) are computed: Design of the controller

		Kp (s -1 )	Ti (s)	Kv (s -1 )
	Initial tuning	94.26	0.009	24.8
	Optimized tuning	97.1	0.009	30.26

mechanical flexible modes, the controller tuning and the computation of the dynamic behavior. Classical machine tool axes are implemented in a database or can be easily created by the user. Future works will concern the extension of this work for any n axes.