  We studied the stable magnetic structure of ordered Nd$_{6}$Fe$_{14-x}$Ga$_x$
($x = 0, 1)$ alloys, which appears in the grain-boundary (GB) phase of Nd-Fe-B
permanent magnets, using first-principles techniques. Slight Ga doping ($x =
1$) was shown to contribute to the stabilization of an anti-ferromagnetic (AF)
state, whereas the non-doped case ($x = 0$) was revealed to favor ferromagnetic
state rather than AF state with a slight energy difference.
