Density Functional Theory Study Of Molecules And Crystals Containing D And F Metals