## 3 Results  
### Structure, Electronic Properties and Stability of Ag Doped WS\({}_{2}\) Monolayer  
Firstly, the supercell of the pristine WS\({}_{2}\) monolayer was optimized. The optimized lattice parameters of the 4 \(\times\) 4-size WS\({}_{2}\) supercell were found to be 12.76 A, with a W-S bond length of 2.43 A. These results are in good arrangement with previous studies (which reported 6.37 A for a 2 \(\times\) 2-sized supercell) [47]. For the Ag-WS\({}_{2}\) structure, an S vacancy was introduced, and this vacancy was then substituted with an Ag atom. The optimized structure of the WS\({}_{2}\) monolayer, WS\({}_{2}\) with a single S vacancy, and the Ag-WS\({}_{2}\) monolayer are depicted in Figure 1. The Ag atom is positioned between three W atoms and forms bonds with them. The calculated bond length for the Ag-W is 2.84 A, which is greater than the W-S bond length. Consequently, the Ag atom extends beyond the S plane. Furthermore, the adsorption energy of Ag on the defective WS\({}_{2}\) monolayer is determined to be 2.31 eV, indicative of an exothermic process. Additionally, following adsorption on the S vacancy, the Ag atom carries a positive charge of +0.25 eV. As illustrated by the CDD configurations in Figure 2a, an electron depletion region forms above the Ag atom, while electrons tend to accumulate around three Ag-W bonds. This phenomenon also underscores the transfer of electrons from Ag to the WS\({}_{2}\) monolayer.  
Regarding the electronic properties of both pristine and Ag-doped WS\({}_{2}\) monolayers, the band structures are depicted in Figure 2(b1,b2). The pristine WS\({}_{2}\) exhibits a band gap of 1.85 eV based on the PBE method, aligning closely with previous research findings (ranging from 1.80 eV to 1.85 eV) [47; 48]. It is generally recognized that the PBE method may underestimate the band gap [49]; however, this study mainly focused on the relative change of the gap value after different gas adsorption. Additionally, considering the computational efficiency, this study still used PBE to evaluate the band gap change for gas detection. Upon Ag doping, several bands emerge between the valence and conductive states, leading to a reduction in the band gap to 1.28 eV. For a comprehensive examination of the new bands, the density of states (DOS) is illustrated in Figure 2(c1,c2). In the total DOS (TODS) of Ag-WS\({}_{2}\), a distinct peak is present above 0 eV. However, the peak originating from Ag 4d orbitals is notably smaller. Conversely, examining the DOS of one of the adjacent W atoms, the peak is attributed to W 5d orbitals. Thus, the introduction of the Ag atom noticeably alters the W 5d orbitals, leading to observable hybridization above 0 eV between Ag 4d and W 5d orbitals. This hybridization indicates chemical interactions between Ag and W  
Figure 1: The optimized structures of perfect, defect, and Ag-doped WS\({}_{2}\) monolayer: (**a**) pristine WS\({}_{2}\) monolayer; (**b**) WS\({}_{2}\) monolayer with one S vacancy; (**c**) Ag-doped WS\({}_{2}\) monolayer.  
atoms and serves as the rationale behind the reduction in the WS2 band gap. Furthermore, an evaluation of thermal stability is also conducted. Molecular dynamic (MD) simulations were performed under a constant temperature and constant volume (NVT) canonical ensemble at 500 K, covering a duration of 5000 fs (with intervals of 2 fs) of 2500 steps. The outcomes are presented in Figure 2(d1,d2), affirming the structural integrity of the Ag-WS2 monolayer with no apparent bond breakage. The total energy of the structure remains within a reasonable range. Consequently, the MD results substantiate the thermal stability of the Ag-WS2 monolayer.