1 Introduction

The exploration of new materials possessing essential functionalities has the potential to revolutionize various fields including nanotechnology [1, 2], computer technology [3, 4], solar energy [5, 6] and spintronics [7, 8]. With the vast number of distinct elements present in the periodic table, each capable of forming diverse crystal structures, there remain numerous unexplored semiconducting materials that could emerge as promising candidates for energy sources [9, 10], show casing remarkable multifunctional capabilities [11, 12]. Lead Li/Na-based perovskite halides are one of these; their novel uses in photovoltaics have attracted a lot of attention [13]. When compared to conventional thin-film solar cells, these Li/N-based perovskite the halides have shown better performance in laboratory settings [8, 14]. Li/Na-based perovskite halides have made amazing progress, as seen by their efficiency rising from 3.8% in 2009 to 22.7% in 2017 [9,10,11,12]. Li/Na-based perovskites halides exhibit outstanding photovoltaic performance, which can be due to their unique properties such as defect tolerance, low exciton binding energies, favorable effective hole and electron masses, a good direct bandgap, and strong optical absorption [13, 15]. Li/Na-based perovskite halides have exceptional optoelectronic properties, which makes them extremely appropriate to produce solar cell devices [14,15,16]. Despite their widespread applicability, Li/Na-based perovskites have some drawbacks that prevent their large-scale commercialization [19, 20]. These drawbacks include unstable in the presence of moist [17, 18], light, heat, and toxicity. As a result, a lot of work has gone into investigating materials free of lead for optoelectronic uses [16]. Thus, it is crucial to reduce or completely remove leads from photovoltaic (PV) equipment [17, 21]. Therefore, it is necessary to discover safe and reliable new energy technologies [18, 19]. To solve this kind of problem, perovskite materials (ABX3) [20] having the characteristics of photovoltaics (PV) that are most solar class technology [21,22,23], due to their significant properties [24, 25] and contribute to the production of the clean energy from pollution [26]. The most promising solar energy in the recent years has been organic–inorganic halide perovskite (OIHP) based PV technologies, which are efficient, inexpensive, and have special optoelectronic effects. However, the lower stability of OIHP performance was the main issue for solar cell production. For example, conventional OIHP like MAPbI3 [27] and MAPbX3 (X = Cl, Br, and I) [28, 29] have garnered considerable interest for their high efficiency and suitability for optoelectronic applications, despite concerns regarding their instability and the toxicity associated with the presence of lead (Pb)[30]. Most of the metal halide Pb-free materials [31] such as ZYbI3 (Z = Rb, Cs) were used as perovskite materials as a result of their high competence efficiency [32]. Mahmood et al. [33] reported the narrow direct band structures with the band gap of 1.22 eV and 1.12 eV for RbYbI3 and CsYbI3, respectively, which are considered finest for solar cells. Interestingly, Ray et al. [34] proposed substituting divalent atoms (such as Ge, Sn, Pb, Mg, Ca, Sr, and Ba) for Pb to address the toxicity concerns associated with perovskite materials in photovoltaic applications [35]. They found that Mg and Ba perovskites are improbable to form in the cubic, tetragonal, or orthorhombic phases due to their positive formation energies [36]. While Ca and Sr perovskites exhibit negative formation energies with respect to the metal-iodide precursors, they possess wide band gaps, making them less favourable candidates for use in photovoltaic devices [37]. They additionally reported that the predictive capability of a local density functional with a non-separable gradient approximation (NGA) closely resembles that of hybrid functional in terms of band gap predictions, particularly when M in CsMI3 represents a p-block element such as Pb, Sn, or Ge. The stability of perovskites material was identified to be enhanced by introducing K and Rb atoms [38], specifically, KGeX3 and RbGX3 (where X = Cl or Br) structures. Due to their exceptional optoelectronic properties, which include a high static refractive index, low reflectivity, high absorption coefficient, and excellent stability they have been thoroughly investigated for their possible uses in solar energy and photoelectric systems [39]. Furthermore, they exhibit relatively low levels of toxicity. Additionally, CsGeX3 (X = F, Cl, and Br) perovskite has been identified [40]as a promising candidate for optoelectronic applications, owing to its exceptional electronic, optical, thermoelectric, and tuneable band gap properties [41]. The electrical and optical properties of different cubic lead − free halide perovskites, CsMgX3 (X = Cl and Br) compounds were studied [42]. Like these compounds, the cubic halide perovskite CsBX3 (B = Sn, Ge, X = I, Br, Cl) compounds were also reported as suitable for optoelectronic energy devices [43]. Furthermore, recently a narrow band gap perovskite material such as BaZrS3 [44] and CsYbI3 [45], were reported [46].

As far as air knowledge goes, there isn’t any material out there now that talks about the physical characteristics of hypothetical cubic halides AMgI3 (A = Li/Mg). Because they make it easier to develop high-performance electronic devices and provide a better knowledge of the underlying physical features, materials with basic crystal structures, such cubic ones, have piqued the interest of the scientific community [47].

“Our objective/ motivation was to study this material theoretically, to simulate the physical properties, by employing the mBJ, to calculate the band gap, to attain the band gap in visible region, to analyze the maximum absorption, and to check the thermal efficiency, to use in the solar cell and thermal devices.” This work aims to explore the structural, electrical, thermo-electric, and magnetic properties of ferromagnetic half-metallic AMgI3 (A = Li/Mg) substances. Theoretical research holds great importance for the practical application of these substances and could potentially enable their utilization in devices that operate at elevated temperatures. We use the improved Becke-Johnson functional (mBJ) to compute these properties of AMgI3 (A = Li/Mg), and the results agree with other theoretical evidence.

2 Method of Calculations

The full potential linearized augmented plane wave plus local orbital (FP-LAPW + lo) [47] method within the density functional theory DFT [48] is employed to evaluate the structural, electronic, and thermoelectric behaviour of AMgI3 (A = Li/Na) compounds. The exchange correlation potential is implemented using the generalized gradient approximation (PBE-GGA) which is incorporated as a code within the WIEN2k software-package [49,50,51]. The ground state parameters are obtained by optimizing a fully relaxed structure using PBE-GGA and Murnaghan’s equation of states is employed to fit the energy of the ground state [52]. Although, generalized gradient approximation (GGA) are effective in determining the lattice constant accurately but they fail to provide precise values of the band gap. This issue is addressed by employing TB-mBJ potential [53]. This technique involves averaging the lattice-constant values obtained from GGA approximations, thereby enhancing accuracy of calculated band gap values of the materials. The FP-LAPW + lo method provides a reliable approach for solving Kohn–Sham equation. This approach involves division of unit-cell in two regions. The 1st region represents the spherical core of the atom while 2nd region corresponds outer interstitial space. The angular-momentum is expanded up to 12 for the first region and specific muffin-tin radii are chosen to prevent charge leakage from the atom’s core. The selected muffin-tin radii for Li, Na, Mg, I am 2.50, 2.50, 1.95, 2.05 and 1.71 Bohr respectively. The plane-wave cut-off approach is utilized for 2nd interstitial segment with RMT × Kmax = 8, where Kmax denotes the highest number of K and RMT represents least muffin-tin radius. The modifies tetrahedron approach is applied with 10,000 K-points for integration of Brillouin zone to achieve self-consistency. The elastic properties are calculated by IRelast method, which is built-in Wien2k code. Finally, thermoelectric characteristics are evaluated with these modified structures implemented in BoltzTrap coding [54].

3 Results and Discussion

3.1 Structural Analysis

For the calculations of structural properties, we used unit cell of cubic halides AMgI3 (A = Li/Mg) with space group 221: Pm3m as shown in Fig. 1a. The cubic primitive unit cell of AMgI3 (where A = Li/Na) comprises five atoms. A atoms are positioned at the corners in the 1a Wyckoff position (0, 0, 0), Mg atom occupy the body centre in the 1b Wyckoff position (0.5, 0.5, 0.5), and I atoms are positioned at the face centre in the Wyckoff position (0.5, 0.5, 0.0). The determination of structural characteristics of AMgI3 (A = Li/Mg) compounds involves a volume optimization procedure. This involves optimizing the energy at specific volumes and fitting the resulting data points.

Fig. 1
figure 1

Crystal structure of AMgI3 (A = Li, Na) compounds and the LDA and GGA phases of AMgI3 (A = Li, Na), along with their respective crystal structures and calculated total energy functions of a volume

Goldschmidt tolerance factor denoted as “τ” is a widely used in the ABX3 perovskite structures to investigate its structural stability. It insight to determine the compatibility of cations within the structure and is defined as follows [55]

$$t_{G} = \frac{{\left( {r_{A} + r_{X} } \right)}}{{\sqrt 2 \left( {r_{B} + r_{X} } \right)}}$$
(1)

where rA, rMg, and rI are A − site, Mg − site, and I − site ionic radii, respectively. In general, perovskite structures are stable in cubic structure when the tolerance factor falls within the range of 0.8 < τ < 1 [56]. Alternatively, when τ < 0.8, the perovskite adopts an orthorhombic structure, while for τ > 1, it is categorized as having a hexagonal crystal structure [57]. The ionic radii used in this calculation were 1.13, 1.39, 0.72, and 2.20 Å, respectively, for Li, Na, Mg, and I. The calculated tolerance factors 0.81 for LiMgI3 and 0.87 for NaMgI3 are fall within an acceptable range as listed in Table 1, resulting in the confirming of the ideal cubic structural stability of the investigated compounds. Further material stability checked by the formation energy and cohesive energy. The obtained cohesive energies and formation enthalpies are listed in Table 1. From Table 1, we can see that the cohesive energies and formation enthalpyy of all investigated compounds are negative, indicating that these materials are energetically stable. Table 1 shows a stable trend where, as one moves from Li to Na in the group, the lattice constantly rises and the bulk modulus falls. This is supported by the fact that as we proceed down the group, the atomic radius grows, expanding interatomic space. The bulk modulus decreases and the solid becomes less dense because of increased compressibility caused by the expansion of the atomic radius. The materials under investigation have a bandgap between 2.5 and 3.5 eV (1 eV = 1.602 × 10–19 Joules), which indicates that they are broad bandgap semiconductors.

Table 1 Calculated lattice constants (a), cell volume (V), ground state energy (Eo), bulk modulus (B) and Pressure Derivative of B (B.P), bond length, Cohesive energy and formation energies of cubic AMgI3 (A = Li, Na)

Structural stability is also achieved by optimization to get ground state lattice parameters (− 43130.389030 Ry, − 43440.262047 Ry) as shown in Fig. 1b, c. The calculated parameters perfectly fit the Brich–Murnaghan equation of state.

$$E\left( V \right) = E + \frac{{9B_{0} V_{0} }}{16}\left\{ {\left[ {\left( {\frac{{V_{0} }}{V}} \right)^{2/3} - 1} \right]B^{\prime}_{0} + \left[ {\left( {\frac{{V_{0} }}{V}} \right)^{2/3} - 1} \right]\left[ {6 - 4\left( {\frac{{V_{0} }}{V}} \right)^{2/3} - 1} \right]} \right\}$$
(2)

In the above expression \({B}_{0}\), E0 V, \({V}_{0}\) and E(V) represents the bulk modulus, ground state energy, volume, equilibrium volume, and total energy, respectively. We can find the most stable structure by changing the crystal lattice’s parameters using above Eq. 2.

3.2 Electron Localization Function (ELF)

The Electron Localization Function (ELF) serves as a valuable tool for analyzing electron distribution and localization during crystalline structure formation [47]. ELF quantifies the likelihood of electrons with identical spins and fixed positions within a reference electron field, offering insights into electron localization within the lattice space and revealing bonding characteristics in materials. Figure 2 presents 3D and 110 crystal dimension ELF maps for AMgI3 (A = Li/Na). The right side of the ELF maps illustrates ELF scaling, including coordination scaling, where regions with lower electron density are depicted in blue and those with higher electron density in red. Examination of the ELF maps for compounds reveals a heightened degree of electron localization around the I ions, attributed to their significant electronegativity.

Fig. 2
figure 2

ELF plot AMgI3 (A = Li, Na)110 plane

3.3 Band Structures and Density of States

The investigation of the band structure for the perovskite compound AMgI3 (X = Li/Na) was semiconductor, the electronic band structure along some high symmetry directions of the BZ and their corresponding densities of states were calculated using the FP-LAPW method within the PBE-GGA and TB-mBJ functionals.

Table 2 reveal that narrow indirect band gaps were computed for LiMgI3 and NaMgI3 using GGA-PBE, and TB-mBJ. Specifically, the band gaps are 2.56 eV and 2.72 eV, respectively, for LiMgI3 and NaMgI3, employing GGA-PBE, and TB-mBJ. It’s clear from that the PBE function consistently underestimates the electronic structure, particularly the band gap as shown in Fig. 3. Despite this underestimation, the results suggest that the proposed compounds exhibit sufficient stability, as they yield similar outcomes across different computational codes. Furthermore, the Tb-mBJ correlation function accurately predicts the band gap, correlating well with experimental values. This suggests that LiMgI3 and NaMgI3 have a favourable band gap which shows a potential engagement as a semiconductor material for use in PV devices. Figure 3a, b shows that both the conduction band minimum (CBM) and valance band maximum (VBM) of LiMgI3 and NaMgI3 compounds were located at Γ and M, respectively, in the first Brillion zone. Which agrees with the previous finding. The s-block valance band (VB) metals are flat between R and M points, suggesting the presence of a heavy holes were observed, whereas the p-block metals have a more dispersive conduction band (CB) at Γ − point.

Table 2 Calculated energy band gap (in eV) Mg based perovskite AMgI3 (A = Li, Na) by different potentials PBE and mBJ
Fig. 3
figure 3

The LDA, PBE-GGA and TB-mBJ approach was utilized in order to compute the band structure of a LiMgI3 b NaMgI3 in directions with good symmetry

Figure 4 present the analysis of the partial density of states (PDOS) and total partial density of states (TDOS) of LiMgI3 and NaMgI3 compounds. Figure 4 illustrates the dominance of the Li s-state in the CB, situated away from the Fermi level. The proximity of the peak to the Fermi level is crucial for electron transitions from the VB to CB, despite the Li s-state’s comparatively lower intensity near the Fermi level in the VB. In the case of the Mg atom, the s-state contributes to the VB, while the p-state contributes to the CB, as depicted in Fig. 4. Additionally, Fig. 4 clearly shows that the prominent peak near the Fermi level within the VB primarily originates from the Li p-state. In summary, the TDOS reveals that the VB is predominantly influenced by the Li p-state, whereas the Mg p-state contributes to the CB in the LiMgI3 compound. Notably, when replacing Li atom with Na, similar trends are observed. These similarities arise from the shared properties of Li and Na as elements within the same family.

Fig. 4
figure 4

TDOS and PDOS for AMgI3 (A = Li, Na) computed using the TB-mBJ approximation

3.4 Elastic Properties

Elastic constants are needed to calculate mechanical characteristics, and the WIEN2k code’s implementation of the IR-elast method yields these constants. Three elastic constants C11, C12, and C44 are sufficient to determine the mechanical properties of a cubic system. As far as we are aware, no report has been written about the mechanical characteristics of the materials under study. The cubic system must meet the following Born mechanical conditions to be stable: C11 > 0, C44 > 0, C11−C12 > 0, C11 + 2C12 > 0, and C11 > B > C12 [26]. According to Poisson’s and Pugh’s ratio, the calculated mechanical parameters, which are presented in Table 3, verified the mechanical stability of both LiMgI3 and NaMgI3. The following relations are used to compute the materials’ elastic modulus for this purpose [58]. Interestingly, the estimated elastic constants of both LiMgI3 and NaMgI3 compounds listed in Table 3 confirmed that these compounds satisfy the Born stability criteria, indicating their mechanical stability. The Pugh ratio (B/G) and Cauchy pressure are useful parameters to assess a material’s brittleness and ductility [59]. The ductility of the material is determined by B/G, which is equal to or greater than 1.75 whereas less than 1.75 represents the material’s brittleness [60]. According to this study, the (B/G) ratios for LiMgI3 (2.29) and NaMgI3 (2.18) are higher than 1.75, suggesting that these materials exhibit ductile behaviour as shown in Table 3. The Cauchy pressure for cubic LiMgI3 and NaMgI3 determines their ductility and brittleness properties based on negative and positive values of C12˗C44, as reported in [61]. The positive value indicates ductility while a negative value suggests brittleness. In this study, the difference between C12 and C44 for both compounds are positive values, resulting in indicating ductility. On the other hand, the Voigt-Reuss-Hill (VRH) method is an approach used to calculate B, G, E, and σ of the materials. The Voigt and Reuss methods are used to determine the bulk [62] and shear [63] moduli of materials, while Hill’s [64] method is used to calculate the average values of these properties. The Reuss bulk modulus (BR) and Voigt bulk modulus (BV). all above computed parameters in 2D and 3D are shown in Fig. 5 for both compounds.

Table 3 Calculated elastic constants (in GPa), anisotropy factor A, shear modulus G (in GPa), Young’s modulus E (in GPa) and the Poisson ratio v of cubic indium-based perovskite XMgI3 (X = Li, Na)
Fig. 5
figure 5figure 5figure 5figure 5

3D and 2D elastic properties for AMgI3 (A = Li, Na)

The values for B, G, and E are presented in Table 3. The B (19.32, 20.04), G (8.41, 9.19), and E (22.05, 323.91) of AMgI3 (A = Li, Na), respectively, indicate that both materials exhibit comparable resistance to changes in volume and shape. Moreover, the observed E and σ listed in Table 3 can be calculated using the following expression, respectively [57]

The resistance of a material, which is indicated by its stiffness, is quantified by E. Materials with higher values of E exhibit increased resistance. Therefore, as shown in Table 3, LiMgI3 and NaMgI3 exhibit identical and higher E values, suggesting that they possess a greater level of stiffness. The σ, which is limited to values between 0.25 and 0.50, determines the behaviour of bond forces. A value of σ greater than 0.26 indicates that the material is ductile, while a value less than 0.26 indicates that it is brittle [40]. Hence, as indicated in Table 3, the bond force of the LiMgI3 and NaMgI3 compounds is central (0.29). As a result, both compounds exhibited a characteristic of ductility that agrees well with the B/G ratio and Cauchy’s pressure equation. Moreover, an elastic anisotropy factor (A) used to calculate the direction-dependent properties of a system. For isotropic compounds, A is ideally set at 1, indicating uniformity; any deviation from 1 signals the presence of anisotropy [19, 65]. As shown in Table 3, the computed anisotropy factors for both compounds differ from unity (0.81 for LiMgI3 and 0.84 for NaMgI3), indicating the presence of anisotropy in these materials. The G and B calculations allow for the determination of the transverse sound velocity, and longitudinal sound velocity, of AMgI3 (A = Li/Na) crystals. The calculated Debye temperature values for LiMgI3 and NaMgI3 are 152.14 K and 156.04 K, respectively. Additionally, ultralow thermal conductivity values verify the thermodynamic stability of the materials under study and show that lattice vibration has no effect on device performance. Additionally, the hardness test revealed that compositions containing I are more dependable and resilient to applied stress [58]. The mechanical factors that were determined are shown in Table 3.

3.5 Optical Properties

These materials’ optical spectra are dependent on the interaction between light and matter. Solar cells in optoelectronics transform light into electrical energy. Transitions and the rate of recombination are two crucial factors that affect this energy conversion [27, 28]. Either the light absorbs or passes through the substance. Actual dielectric constant ε1 (ω) represents light dispersion, while imaginary dielectric characteristic ε2 (ω) represents light absorption (Table 4).

Table 4 Calculated optical properties Mg-based perovskite AMgI3 (A = Li, Na) by TB-mBJ

Figure 6a, b shows the dielectric functions for real and imaginary parts of XMgI3 (X = Li/Na), respectively. In Fig. 6a, a static frequency of ε1(0), the real dielectric constant 3.15 for LiMgI3 and 3.10 for NaMgI3. The ε1(ω) of the LiMgI3 and NaMgI3 reached maximum peak intensity of 6.1 eV and 6.16 eV edge of ultraviolet light region. In contrast, as shown in Fig. 6b, LiMgI3 and NaMgI3 revealed that 0 eV at ε2 (0), indicating no dissipated energy exists. The imaginary part of the dielectric materials ε2 (ω) increased until energy dissipation occurs in the photon energy absorption region. Imaginary parts of dielectric reflect the behavior of absorption coefficient. Figure 6c shows the evaluation of the optical characteristics of the refractive index, which explains the bending or refracting behavior of light in a medium. The obtained static refractive indices of LiMgI3 and NaMgI3 are 1.80 and 1.82, respectively. This suggests that the square of the refractive index (n(ω)) corresponds to ε1(ω) at a static frequency, as represented in Fig. 6c. Additionally, both compounds reached their maximums at the edge of higher energy of ultra volet light (6.4 eV). The detection of refractive index peaks within the low-energy segment of the spectrum is a crucial aspect, especially in the visible region, providing valuable insights for applications in optoelectronic devices. The extinction coefficient demonstrated how the light intensity attenuated on a given compound, LiMgI3 and NaMgI3, as displayed in Fig. 6d. Both compounds depicted similar behavior. Figure 6e shows how electromagnetic (EM) radiation induces the compound’s optical excitation, displaying the conductivity σ (ω) of AMgI3 (A = Li and Na). In LiMgI3 and NaMgI3, σ (ω) remains zero between 0 eV and 3.89 eV photon energy due to the absence of optical excitations, indicating no interaction between incident EM radiation and the materials’ electrons in this energy range. As LiMgI3 and NaMgI3 absorb energy, electrons shift from the VB to the CB. Figure 6f shows the absorption coefficient of the cubic structure of LiMgI3 and NaMgI3. In Fig. 6f, it is evident that both LiMgI3 and NaMgI3 compounds initiate photon absorption at 3.6 eV and display a wide absorption peak spanning the visible to ultraviolet (UV) region. Therefore, the proposed materials are highly recommended as a novel lead-free halide perovskite material for solar harvesting applications. To comprehend the surface attributes of perovskites, examining their reflectivity offers insights. Figure 6f illustrates the reflectance spectra of LiMgI3 and NaMgI3 perovskite compounds relative to photon energy. Both compounds consistently demonstrate low reflectivity (less than 0.105) across the infrared to visible region spectrum, which are negligible. Remarkably, their reflectivity remains consistently low in the visible to infrared range, making these materials well-suited for solar cell applications. The spectrum’s consistency with the absorption coefficient analysis Fig. 6g suggests that absorbing light within the visible part of the electromagnetic spectrum is particularly beneficial for solar cell applications (Table 4).

Fig. 6
figure 6figure 6

Optical parameters regarding the photon energy of the compound AMgI3 (A = Li, Na) a Real part ε1 b Imaginary ε2 c refractive index n, d extinction coefficient k (ω) optical conductivity f absorption coefficient g Reflectivity h energy loss function

3.6 Thermoelectric Properties

In the present era, where the generation of the energy mainly presides on fossil fuels, requires efficient and easily manipulated substitutes that are eco-friendly in nature. The (TE) materials can be an answer with their efficient conversion of waste energy into electricity leading to the increased operating efficiency of the engines [66, 67]. The transport properties of the present materials have been calculated using the Boltzmann transport theory. We have used constant relaxation time approximation (τ) with accurate Brillouin zone (BZ) sampling with a dense grid of 1,00,000 k-points to obtain convergence. The appropriate properties for the valuable thermoelectric material require large (S), (σ/τ), (κ/τ) (PF), (zT).

To study the transport properties, we have used the tetrahedron method with energy steps of 0.16 × 104 Ry for integration. The proper selection of the energy grid majorly decides the thermoelectric properties which critically depend upon the size of the band gap of the material. Different thermoelectric parameters are plotted in Fig. 7a–f. Thermal conductivity (κ/τ) is divided into two parts: the phononic (κph) and electronic (κe) sections. The zT is used to evaluate thermoelectric performance, and the BoltzTrap algorithm is used to calculate the κe [68].

Fig. 7
figure 7

Transport parameters regarding the versus temperature the TE of the compound AMgI3 (A = Li, Na) a S, b σ/τ, c PF, d zT, e κe and f κl

Figure 7a. shows the Seebeck coefficient, whose value rises from 199.5/198.3 µV/K at 300 K to a maximum of 197.26/196.75 µV/K at 600 K for LiMgI3(NaMgI3). The thermal resistive effect, which raises potential with rising temperature, could be the cause of the increases in S. Due to the smaller band gap, LiMgI3 has a higher value of S than NaMgI3. There are more carriers accessible at high temperatures, which explains why electrical conductivity increases with temperature [35]. As shown in Fig. 7b, at 300 K the values of electrical conductivity are 0.644 × 10191/Ωms and 2.56 × 10191/Ωms for (Li/Na)MgI3. As the temperature has risen, the PF nature of both systems has directly grown. The values of PF reached 4.74 × 1011(4.72 × 1011) W/K2ms at 600 K for LiMgI3(NaMgI3) respectively (Fig. 7c). We calculated the figure of merit (zT), which is displayed in Fig. 7d. to assess performance. Up to 300 K, zT increases as temperature rises. For (Li/Na)MgI3, the values at ambient temperature are 0.19 and 0.18, respectively. But at 600 K, the zT ratio increased by 0.50 and 0.55, which highlights the significance of the materials for thermoelectric uses.

For (Li/Na)MgI3 systems, Fig. 7e, f. computes the electronic thermal conductivity; this allows for the calculation of lattice thermal conductivity κL using Slack’s approach [32]. The low lattice thermal conductivity κL at 600 are 0.16 and 0.11 for LiMgI3 and NaMgI3 compounds.The transport parameters at ambient temperature are presented in Table 5.

Table 5 Calculated transport properties of Mg-based perovskite AMgI3 (A = Li, Na) at 300 K by TB-mBJ

The κe/τ for (Li/Na)MgI3 systems have linear relation with the temperature, at 300 K and 600 K the value of the 3.97 × 1014W/Kms and 3.96 × 1014W/Kms. In semiconductors, the doping with these charge carriers intensifies the electrical conductivity and Seebeck coefficient

$$S = \frac{{8\pi^{2} k_{B}^{2} }}{{3e\hbar^{2} }}m^{*} T\left( {\frac{\pi }{3N}} \right)^{2/3}$$
(3)

where N represents carrier concentration. \(S\) being inversely proportional to \({N}^{2/3}\) and it decreases with the increase in the doping carrier concentration. The μ dependence of thermoelectric properties of both the double perovskites are studied in the range of − 2.0 eV to 4.0 eV and presented in Fig. 8a, j. at different temperatures like 300 K, 700 K, 1200 K. Seebeck coefficient \(S\) obtained in the investigated range of temperature have positive values depicting that dominating behaviour of holes as majority charge carriers and it declines with increasing temperature. This behaviour of S again confirms the semiconducting behaviour of these compounds in Fig. 8a, b. The value of Seebeck coefficient S is found to be almost negligible in the region − 2.0 eV to 0.0 eV and it continuously rises with the chemical potential \(\mu -{\varepsilon }_{F}\) and decreases with the chemical potential in the region 0.0 eV to 0.65 eV having optimal value for both n-type and p-type doping at a constant temperature. The power factor of both compounds was maximum at fermi level but here by increasing the temperature the PF increased as shown in the Fig. 8c, d.

Fig. 8
figure 8

Transport parameters regarding the versus chemical potential (μ) and carrier concentration (e/uc) at various temperatures (300 K, 700 K, 1200 K) for AMgI3 (A = Li, Na) a S, b σ/τ, c PF d ZT e κe and f κl

The zT value of both perovskites’ materials are approximately 1 (can be seen Fig. 8e, f) which advocates these materials are suitable for thermal devices. By increasing the temperature, the value of zT go down. For both the compounds, the electrical as well as thermal conductivities rises with that of chemical potential, illustrating the rise in their conductivities with rise in charge-carrier concentrations for both n-type and p-type doping at a fixed temperature. The value of electrical conductivity (\(\sigma /\tau )\) is found to be maximum of 2.8 \(\times {10}^{20}{\Omega }^{-1}{m}^{-1}{s}^{-1}\) at − 1.57 eV, which gets continuously decreases and becomes zero at 0 eV, in case of LiMgI3 whereas there are two peaks \((4.5 \times {10}^{20}{\Omega }^{-1}{m}^{-1}{s}^{-1})\) lying at − 1.63 eV and 0.0 eV in the n-type region demonstrated in Fig. 8g, h. The \(\sigma /\tau\) continuously decreases with the increase in temperature whereas the κe \(/\tau\) increases with the applied temperature in both p and n-type semiconductors, with optimal value in p region as shown in Fig. 8i, j.

4 Conclusion

This investigation explores the structural, electronic, optical, mechanical and transport attributes of cubic AMgI3 (A = Li/Na) through employing WIEN2k code and BoltzTrap coding. The lattice constant (5.80 Å, 5.82 Å), ground energy (− 43130.389030 Ry, − 43440.262047 Ry) and mechanical stability were confirmed by assessing the tolerance factor (0.81, 0.87) and formation energy (− 326.60 kJ/mol, − 76.38 kJ/mol), and by evaluating the elastic constants, respectively. Our examination of the elastic constants and mechanical properties indicates the notable stability and ductile nature of each perovskite material. Additionally, we investigated the electron charge distribution using the electron localization function. The developed compounds exhibit advantageous indirect narrow band gaps (2.56 eV for LiMgI3 and 2.71 eV for NaMgI3) and a broad-spectrum absorption coefficient, using mBJ correlation function. The DFT analysis suggests a highly favourable band gap for photovoltaic applications. The materials LiMgI3 and NaMgI3 have electronic thermal conductive values of 1.07 × 1014 (W/m.K.s.), which indicates that these materials are especially appropriate for use at high temperatures. These values peak at 1200 K. Additionally, the thermoelectric component analysis shows that our materials have a favorable efficiency at ambient temperature and the possibility to increase this efficiency to higher temperatures. As a result, more work is needed to synthesis and investigate these perovskite-based substances considering upcoming advances in photovoltaic technology.