Utilization of deformations in molecular quantum chemistry and application to density functional theory