Adsorption is a simple and effective method to remove heavy metal ions and anionic or cationic dyes from aqueous or waste solutions. Herein, we report on the adsorption of a cationic dye crystal violet on a low-cost natural material. The diatomite was obtained from Sig deposit (west of Algeria) and then treated with 1 M HCl solution. Natural clay (diatomite) was characterized using different physical-chemical methods, including, X-ray powder diffraction, X-ray fluorescence, thermogravimetric analysis, scanning electron microscopy, and Fourier transform infrared and pH of zero charge. The effect of various experimental parameters, such as initial dye concentration, adsorbent dose, initial pH, and shaking time on adsorption was investigated. The maximum adsorption capacity was found to be 82.0 mg.g− 1 for treated Diatomite and 75.0 mg.g− 1 for raw diatomite, with equilibrium reached within 120 min. Adsorption kinetics followed the pseudo-second-order model, with high correlation coefficients (R² = 0.998 for treated diatomite and R² = 0.999 for raw diatomite). The isotherm data showed the best fit with the Langmuir model. Optimal adsorption occurred at pH 8 for treated diatomite and pH 10 for raw diatomite.
First-principles calculations carried out using the full potential linearized augmented planewave (FPLAPW) method as implemented in the Wien2K code indicate that the ground state volume of Cs2AgInBr6 and Cs2AgInCl6 is 2400 (a.u)3 and 2050 (a.u)3, which corresponds to a unit cell energy minimum of − 84,842.919545 Ryd and − 59,101.325763 Ryd. The negative formation energy, Goldschmidt tolerance factor closer to unity and octahedral factor greater than 0.41justify their thermodynamic and structural stability of our investigated double perovskites. The reported lattice constant, ground state energy, bulk modulus and its pressure derivative are closer to their available experimental and theoretical data. Optical analysis reveals high absorption in the visible to ultraviolet range, along with enhanced dielectric constants and optical conductivity. Cs2AgInX6(X = Cl, Br) double perovskites are promising candidates for solar cells, thermoelectric devices, and energy harvesting applications due to their tunable band gap, high optical absorption, and enhanced thermoelectric performance.