## Layer-dependent magnetic phase diagram in FenGeTe2 (3 ≤ n ≤ 7) ultrathin films

### Coexistence of localized and itinerant magnetism in 2D Fe_{3}GeTe_{2}

The atomic configuration of 2D Fe_{3}GeTe_{2} is shown in Fig. 1. Each Fe_{3}GeTe_{2} unit has a thickness of five atomic layers. Clearly, there are two types of Fe atoms with different coordination environments, namely, trivalent iron (Fe^{3+}) and divalent iron (Fe^{2+}). The middle of the 2D Fe_{3}GeTe_{2} is a Fe^{2+}Ge layer, sandwiched by bottom and top Fe^{3+} layers. The entire surface of each Fe^{3+} layer is then covered by an atomic layer of Te. The corresponding ratio of number of Fe^{3+} and Fe^{2+} is 2:1. The 2D Fe_{3}GeTe_{2} is metallic^{13}, as can be seen from both the electronic band structure and the total density of states (TDOS) in Supplementary Note 1. Nonmagnetic (NM), FM, and antiferromagnetic (AFM) states are all considered, to determine their ground spin configurations. The corresponding FM and various AFM configurations are shown in Supplementary Note 2. Our results indicate that 2D Fe_{3}GeTe_{2} has an FM ground state.

In addition to their coordination environment, the Fe^{3+} and Fe^{2+} ions are more accurately distinguished in 2D Fe_{3}GeTe_{2} by their different electronic behaviors, which is confirmed by the charge density distributions and the Bader charge on Fe atoms^{26} (see Supplementary Notes 1 and 4) Electrons are more strongly localized around the Fe^{2+} ions than around the Fe^{3+} sites. The electrons are localized between Fe^{2+} and Ge/Te ions, indicating covalent bonding characteristics. By comparison, more delocalized ionic bonding takes place between Fe^{3+} and Ge/Te ions. This difference between localized and delocalized electron distributions around the Fe^{3+} and Fe^{2+} ions is also supported by deformation charge density analysis and Bader charge (see Supplementary Fig. 2 and Note 4). There is a net charge transfer of about 0.4 electron from each Fe^{3+} ion to its surrounding Ge/Te ions. However, there is no evident charge transfer in the case of Fe^{2+} ions. Following this picture, we find that the Fe^{2+} ions are localized relative to the Fe^{3+} ions in 2D Fe_{3}GeTe_{2}, which is consistent with a previous report by ref. ^{27}. The coexistence of localized and itinerant magnetism has also been found in iron-based superconductors and double perovskite materials, such as LaOFeAs, Sr_{2}FeMoO_{6}, and La_{1−x}Sr_{x}MO_{3} (M = Mn and Co)^{28,29,30,31}, all of which are polyvalent materials.

The partial density of states (PDOS) can provide further clarification of the origin of different electronic and magnetic features in Fe^{3+} and Fe^{2+} ions of 2D Fe_{3}GeTe_{2}, which are shown in Supplementary Note 1. Under a hexagonal crystal field, the five 3*d* orbitals of the Fe atom split into a single state a_{1} (\({d}_{{z}^{2}}\)), two twofold-degenerate states e_{1} (\({d}_{{x}^{2}-{y}^{2}}\)/*d*_{xy}) and e_{2} (*d*_{xz}/*d*_{yz}). From the PDOS of Fe atoms, one can see that the \({d}_{{z}^{2}}\) orbital is clearly narrower and sharper than the other 3*d* orbitals, suggesting a localized feature. However, it is also obvious that the \({d}_{{x}^{2}-{y}^{2}}\), *d*_{xy}, *d*_{xz}, and *d*_{yz} orbitals in the minority-spin channels are obviously wide and are hybridized with Ge/Te-*p* states, indicating a delocalized feature. Similar to LaOFeAs, the localized *d* electrons differ from the itinerant electrons in coming from more isolated \({d}_{{z}^{2}}\) orbitals^{28}. Moreover, the 3*d* bands of the majority spin for both Fe^{3+} and Fe^{2+} ions are fully occupied, while those of the minority spin are partially occupied.

Based on the occupation matrix, the electron occupation numbers of the \({d}_{{z}^{2}}\), \({d}_{{x}^{2}-{y}^{2}}\), *d*_{xy}, *d*_{xz}, and *d*_{yz} orbitals of Fe_{n}GeTe ultrathin films are listed in Supplementary Note 4, which further confirms the valance states of Fe ions. The main difference between Fe^{3+} and Fe^{2+} ions in terms of the PDOS is due to the \({d}_{{z}^{2}}\) and *d*_{xz}/*d*_{yz} states in the minority-spin channels. Specifically, the electron occupation numbers in the minority \({d}_{{z}^{2}}\) orbitals are 0.04 and 0.30 for Fe^{3+} and Fe^{2+} ions, respectively. That is to say, the Fe^{2+} ion has ~0.3 more electrons than Fe^{3+} ion to occupy the minority \({d}_{{z}^{2}}\) orbital. The occupied minority \({d}_{{z}^{2}}\) orbital results in the Fe^{2+} ion being more localized than the Fe^{3+} ion. In addition, compared with the Fe^{2+} ion, the energy level of the minority *d*_{xz}/*d*_{yz} state of the Fe^{3+} ion will shift to lower energy. The corresponding number of occupied minority *d*_{xz}/*d*_{yz} states increases from 0.35 to 0.54. Therefore, the resulting calculated net magnetic moments are 3.0 *μ*_{B} and 2.6 *μ*_{B} for Fe^{3+} and Fe^{2+} ions, respectively. Similar to Fe ion in Li_{3}FeN_{3}, (PMe_{3})_{2}FeCl_{3} and FePc/Ti_{3}C_{2}T_{x} compounds^{32,33,34}, the magnetic moments values may suggest that both Fe^{3+} and Fe^{2+} ions are probably in their intermediate spin states. The intermediate-spin state can become the ground states of the system due to the relative stability of the ligand hole states that it hybridizes with ref. ^{35} A density functional theory (DFT) calculation by Zhu et al.^{36} gave similar values of 2.5 *μ*_{B} and 1.6 *μ*_{B} for the magnetic moments of Fe^{3+} and Fe^{2+} ions, respectively, in bulk Fe_{3}GeTe_{2}. The localized a_{1} and delocalized e_{1}/e_{2} states result in the unique magnetic properties of 2D Fe_{3}GeTe_{2}, with coexistence of local and itinerant magnetism, consistent with a previous report by ref. ^{25}

### Magnetic coupling mechanism of 2D Fe_{3}GeTe_{2}

Because of the coexistence of localized and itinerant magnetism, the magnetic behavior of metallic ferromagnetic Fe_{3}GeTe_{2} will deviate from the itinerant Stoner model. The recent experiment by Yang et al.^{25} indeed confirmed that metallic Fe_{3}GeTe_{2} exhibits non-Stoner ferromagnetism. Yang et al. did not observe any considerable change in electronic structure with temperature, which is not consistent with expectations. According to the itinerant Stoner model, a ferromagnetic metal will exhibit a temperature-dependent exchange splitting that disappears above *T*_{C}^{25}. Moreover, Tovar et al.^{29} used a corrected Stoner parameter to describe the magnetic behaver in polyvalent Sr_{2}FeMoO_{6} and found evidence for the coexistence of localized and itinerant magnetism in this material too. The corrections for Landau diamagnetism to the Stoner parameter need to derived from experimental measurements^{29}. Therefore, we need a new model to describe the complicated ferromagnetism in Fe_{3}GeTe_{2} systems.

In this paper, two main magnetic exchange mechanisms have been introduced in 2D Fe_{3}GeTe_{2}, namely, the itinerant magnetism between e_{1} and e_{2} electrons and the localized magnetism in a_{1} spins. Therefore, we propose a multipath magnetic interaction mechanism to understand the localized magnetic exchange in 2D Fe_{3}GeTe_{2}. According to the splitting of Fe^{2+} and Fe^{3+} orbitals in the crystal field and the multilayer structure of 2D Fe_{3}GeTe_{2}, three possible exchange paths are considered. Figure 2 shows the exchange paths between unoccupied \({d}_{{z}^{2}}\) orbitals (Fe^{3+}–Fe^{3+}), between occupied \({d}_{{z}^{2}}\) orbitals (Fe^{2+}–Fe^{2+}), and from an unoccupied to an occupied \({d}_{{z}^{2}}\) orbital (Fe^{2+}–Fe^{3+}), respectively. The hopping from an occupied Fe-\({d}_{{z}^{2}}\) orbital to an unoccupied Fe-\({d}_{{z}^{2}}\) orbitals induces extremely strong FM coupling (path *P*_{1}), which occurs between magnetic ions in different oxidation states, i.e., double exchange^{37}. Double exchange plays an essential role in polyvalent ferromagnetic materials such as La_{1−x}Sr_{x}MnO_{3} that also exhibit both localized and itinerant magnetism^{38}. However, spin crossover between both unpaired Fe-\({d}_{{z}^{2}}\) orbitals (path *P*_{2}) and paired Fe-\({d}_{{z}^{2}}\) orbitals (path *P*_{3}) gives rise to an AFM interaction according to the Pauli exclusion principle. On the other hand, the non-spin-polarized PDOS (see Supplementary Note 1) shows that *d*_{xz}/*d*_{yz} and \({d}_{{x}^{2}-{y}^{2}}\)/*d*_{xy} are mainly contributed at the Fermi level, and their lower kinetic energy makes them contribute to the itinerant ferromagnetism in 2D Fe_{3}GeTe_{2}. Therefore, the interaction between itinerant electrons in e_{1} states favors intralayer FM (*I*_{1}), while the coupling between electrons in e_{2} states favors interlayer FM (*I*_{2}). Of these, the intralayer FM is contributed only by itinerant electrons (*I*_{1}), but there is competition between interlayer FM (*P*_{1} and *I*_{2}) and AFM (*P*_{2} and *P*_{3}) coupling. This explains why there is some debate regarding Fe atoms behaving ferromagnetically or antiferromagnetically in Fe_{3}GeTe_{2}^{39}. Moreover, Fu et al.^{40} have also found that the coexistence of localized and itinerant 3*d* electrons in BiFeO_{3}/SrTiO_{3} superlattices and itinerant Fe-3*d* electrons tends to cause ferromagnetism.

A local Heisenberg model can provide a good description of the FM ordering in the Fe_{3}GeTe_{2} system^{14}. In 2D Fe_{3}GeTe_{2}, there are three types of exchange interaction between Fe ions, corresponding to the first, second, and third nearest neighbor magnetic exchange constants *J*_{1}, *J*_{2}, and *J*_{3}, as shown in Fig. 2. The values of *J*_{1}, *J*_{2}, and *J*_{3} for 2D Fe_{3}GeTe_{2} can be extracted from the total energy difference between different spin orderings. As summarized in Table 1, the derived exchange interaction parameters are *J*_{1} = −0.44 meV, *J*_{2} = 3.27 meV, and *J*_{3} = 0.47 meV. It is known that a positive *J* value favors FM ordering, while a negative *J* value favors AFM coupling. Therefore, the calculated *J*_{1} of −0.44 meV yields weak AFM coupling, which occurs mainly through the path *P*_{2}. The path *P*_{1} corresponds to strong FM coupling, with *J*_{2} having a value of 3.27 meV. Moreover, itinerant magnetism (*I*_{1} and *I*_{2}) gives a value of 0.47 meV for *J*_{3}, corresponding to long-range intralayer FM coupling. The coincidence between the magnetic interaction parameters and the effect of coexisting localized and itinerant magnetism suggests that our proposed magnetic interaction mechanism is valid for understanding the magnetic ground state of 2D Fe_{3}GeTe_{2}. Its validity is also verified by other theoretical results. For example, first-principles calculations by Hu et al.^{41} have shown that the stability of ferromagnetism can be greatly enhanced by tensile strain in Fe_{3}GeTe_{2} monolayer. According to our picture, tensile strain will shorten the Fe^{3+}–Fe^{2+} distance (*P*_{1} path) but lengthen the other interatomic distances, which in turn will enhance FM double exchange between Fe^{3+} and Fe^{2+} ions.

MAE as an important parameter of ferromagnets counteracts thermal fluctuations and preserves long-range FM ordering^{42}. From noncollinear calculations with inclusion of the spin–orbit coupling (SOC) effect, the MAE of 2D Fe_{3}GeTe_{2} has been determined as 0.94 meV/Fe, favoring perpendicular anisotropy, whereas the previously reported value was 0.67 meV/Fe^{14}. For comparison, the MAE of 2.5 meV/Fe in bulk Fe_{3}GeTe_{2} is slightly higher. The physical origin of a positive MAE can be ascribed to the matrix element differences between the occupied and unoccupied spin-down *d* orbitals of the Fe atom^{43}. For the contributions from *d* electrons, all nonvanishing matrix elements will make nonnegligible contributions to the MAE. In a simple analysis, the matrix elements that are near the Fermi level in spin-down states are most important to the MAE. According to Eq. (4) in the Methods section, the contribution to MAE is dominated by the coupling of \(\left\langle {xz},|,{L}_{z},|,{yz}\right\rangle\) and \(\left\langle {xz},{yz},|,{L}_{x},|,{z}^{2}\right\rangle\). Owing to the degeneracy of the *d*_{xz} and *d*_{yz} orbitals, we consider mainly the coupling between \({d}_{{z}^{2}}\) and *d*_{xz}/*d*_{yz} orbitals. Roughly speaking, the positive contributions to the total MAE originate mainly from unoccupied \({d}_{{z}^{2}}\) orbitals and half-occupied *d*_{xz}/*d*_{yz} orbitals of Fe^{3+} ions, while the coupling of occupied \({d}_{{z}^{2}}\) and unoccupied *d*_{xz}/*d*_{yz} orbitals of Fe^{2+} ions make a negative contribution to the MAE. Such a mechanism also accounts for the variation in MAE for Fe_{3}GeTe_{2} monolayer when the Fe^{3+} content is decreased by hole doping, as observed by Park et al.^{44}.

An experimental study by Hwang et al.^{45} found AFM coupling between pristine Fe_{3}GeTe_{2} layer and oxidized Fe_{3}GeTe_{2} layers. Their DFT calculations further revealed that such AFM coupling mainly originates from the oxygen atoms located at the bilayer interface, while bilayer Fe_{3}GeTe_{2} with oxygen atoms adsorbed on the top or bottom sites still preferentially exhibit an FM state. According to our localized Fe–Fe exchange model, the intermediate oxygen atoms could provide an oxygen-mediated *P*_{2} path between two Fe_{3}GeTe_{2} layers, thereby inducing AFM coupling. Dai et al.^{24} reported a pressure-dependent phase diagram of Fe_{3}GeTe_{2} thin flakes, with a magnetic transformation temperature from ferromagnetic to paramagnetic states of 203 K at 3.7 GPa and 163 K at 7.3 GPa. Moreover, the *T*_{C} showed a clear decreasing trend from 4.0 GPa to 7.3 GPa because of the reduced local magnetic moment and increased electronic itinerancy. On the one hand, the increased electronic itinerancy could weaken the localized double exchange (*P*_{1} path). On the other hand, by analyzing structural characteristics, we found that the Fe^{3+}–Te distance clearly decreases at pressures below 7 GPa. The corresponding Fe^{3+}–Fe^{3+} exchange though the Te-mediated *P*_{2} path is stronger. As a consequence of the weakened FM coupling and enhanced AFM coupling, *T*_{C} is drastically reduced. In particular, the gate-tunable electrons sequentially fill the sub-band origin from the Fe-\({d}_{{z}^{2}}\), *d*_{xz}, and *d*_{yz} orbitals, inducing room-temperature ferromagnetism in Fe_{3}GeTe_{2}^{14}. The value of *T*_{C} depends mainly on the interaction between \({d}_{{z}^{2}}\), *d*_{xz}, and *d*_{yz} orbitals, consistent with our previous discussion. Moreover, the transition from itinerant to localized magnetism increases *T*_{C}, indicating that the FM coupling in Fe_{3}GeTe_{2} comes mainly from localized double exchange (*P*_{1} path).

### Structure and magnetic behavior of Fe_{n}GeTe_{2} ultrathin films

The above discussions on the one hand again demonstrate the coexistence of itinerant and localized magnetism in the Fe_{3}GeTe_{2} system. On the other hand, the interlayer competition between localized exchange coupling (paths *P*_{1}, *P*_{2}, and *P*_{3}) and itinerant electrons (*I*_{1} and *I*_{2}) is also crucial in determining the nature of the magnetic ground states and the values of the Curie temperature and MAE of 2D Fe_{3}GeTe_{2}. Moreover, *T*_{C} has been found to increase from 143 K to 226 K when the Fe content is increased from 2.75 to 3.10 in bulk Fe_{3−x}GeTe_{2}^{46}, indicating that *T*_{C} is very sensitive to Fe content. These findings motivate us to explore new high-temperature Fe–Ge–Te systems with optimal Fe^{2+}/Fe^{3+} ratio and thickness, in which the valences of Fe ions are related to the direction of MAE and the competition between localized and itinerant magnetism in the Fe_{n}GeTe_{2} system. To satisfy these requirements, we have designed a series of Fe-rich Fe_{n}GeTe_{2} (4 ≤ *n* ≤ 7) ultrathin films with various thicknesses (Fig. 1), which could exhibit abundant magnetism through more complicated competition between itinerant and localized magnetism in a multilayer structure. Similar to 2D Fe_{3}GeTe_{2}, these Fe_{n}GeTe_{2} ultrathin films also belong to the *P-*3*m*1 space group. The effective thicknesses (Table 1) of Fe_{4}GeTe_{2}, Fe_{5}GeTe_{2}, Fe_{6}GeTe_{2}, and Fe_{7}GeTe_{2} ultrathin films are 5.63 Å, 6.79 Å, 7.56 Å, and 8.73 Å, respectively, which are moderately larger than that of Fe_{3}GeTe_{2} (5.14 Å). The atomic arrangements of Fe_{n}GeTe_{2} ultrathin films can be regarded as six, seven, eight, and nine atomic layered thickness (001) surfaces of a Te-substituted Fe_{7}Ge_{4} crystal^{47}. Fortunately, the atomic arrangement of a five atomic layered thickness Te-substituted Fe_{7}Ge_{4} crystal is the same as that of the experimentally reported Fe_{3}GeTe_{2} phase.

To further check the experimentally feasibility of Fe_{n}GeTe_{2}, we have calculated their formation energies, defined as

$${E}_{{{{{{\rm{f}}}}}}}=[E({{{{{{\rm{Fe}}}}}}}_{n}{{{{{{\rm{GeTe}}}}}}}_{2})-E({{{{{{\rm{Fe}}}}}}}_{2}{{{{{\rm{Ge}}}}}})-E({{{{{{\rm{Te}}}}}}}_{2})-({{{{{\rm{n}}}}}}-2)E({{{{{\rm{Fe}}}}}})]/n,$$

(1)

where *E*(Fe_{n}GeTe_{2}) is the total energy of the 2D Fe_{n}GeTe_{2} compound, and *E*(Fe_{2}Ge), *E*(Te_{2}), and *E*(Fe) are the total energies of Fe_{2}Ge, Te, and Fe in their most stable bulk phases^{48}. The formation energies of four Fe_{n}GeTe_{2} ultrathin films from our theoretical design are −0.03 eV/atom (*n* = 4), −0.11 eV/atom (*n* = 5), −0.05 eV/atom (*n* = 6), and −0.01 eV/atom (*n* = 7), which are comparable to the formation energy of −0.08 eV/atom for Fe_{3}GeTe_{2}. All these negative values indicate that the formation processes are exothermic. More importantly, we find that the total energy of our proposed Fe_{5}GeTe_{2} ultrathin film is 0.24 eV per atom lower than that of the experimentally reported layered phase with the same stoichiometry^{16}. It should be noted, however, that our DFT simulation results only mean that our proposed Fe_{5}GeTe_{2} ultrathin film is energetically favorable than the experimentally reported one at 0 K. Anyway, the satisfactory stability of these Fe_{n}GeTe_{2} ultrathin film implies that they are feasible from a theoretical point of view.

It is noteworthy that ultrathin films of Cr_{2}S_{3}, CrSe, and FeTe in a FM state have been synthesized by chemical vapor deposition and molecular beam epitaxy methods in previous experiments^{11,12,49}. Therefore, we have proposed that our predicted Fe_{n}GeTe_{2} films could be grown on the surface of hexagonal Si phase. The calculated lattice mismatches between Si(001) and (5 × 5) Fe_{n}GeTe_{2} superlattices are 0.5%, 3.7%, 0.7%, and 1.1% for Fe_{4}GeTe_{2}, Fe_{5}GeTe_{2}, Fe_{6}GeTe_{2}, and Fe_{7}GeTe_{2}, respectively. The optimized structures of Fe_{n}GeTe_{2}/Si (001) heterostructures are shown in Supplementary Note 3. Evidently, the lattice misfit due to the Si substrate does not cause noticeable structural distortion in 2D Fe_{n}GeTe_{2} superlattices.

We further discuss the electronic and magnetic properties of the proposed Fe_{n}GeTe_{2} ultrathin films. Similar to 2D Fe_{3}GeTe_{2}, all the Fe_{n}GeTe_{2} systems are metallic, as can be seen from the electronic band structures in Supplementary Fig. 6. The orbital projected densities of states in Supplementary Fig. 7 demonstrate that the metallicity still originates from *d* orbitals of Fe atoms. The coexistence of itinerant and localized *d* electrons in Fe_{n}GeTe_{2} (3 ≤ *n* ≤ 7) can be revealed by the Bader charge (see Supplementary Note 4) and the PDOS. The distributions of Fe^{2+} and Fe^{3+} ions vary with the thickness and composition of the 2D Fe_{n}GeTe_{2} ultrathin films. With increasing Fe content, the Fe^{2+}/Fe^{3+} (*x*) ratio is 0.5, 1.0, 0, 0.2, and 0.75 for *n* = 3, 4, 5, 6, and 7, respectively, which correspond to a progressive change in magnetic behavior from itinerant to localized. To investigate the ground states of Fe_{n}GeTe_{2} ultrathin films, we consider FM and various AFM configurations (see Supplementary Fig. 8). Owing to the multilayer structure, the considered AFM configurations increase with increasing Fe content. From our DFT calculations, FM ordering in all Fe_{n}GeTe_{2} systems is more favored than its AFM or NM counterparts. The magnetic moment as a function of *x* is plotted in Fig. 3a. With increasing Fe^{2+}/Fe^{3+} ratio, the average magnetic moment per Fe atom decreases slightly from 3.18 *μ*_{B} for *x* = 0 to 2.73 *μ*_{B} for *x* = 1. This observation can be easily understood on the basis that Fe^{3+} ions contribute a larger magnetic moment than Fe^{2+} ions.

Because the *T*_{C} in Fe_{n}GeTe_{2} systems is determined mainly by localized double exchange, we consider the exchange parameters *J* of Fe_{n}GeTe_{2} ultrathin films that are presented in Table 1 and Supplementary Note 5. Meanwhile, the long-range magnetic coupling with exchange parameter *J* = 5 instead of *J* = 3 is considered for Fe_{n}GeTe_{2} (*n* = 5–7) with increasing Fe content (see Supplementary Note 5). For Fe^{2+}/Fe^{3+} ratios up to 0.5, the magnitude and sign of the coupling are insensitive to the distance between magnetic ion pairs, and there obviously exists competition between localized and itinerant magnetism. As the Fe^{2+}/Fe^{3+} ratio is increased further, localized magnetic exchange becomes dominant, and the magnitude decreases with the distance between Fe ions. Meanwhile, the variations in *J*_{1}, *J*_{2}, and *J*_{3} can also be interpreted in terms of the magnetic interaction mechanism, as has earlier been established for 2D Fe_{3}GeTe_{2}.

To further clarify the magnetic ground states of 2D Fe_{n}GeTe_{2} ultrathin films, the relationship between the exchange-path-dependent parameters *J*_{1}, *J*_{2}, and *J*_{3} and the Fe^{2+}/Fe^{3+} ratio *x* is displayed in Fig. 3b, from which we can deduce several arguments. First, because the exchanges through \({d}_{{z}^{2}}\) and *d*_{xz}/*d*_{yz} orbitals are dominant in multilayer structures, the interlayer localized \({d}_{{z}^{2}}\) orbital interactions (*P*_{1}, *P*_{2}, and *P*_{3} paths) and the itinerant electron coupling of *d*_{xz}/*d*_{yz} orbitals (*I*_{2}) are stronger than the intralayer interactions (*I*_{1} path) in Fe_{n}GeTe_{2} systems. Second, for all the Fe_{n}GeTe_{2} systems considered here, the dominant *J* parameter for FM coupling comes mainly from double exchange of localized \({d}_{{z}^{2}}\) orbitals (*P*_{1} path) and coupling of itinerant electrons in *d*_{xz}/*d*_{yz} orbitals (*I*_{2}). However, the major *J* parameter for AFM ordering comes mainly from coupling between localized \({d}_{{z}^{2}}\) orbitals in Fe^{3+}–Fe^{3+} and Fe^{2+}–Fe^{2+} exchange (*P*_{2} and *P*_{3} paths). Therefore, the competition between interlayer AFM and FM coupling results from that between itinerant and localized magnetism in Fe^{2+}–Fe^{2+} or Fe^{3+}–Fe^{3+} coupling. In an Fe_{5}GeTe_{2} ultrathin film, when the distance between interlayer Fe layers is shorter, the localized magnetic exchange through the *P*_{2} path can compete with itinerant e_{2} electrons. However, the itinerant e_{2} electrons become dominant as the Fe–Fe distance increases, such that the value of *J*_{4} becomes 5.9 meV. Subsequently, the itinerant magnetism weakens as the Fe–Fe distance continues to increase, with the value of *J*_{5} becoming 0.1 meV. Two competing ferromagnetisms of localized and itinerant are responsible for these complicated behaviors of the magnetic exchange parameters. As the Fe^{2+}/Fe^{3+} ratio increases, the itinerant behavior of *d* orbitals is weakened. That is to say, more localized *P*_{1}**/***P*_{3} paths (FM/AFM) and fewer *I*_{2} (FM) appear. Therefore, there is no simple trend of variation of the *J* parameters.

The MAE values for all the Fe_{n}GeTe_{2} ultrathin films with different Fe^{2+}/Fe^{3+} ratios are also shown in Fig. 3a. One can see that MAE first increases from 0.91 meV/Fe atom for *x* = 0 (Fe_{5}GeTe_{2}) to 1.05 meV/Fe atom for *x* = 0.2 (Fe_{6}GeTe_{2}). Then, it decreases almost monotonically with increasing Fe^{2+}/Fe^{3+} ratio in the mixed-valence Fe_{n}GeTe_{2} compounds. As *x* further increases to 1, the easy axis flips from a perpendicular into an in-plane orientation. The amplitude and direction of magnetic anisotropy are affected by two competing factors simultaneously. One is the Fe^{2+}/Fe^{3+} ratio. As we have discussed with regard to 2D Fe_{3}GeTe_{2}, the Fe^{3+} and Fe^{2+} ions contribute to positive and negative MAE, respectively. Another important factor is the interaction between \({d}_{{z}^{2}}\) and *d*_{xz}/*d*_{yz} orbitals, since the electronic band structures reveal that the spin-minority components of these orbitals are affected by SOC associated with the inserted Fe layers. To further unveil the origin of MAE enhancement from Fe_{5}GeTe_{2} to Fe_{6}GeTe_{2}, we decompose the MAE into the coupling of \({d}_{{z}^{2}}\) and *d*_{xz}/*d*_{yz} pairs by Eq. (4) (see Supplementary Fig. 10). When the Fe^{2+}/Fe^{3+} ratio is 0 (Fe_{5}GeTe_{2}), there exist only positive contributions of occupied *d*_{xz}/*d*_{yz} and unoccupied \({d}_{{z}^{2}}\) pairs, with a difference in orbital energy levels of about 4.08 eV, leading to an out-of-plane MAE of 0.91 meV/Fe atom. When the Fe^{2+}/Fe^{3+} ratio is increased from 0 (Fe_{5}GeTe_{2}) to 0.2 (Fe_{6}GeTe_{2}), the energy level differences between occupied *d*_{xz}/*d*_{yz} and unoccupied \({d}_{{z}^{2}}\) pairs and unoccupied *d*_{xz}/*d*_{yz} and occupied \({d}_{{z}^{2}}\) pairs become 3.79 and 4.65 eV, respectively. Therefore, for the occupied *d*_{xz}/*d*_{yz} and unoccupied \({d}_{{z}^{2}}\) pairs, the positive contributions to MAE prevail over the negative contributions.

Based on the obtained magnetic exchange constants and MAE, the Curie temperature of Fe_{n}GeTe_{2} is estimated using the 2D Heisenberg model, as shown in Fig. 4a. We have also simulated the *M*–*T* curves for every Fe sublattice (see Supplementary Fig. 11). The obtained *T*_{C} value of 138 K for 2D Fe_{3}GeTe_{2} coincides well with previous experimental values of about 68–130 K^{13,14}. The temperature-dependent magnetic moments (i.e., *M–T* curves) for each type of Fe ion (Fe^{3+} and Fe^{2+}) in Fe_{3}GeTe_{2} compounds are also presented in Supplementary Fig. 11a. One can see that the magnetizations of both Fe^{3+} and Fe^{2+} sublattices indeed behave like ferromagnets. Additionally, the estimated *T*_{C} for bulk Fe_{3}GeTe_{2} crystal is 280 K (see Supplementary Note 5), which is also comparable to the experimental value of 230 K^{27}.

For various stoichiometries, three kinds of *M–T* curves are observed. Similar to Fe_{3}GeTe_{2}, Fe_{4}GeTe_{2} is also a true ferromagnet. The magnetic spin moments of all Fe atoms align in the same direction, and they decrease with increasing temperature, yielding a *T*_{C} value of 68 K. One should note that this *T*_{C} is significantly lower than the experimentally reported one (270 K), owing to differences in thickness and symmetry^{15}. For Fe_{5}GeTe_{2}, the magnetic moment continues to increase with temperature, and full compensation is not observed anywhere in the entire temperature range. The maximum in spontaneous magnetization appears between 0 K and *T*_{C} (320 K). For each Fe sublattice, the Fe_{1} and Fe_{5} layers are thermally disturbed more easily, and their magnetic moments decrease almost linearly with increasing temperature, while the other three layers (Fe_{2}, Fe_{3}, and Fe_{4}) drastically decrease around 320 K. The correlation here between magnetization and temperature is characteristic of a Néel’s P-type ferrimagnet^{50}. The ferrimagnetic (FiM)-to-paramagnetic transition occurs at a critical temperature *T*_{C} = 320 K. Such complicated magnetic behavior of Fe_{5}GeTe_{2} has also been discussed in previous papers. For example, Ramesh et al.^{51} found that the Fe_{5−x}GeTe_{2} system exhibited a temperature-dependent FM-to-FiM phase transition, and existed glassy cluster behavior at low temperature. Li et al.^{22} performed spin dynamics simulations of Fe_{5}GeTe_{2}, the results of which support the existence of the magnetic transition but not that of a spin glass state. Compared with 2D Fe_{5−x}GeTe_{2}, Fe_{6}GeTe_{2} and Fe_{7}GeTe_{2} sheets exhibit a relatively rapid decline in magnetization within an intermediate range of temperatures, showing the characteristics of a Néel’s R-type ferrimagnet. From a careful analysis of the spin coupling strength, we speculate that the main feature distinguishing FiM Fe_{5}GeTe_{2} from Fe_{6}GeTe_{2} and Fe_{7}GeTe_{2} is the existence of a frustration effect. In this situation, the magnetic moments of Fe_{5}GeTe_{2} will be more sensitive to the thermal fluctuations induced by temperature.

The *M–T* curves exhibit monotonic decreases with increasing temperature. For the Fe sublattices of Fe_{6}GeTe_{2}, the spin moments of the Fe_{1}, Fe_{3}, Fe_{4}, Fe_{5}, and Fe_{6} layers and those of the Fe_{2} layers show opposite directions, although all the moments decrease with temperature. For the *M–T* curves of 2D Fe_{7}GeTe_{2}, the spin directions of the Fe_{2}, Fe_{4}, and Fe_{5} layers and those of the Fe_{1}, Fe_{3}, Fe_{6}, and Fe_{7} layers are opposite. The FiM-to-paramagnetic transition occurs at a *T*_{C} of 570 K. The Néel’s R- and P-type magnetization profiles seen here have also been reported in mixed-valence complex alloys (Mn_{1.5}FeV_{0.5}Al^{52} and Mn_{2}V_{0.5}C_{0.5}Z^{53}), complex oxides (NiCo_{2}O_{4}^{54}), layered materials (AFe^{II}Fe^{III}(C_{2}O_{4})_{3}^{55}) and core–shell nanoparticles^{56}. The competition between interlayer AFM and FM coupling resulting in the transition from FM to FiM states in Fe_{n}GeTe_{2} is derived from the coexistence of different electronic states.

The simulated values of *T*_{C} are 138 K for Fe_{3}GeTe_{2}, 68 K for Fe_{4}GeTe_{2}, 320 K for Fe_{5}GeTe_{2}, 450 K for Fe_{6}GeTe_{2}, and 570 K for Fe_{7}GeTe_{2}. For truly FM systems, *T*_{C} drops from 138 K for Fe_{3}GeTe_{2} to 68 K for Fe_{4}GeTe_{2} because of the flipping of out-of-plane MAE brought about by the increased ratio of Fe^{2+} ions. Further increases in Fe content lead to a transition of magnetic ordering from FM to FiM at Fe_{5}GeTe_{2}. For *n* ≥ 5, the *T*_{C} of the FiM Fe_{n}GeTe_{2} film increases with *n*, mainly owing to the higher MAE and stronger double exchange. A similar trend has also been observed in FM Fe_{3−x}Cr_{x}Ge and Fe_{3−x}V_{x}Ge alloys^{57,58}. Extrapolating to even thicker films, Fe_{n}GeTe_{2} with *n* = 9 and an effective thickness of 14 Å yields a *T*_{C} = 1006 K, which is comparable to the *T*_{C} = 1043 K for pure Fe solid of bcc phase^{15} (see Supplementary Fig. 13).

To provide a more general view of the composition and dimensional effects on the magnetic behavior of Fe–Ge–Te systems, we plot a ternary phase diagram of *T*_{C} for various reported Fe-based compounds (Fig. 4b). In the three-dimensional (3D) compounds, the *T*_{C} of Fe-rich compositions increases monotonically from 279 K for FeGe^{59} to 485 K for Fe_{2}Ge^{60}, and then to 1043 K for pure Fe^{15}, revealing a prominent composition effect. In the 2D Fe–Ge–Te films, *T*_{C} is determined by a combination of composition and dimensional effects. Generally speaking, incorporation of Fe atoms into the system will increase *T*_{C}. For example, Fe doping generates long-range spin ordering in GeTe films, and the *T*_{C} of Fe_{0.18}Ge_{0.82}Te films is 100 K^{61}. The *T*_{C} of our Fe_{3}GeTe_{2} with an effective thickness of 0.86 nm (138 K) is lower than that of an FeTe ultrathin film with thickness 2.80 nm (*T*_{C} = 220 K)^{12}, even with the same Fe content. Moreover, the *T*_{C} of Fe_{6}GeTe_{2} (450 K) is slightly lower than that of the bulk Fe_{2}Ge phase (*T*_{C} = 485 K). Both of them have an Fe content of 0.67. However, the role of nonmetal element (Ge and Te) inclusions in ultrathin Fe–Ge–Te films is very complicated. These inclusions can not only tune the chemical valence state and the electronic behavior of the variable element Fe, but also provide a crystal field to control the MAE, which will change the magnetic behavior and *T*_{C}.