  Aiming at testing the validity of our magnesium atomic model and
investigating the effects of non-local thermodynamical equilibrium (NLTE) on
the formation of the H-band neutral magnesium lines, we derive the differential
Mg abundances from selected transitions for 13 stars either adopting or
relaxing the assumption of local thermodynamical equilibrium (LTE). Our
analysis is based on high-resolution and high signal-to-noise ratio H-band
spectra from the Apache Point Observatory Galactic Evolution Experiment
(APOGEE) and optical spectra from several instruments. The absolute differences
between the Mg abundances derived from the two wavelength bands are always less
than 0.1 dex in the NLTE analysis, while they are slightly larger for the LTE
case. This suggests that our Mg atomic model is appropriate for investigating
the NLTE formation of the H-band Mg lines. The NLTE corrections for the Mg I
H-band lines are sensitive to the surface gravity, becoming larger for smaller
log g values, and strong lines are more susceptible to departures from LTE. For
cool giants, NLTE corrections tend to be negative, and for the strong line at
15765 \AA\ they reach -0.14 dex in our sample, and up to -0.22 dex for other
APOGEE stars. Our results suggest that it is important to include NLTE
corrections in determining Mg abundances from the H-band Mg I transitions,
especially when strong lines are used.
