Anomalous Nernst effect and three-dimensional temperature gradients in magnetic tunnel junctions

Localized laser heating creates temperature gradients in all directions leading to three-dimensional electron flux in metallic materials. Temperature gradients in combination with material magnetization generate thermomagnetic voltages. The interplay between these temperature gradients and the magnetization along with their control enable to manipulate the generated voltages in magnetic nanodevices. We present a highly sensitive method to identify the anomalous Nernst effect generated on the nanometer length scale by micrometer-sized temperature gradients in magnetic tunnel junctions with CoFeB electrodes and a MgO tunnel barrier systematically extracted by analyzing the influence of in-plane temperature gradients on the tunnel magneto-Seebeck effect. This method yields an anomalous Nernst effect coefficient of KN ≈ 1.6 × 10−8 V T−1 K−1 for CoFeB. Generally, such investigations are motivated by utilizing otherwise wasted heat in magnetic memory devices for read/write operations. The additionally generated anomalous Nernst effect offers a functionality expansion, opening new application fields such as direction-dependent temperature sensing with downscaling potential. Understanding nanoscale temperature gradients in magnetic materials and how it affects their properties can help widen their potential applications. The authors analyze the anomalous Nernst effect in magnetic tunnel junctions and report how temperature gradients influence the thermomagnetic properties in three dimensions.

S pin-dependent thermally driven transport phenomena have the potential to expand the functionality of today's conventional electronics. A dream of spintronic researchers has been to improve not solely the devices speed, but also enhance power management. This can be accomplished by employing additional energy conversion mechanisms usually available in semiconductor-based integrated circuitry in the form of waste heat. The emerging field of spin caloritronics takes advantage of spin electronic devices in combination with thermal effects. This research field stands at the frontier between thermal transport and spin physics [1][2][3] . Magnetic tunnel junctions (MTJs) are one great testbed for spin caloritronic application devices. Originally, they were developed for storage capacity enhancement by the use of the tunnel magnetoresistance effect (TMR) 4 . However, their properties can be directly translated to spin caloritronics when an electric potential as a driving force is replaced by temperature gradients. The thermal method to generate voltage and read out information from MTJs employing temperature gradients utilizes the tunnel magneto-Seebeck effect (TMS). When a temperature gradient is applied across a layer stack of two magnetic electrodes separated by an insulating barrier, the generated voltage V differs, depending on whether the electrodes' magnetizations are aligned parallel (p) or antiparallel (ap). The microscopic origin, together with theoretical predictions of the TMS for multiple CoFe compositions with MgO barriers is given in refs. 5,6 and is calculated by: The TMS effect has been observed and analyzed for various combinations of barrier and electrode materials, showing thermovoltages in the μV range for MgO [7][8][9][10][11][12][13] and MgAl 2 O 4 [14][15][16] , and reaching the mV range for Heusler-based MTJs 17 . An overview is given in Kuschel et al. 18 . All examined material configurations result in specific TMS ratios. Although MgAl 2 O 4 exhibits ratios below 10%, MgO reaches values up to 60% 15 and for electrode combinations CoFeB/MgO/Heusler even ratios of approximately 100% are reported. Meanwhile, the thermal voltage amplitudes approach the order of magnitude that could be used in commercial electronics. Besides this, other effects, e.g., the Onsager reciprocal effect, the tunnel Peltier effect has been realized experimentally 19 .
Two preconditions are required to unambiguously achieve enhanced Seebeck voltages in the MTJ's parallel and antiparallel state, V p and V ap , 9,11 . One must apply a large temperature gradient across the junction and at the same time, the whole junction area needs to be heated homogeneously. As a consequence, using all-optical laser heating, the spot size needs to be adapted to the junction size and positioned centrally in order to create a welldefined temperature gradient across both electrodes and generate reliable voltages 11 . Temperature gradients deviating from the outof-plane direction, e.g., temperature in homogeneities in the sample plane, lead to further thermoelectric effects that influence the total Seebeck voltages. In this study, we focus on effects generated by these additional in-plane temperature gradients.
There are three thermomagnetic effects that come into question when considering ferromagnetic metal materials whose temperature gradient ∇T and the magnetization M are aligned in the film plane. The first two are the anisotropic magneto thermopower (AMTP) E AMTP / ∇T Á cosðϕ ∇T ÞM 2 Á cosð2ϕ M Þ and the planar Nernst effect The angles ϕ ∇T and ϕ M express the direction of ∇T and M with respect to the direction of voltage measurement. The third is the anomalous Nernst effect (ANE), E ANE / ∇T M / ∇T Á M Á sinðϕÞ. The angle ϕ denotes the angle between the magnetization M and the temperature gradient ∇T. In the first two configurations, the generated electric fields E AMTP and E PNE are both coplanar with ∇T and M 20 , whereas in the last case, the voltage is orthogonal to both, ∇T and M. The former two effects are quadratic in M, which means that magnetization reversal (180°rotation) does not lead to any change of the electric field and thus a reversal of voltage direction. For the ANE, the resulting electric field is perpendicular to the plane defined by ∇T and the M vector, and in contrast to the former two it exhibits a sign change upon magnetization reversal.
In general, ANE experiments are performed with an out-ofplane temperature gradient and the magnetization in the film plane (IM configuration), as well as with in-plane temperature gradients and perpendicular magnetization (PM configuration) 21,22 . Some publications investigate the aspects of the IM configuration, as published in refs [23][24][25][26][27][28][29][30][31] or the PM configuration, as published in 28,[32][33][34] . In those experiments, usually macroscopic millimeter-sized structures and micrometer wide wires are investigated. The voltage is generated on macroscopic length scales ranging from >10 μm to several millimeters probing predominantly bulk-like properties. In this scope, the ANE measurements in PM CoFeB nanowires with thicknesses below 1 nm play a special role, because those are the smallest dimensions, in which the ANE has been reported so far. There, the temperature gradients are created on length scales up to 500 nm and the generated voltages are detected on length scales in the micrometer range 35,36 .
Moreover, several publications investigate the ANE enhancement capabilities by utilizing multilayer structures 37 , by looking at the thickness dependence in different ferromagnetic materials 38 or disentangling and quantifying the contributions of other effects, e.g., the thermal Hall effect, to ANE measurements 39 .
In the present study, we utilize an extended TMS measurement configuration to deliberately create in-plane temperature gradients in MTJ electrodes with in-plane magnetization easy axis and detect the underlying thermomagnetic processes on mesoscopic length scales. This is done by the application of complex three-dimensional temperature gradients to drive spin caloritronic effects in the layered device. We exploit a high flexibility to control both, the magnetization and the temperature gradient direction, and measure the voltages in the lithographically structured MTJ.

Results
Sample geometry and experimental procedure. Figure 1a depicts the sample geometry and the layer sequence to explain the temperature distribution for the discussed heating scenarios and applied magnetic field geometries. In our experimental configuration, the voltage is measured in the out-of-plane direction (defined as z axis), perpendicular to the applied magnetic field μ 0 H (defined as y axis), whereas the in-plane temperature gradient is rotated in the x-y plane, as defined in Fig. 1b. The access to temperature gradients and the relevant temperature differences is discussed by finite element simulations using COMSOL.
We use pseudo spin valves, because of their most simplistic layer structure and possibility to control the magnetization in both layers of the MTJs. In contrast to exchange biased spin valves, where one magnetic layer is pinned, these devices allow multiple magnetic configurations in the parallel magnetization alignment: with respect to the temperature gradient the magnetization of both ferromagnetic electrodes can be rotated together. We define the thermovoltage measured in the parallel state for direction 1 and 2 as V p1 and V p2 . The difference is employed in the following to disentangle and characterize thermomagnetic effects that arise from in-plane temperature gradients created in the plane of the electrodes. Additional experimental data identifying the uniaxial magnetic anisotropy (UMA) present in the investigated samples is discussed in a section below.
Temperature distribution. The key feature to analyze spin caloritronic effects in MTJs is the access to temperature distributions on micrometer to nanometer length scales. TMR junctions provide a rich variety of possibilities to create anisotropic temperature profiles on nm to μm length scales using position-dependent laser heating. Extending the scanning technique originally developed for the extraction of the preferably pure TMS signal, as introduced in ref. 11 , allows a systematic temperature gradient variation. The schematic in Fig. 1b depicts this experimental procedure. In general, a centrally positioned laser spot creates a temperature gradient through the layer stack in z-direction that generates a magnetization-dependent voltage V(M), which can be varied by sweeping an external magnetic field μ 0 H applied in y-direction. The MTJ layer stack itself is embedded into Au and Ta contact pads and surrounded by insulating Ta 2 O 5 in the x-y plane. The Au pads thickness is around three times larger than the optical penetration depth λ opt ≈ 15−20 nm, leaving purely thermal excitation in the CoFeB layers. This sample design allows to create and steadily vary temperature gradients in the x-y plane by moving the laser spot along the surface. The voltage generated at the CoFeB electrodes is measured in z-direction. Due to this configuration, the main voltage contribution generated by in-plane temperature gradients stems from the ANE. Both the AMTP and the PNE can be disregarded, because the voltage is generated in the x-y plane, and only second-order processes with amplitudes that are orders of magnitude smaller can contribute to the out-of-plane signal. For the investigation of inhomogeneous laser heating, the setup parameters need additional adjustment. The modulated continuous wave laser spot is focused down to 2 μm in diameter and systematically scanned across the sample within an area of 30 × 30 μm 2 in which the elliptically shaped MTJ itself has a dimension of 6 μm by 4 μm. Performing such a two-dimensional scan, a local heating point is moved over the entire MTJ area and enables the creation of specifically directed and consistently varied temperature gradients. This allows us to apply complex three-dimensional temperature profiles at will. The situation is discussed in the following example when we place the laser spot at the MTJ's edge. Figure 1a shows an enlargement of the elliptically shaped MTJ layer stack. The tunnel junction consists of the CoFeB/MgO/CoFeB stack, the Ta layer is necessary to remove boron during crystallization from the CoFeB/MgO interface and lastly the Ru capping is deposited to prevent oxidation during the ex situ annealing process and patterning. The in-plane ∇T together with the in-plane M and the angle ϕ are sketched on top of the stack. Note, that during the measurement, the direction of M remains constant, whereas ∇T is rotated by ϕ = 0°−360°. The access to temperature in such small devices is not available experimentally, therefore, three-dimensional finite element simulations using the COMSOL package with the heat transfer module are performed to gain insight into the temperature distribution within the MTJ. The simulations are performed for continuous wave laser heating in equilibrium using the parameters given in the Supplementary Table 1. Figures 1c-e display the temperature distribution for three different laser spot positions located at the MTJ edges. The false color plots show the equilibrium temperature distribution inside the top CoFeB electrode, which is indicated by the dashed lines. The temperature distribution in the bottom CoFeB shows the same characteristics and is not shown here. However, due to ∇T created in the out-of-plane direction, the overall T is slightly lower. The difference in temperature between top and bottom Heating at the end of the long (short) axis results in the main temperature gradient in y-direction (x-direction) as shown in c (e) and indicated by the black arrows. Graph d shows the scenario, when the heating laser spot is placed on the edge between both major ellipses axes, resulting in the main temperature gradient at an angle between the main temperature gradient at an angle between the two electrodes ranges from ΔT top−bottom ≈ 50 mK in the vicinity of the laser spot to <1 mK at the opposite edge and decreases exponentially to a first approximation. However, the temperature distribution simulations reveal that the temperature profiles are more complicated and show strong fluctuations especially at the edges, as discussed in more detail in the Supplementary Note 1 and shown in Supplementary Figures 1-4. As the dimensions in the x-y plane are three orders of magnitude larger, the in-plane temperature differences are larger than those across the layer stack. The temperature gradient directions for each heating scenario are indicated by the gray arrows accompanied by the temperature drop ΔT between both junction edges. Figure 1c describes the first scenario, when the laser spot is located at the vertex, then a temperature gradient along the major axis with a temperature difference ΔT ≈ 9K is created. Figure 1d shows the second heating scenario when the laser spot is located at the edge of the ellipse at a 45°angle between both principal axes. Consequently, this results in a temperature gradient along the MTJ diagonal with ΔT ≈ 8K. Finally, Fig. 1e illustrates the third scenario, when the laser spot is located at the co-vertex, resulting in a temperature gradient along the minor axis with ΔT ≈ 8K. The slight temperature differences for these external cases results from the asymmetry in the MTJ's geometry. A thorough temperature profile analysis reveals that independent of the ∇T angle the in-plane temperature gradient covers equally sized areas of the MTJ. Therefore, we expect the number of electrons involved in the process triggered by the in-plane temperature gradient to remain angle independent.
The largest, most homogeneous area with a high temperature gradient across the layer stack is created when the laser spot is located with its center at least 1.7 μm away from the MTJ's edge. When heating within this area, effects from in-plane temperature gradients cancel each other out and can be excluded. We conclude that by application of the laser spot at the edge of the tunnel junction, large in-plane gradients can be created and rotated by an arbitrary angle in the x-y plane. For a laser spot at the center, the overall x-y gradient is found to vanish, and we have predominantly a temperature gradient in z-direction.
Anomalous Nernst Effect. The pseudo spin valves selected in this study allow for the full directional manipulation of the magnetization in both electrodes, because in contrast to conventional MTJ design, none of the magnetic layers is antiferromagnetically pinned. The condition for their antiparallel magnetization alignment is realized by choosing specially designed electrodes with different anisotropy strength and thus different coercive fields. In the presented investigation both CoFeB layers differ in thicknesses by around 2 nm to fulfill this criterion. This allows two parallel magnetization alignment configurations of opposite direction. Figure 2a shows an example of a Seebeck voltage vs. external field μ 0 H sweep, recorded while the laser spot is close to the MTJ edge and a pronounced in-plane temperature gradient is generated, ϕ ∇T = 90°. The ranges with parallel and antiparallel magnetization alignment are indicated by the black arrows. For large field amplitudes, both electrodes magnetizations align parallel and a different Seebeck voltage is generated than in the antiparallel alignment. From this measurement curve, the TMS ratio is calculated, which results in a ratio of approximately 50%. This is consistent with the findings reported in ref. 11 .
The measurement confirms the two possibilities for parallel alignment configuration of opposite direction, V p1 for negative μ 0 H and V p2 for positive μ 0 H. Furthermore, the data exhibit a clear shift of V p1 with respect to V p2 . This voltage shift ΔV ANE = V p1 − V p2 is marked by the shaded blue area. Data recorded with the heating laser spot positioned in the MTJs center are shown in Supplementary   Figure 5. There, ΔV ANE = 0, as expected. We argue that ΔV ANE originates from the in-plane temperature gradient, which affects the voltage in the perpendicular direction for parallel magnetization states of opposite sign. At this point, we rule out the PNE and the AMTP for two reasons. First, their quadratic dependence on the magnetization~M 2 would not result in a difference between V p1 and V p2 upon magnetization reversal. Second, the voltage is measured perpendicularly to the plane that is spanned by ∇T and M. This perpendicular voltage is zero for PNE and AMTP. Conclusively, we state that ΔV ANE originates from the ANE.
Recently, also the spin Nernst effect (SNE) was verified experimentally at heavy metal/ferromagnet interfaces for ferromagnet insulators (YIG) 40 , and for metallic ferromagnets (CoFeB) 41,42 . There, an in-plane temperature gradient generates a transverse spin current density in the heavy metal, which influences the generated Seebeck voltage or the Hall resistance of the ferromagnetic layer. However, the Ta/CoFeB interface investigated in ref. 41 shows an SNE that is lower than 0.1 μV at an applied temperature difference in the Kelvin range. Because the calculated in-plane temperature gradients in our sample system are two orders of magnitude smaller, we rule out any detectable contribution of the SNE to the ANE extracted from our experiments.
The laser spot is moved over the sample surface and the inplane temperature gradient is varied, as analyzed in the previous section from the finite element temperature simulations. From each curve, one ΔV ANE value is extracted and plotted in Fig. 2b. In each measurement, the magnetization is reversed together with μ 0 H along the y axis, as depicted by the black double arrow next to the graph. Figure 2b is divided into two parts.
In the first part, the extracted ΔV ANE values for each heating scenario are illustrated in a three-dimensional surface plot. The spatial position for the ΔV ANE value extracted from Fig. 2a is indicated by the gray dotted lines pointing to Fig. 2b. The voltage difference ΔV ANE shows an increase and a decrease with absolute value maxima of around 0.4 μV showing an inversion symmetry regarding the origin of the coordinate system.
In the second part, the same data are projected at the bottom in a false color plot for a better overview. This depiction includes a contour of the MTJ's elliptical area with both principal axes (dashed dark gray crossed lines). Without loss of generality, the angle ϕ ∇T = 0°is defined along the positive y axis and parallel to the positive μ 0 H and the ϕ ∇T rotation is marked in counter clockwise direction. Both extreme values of ΔV ANE are generated when the laser heating spot is located near the MTJ's edge, where the largest in-plane temperature differences are created (compare COMSOL simulations in Figs. 1c-e) and at ϕ ∇T = 90°and ϕ ∇T = 270°. The borderline between the elevation and decrease where ΔV ANE ≈ 0 proceeds parallel to μ 0 H and is perpendicular to the line connecting the extreme ΔV ANE absolute value locations.
As a main result, the ΔV ANE values extracted from the positions marked by the black ellipse contour are plotted vs. the temperature gradient angle ϕ ∇T with respect to the μ 0 H direction is shown in Fig. 2c. This two-dimensional plot highlights the ΔV ANE sign change upon in-plane ∇T reversal with respect to the magnetization. This behavior confirms the thermomagnetic origin of the extracted effect. Further analysis of the ΔV ANE signal in Fig. 2c validates the ANE effect generated by in-plane temperature gradients. The extracted data (blue dots) are fitted to the formula given by the ANE cross-product definition, when the temperature gradient is rotated by ϕ ∇T : The extracted fit parameters are A = (0.42 ± 0.04) μV, the maximum ΔV ANE amplitude, ϕ 0 = (4 ± 5)°, the phase shift, which expresses the angle between the MTJ's magnetization and ∇T when the temperature gradient is aligned parallel to μ 0 H, and V 0 = (0.00 ± 0.026) μV, the offset voltage.
The small value obtained for ϕ 0 indicates an excellent magnetization easy axis alignment with the external field direction. This also reveals that when ∇T and M are aligned parallel or antiparallel, ΔV ANE = 0. This corresponds to the angles ϕ ∇T = 0°and ϕ ∇T = 180°, as indicated in the projection in Fig. 2b. Both maximum amplitudes are located at ϕ ∇T = 90°and ϕ ∇T = 270°, when M and ∇T are perpendicular to each other. In conclusion, our findings are consistent with the cross-product definition of the ANE. Besides this, the vanishing offset V 0 confirms the ANEs symmetry with respect to the magnetization direction.
During the course of our measurements, we find that the MTJs possess an in-plane magnetic anisotropy. This is indicated in TMR, as well as in MOKE measurements on CoFeB/MgO films. Additional magnetic anisotropy contributions could also influence the characteristics of the ANE effect.
In order to suppress these contributions to the voltage signal generated by in-plane temperature gradients, we first analyze the magnetic anisotropy for CoFeB thin films deposited on MgO substrates in detail. For this purpose, we prepare a thin CoFeB film sputtered from the same target as those used for the MTJs on an MgO substrate under identical conditions. This film was chosen to be thicker (40 nm) to assure a good signal in all-optical pump-probe experiments. Further, if the crystallization at the MgO/CoFeB interface induces a strong enough uniaxial in-plane anisotropy for a 40 nm thick film, then this will hold even more for thinner CoFeB films. After that, magnetization dynamics experiments, rotating μ 0 H in the sample plane are performed with an angle resolution of 5°, as depicted in Fig. 3a. Here, the precessional dynamics on the nanosecond time scale are plotted vs. the rotation of μ 0 H in a false color plot, showing the negative/ positive precession amplitude in blue/red. Figure 3b shows the precession frequencies extracted by fast Fourier transform. The frequency amplitudes are false color coded using a different color scheme for a better distinction. In accordance to the analysis presented in ref. 43 , we interpret our data as follows. The plot shows a declining precession frequency near the magnetic hard axis pointing into the ½ 110 direction and frequency increase when μ 0 H is rotated towards the magnetic easy axis pointing into the [110] direction. The frequency reaches saturation and the amplitude declines in the vicinity of the easy axis, because the applied field amplitude (μ 0 H = 6.8 mT) is sufficient to saturate the sample, but too small to force the magnetization slightly out of the magnetic easy axis. This means, CoFeB grown on MgO exhibits an UMA with the magnetic easy axis along the [110] crystalline direction.
Although the MTJ's elliptic shape is aligned with the vertex along the [100] direction, for a 1.5 vertex/co-vertex ratio and a layer thickness in the nanometer range, the calculated demagnetizing fields due to shape anisotropy are approximately 2 mT, using geometrical considerations given in ref. 44 . Therefore, solely the magneto-crystalline anisotropy remains as a significant factor leaving the magnetic easy axis along the [110] direction. Taking those findings into account, the MTJ is placed with the magnetic easy axis parallel to the applied field μ 0 H for the ANE measurements.
In addition to this, we also exclude contact resistance or bond wire geometry as an origin for this behavior, because repetition of those measurements with the contact wires attached at different angles to the magnetic field, as well as at various positions and distances from the MTJ all return the same qualitative and quantitative characteristics (not shown here).
Finally, from these findings, the ANE coefficient can be estimated, considering that the CoFeB saturation magnetization is M S ≈ 1.6T and the in-plane temperature difference ΔT ≈ 8K. The maximum ΔV ANE value needs to be divided by two, because the shift in Fig. 2a influences the voltage measured in both parallel magnetization alignment directions. Starting with a homogeneous heating scenario, where the in-plane ∇T ≈ 0, also results in ΔV ANE = 0. However, an in-plane ∇T ≠ 0 shifts V p1 to higher values, whereas it shifts V p2 to lower values. Thus, the contribution to the ANE is given by 1 2 ΔV ANE . This results in an anomalous Nernst coefficient of for Ni. The comparison shows that our experimental method is extremely sensitive. We estimate that even for an anomalous Nernst coefficient as small as 10 −9 V T −1 K −1 a detection would be possible.
The two orders of magnitude difference between K N extracted by Wells et al. and in our experiments have several reasons. The main difference is the amorphous structure of the nanowires, compared with the crystalline MTJs. Electrical and thermal transport properties of amorphous materials differ strongly from crystalline materials; therefore, it is not surprising that the ANE coefficients differ as well. Additionally, spin-orbital coupling is different in all materials compared here. In case of Wells et al., a strong PMA is present, which is stronger than the UMA in the MTJs. Furthermore, there is a difference in temperature determination. They use scanning thermal microscopy to determine the temperature gradients. Due to the sample design and the MTJ size, which is relevant for the experiment, we are compelled to rely on temperature simulations, which can account for further deviations.

Discussion
We investigated how in-plane temperature gradients in single MTJs enhances or decreases the out-of-plane thermovoltage in TMS measurements. The extracted voltage shows a symmetric characteristic that can be clearly attributed to the ANE with respect to the UMA of the sample. This UMA is verified by magnetization dynamics measurements.
Primarily we observe that the ANE affects only the Seebeck voltage in the parallel magnetization alignment and the ANE voltages are two orders of magnitude smaller compared with the TMS voltages. Therefore, the influence on the overall TMS ratio needs to be considered in the analysis if in-plane temperature gradients are present, even if it is small. Nevertheless, the ANE can be clearly identified and extracted from TMS measurements of pseudo spin valve MTJs. In the case of MTJs with one antiferromagnetically pinned and one switching electrode, the occurrence of ANE due to inhomogeneous heating and the presence of in-plane temperature gradients will lead to a deviation in the magneto-Seebeck voltage from the real value. However, in this configuration it is not possible to disentangle both contributions, as the ANE and the minor TMS loop have the same shape due to the equal magnetic field dependence.
In our experiments, samples with different MgO barrier thicknesses are measured and show qualitatively similar characteristics as is discussed in the Supplementary Note 2 and can be seen in Supplementary Figure 6. From those findings, we conclude that there is no significant influence of the MgO layer thickness on the ANE contribution. However, we are pointing out that an intact MgO barrier is essential for ANE detection, because it is sensed as an influence on the Seebeck voltages measured for the TMS effect. To elucidate the importance, we are showing ANE measurements on an MTJ with broken MgO barrier in Supplementary Figure 7 added to the Supplementary Note 3.
Within this study, we illustrate the first detection of the ANE in MTJs on such short length scales also obtaining a high spatial resolution. These results show very clearly the importance of homogenous laser heating to avoid unintended effects in case of TMS measurements by laser heating. The measurements show a clear dependence of the extracted ANE effect on the angle between the magnetization and the temperature gradient. Together with a proper calibration, and a combination of the investigated effects and technologies enables the construction of a direction-dependent thermometer. This thermometer would not only sense the temperature, but also the direction of change, working as follows. Consider an MTJ in the parallel magnetization alignment for both ferromagnetic layers, subject to a lateral heat flux, which is not necessarily induced by laser heating, and which shall be characterized. The heat flux establishes a temperature gradient in the MTJs plane. As we have discussed above, the lateral temperature gradient generates a voltage in the direction perpendicular to the MTJs plane. This voltage changes from V p1 to V p2 upon magnetization reversal. As the difference V p1 − V p2 = ΔV ANE depends on the angle between magnetization axis and the direction of heat flux, after detecting ΔV ANE for different magnetization directions, the direction of the heat flux can be determined. The suggested device demands a way to set the magnetization in the MTJ at arbitrary in-plane angles. Note, that switching of magnetization could be accomplished by employing spin transfer torque or spin orbit torque switching. In the future, the combination of TMS and ANE measurement will even enable a three-dimensional direction analysis of the effective heat flux by evaluating the relation between the TMS and ANE contribution to the signal. Because of the exponential temperature decay in the sample plane together with the sensitivity of this method, there is room for further device miniaturization beyond the micrometer scale. In a separate chamber, the MgO barrier is e-beam evaporated without breaking the vacuum. The Ru capping layer is deposited by e-beam evaporation and prevents the underlying layers from oxidation. Ex situ annealing with applied bias field is performed to crystallize the amorphous CoFeB electrodes and the MgO layer to obtain coherent interfaces and to activate the diffusion of B into the Ta layers [47][48][49] . Afterwards, elliptical MTJs are patterned to a size of 6 μm × 4 μm with the long axis parallel to the direction of the magnetic field applied during the annealing by lithography processes. For thermal and electrical isolation, Ta 2 O 5 is sputtered in the surroundings of the single MTJs. The Au layer pads on top are necessary to enable electrical contacting. A detailed description of the sample fabrication can be found in ref. 11 .
Magneto-Seebeck experiment. For the generation of a temperature gradient across the layer stack, a laser diode (TOPTICA ibeam smart) with a wavelength of 638 nm and a maximum power of 150 mW is used. The laser is focused to a minimum diameter of~2 μm full-width at half-maximum by utilizing a microscope objective (NIKON 20×, WD 20.5 mm). The generated thermovoltage is detected with a lock-in amplifier. The laser diode is modulated with a square wave at a frequency of 77 Hz, which is used as modulation frequency for the lock-in amplifier. For magnetization-dependent measurements, the sample is placed in between two pole shoes of an electromagnet. The implemented linear stages with motorized actuators for the horizontal (x-direction) and vertical (y-direction) movement enable an exact positioning of the laser beam on the sample surface together with a high spatial resolution of 0.2 μm. This setup allows the recording of the generated thermovoltage in z-direction depending on the magnetization direction by heating the sample at different positions over a defined area. In this study, the measured area is adapted to the junction size and with respect to the backlash of the actuators a dimension of 30 μm × 30 μm with a resolution of 1 μm is preferred.
Magnetization dynamics. The all-optical pump-probe Faraday configuration uses a 400 nm pump and 800 nm probe beam from a 1 kHz Ti:Sapphire laser system with 120 fs pulse lengths. The pump fluence is F pump = 5.7 mJ cm −2 . The delay can be varied from 0 to 8 ns. The sample is situated in a constant applied magnetic field, which can be rotated in the sample plane.
Temperature distribution simulations. The temperature distributions were obtained by finite element modeling with the software package COMSOL version 4.2a, including the heat transfer module. Most values for the necessary material parameters (specific heat c, thermal conductivity κ, density ρ) were taken from ref. 7 . For Ta 2 O 5 , we assumed c = 135.6 J mol −1 K −1 , κ = 0.3 W m −1 K −1 , and ρ = 8270 kg m −3 according to refs 50,51 . In contrast to the work presented in ref. 7 , here we implemented a fully three-dimensional model of the junction. The laser heating was taken into account as a volumetric heating source H $ exp À z

Data availability
The data that support the plots within this paper and other finding of this study are available from the corresponding author upon reasonable request.