  The crystal structure of MoS$_2$ with strong covalent bonds in plane and weak
Van der Waals interactions out of plane gives rise to interesting properties
for applications such as solid lubrication, optoelectronics, and catalysis,
which can be enhanced by transition-metal doping. However, the mechanisms for
improvement and even the structure of the doped material can be unclear, which
we address with theoretical calculations. Building on our previous work on
Ni-doping of the bulk 2H phase, now we compare to polytypes (1H monolayer and
3R bulk), to determine favorable sites for Ni and the doping effect on
structure, electronic properties, and the layer dissociation energy. The most
favorable intercalation/adatom sites are tetrahedral intercalation for 3R (like
2H) and Mo-atop for 1H. The relative energies indicate a possibility of phase
change from 2H to 3R with substitution of Mo or S. We find structural and
electronic properties that can be used to identify the doping sites, including
metallic behavior in Mo-substituted 3R and 2H, and in-gap states for Mo- and
S-substituted 1H, which could have interesting optoelectronic applications. We
observe a large enhancement in the interlayer interactions of Ni-doped MoS$_2$,
opposite to the effect of other transition metals. For lubrication
applications, this increased layer dissociation energy could be the mechanism
of low wear. Our systematic study shows the effect of doping concentration and
we extrapolate to the low-doping limit. This work gives insight into the
previously unclear structure of Ni-doped MoS$_2$ and how it can be detected
experimentally, the relation of energy and structures of doped monolayers and
bulk systems, the electronic properties under doping, and the effect of doping
on interlayer interactions.
