## 2 Computational Details  
A series of ab initio calculations were performed to evaluate the adsorption reactions and work functions of NO\({}_{2}\) and H\({}_{2}\)S on ZnGa\({}_{2}\)O\({}_{4}\)(111) surfaces. The ab initio theoretical results were implemented in the Vienna ab initio simulation package [13; 14], and the exchange correlation function was predicted using the generalized gradient approximation (GGA) with the Perdew-Wang (PW91) correction [15; 16]. The crystal structure of ZnGa\({}_{2}\)O\({}_{4}\) is displayed in Figure 1. The space group for ZnGa\({}_{2}\)O\({}_{4}\) is _Fd-3m_, which contains 56 atoms, comprising 8 Zn, 16 Ga, and 32 O atoms. The cutoff energy was set as 400 eV. To simulate the change of the work function with and without an NO\({}_{2}\) or H\({}_{2}\)S molecule, we developed a supercell of ZnGa\({}_{2}\)O\({}_{4}\) along the (111) direction. This supercell contained 112 atoms, and the vacuum was set to 20 A. The stoichiometry of all supercells was fixed at Zn\({}_{16}\)Ga\({}_{32}\)O\({}_{64}\). We used the preferred Ga-Zn-O-terminated surface of ZnGa\({}_{2}\)O\({}_{4}\)(111) with a surface energy of 0.10 eV/A\({}^{2}\)[17]. A gamma-centered \(3\times 3\times 1\) Monkhorst-Pack grid was used. This supercell was fully relaxed until the force acting on each atom was less than 0.001 eV/A. To determine the most favorable adsorption site of NO\({}_{2}\) (H\({}_{2}\)S) molecules on the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface, we labeled the surface atoms as Ga\({}_{3c}\), Zn\({}_{3c}\), O\({}_{3c}\), and O\({}_{4c}\) in the top and side views of Figure 2.  
We first calculated the work function using the formula [18]  
\[\Phi_{ZGO}=E_{VAC}-E_{F} \tag{1}\]  
Figure 1: Atomistic representation of bulk ZnGa\({}_{2}\)O\({}_{4}\). Atoms are represented by spheres: Zn (purple, large), Ga (brown, medium-sized), and O (red, small). Figure 2: Top and side views of the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface. Surface atoms are labeled Ga\({}_{3c}\), Zn\({}_{3c}\), O\({}_{3c}\), and O\({}_{4c}\). Atoms are represented by spheres: Zn (purple, large), Ga (brown, medium-sized), and O (red, small). where \(\Phi_{ZGO}\) is the work function for the clean ZnGa\({}_{2}\)O\({}_{4}\)(111) surface and \(E_{VAC}\) and \(E_{F}\) are the energy of the vacuum and the Fermi energy, respectively. Similarly, when the NO\({}_{2}\) (H\({}_{2}\)S) molecule was adsorbed on the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface, we also calculated the work function \(\Phi_{NO_{2}}\) and \(\Phi_{H_{2}S}\), which in turn determined the work function differences \(\Delta\Phi\) (eV) between \(\Phi_{ZGO}\) and \(\Phi_{NO_{2}}\) (\(\Phi_{H_{2}S}\)). The binding energy \(E_{B}\) (eV/u. c.) is also an important factor determining gas-sensing performance and can be defined as  
\[E_{B}=E_{total}-E_{ZGO}-E_{NO_{2}/H_{2}S} \tag{2}\]  
where \(E_{total}\) is the total energy of the NO\({}_{2}\) (H\({}_{2}\)S) molecule adsorbed on the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface, and \(E_{ZGO}\) and \(E_{NO_{2}/H_{2}S}\) are the total energies of the slab of ZnGa\({}_{2}\)O\({}_{4}\)(111) surface and the free or isolated NO\({}_{2}\) (H\({}_{2}\)S) molecule, respectively. First, we constructed eight adsorption models, denoted N1, N2, N3, N4, O1, O2, O3, and O4. Here, N (O) represents a nitrogen (oxygen) atom in NO\({}_{2}\), and numbers \"1\", \"2\", \"3\", and \"4\" respectively indicate the initial adsorbed Ga\({}_{3c}\), Zn\({}_{3c}\), O\({}_{3c}\), and O\({}_{4c}\) atom on the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface. The initial distance of the NO\({}_{2}\) molecule to the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface was set as the sum of the van der Waal radii of N (O) for the NO\({}_{2}\) molecule and Ga (Zn or O) for surface atoms. Similarly, for the H\({}_{2}\)S molecule adsorbed on the ZnGa\({}_{2}\)O\({}_{4}\)(111) surface, we also developed eight adsorption models, denoted S1, S2, S3, S4, H1, H2, H3, and H4.