  Using density functional calculations, we investigate the structural and
magnetic properties of ultrathin Gd and Gd-carbide nanowires (NWs) encapsulated
in narrow carbon nanotubes (CNTs). The equilibrium geometry of an encapsulated
(2 \times 2) Gd-NW is markedly different from that of bulk Gd crystals. The
charge-density analysis shows pronounced spin-dependent electron transfer in
the encapsulated Gd-NW in comparison with that of Gd-carbide NWs. We conclude
that Gd-CNT hybridization is primarily responsible for both the structural
difference and electron transfer in the encapsulated Gd-NW.
