1 Introduction

Polycrystalline ferrites are determined to be the ideal auxiliary materials for extremely high recurrence circuits, due to their attractive electrical properties. They are more stable than other contending materials as they can satisfy a scope of utilizations in radio recurrence circuits, working gadgets, transformer centers, brilliant channels, stifle curls, information stockpiling gadgets, clamor channels, recording heads, reception apparatuses, read/compose for rapid advanced tape, and loop centers.[1] Numerous physical properties of ferrites depend on the microstructure, porosity, grain size, and the cation distribution of these materials.[2,3]

In recent years, MgFe2O4 has been identified as a spinel n-type semiconducting ferrite, which has been extensively studied for various applications such as in photoelectrochemical water splitting,[4] hydrogen production,[5] sensors,[6] drug delivery,[7] magnetic hyperthermia,[8] batteries,[9] supercapacitors,[10] removal of contaminants,[11] and biodiesel.[12] Spinels are characterized using the following general formula: AB2O4, crystal structure: cubic, and space group: \( Fd\bar{3}m \). Each unit cell consists of 8 formula units, 32 O anions in close packing cubic configuration, and 24 cations. Spinels can be classified as either normal or inverse, i.e., according to the occupation of metal ions on the tetrahedral and the octahedral sites. In the normal spinel, A cations occupy the tetrahedral sites and B cations occupy the octahedral sites, while in the inverse spinel, A cations occupy the octahedral sites and B cations are distributed equally on both the tetrahedral and octahedral sites.[13]

Most experimental and theoretical studies on spinel MgFe2O4 have focused on the perfect crystal. Vacancy defects have been found to have a significant effect on the electronic and geometric structures of crystalline materials, thereby resulting in the changes in their physical properties. Yao et al.[13] have studied the effect of vacancies on the geometric and electronic structure of ZnFe2O4. They reported that the vacancy defects have converted the properties of normal spinel ZnFe2O4 from semiconducting to metallic. MgFe2O4 ferrites can be used as a rapid gas sensor toward alcohol vapor particles.[14,15] Liu et al.[16] have prepared magnesium ferrite nanoparticles and explored their gas-detecting properties toward H2S, CH4, ethanol, and LPG vapors. Ponpandian and Narayanasamy[17] showed that oxygen vacancies that are fabricated via high-energy ball milling have a considerable effect on the electrical properties of nanocrystalline ZnFe2O4.

In this work, first-principles calculations using the generalized gradient approximation (GGA) and Hubbard-U methods were performed in order to examine the ground state electronic structures of normal spinel MgFe2O4 with vacancy defects (Mg-vacancy, Fe-vacancy, and O-vacancy). Our study on the vacancy defects is essential because the preparation of high crystallinity and purity MgFe2O4 samples is found to be quite difficult. Moreover, the occurrence of defect cation and/or anion sites in the prepared sample is quite likely. Thus, this present theoretical study is valuable in understanding the effect of vacancy self-doping on the structure, electronic, magnetic, and optical properties of the normal spinel MgFe2O4.

2 Calculation Methods

This study aimed to examine the normal spinel magnesium ferrite (MgFe2O4; space group: \( Fd\bar{3}m \)). Magnesium, iron, and oxygen atoms in this material are found to occupy the 8a, 16d, and 32e Wyckoff positions, respectively. All computations were performed using the CASTEP package based on the density functional theory (DFT).[18] The generalized gradient approximation (GGA) with the Perdew–Burke–Ernzerhof (PBE)[19] functional along with various other functionals and approximations were employed. These included the revised PBE (RPBE),[20,21] Perdew-Wang 91 (PW91),[22] PBE functional revised for solids (PBESOL),[23] and Wu-Cohen (WC),[24] as well as the local-density approximation (LDA) [25]/Perdew and Alex Zunger (CA)[26]-Perdew and Alex Zunger (PZ)[27] functional. Furthermore, these calculations were performed using a Hubbard-U correction (GGA + U),[28] where the 3d orbitals of the Fe atoms were treated with a U value of 2.5. We have used an ultrasoft pseudopotential to describe the interaction of the ionic core with valence electrons. The valence electron configurations for Mg, Fe, and O atoms were determined to be 2p6 3s2, 3d6 4s2, and 2s2 2p4, respectively. The Brillouin zone of the structures was sampled with 2 × 2 × 2 k-point Monkhorst-Pack (energy cutoff: 310 eV). Moreover, the convergence criteria of geometry optimization and energy computation were as follows: the SCF tolerances, energy, maximum force, maximum stress, and maximum displacement were adjusted to 2 × 10−6 eV/atom, 2 × 10−5 eV/atom, 0.05 eV/Å, 0.1 GPa, and 0.002 Å, respectively.

Using the GGA/RPBE method, which found to yield good results compared to the experimental, the perfect crystal was optimized using different Hubbard-U values (4.3, 5.0, 5.4, 6.0, 8.0, and 10.0 eV); a cutoff energy of 380 eV was employed. Moreover, the vacancy structures were computed using the GGA/RPBE + U method with U = 5.0 eV. The computational models of MgFe2O4 with an Mg-vacancy, Fe-vacancy, and O-vacancy (Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31) are involved in removing one Mg, one Fe, and one O ion from the actual MgFe2O4. Figure 1 shows the examined Mg/Fe/O vacancies, where the fractional coordinates of the removed Mg, Fe, and O atoms are (0.375, 0.375, 0.375), (0.5, 0.25, 0.75), and (0.25, 0.26, 0.76), respectively. Different O, Fe, and Mg-vacancy sites were tested, but no significant energy variation was determined.

Fig. 1
figure 1

Crystal structure of the normal spinel Mg8Fe16O32 with vacancy defects; the labeled ions have been removed

3 Results and Discussion

Table I reports the lattice parameters and bond lengths, which were computed using the different DFT + U functionals with U = 2.5 eV, and the relative deviations (RD pct) between the computed and the experimental lattice parameters of MgFe2O4. The lattice parameters of MgFe2O4 calculated by GGA+U with (PBE, RPBE, WC, PW91, and PBESOL) and (LDA+U/CA-PZ) functionals using an ultrasoft pseudopotential are 8.629, 8.699, 8.546, 8.617, 8.543, and 8.432 Å, respectively. The experimental lattice parameter of MgFe2O4 is found to be 8.397 Å.[29] Moreover, the relative deviations between the computed lattice parameters and experimental values are ~ 2.6, 3.4, 2.5, 1.7, 1.7, and 0.41 pct for (GGA+U)/PBE, (GGA+U)/RPBE, (GGA+U)/PW91, (GGA+U)/WC, (GGA+U)/PBESOL, and LDA/CA-PZ, respectively.

Table I Lattice Parameters and Bond Lengths of the Normal Spinel Mg8Fe16O32 Computed with Various DFT+U Methods (U = 2.5 eV) Compared with the Experimental Lattice Parameters

Yao et al.[13] have reported that the GGA/RPBE functional can provide a better result for ZnFe2O4 than the other methods. Table II shows the bandgap values computed using the different DFT functionals and the experimental value[30,31] of the spinel MgFe2O4, along with the relative deviations. Furthermore, the table further presents that the bandgap of MgFe2O4 computed using GGA/RPBE deviates the least from the experimental value, which agrees with previous results reported for ZnFe2O4.[32]

Table II Bandgap (eV) of the Spinel MgFe2O4 Computed with Various DFT + U Functionals (U = 2.5 eV) Compared with the Experimental Value

3.1 Influence of the Hubbard-U Value on Bandgap and Magnetic Moment of MgFe2O4

For the perfect crystal, the (GGA+U)/RPBE (U = 2.5) method was found to yield a bandgap value of 0.97 eV, which deviates considerably from the experimental value (1.6 to 2.0) eV.[30,31] The GGA/LDA level of theory considers delocalization of the electrons and underestimates the bandgap. Moreover, the exchange-correlation functionals neglect the orbital energy dependence. For materials containing fully or partially filled d or f orbitals, the GGA/LDA methods make no distinction between orbitals with different quantum numbers.[32] The metallic behavior of these fully or partially filled states will be predicted, but the exchange and crystal field splitting will create a gap. The GGA/LDA methods predict that the insulator transition metal oxides are metals. An orbital-dependent potential must be incorporated into the GGA/LDA methods; that is, the Hubbard-U formalism considers the localized d states, which were determined to split the d bands into upper and lower Hubbard bands. The investigated GGA/LDA methods have predicted the metallic band structure behavior of normal spinel MgFe2O4 (data not shown). However, using the Hubbard approach with U = 2.5 eV, the semiconductor behavior with a bandgap of 0.97 eV is predicted using a GGA/RPBE functional. Previous studies have reported that in order to achieve semiconducting behavior, the Hubbard parameter should be added to the d states for most of the normal spinels. [33,34]

Here, the bandgap dependence on U for Fe-3d is determined for the normal spinel MgFe2O4 using the (GGA+U)/RBPE functional, where U ranges from 4.3 eV to 10 eV. Bandgap values of the normal spinel are determined to be (1.41, 1.63, 1.64, 1.64, 1.63, and 1.61) eV for U = (4.3, 5.0, 5.3, 6.0, 8.0, and 10) eV, respectively. U = 4.3 and 5.0 eV have yielded significant enhancement in the bandgap, while U > 5.0 eV yielded negligible changes. The magnetic moment values of the Fe cation changes from 4.11 µB for U = 2.5 eV to 4.21 µB for U =10.0 eV, where µB is the Bohr magneton; thus, the magnetic moment changes only modestly with increasing U value. In some DFT + U calculations, different values of the U parameter are used to treat different transition metal charge states. For example, Mosey et al.[35] have used U = 3.7 and 4.3 to treat Fe2+ and Fe3+, respectively, thereby obtaining a sensible bandgap, magnetic moment, and other physical properties for Fe-O and Fe2O3. Previous studies on Fe3+-containing materials have applied U values of 3.0 eV,[36] 4.0 eV,[37] 5.0 eV,[38] and 5.4 eV.[39] U = 5.0 eV has been selected for exploring the normal spinel Mg7Fe16O32 with Mg, Fe, and O defects, since the bandgap value remains almost constant at U values larger than this value.

3.2 Geometric Structure of Mg8Fe16O32 with Vacancy Defects

As shown in Table III, the optimized lattice parameters of the Fe-vacancy (Mg8Fe15O32) are found to be smaller than those of the Mg-vacancy (Mg7Fe16O32), and both sets of parameters are slightly smaller than those of the perfect crystal. However, the lattice parameters of the optimized O-vacancy (Mg8Fe16O31) are determined larger than those of the perfect crystal. Moreover, the crystal structures of MgFe2O4 with Fe-vacancy and O-vacancy defects were observed to deviate significantly from the perfect cubic crystal structure. In contrast, the deviation of the Mg-vacancy structure is negligible. The optimized vacancy defects are shown in Figure 2, and the corresponding converged structural files are provided in the electronic supplementary data file.

Table III Optimized Lattice Parameters of Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 as Determined via the (GGA + U)/RPBE (U = 5.0 eV) Method
Fig. 2
figure 2

Optimized structures of (a) Mg7Fe16O32, (b) Mg8Fe15O32, and (c) Mg8Fe16O31

3.3 Stability of Mg8Fe16O32 with Vacancy Defects

The stability of vacancies can be evaluated from the formation energy calculations. The formation energy of a vacancy can be determined as follows:[32,40]

$$ \Delta E_{\text{formation}} = E_{\text{vacancy }}^{\text{total}} + E_{x} - E_{\text{perfect }}^{\text{total}} $$
(1)

where \( E_{\text{vacancy }}^{\text{total}} \) is the total energy of MgFe2O4 with vacancy defects and \( E_{\text{perfect }}^{\text{total}} \)is the total energy of MgFe2O4 without vacancy defects. \( E_{x} \) refers to the total energy of the isolated atom in its bulk form (Fe in bulk Fe and Mg in Mg8). The total energy of the oxygen atom is computed from an isolated oxygen molecule centered inside a 20 × 20 × 20 Å3 simulation box. The predicted bond length of 1.24 Å corresponds closely to the value reported by Das et al.[36] In addition, the positive value of the formation energy indicates that spontaneous formation of the MgFe2O4 vacancy defect is impossible, whereas the negative value indicates easy formation of the defect. Table IV presents the formation energy of MgFe2O4 with different vacancy defects. The formation energy values of the Mg-vacancy, Fe-vacancy, and O-vacancy are found to be positive, indicating that spontaneous formation of these three defects is impossible. However, these vacancies may form during mechanical activation, which can result in high transient temperature and pressure.[17,41] From the data in Table IV, the vacancies may be identified as O-vacancy (Mg8Fe16O31), Fe-vacancy (Mg8Fe15O32), and Mg-vacancy (Mg7Fe16O32), i.e., based on decreasing ease of formation under an external energy supply. This suggests that some defects may form during the preparation and/or annealing steps of experiments.

Table IV Formation Energies (eV) of Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 at 0 K

3.4 Band Structures of Mg8Fe16O32 with Vacancy Defects

The computed band structures of Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 are shown in Figure 3, and the corresponding bandgaps are listed in Table V. As has been noted in the figure, the perfect MgFe2O4 is a direct-gap semiconductor (1.63 eV) at the G point. The bandgap of the MgFe2O4 with an O-vacancy defect has been observed to decrease to 0.88 eV. In the case of MgFe2O4 with Mg-vacancy and Fe-vacancy defects, the majority spins (spin-up) have exhibited metallic behaviors, where few of the highest occupied states cross the Fermi level. Meanwhile, the minority spins (spin-down) of these defects exhibit semiconducting behaviors with minority bandgaps of 2.19 and 1.97 eV for the Mg7Fe16O32 and Mg8Fe15O32, respectively. Thus, these two defects can be considered half-metallic (HM) ferromagnetic materials, where one spin channel exhibits metallic behavior with a Fermi level and the other spin channel exhibits semiconductor or insulator behavior. Nowadays, HM ferromagnets are regarded as promising materials for spintronic device applications.[42] Some spinel ferrites (e.g., FeFe2O4) have exhibited HM behavior.[43] The HM gap has been defined as the minimum bottom energy value of spin-up (spin-down) conduction bands with respect to the Fermi energy and the maximum top energy value of spin-up (spin-down) valence bands.[44] The HM gap values of the Mg-vacancy and Fe-vacancy structures are 0.67 and 0.48 eV, respectively.

Fig. 3
figure 3

Band structures of (a, b) Mg8Fe16O32, (c, d) Mg7Fe16O32, (e, f) Mg8Fe15O32, and (g, h) Mg8Fe16O31

Table V Calculated Bandgaps of Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 as Determined via the (GGA+U)/RPBE (U = 5.0 eV) Method

3.5 Total Density of States of MgFe2O4 with Vacancy Defects

Figure 4 shows the computed spin-polarized partial density of states (PDOS) and the total density of states (TDOS) for Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 within the GGA+U framework (U = 5.0 eV). Within this framework, the given contributions of various atomic orbitals in the electronic band structure have been accounted. The dashed line shows the site of the Fermi level that corresponds to an energy of zero. The DOS near the Fermi level is mainly composed of the O-2p and Fe-3d states; thus, these states are the main contributor to the valence band maximum. However, the 3d states of Fe are the main contributor to the conduction band minimum. In general, the TDOS of the vacancy defects is reduced and shifted to lower energies compared with that of the perfect crystal. The O-2p states of the Fe-vacancy and Mg-vacancy defects cross the Fermi level (as shown in the figure) and are therefore associated with the metallic behavior of these two defects.

Fig. 4
figure 4

Partial density of states determined for Mg (a, b), Fe (c to e), and O (f, g) and total DOS (h) of the Mg8Fe16O32 (perfect crystal), Mg7Fe16O32 (Mg-vacancy), Mg8Fe15O32 (Fe-vacancy), and Mg8Fe16O31 (O-vacancy) materials

3.6 Magnetic Moment of MgFe2O4 with Vacancy Defects

The total magnetic moment (Mtotal, µB) per formula unit of normal spinel MgFe2O4 and its vacancy defects is presented in Table VI. The Mtotal values of the vacancy defects are determined to be smaller than that of the perfect crystal, and the materials can be listed in ascending order of the Mtotal value as follows: Mg8Fe15O32 < Mg8Fe16O31 ≈ Mg7Fe16O32 < Mg8Fe16O32. The magnetic moments are computed via Hirshfeld analysis.[45] A magnetic moment of 4.16 µB is computed for the Fe ion in the perfect crystal. In the Mg-vacancy defect, the magnetic moment of the Fe ions near the vacancy is 4.10 µB. In the Fe-vacancy defect, a magnetic moment of 4.04 µB is computed for the Fe ions connected to the six O ions that were bound to the removed Fe atom. Most experimental results show that Fe has a high spin-state in ferrites.[36,46] The magnetic moment, which is a representation of the unpaired electrons in an atom, was used in describing the Fe charge state.[36] The local Fe formal charge state ranges from 2+ to 4+, which could be attributed to the formation of Mg, Fe, and O vacancies. Moreover, magnetic moments of 4.23 µB and 3.61 µB have been reported for the Fe3+ in LaFeO3 and the Fe4+ in SrFeO3, respectively.[36] Some Mg/Fe-vacancy-neighboring Fe3+ atoms may adopt a charge close to Fe4+ after neutral Mg or Fe-vacancy formation. A formal charge of 3.5+ corresponding to a magnetic moment of 3.92 µB has been reported for Fe in La0.5Sr0.5FeO3.[36] Thus, the decrease in the magnetic moments of the Mg/Fe-vacancy-neighboring Fe3+ ions is attributed to some of the Fe3+ ions adopting a high charge close to Fe3.5+. Furthermore, if the charge on Fe changes from 3+ to 3.5+, the Fe-O bond length should then decrease. A Fe-O bond length of 2.095 Å is computed for the perfect crystal, using the (GGA+U)/RPBE method (U = 5.0). This bond length decreases to 2.013 Å (average value) and 1.979 Å in Mg-vacancy and Fe-vacancy structures, respectively, indicating that the Fe3+ atoms near the vacancy adopt a formal charge close to 3.5+.

Table VI Total Magnetic Moment (Mtotal, µB), Integrated Spin Density (µB), and Integrated |Spin Density| (µB) of Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31

In the case of the O-vacancy defect, the magnetic moments of the three Fe ions that were linked to the removed O atoms are 3.72, 3.93, and 3.97 µB. Some of the oxygen-vacancy-neighboring Fe3+ ions may take a charge close to that of Fe2+. This yields an Fe2+ ion with a magnetic moment of 3.68 µB, which is close to the magnetic moment of Fe4+ (3.61 µB) because the Fe2+ ion has the same number of unpaired electrons as the Fe4+ ion.[36] Thus, the decrease in the M values of the O-vacancy-neighboring Fe3+ ions is due to the decrease in the charge of the three Fe3+ atoms. This assertion is supported by an increase in the Fe-O bond length to values ranging from 2.102 to 2.144 Å.

The magnetic states of the investigated vacancy defects can be determined from the integrated spin density and its absolute magnitude (Table VI); if the integrated spin density is zero and its absolute magnitude is non-zero, the material exhibits antiferromagnetic ordering. The material is ferrimagnetic if the spin density is non-zero and considerably smaller than its absolute magnitude. If both values are non-zero and equal, the material is considered ferromagnetic. If both values are zero, the material is paramagnetic. The normal spinel and its vacancy defect are ferromagnetic, as shown in Table VI.

3.7 Optical Properties

Knowledge on the optical properties is critical for comprehending the electronic structure of materials. This can be acquired from the complex dielectric function ε (ω), which is defined as ε (ω) = ε1 (ω) + 2 (ω). The imaginary part ε2 (ω) is obtained from the momentum matrix components between the occupied electronic states and the unoccupied electronic states, which can be directly determined from[47]

$$ \varepsilon_{2} \left( {q \to o_{{\hat{u}}} , h\omega } \right) = \frac{{2e^{2} \pi }}{{\varOmega \varepsilon_{0} }}\mathop \sum \limits_{k,\nu ,c} \left| {\psi_{k}^{c} \left| {u \cdot r} \right|\psi_{k}^{\nu } } \right|^{2} \delta \left( {E_{k}^{c} - E_{k}^{\nu } - E} \right) $$
(2)

where u is the vector showing the polarization due to the incident electric field, ω is the light frequency; e is the charge of the electron, and \( \psi_{k}^{c} \) is the conduction band wave functions and \( \psi_{k}^{\upsilon } \) is the valence band wave functions at k. The optical functions of the perfect normal spinel Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 are then calculated with the [100] polarization vector and are shown in the following figures. We have employed a 0.5 eV smearing for all calculations.

Figure 5 shows the reflectivity of the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials as a function of the photon energy. The reflectivity values at 0.01 eV are 0.58, 0.20, 0.52, and 0.16 for the Fe-vacancy, O-vacancy, Mg-vacancy, and the normal spinel MgFe2O4, respectively. The reflectivity of the Fe-vacancy and Mg-vacancy defects was determined to drop sharply to a minimum of ~ 1.4 eV in the infrared region, while a sharp peak is observed at ~ 4.1 eV in the ultraviolet region. Then, the reflectivity drops again in the ultraviolet region starting from ~ (32 to 46) eV, and some peaks occur at ~ (47 to 64) eV.

Fig. 5
figure 5

Reflectivity of the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials

The absorption coefficient is seen to provide useful information about the ideal solar energy conversion efficiency.[48] The absorption of the normal spinel MgFe2O4 and its vacancy defect is shown in Figure 6, where MgFe2O4 and its vacancy defect exhibits good light absorption in the visible and ultraviolet regions (1.7 to 25) eV, (46 to 62) eV. A small peak was also observed to occur at 42 eV. MgFe2O4 has been used as a photocatalyst under visible light due to its small bandgap.[11] The optical absorption properties of the photocatalyst play the most essential role during the photocatalysis process. Considerable effort has been expended in tailoring a sufficiently small bandgap of the materials, which will result in maximum absorption of light in the visible spectrum. An absorption peak corresponding to the Fe-vacancy and Mg-vacancy defects occurs at 0.7 eV in the infrared radiation region. Therefore, these two vacancy defects could be promising photocatalysts due to their small bandgaps and good utilization of solar light in the infrared, visible, and ultraviolet regions. They may also be considered suitable for thermal imaging due to their absorption in the infrared region.

Fig. 6
figure 6

Absorption of the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials

The optical conductivity can be obtained from absorption of photon energy by electrons of the occupied states and excitation of these electrons to unoccupied states above the Fermi level. Figure 7 presents the real and imaginary parts of the optical conductivity characterizing the studied materials. The real optical conductivity begins in the infrared region for all MgFe2O4 with vacancy defects and in the visible region (i.e., at ~ 1.7 eV) for the perfect normal spinel MgFe2O4.

Fig. 7
figure 7

(a) Real (Re) and (b) imaginary (Im) parts of the optical conductivity determined for the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials

The dielectric function describes the effect of an AC electric field (oscillating light wave) on a material.[49] The components ε1 (ω) and ε2 (ω) indicate the extent of material polarization by an applied electric field and absorption by a material, respectively.[49] When ε2 (ω) is zero, the material is determined to be transparent, and when ε2 (ω) is non-zero, absorption begins. Figure 8 shows the dielectric function of the spinel MgFe2O4 and its vacancies. Non-zero ε2 (ω) values corresponding to energy ranging from 0 to 22 and 46 to 60 eV indicate the occurrence of absorption in these ranges. Between these two regions, the imaginary part of the dielectric function of the MgFe2O4 and its vacancy defect is determined to be zero, which indicates that they have become transparent. Static dielectric constants of 5.53, 35.57, 51.03, and 6.67 are obtained for spinel MgFe2O4, the Mg-vacancy, the Fe-vacancy, and the O-vacancy, respectively. The static dielectric constant of the Fe-vacancy is greater than that of the Mg-vacancy, and both constants have been found to be higher than that of the perfect MgFe2O4 structure. Thus, these two vacancy defects are expected be promising dielectric materials. Materials with high dielectric constants are useful for the manufacturing of high-value capacitors.

Fig. 8
figure 8

(a) Real (Re) and (b) imaginary (Im) parts of the dielectric function determined for the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials

The refractive index indicates the quantity of light that is curved or refracted while entering a material.[49] The refractive indices of perfect spinel Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31, are presented in Figure 9. Static refractive index values of 2.35, 6.03, 7.24, and 2.58 are obtained for Mg8Fe16O32, the Mg-vacancy, Fe-vacancy, and O-vacancy, respectively. The static refractive indices of all structures with vacancy defects are higher than that of the perfect MgFe2O4 structure. The highest index is obtained for the MgFe2O4 with Fe-vacancy defects. The static refractive indices for all materials occur in the infrared region, while they gradually decrease in the visible region and ultraviolet region.

Fig. 9
figure 9

(a) n and (b) k parts of the refractive index determined for the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials

The electron energy loss function has been identified as a significant optical parameter. Figure 10 shows the energy loss function of perfect normal spinel Mg8Fe16O32, the Mg-vacancy, MgFe2O4, Mg8Fe15O32, and Mg8Fe16O31. A prominent peak occurs at 22.5 eV.

Fig. 10
figure 10

Loss function of the Mg8Fe16O32, Mg7Fe16O32, Mg8Fe15O32, and Mg8Fe16O31 materials

4 Conclusions

The geometric and electronic structures and the physical properties of spinel MgFe2O4 (Mg8Fe16O32) and its vacancy defects were examined using the first-principles methods. We were able to determine that the (GGA+U)/RPBE/ultrasoft pseudopotential method is the best functional for the study of MgFe2O4 with vacancy defects. The results showed that the lattice parameters of the vacancy defects Mg7Fe16O32 and Mg8Fe15O32 are smaller than those of the perfect crystal, whereas the parameters of the O-vacancy are larger. Furthermore, the crystal structures of the Fe-vacancy and O-vacancy defects deviated significantly from the perfect cubic crystal structure. However, the deviation of the Mg-vacancy structure was found to be insignificant. Spontaneous formation of structures with vacancy defects is impossible; however, the O-vacancy was the easiest to form, followed by the Fe-vacancy and the Mg-vacancy under specific conditions. The bandgap of MgFe2O4 with Mg-vacancy and Fe-vacancy defects can be considered half-metallic ferromagnetic materials, which could be promising for spintronic device applications. The refractive index, reflectivity, dielectric function, optical conductivity, and loss function of the studied structure were computed and discussed. The absorption coefficient spectra indicated that MgFe2O4 and its vacancy defect have good absorption coefficients in the visible and ultraviolet regions. Additionally, for the Fe-vacancy and Mg-vacancy defects, an absorption peak occurred in the infrared radiation region; thus, these defects could be promising photocatalysts due to their small bandgaps and good utilization of solar light in the infrared, visible, and ultraviolet regions. The static dielectric constants of the Fe-vacancy and Mg-vacancy defects were found to be significantly higher than that of the perfect MgFe2O4 structure. In the case of MgFe2O4 with vacancy defects, the highest value of the static dielectric constant occurred for the Fe-vacancy. Thus, the MgFe2O4 with Fe-vacancy and O-vacancy defects may be suitable as dielectric materials. The static refractive indices of the Fe-vacancy and O-vacancy defect structures were higher than that of the perfect MgFe2O4 structure.