{'fraction_non_alphanumeric': 0.03641601418230167, 'fraction_numerical': 0.019943861722558725, 'mean_word_length': 4.535159443990188, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Calculation of the work function with a local basis set

Electronic structure codes usually allow to calculate the work function as a part of the theoretical description of surfaces and processes such as adsorption thereon. This requires a proper calculation of the electrostatic potential in all regions of space, which is apparently straightforward to achieve with plane wave basis sets, but more difficult with local basis sets. To overcome this, a relatively simple scheme is proposed to accurately compute the work function when a local basis set is used, by having some additional basis functions in the vacuum. Tests on various surfaces demonstrate that a very good agreement with experimental and other theoretical data can be achieved.


Introduction
The work function is one of the most important quantities in the characterization of surfaces and processes on surfaces such as adsorption or chemical reactions. It is defined as the energy required to move an electron from deep within the bulk to a point far away from the surface. Experimentally, 'far away' means a distance large compared to atomic dimensions, but small compared to the dimensions of the corresponding face of the crystal; the size of the sample is finite. In electronic structure codes, surfaces can be modeled as slabs having an infinite extension in the surface plane, and a finite thickness orthogonal to it. The work function is then obtained as the difference of the energy of an electron at infinity, minus the Fermi energy: E(∞) − E F . The calculation of the work function is nowadays routinely done in density functional calculations, and the agreement between theoretical and experimental data is usually very good, see e.g. [1]. To compute E(∞) − E F , knowledge of the electrostatic potential, which is determined by the charge density, and of the Fermi energy is necessary. If the exact functional was known, and if numerical noise was neglected, then the charge density, the position of the Fermi energy and thus the work function would be obtained exactly [2,3,4].
Most codes use plane waves as basis functions, where the description of the electrostatic potential in all parts of space, i.e. in the region of the surface and in the vacuum region, seems to be without any difficulty. Local basis sets such as Gaussian type orbitals are an alternative to plane waves. They perform well for many properties such as energetics or structural optimization. However, the calculation of the work function appears to be more intricate, and difficulties such as a basis set dependence of the results had been observed [5,6,7].
To overcome this problem and to obtain accurate values for the work function, a simple scheme is proposed. It consists of having additional basis functions in the vacuum region above the surface, for a better description of the electrostatic potential and thus the work function. The method and computational details are explained in section 2. In section 3, tests on the low index Cu surfaces are performed. To demonstrate the reliability of this scheme, results for various clean surfaces are presented in section 4, and for the adsorbate systems Cl/Cu(111) and K/Ag(111) in section 5.

Method
The calculations were performed with the code CRYSTAL2003 [8]. This code uses Gaussian type orbitals, which can be centered at the position of the atoms. In addition, the code has the option to use basis functions without atoms (usually referred to as dummy or ghost atoms) which is the standard procedure when the basis set superposition error is evaluated by the counterpoise method. In the present context, this option will be used for a better description of the electrostatic potential in the vacuum region. Such an approach had already been used earlier, e.g. for Pt(110) and Pd(110) [9]. A different way to tackle the problem of computing the work function might be to try basis sets with very diffuse exponents, and to explore whether convergence of the work function can be achieved. However, this can not be done with the CRYSTAL code because linear dependence sets in when very diffuse exponents (i.e. with exponents less than ∼ 0.1) are used, and the calculations become numerically unstable. The idea is thus to calibrate a scheme relying on ghost atoms, and to perform extensive tests on various surfaces and adsorbate systems.
The basis sets employed in the present work are either pure all electron basis sets or use in addition a pseudopotential. Using a pseudopotential is not mandatory, and calculations on heavy atoms with all electron basis sets are feasible. The pseudopotential helps to reduce the computational effort, and, maybe even more important, offers the possibility to include scalar-relativistic effects. The Gaussian basis sets are: a [3s2p] basis set or a [4s3p] basis set for Li [10], [6s5p2d] basis sets for Cu [11] and Ni [6], a [4s3p2d] basis set together with a 19-valence electron pseudopotential for Ag [12], a [4s4p2d] basis set for Pt together with a 18-valence electron pseudopotential [13], and [5s4p1d] basis sets for Cl [11], and K [14]. k-point nets of the size 16 × 16 were used, and the smearing temperature was in the range between 0.001 E h and a maximum value of 0.01 E h , as described earlier [10,11,12,13,15]. In the case of nickel, spin-polarized calculations were performed, and the smearing temperature must be chosen low (0.001 E h ) because a too high temperature would artificially reduce the magnetic moment.
Most of the calculations were done at the level of the local density approximation (LDA), with the Perdew-Zunger potential [16]. In some cases, where computationally expensive optimizations had been performed earlier [11,15], the same functionals were used here again: the gradient corrected functional of Perdew and Wang (PWGGA) or Perdew, Burke and Ernzerhof (PBE).
The surfaces are modeled with slabs of a finite thickness (typically 6 layers for the clean surfaces and 3-5 adsorbate layers in the case of adsorbate systems), as displayed in Fig. 1. The slabs are not periodically repeated in the third dimension. The slab model should be thick enough so that the Fermi energy is not modified by surface states. The zero of the electrostatic potential Φ is defined by the CRYSTAL code in such a way that Φ(∞) = −Φ(−∞), and the Fermi energy is then determined by the number of electrons. In the case of symmetrical arrangements of the slabs (e.g. clean, unrelaxed surfaces), Φ(∞) = 0 holds, and the work function is −E F .

The low index Cu surfaces
The Cu(111) surface is chosen as a first system for the method suggested. Various tests are performed: first, relaxation is not allowed and the distance is determined by the Cu lattice constant, as computed at the LDA level (3.53 A [11,17]). Three basis sets for the ghost layers are compared: one basis set which consists of only the outermost diffuse sp shell of the original Cu basis set (exponent 0.15), a second basis set consisting of this sp shell and additionally the outermost diffuse d function (exponent 0.392), and the full basis set, i.e. the same basis set is used for the ghost atoms and for the Cu atoms which are not ghosts.   Table 1 The work function of Cu (111) The data are displayed in table 1. We note that already two ghost layers, i.e. one on each side, result in a value of the work function which is practically converged, as the value hardly changes when more ghost layers are used. Another important finding is that the outermost diffuse exponents are sufficient for a good description. This is expected, as these diffuse exponents are the ones which have the most impact to describe the electrostatic potential in the vacuum region, and diffuse exponents are required to describe a delocalized charge distribution. The electrostatic potential for the Cu(111) surface is visualized in figure 2, with various numbers of ghost layers (note that, to obtain the electrostatic energy of an electron, the potential has to be multiplied by the electronic charge, -|e|). As the total potential (top panel) looks very similar for all possible arrangements, it is better to consider the difference of the electrostatic potential with and without ghost layers (bottom panel). This difference of the potentials with 2,4 or 6 ghost layers and without ghost layers demonstrates that convergence with respect to the number of ghost layers is very fast, and the change in the potential is about 0.05 a.u. in the middle of the slab which corresponds to the change in the work function when having ghost layers, as displayed in table 1.
In a next step, relaxation of the top Cu layer on each side of the slab was allowed. One sp basis function was used on the ghost atoms, with 6 layers made of ghost atoms (3 on each side of the Cu slab). The positions of the ghost atoms were held fixed. The data in table 2 shows that in all cases, the work function hardly changed. The relaxation changes slightly when ghost layers are used. The ghosts thus have a slight impact on the geometry, as they can also be interpreted as an improvement of the basis set of the outermost atom.

Adsorbate systems
An interesting and important application of work functions are adsorbate systems. Therefore, the scheme is now tested with Cl/Cu(111) and K/Ag(111). Both systems had been studied previously with a local basis set [11,15], and now the work functions are evaluated. With the adsorbate adsorbed on one side of the slab (on the side pointing to +∞), E(∞) − E F gives the work function of the adsorbate covered side. E(−∞) − E F corresponds to the work function of the clean surface and is virtually identical to the values from tables 2 and 3, when computed for Cl/Cu(111) or K/Ag(111).
First, the adsorbate system Cl/Cu(111), at the coverage of one third, in a ( √ 3 × √ 3)R30 • pattern, is considered. Chlorine is adsorbed on the fcc site [18], with a minority occupation of the hcp site [19]. This was confirmed by total energy calculations [11], and the geometry was in excellent agreement with the experimental geometry. With this geometry, two ghost layers (one on each side of the slab) are now added to compute the work function, see table 4. First, the work function of the clean Cu(111) surface is determined as 0.175 E h (1 E h =27.2114 eV), at the PWGGA level. When Cl is adsorbed it is found to increase by 0.023 E h at the fcc site, which is reasonable, compared with computed data [20] (0.01 E h increase, for a coverage of 0.125) and experimental data [21], where an increase of the work function up to a saturation of 0.04 E h was observed (however, the coverage was not specified). The increase of the work function is larger for the bridge and largest for the top site, which is consistent with the increasing Mulliken charge on chlorine and the increasing interlayer distance between the Cl layer and the top Cu(111) layer. It is also interesting that the chlorine Mulliken charge is ∼ -0.2 and thus far away from that of a fully negatively charged chlorine ion.
In earlier calculations on nickel surfaces [6], without using ghost atoms, it had already been shown that varying the outermost diffuse exponent changed the work function strongly, but the other properties such as the geometry, relative energies of the adsorption sites or Mulliken populations were only weakly affected. As the relative energies of the various sites are very important, the relative energies with and without ghosts were computed, as a further test for the system Cl/Cu(111). These data are included in table 4. Essentially, the energy splitting between the various sites is the same with or without ghost atoms, as the largest difference is in the range of the numerical noise (0.0155 E h without ghosts versus 0.0147 E h with ghosts, i.e. 0.0008 E h , in the case of the top site).
In addition, the work function of the system K/Ag(111) is computed (table 5, at the PBE level, for the clean surface and at the coverages of one fourth and one third of a monolayer. With four ghost layers (two on each side of the slab), the computed work function is in reasonable agreement with the experimental value for the clean surface and with the data measured at various coverages [29]; the initial decrease of the work function when potassium is adsorbed is found in theory and experiment, and similarly, the slight increase with larger coverage and depolarization is observed.
Finally, it should be emphasized that the approach using ghost atoms as dis-  Table 5 The work function and its change upon adsorption for the adsorbate system K/Ag (111) Ag(111)(2 × 2)-K fcc [28] 0.068 ∼ 0.05 [29] Ag(111)( √ 3 × √ 3)R30 • -K hcp [28] 0.084 ∼ 0.06 [29] played in Fig. 1 will need further refinements in cases such as for example low coverages or reconstructions, where it may be necessary to have additional ghost atoms, for instance in surface regions not covered by adsorbates, or at the place of missing rows.

Conclusion
A scheme to accurately compute work functions with a local basis set was suggested and tested. Placing at least one layer with ghost atoms in the vacuum region on each side of the slab makes it feasible to obtain reasonable values for the work function. It is sufficient to use the outermost diffuse basis functions for the ghost atoms. Structural and energetical properties change only weakly when ghost atoms are added. Computed work functions for simple metals and for adsorbate systems are in good agreement with data obtained with codes employing plane waves and with experimental data.