Optical spectra of the quantum defects in metal halide perovskites