Competitive and cooperative electronic states in Ba(Fe1−xTx)2As2 with T = Co, Ni, Cr

The electronic inhomogeneities in Co, Ni, and Cr doped BaFe2As2 single crystals are compared within three bulk property regions: a pure superconducting (SC) dome region, a coexisting SC and antiferromagnetic (AFM) region, and a non-SC region. Machine learning is utilized to categorize the inhomogeneous electronic states: in-gap, L-shape, and S-shape states. Although the relative percentages of the states vary in the three samples, the total volume fraction of the three electronic states is quite similar. This is coincident with the number of electrons (Ni0.04 and Co0.08) and holes (Cr0.04) doped into the compounds. The in-gap state is confirmed as a magnetic impurity state from the Co or Ni dopants, the L-shape state is identified as a spin density wave which competes with the SC phase, and the S-shape state is found to be another form of magnetic order which constructively cooperates with the SC phase, rather than competing with it.


INTRODUCTION
The interplay between magnetism and superconductivity (SC) is one of the fundamental topics for understanding the mechanism of superconductivity of unconventional superconductors in the cuprates and iron-based superconductors (FeSCs) 1,2 since SC appears near antiferromagnetic (AF) order. In cuprates, experiments demonstrated that the superconducting pairing state is the unconventional d x2-y2 , which is believed induced by spin fluctuations [3][4][5] . Similar to the cuprates, magnetism in the FeSCs plays an important role in the electron pairing mechanism 2,4 . However, in the FeSC it is more complicated and controversial since Fe 3d orbitals form multiple Fermi surfaces (FS), while in cuprates only a single Cu d-band crosses the FS [6][7][8][9] . For example, in the most studied FeSC family of pnictides BaFe 2 As 2 (122), SC can be realized by atomic substitution at any element site, for example by hole-doping onto Ba site 10 , electron-doping on Fe site 11,12 and isovalent doping on As site 13 . However, it is intriguing that crystals with electron-doping to Fe site (with Ni and Co) are superconducting while crystals with hole-dopants (with Cr) are not 14 .
On the other hand, for the electron-doped 122 crystals, it is well established that upon electron doping via Co/Ni substitution for Fe, the collinear long-range AF order is suppressed, and SC then appears. However, there are ongoing debates concerning the relationship between the AF order and SC. One perspective arises from a presumed itinerant nature of magnetism. In this view, the static AF order arises from the formation of a spin-density wave induced by itinerant electrons and the Fermi surface nesting of the electron and hole pockets. Upon doping the pair scattering between the electron and hole like FS pockets then leads to SC 15,16 . A different perspective arises from a presumed localized nature of magnetism: the short-range incommensurate AF order is a cluster spin glass phase arising from disordered localized moments 12,17 . There is an additional perspective that local moments and itinerant electrons coexist. In this scenario, part of the Fe d bands are delocalized and contribute to the itinerancy, whereas others are localized due to a strong correlation effect and provide the source for local moments 18,19 . This model was used to explain the scanning tunneling microscopic observation of the coexistence as well as the co-disappearance of a pseudogap-like feature and superconductor in the NaFe 1−x Co x As (Co-111) system where the pure itinerant picture apparently fails 20 . A muon spin rotation study also observed a spatially inhomogeneous magnetic state developing below T c which, surprisingly, has a constructive relationship with SC in nearoptimal or overdoped Co-122 samples 21,22 . This is intrinsically different from the reported SDW phase in NaFe 1−x Co x As (Co-111) which competes with, and is anti-correlated, with the SC phase 23 .
Here, we investigate the local electronic structure of 122 crystalline matrix BaFe 2 As 2 that is doped with magnetic elements (Ni, Co, or Cr) at the same amount of electron versus hole doping levels per Fe atom. We systematically explore the electronic structure signatures of the magnetism and SC phases using lowtemperature high magnetic-field scanning tunneling microscopy/ spectroscopy (STM/S). The machine learning technique of the K-means clustering method is employed to categorize the various nanometer-size inhomogeneous electronic states. In addition to the SC state, an in-gap state, a competitive L-shape, and a cooperative S-shape state are found to coexist in the samples. The in-gap state in the SC crystals is confirmed to be a magnetic impurity state from Co or Ni dopants, while the L-shape state is identified as an SDW that competes with the SC phase. In addition, the S-shape state originates from a local magnetic order that surprisingly, constructively cooperates with the SC phase rather than competing with it. A comparison of the vortex structures indicates that those inhomogeneous electronic states serve as pinning centers for stabilizing the hexagonal vortex lattice for the bulk superconductors.

Local electronic inhomogeneity
For the purpose of comparison, we have studied three sets of samples of the transition-metal substituted Ba(Fe 1-x T x ) 2 As 2 in three different bulk property regions (bulk SC, magnetism, and SC coexistence, and non-SC). These are the bulk SC Ba (Fe 0.92 Co 0.08 ) 2 As 2 (Co-122) crystal, the AFM and SC coexisting Ba (Fe 0.96 Ni 0.04 ) 2 As 2 (Ni-122) crystal, and the AFM Ba(Fe 0.96 Cr 0.04 ) 2 As 2 (Cr-122) crystal. Since Ni (Cr) doping introduces twice the number of electrons (holes) in the FeAs layer as that of Co doping (from simple electron counting), we select the Co-122 doping level as 0.08 instead of 0.04 to achieve the same amount of electron versus hole doping levels per Fe atom. This ensures consistency across the three sets of samples. Cr-122 has a G-AFM ground state (T N~1 00 K), while optimally doped Co-122 is in the SC state (T c 22 K) 24 ; and the composition of the Ni-122 was chosen to locate it in the coexistence range of SC and AFM orders (T c~1 9 K, T Ñ 45 K). All the scanning tunneling microscopy/spectroscopy experiments are performed at the base temperature of~4 K. These phases are indicated using blue, red, and yellow balls in the temperature-composition (T − x) phase diagram in Fig. 1a; the crystal structure of the undoped parent 122-unit cell is in the inset.
After low-temperature cleavage, the three sets of samples show similar topography, which is the coexistence of 2 × 1 and √2 × √2 reconstructions, as reported for Co-122 before 25,26 . Figure 1b shows a typical large-scale topographic image of Ni-122, with terraces, steps in 0.7 nm (half unit cell in c-axis), and defects. The atomic resolution image collected from the red box of Fig. 1b reveals the √2 × √2 reconstruction, atomic-scale dark pits, protrusions, and dark lines, as shown in Fig. 1c. The dark lines are the antiphase boundaries of the √2 × √2 domains, the dark pits are the results of missing single or multiple Ba atoms on the top surface, and the bright protrusions reflect the electronic contributions of the elemental defects beneath the Ba surface based on the height of the protrusion (~0.04 nm). Note that there exist height-variations of approximately 20 pm even on atomically well-ordered areas (~5 pm atomic corrugation from relative homogeneous areas), suggesting the existence of electronic inhomogeneity in the sample.
Dramatic local electronic inhomogeneity is found on the Ni-122 surface. Figure 1d presents the STS spectra along the black arrow in Fig. 1c. Although the morphology of the areas around the arrow is similar (√2 × √2, no defects), the STS spectra, which are proportional to the local density of states (LDOS), show remarkably different features. The spectra along the black arrow exhibit not only superconducting coherent peaks with an SC gap width of about 4.5 meV in the blue curves but also an in-gap state around the Fermi level, with the suppression of the SC coherence peaks in the brown curves.
To clarify the correlation between the topography and the local electronic inhomogeneity on Ni-122, current imaging tunneling spectroscopy (CITS) maps were collected from various areas on the surface. Systematic comparison among topography, CITS, and SC gap map concludes that there is no apparent correlation between the topography and local electronic inhomogeneity. Such a comparison from an area with fairly ordered √2 × √2 reconstruction and few defects (blue box in Fig. 2a) is shown in Fig. 2. Shown in Fig. 2b, c is the STS map at the Fermi level and the corresponding gap map. The SC gap map in this work is the map of the SC gap value at each pixel, where the value of Δ is obtained by fitting each dI/dV using the Dynes model of n o , as we did previously 25 . Patches of non-SC areas (green) are immersed in the SC matrix (blue to the white area, with various SC gap widths). The nanometer size inhomogeneity in the STS map and gap map are highly correlated to each other, but not with the almost homogeneous topographic image. To reveal the intrinsic electronic structure of the inhomogeneity, an extensive survey of the spectra on the surface is conducted. Other than the SC gap features, two other types of characteristic STS are found on the Ni-122 surface, also noncorrelated to the topography. Two such areas are circled in blue and brown in Fig. 2b. Line STS in Fig. 2d, e along the dashed green and solid brown arrows in Fig. 2b reveal the  Fig. 2e have an elevated density of states at the Fermi level, which is named as an S-shape state in this work. In order to analyze the spatial distribution of all three types of spectra, K-means clustering analyses of the spectra of CITS in Ni-122 are performed. K-means clustering is a vector quantization data mining approach, which groups a large dataset into components with principal characteristics 27 . Figure 2f shows the three principal responses in this data set, which correspond to an SC, an in-gap and an S-shape state via comparison with the STS in Fig. 2d, e. In the cluster map, each color represents the spatial distribution of the corresponding principal dI/dV spectra. As we can see, the cluster map captures the transition between the phases in dI/dV line mappings across the boundaries (Fig. 2d, e). Furthermore, the distribution of the SC state in the K-means clusters is the same as the distribution of the STS map and gap map in Fig. 2b, c. Most importantly, the non-SC areas are clearly categorized into distinct areas of an in-gap state (brown) and an S-shape state (green).
The above coexistence of S-shape and in-gap states within superconducting crystals are not affected by the surface termination since they are observed not only on a √2 × √2 reconstruction but also on 2 × 1 reconstructed area. It has been reported that the √2 × √2 and 2 × 1 surface reconstructions coexist on the cleavage surface of BaFe 2 As 2 25,26 . However, the superconductivity gap width is not affected by the surface reconstructions owing to the global nature of the superconductivity 25 . These observations strongly suggest that the S-shape, in-gap state, and superconducting state are in fact intrinsic electronic structures of the superconducting 122 system rather than the surface-specific properties.

The local inhomogeneity within three bulk property regions
The successful grouping of the characteristic states from large datasets of CITS in Ni-122 suggests the usage of the K-means clustering analysis as a convenient tool for a statistical comparison of the transition metal substituted Ba(Fe 1−x T x ) 2 As 2 , i.e., Ni-122, Co-122, and Cr-122. Shown in Fig. 3a, d, g are typical large-size STM topographic images of terraces in well-cleaved samples. Using the above K-means clustering method, the spatial distribution, as well as the corresponding principal responses of Ni-122, Co-122, and Cr-122, are presented in Fig. 3b, c, e, f, h, i, respectively. Also, the corresponding principal responses with shaded error bars (spectral distribution plots) are shown in Supplementary Fig. 1. Note that, in addition to SC, in-gap and S-shape states, and L-shape states are observed in all crystals. The L-shape states are presented as yellow curves in Fig. 3c, f, i, a group of line dI/dV spectra in Supplementary Fig. 2 shows the crossover between SC and L-shape state. The dominant domains in Fig. 3b, e, h are the percolated blue areas, which corresponds to the blue curves in Fig. 3c, f, i as SC state in Ni-122 and Co-122, and to a metallic state in Cr-122, respectively, consistent with the bulk physical properties of the samples.
All those samples share a substantial volume of green and yellow areas in the blue matrix, which correspond to the S-shape state (green curves) and L-shape state (yellow curves) in Fig. 3c, f, d, i. In Fig. 3b, e, both superconducting Ni-122 and Co-122 surfaces have brown areas which correspond to the in-gap state (brown curves) in Fig. 3c, f, while in Fig. 3g the in-gap state is not observed on the non-superconducting Cr-122 surface. Although the energy scale of the spectral feature for the S-shape and L-shape states for  Fig. 1a, V Bias = −20 mV and I t = 100 pA, the scale bar represents 6 nm. b STS map at Fermi level (0 meV) and c superconducting gap map from the same area (blue box in (a)), the scale bar represents 3 nm. d, e The line STS spectra along the brown and green arrows in (b). Brown and green circles in (b) and spectra in (d) and (e) outline the non-SC areas. f Three K-means principal responses and g cluster map which shows the spatial distribution of each type of spectra from the same area as (b).
Ni, Co-122 vs. Cr-122 varies slightly, the characteristic features are the same. For the S-shape, there is a highly elevated DOS at Fermi level, and a local minimum at filled state, while for the L-shape there is a much lower DOS at the Fermi level, and a local minimum at empty state. We speculate that the differences in the energy scales might be the result of the influence of the superconducting matrix in Ni-122 and Co-122 which is notably absent in Cr-122. Although the S-shape, L-shape, and in-gap states are immersed in the SC (or metallic for Cr-122) matrix, the spatial distribution of those states is not correlated. Figure 3j shows the area percentages of each principal response in Ni-122, Co-122, and Cr-122 from the three sets cluster maps in Fig. 3. The total volume of the majority domains (SC or metallic) is similar for the three sets, but the volumes of the S-shape and L-shape states show a noticeable difference between the SC (Ni-122 and Co-122) and metallic (Cr-122) compounds. In Cr-122, the percentage of the L-shape state is 2.4 times higher than in Ni-122(Co-122), while the S-shape state is rarely found. Although the relative percentage of S-or L-shape states are different, the total volume of the two states is quite similar in the three compounds, despite the notable differences that Cr-122 is non-SC, Ni-122 is an underdoped SC and Co-122 is an optimally doped SC, coincident with the same amount of hole (Cr 0.04 )/electrons (Ni 0.04 and Co 0.08 ) doped into the three compounds. It is important to note that while the distribution of those states in Co-122 and Cr-122 is quite uniform, Ni-122 shows strong spatial variations. In Ni-122, there are phase segregated areas with an almost pure SC state and areas with four highly mixed electronic states. As shown from the spectral distribution plots (Fig. S1), the overlap among different states is small. Furthermore, fairly large size CITS images are used for the analysis instead of small size ones, leading to better capturing not only the influence of the local inhomogeneity but also the average features of the surface. Figure 3k shows a direct comparison of the average LDOS of the in-gap state in Ni-122 and Co-122 (the corresponding spectral distribution is shown in Supplementary Fig. 3). The in-gap state of Ni-122 samples shows a higher density of states around the Fermi level and superconducting coherence peaks with an asymmetrical suppression. In view of the different forms of the in-gap states in two compounds (Ni-122 and Co-122) and the observation of the zero-energy peak state only in the Ni-122 and Co-122 crystals (never in Cr-122), we conclude that the robust in-gap state in the iron-based 122 samples originates from the Co and Ni dopants, rather than from Fe defects 25 . Included in the Supplemental Information (Supplementary Fig. 4) is density functional theory calculations of the effects of these dopants on the BaFe 2 As 2 DOS, which find a substantial dopant-associated DOS variation even at rather dilute concentrations. While these non-magnetic calculations cannot be directly compared with experimental data from the superconducting state, they are nonetheless suggestive of the ability of even small dopant concentrations to substantially alter materials properties-as the very existence of superconductivity in this material class reflects.

Three electronic states under magnetic field
To reveal the origin of various states, the samples were investigated under a magnetic field applied perpendicular to the cleavage surfaces. Under magnetic field, the superconducting state transforms into the Abrikosov state by forming a vortex structure, where non-superconducting cores are surrounded by superconducting areas. Such a vortex structure can be imaged by spatial STS mapping around the Fermi level, with a higher local density of states bright spots in the cores [28][29][30] . Shown in Fig. 4a-c is the STS maps at Fermi level (zero bias) under a perpendicular magnetic field of 2, 4, and 6 T, respectively. These maps were collected from the same location on the Ni-122 surface. STS curves across a vortex core are plotted in Fig. 4m to demonstrate the spatial evolution of the tunneling conductance. Approaching the core center, the zero-bias conductance increases, and the superconducting coherence peaks are suppressed. Consistent with previous observations from electrondoped 122, no Andreev bound state is observed up to 6 T in the vortices of Ni-122 30  The symmetry of vortex lattices changes dramatically with the increase of the magnetic field. Figure 4d-f shows two-dimensional autocorrelation images calculated from the vortex images in (a)-(c). The vortex forms a weak triangular lattice at 2 T with a six-fold correlation shown in Fig. 4d. At higher fields, the vortex lattice gradually changes to a rectangular shape at 4 T (Fig. 4e) and becomes a more isotropic ring-like structure at 6 T (Fig. 4f). The sixfold symmetry and ring-like pattern can be faintly seen in the two dimensional fast Fourier transformation (FFT) images in Fig. 4g, i, and the rectangular symmetry in the 4 T image is not recognizable in Fig. 4h. The 2D autocorrelation image presents more information in the vortex lattice than the FFT image since the former extracts the spatial correlation among all vortices and so is sensitive to the anisotropy of the features, while the latter decomposes the signal into its harmonic components which is usually applied to ordered lattices. The emergence of a fourfold symmetry on top of sixfold symmetry suggests that the configuration of the vortices is affected by the underlying fourfold crystal lattice. The emergence of the ring-like structure also suggests that the distance correlation among the vortices is stronger than the orientational correlation in Ni-122. The Delaunay triangulation analysis is shown in Fig. 4j-l. The defect vortices are symbolized by blue and red triangles, which have five and seven nearest neighbors rather than six in regular vortex lattice.
It is noteworthy to point out that although the vortex densities for the two compounds are almost the same, the vortex matter for Ni-122 and Co-122 is different. In contrast to the gradual change of the vortex lattice in Ni-122, the vortex lattice shows no change in Co-122 under a magnetic field up to 6 T. This difference is also reflected in the different trends of defect-vortex fractions of the two compounds, as shown in Fig. 4o and Supplementary Fig. 5 in the Supplementary Information. While the vortex matter of Ni-122 is quite similar to LiFeAs 29 , its behavior in Co-122 is more similar to (BaK)Fe 2 As 2 31 . We anticipate that the different vortex matters for Ni-122 and Co-122 relate to the drastically different phase distributions in the two compounds: uniformly scattered S, L, and in-gap states in the Co-122 compound serve as pinning nuclei for stabilizing the hexagonal vortex lattice, consistent with the observation of surface pinning effect in (BaK)Fe 2 As 2 sample 31 . This observation suggests that the inhomogeneous electronic states play an important role in the higher upper critical fields in the FeSC.
The magnetic field influence on all states is summarized in Fig. 5, which shows the result from Co-122 under magnetic field up to 6 T. In this plot, each set of field-dependent spectra is extracted from the same location. The gradually increased zero bias conductance and suppressed superconducting coherence peaks under magnetic field shown in Fig. 5a were discussed in the previous few paragraphs. For the in-gap state, the peak is pinned at the Fermi level even up to 6 Tesla, but the intensity of the peak increases slightly with the magnetic field as shown in Fig. 5b. A similar robust zero-energy bound state was also observed on Fe(Te,Se) 32 , which in that material is caused by interstitial Fe impurities.
For both the S-shape and L-shape states, there is no significant change detected up to 6 T as shown in Fig. 5c, d. These observations exclude observation of the Kondo effect of magnetic moment in metal/superconductor since no splitting was found in the magnetic field-dependent spectra. Although the S-shape and L-shape spectra look similar to the Fe-vacancyinduced bound state found in the K-doped iron selenide 33 , their extremely weak field dependence indicates that either the g-factor in our case is far smaller than 2.1 or that these spectra are from a different origin.

DISCUSSION
The L-shape-like state has been identified as a spin density wave spectrum with the signature features of a large asymmetry with respect to the Fermi level and a large residual DOS at E F 20,23 . This is found both coexisting and competing with SC states in under-and over-doped NaFe 1−x Co x As (Co-111) FeSC. In our current comparison of the 122 system, we further found that (1) the SDW spectrum exists in both electron and hole-doped 122 compounds; (2) the SDW survives even in the optimally doped Co-122 crystals, although the volume is very small (2.3%); (3) the highly asymmetric spectrum results from the usual particle-hole symmetry being tilted toward positive bias, similarly to the positive bias in Co-111 case. These results suggest that the coexistence of local moments and itinerant electrons, as modeled for the Co-111 system 20,23 should also hold for the 122 system: Cooper pairing can occur when portions of the Fermi surface are already gapped by the SDW order. The much higher percentage of the L shape state in Cr-122 offers a hint as to why there is no SC in the Cr-122. Further variable temperature experiments are necessary here to confirm the SDW gap and the transition temperature.
The S shape state was not reported previously. Although the present data set cannot firmly prove the origin of this phase, we believe it is another form of magnetic state, based on its spectral features. The main differences between the S and L shape states are as follows: (1) the asymmetric spectrum is tilted to the negative bias; (2) the Fermi surface residual DOS of the L shape is low, very close to the bottom of the SC gap, but for S shape the Fermi surface residual is much higher (Fig. 3c, f, i); (3) the volume percentage of the S state is lowest in non-SC Cr-122, and highest in the optimally doped Co-122. Notably, from the volumes of the S state of the three compounds, the behavior of the S shape state is more cooperative with the superconducting state, rather than competitive with SC as observed for the L shape state. This abnormal behavior and the highly elevated LDOS at the Fermi level suggest the S-shape state should have the same origin as in the muon spin rotation-based observation of a different component of spin density wave order in Co-122 21,22 and the neutron study of the identification of a shortrange spin-glass state in Ni-122 12 . In the muon spin rotation study, a spatially inhomogeneous magnetic state develops below T c and it has a constructive rather than a competitive relationship with SC near optimally or even overdoped Co-122 samples 21,22 . A follow-up theoretical study explains the distinct magnetic phases using an impurity-induced order which is stabilized by a multiple-Co dopant effect 34 . Future spinpolarized STM studies are essential to further determine the relations between the S and L shape states as well as that of the in-gap state with the superconductivity phase.
In summary, the nanoscale electronic structures of Ba(Fe 1−x T x ) 2 As 2 single crystals in three different phases of optimally doped SC Co-122, coexisting SC and AFM Ni-122, and non-SC Cr-122, are studied with STM/S at 4 K. All these crystals show nanometer-size local electronic inhomogeneities that are unrelated to the surface topography. The total volume of the inhomogeneous areas is similar in the three compounds, coincident with the same amount of a number of electrons (Ni 0.04 and Co 0.08 )/holes (Cr 0.04 ) doped into the three crystals. But the distribution of the inhomogeneous electronic states is different in that they are uniformly distributed all around the sample in nanometer-size clusters in optimally doped Co-122 crystals but more segregated in under-doped Ni-122. Using a K-means clustering statistical method, the local electronic states are categorized as S-shape, L-shape, and in-gap states immersed in the matrix of SC state for Ni-122 and Co-122, and S-shape and L-shape state in the metallic phase for Cr-122. The spatial distribution of S-shape, L-shape, and in-gap states are not correlated. The comparison of vortex structures under different magnetic fields in areas with pure SC state or mixed inhomogeneous areas indicates that the S-shape, L-shape, and in-gap states serve as pinning nuclei for stabilizing the hexagonal vortex lattice. By combining all the observations including the volume fractions of the three states, LDOS, field-dependent behavior, and global properties in the three sets of samples, we confirm the following. Firstly, the in-gap state in SC crystals originates from the magnetic Co/Ni dopants. Secondly, the origin of the L-shape state is an SDW that competes with the SC phase. Thirdly and most compellingly, another form of magnetic order observed in an S-shape state constructively cooperates with the SC phase or serves as an essential element for SC. This research also demonstrates the usage of machine learning to categorize spectra as a powerful approach to analyze a hyperspectral dataset and aid in uncovering out meaningful physics beneath it.

Crystal synthesis and structure characterizations
Single crystals of Ba(Fe 0.92 Co 0.08 ) 2 As 2 , Ba(Fe 0.96 Ni 0.04 ) 2 As 2 , and Ba (Fe 0.96 Cr 0.04 ) 2 As 2 were grown out of self-flux from FeAs and Co (or Ni, Cr) As binaries, a synthesis method similar to our previous reports 24 . Phase purity, crystallinity, and the atomic occupancy of all crystals were checked by collecting Powder X-ray diffraction data on an X'Pert PRO MPD diffractometer (Cu K α1 radiation, λ = 1.540598 Å); The average chemical composition of each crystal was measured with a Hitachi S3400 scanning electron microscope operating at 20 kV, and use of energy-dispersive X-ray spectroscopy.
All crystals were cleaved in ultra-high vacuum (UHV) at~78 K and then immediately transferred to the scanning tunneling microscopy/spectroscopy (STM/S) head which was precooled to 4.2 K without breaking the vacuum. The STM/S experiments were carried out at 2.0 or 4.2 K using a UHV low-temperature and high field scanning tunneling microscope with a base pressure better than 2 × 10 −10 Torr 25 . Pt-Ir tips were mechanically cut then conditioned on clean Au (111) and checked using the topography, surface state, and work function of Au (111) before each measurement. The STM/S were controlled by a SPECS Nanonis control system. Topographic images were acquired in constant current mode with a bias voltage applied to the sample, and tip grounded. All the spectra were obtained using the lock-in technique with modulation of 0.1-1 mV at 973 Hz on the bias voltage. Line spectroscopies and current-imaging-tunnelingspectroscopy were collected over a grid of pixels at a bias range around Fermi level using the same lock-in amplifier parameters. During STM/S measurement, a magnetic field up to 9 T was applied perpendicular to the crystal surfaces.

K-means clustering analysis
The K-means clustering analysis uses an unsupervised learning algorithm, with the goal to find groups in the data, with the number of groups represented by the variable K. K-means method groups a large dataset into components with quintessential characteristics. K-means method itself is a well-developed method in the community. We use the K-means codes from PYCROSCOPY package 27 . Our own software package was developed by utilizing the K-means clustering method to minimize cognitive bias during processing large amounts of dI/dV mapping data (CITS image). More details in the Supplementary Information.

Theoretical calculations
Calculations were performed using the commercially available plane-wave density functional theory-code WIEN2K 35 employing the generalized gradient approximation of Perdew, Burke, and Erzenhof 36 . Convergence of the calculations was carefully checked, both with respect to RKmax (the product of the smallest sphere and largest plane-wave expansion wavevector, here taken as 8.0) and the number of k-points, with 1000 being used in the full Brillouin zone. Spin-orbit coupling was not included, and no internal coordinate relaxation was performed. All calculations used the low-temperature orthorhombic experimental structure of BaFe 2 As 2 by Avci et al. 37 in a 2 × 2 × 1 supercell of this structure, comprising 80 atoms total, including 32 transition metal atoms. Exactly one of these transition metal atoms was substituted by each of the respective dopants Cr, Ni, and Co, with the remaining 31 transition metal atoms being Fe. The calculated densities-of-states were performed on a relatively tight energy grid of 0.3 mRyd (4.08 meV) and a Gaussian smearing parameter of 0.5 mRyd was used. Convergence checks comparing calculated densities of states with 300 and 1000 k-points found scant differences so that the latter number is considered sufficient to describe the properties.

DATA AVAILABILITY
The data sets that support the findings in this study are available from the corresponding author upon request.