The chemical bonds in CuH, Cu2, NiH, and Ni2 studied with multiconfigurational second order perturbation theory