Electronic structure and magnetic properties of rare-earth organometallic sandwich compounds