  We present an extensive review of the two-dimensional finite difference
Hartree--Fock (FD HF) method, and present its implementation in the newest
version of X2DHF, the FD HF program for atoms and diatomic molecules. The
program was originally published in Comput. Phys. Commun. in 1996, and was last
revised in 2013. X2DHF can be used to obtain HF limit values of total energies
and multipole moments for a wide range of diatomic molecules and their ions,
using either point nuclei or a finite nuclear model. Polarizabilities
($\alpha_{zz}$) and hyperpolarizabilities ($\beta_{zzz}$, $\gamma_{zzzz}$,
${A}_{z,zz}$, ${B}_{zz,zz}$) can also be computed by the program with the
finite-field method. X2DHF has been extensively used in the literature to
assess the accuracy of existing atomic basis sets and to help in developing new
ones. As a new feature since the last revision, the program can now also
perform Kohn-Sham density functional calculations with local and generalized
gradient exchange-correlation functionals with the Libxc library of density
functionals, enabling new types of studies. Furthermore, the initialization of
calculations has been greatly simplified. As before, X2DHF can also perform
one-particle calculations with (smooth) Coulomb, Green-Sellin-Zachor and
Krammers-Henneberger potentials, while calculations with a superposition of
atomic potentials have been added as a new feature. The program is easy to
install from the GitHub repository and build via CMake using the x2dhfctl
script that facilitates creating its single- and multiple-threaded versions, as
well as building in Libxc support. Calculations can be carried out with X2DHF
in double- or quadruple-precision arithmetic.
