Sol–gel synthesis and defect engineering in Mg-, Co-, Ni-, and In-doped ZnO nanoparticles for UV photodetector and spintronic applications: a combined PL, VSM, PAS, DBS, and DFT study | Synapse