## 1 Introduction  
Photonic crystals (PhCs) have been widely studied for their ability to prohibit light propagation due to their photonic bandgap (PBG) [1; 2]. In particular, PhC cavity structures have attracted many researchers due to their small modal volume (V) and high quality (Q) factor with help of the rapid development of nanotechnology processes such as lithography and dry etching [3; 4; 5]. One of the possible applications of PhC cavity structures is optical sensing based on wavelength shift due to environmental changes such as pH changes, chemical changes, and strain changes [6; 7; 8].  
Recently, PhC nanobeam (NB) structures have been proposed as new types of optical integrated circuits because of structural simplicity to achieve an ultrahigh Q/V ratio and direct coupling to optical waveguides [9; 10; 11]. Furthermore, PhC NB cavity structures are ideally suitable for ultrasensitive optical sensing with an extremely small footprint because of the deterministic wavelength-scale design [12; 13]. Moreover, nanometer-wide air gap geometry surrounded by a high-index region was proposed to enhance and confine the light [14]. As the electric field could be tightly concentrated in the air void by large discontinuity at the high-index-contrast interfaces, the Q/V ratio and optical sensitivity of the resonant mode in PhC cavity structures with an air gap could increase dramatically [15; 16]. However, by introducing the air gap geometry in the PhC cavity, the Q-factor decreased due to a high scattering loss. Consequently, the deterministic PhC NB cavity with an air gap was proposed to achieve a high coupling efficiency to the waveguide with a high Q factor [17; 18]. The Q-factor of the resonant cavity mode in PhC NB structures could be increased easily by adding more air holes outside the cavity region to reduce the loss along the waveguide.  
It was also reported that the light could be localized strongly with low index materials in a horizontal slot region [19]. In particular, the scattering loss in the horizontal slot region is smaller than that in the vertical slot due to the smooth interface formed by the simple selective wet etching or oxidation process. Additionally, the horizontal air gap can be made ultrathin by controlling the deposition process, which can enhance the light\(-\)matter interaction [20; 21]. However, the light localization in the horizontal slot is found in the transverse magnetic (TM) mode among the guided modes in the slab where there is no PBG [19; 20]. In contrast, the PhC NB structure can have the PBG in both transverse electric (TE) and TM modes [22]. There are several reports related to the horizontally slotted PhC NB cavity; however, there was no systematical investigation of PhC NB cavities for gas sensing [23; 24]. In this paper, we numerically investigate the TM mode in a PhC NB cavity with a horizontal air gap from the origin of the PBG to the whole transmission response by the three-dimensional (3-D) plane wave expansion method and the finite-difference time-domain (FDTD) method. Because of the intrinsic trade-off between the Q-factor and the sensitivity of the TM mode in the PhC NB cavity with an air gap, there is an optimal thickness of the air gap in the dielectric slot. The optimized PhC NB cavity is ultrasensitive to a refractive index change of approximately 1020 nm/RIU with Q > 40,000. When the dielectric slot becomes thin, the sensitivity can exceed 1200 nm/RIU. For practical applications, we suggest and Si-based PhC NB cavity with a horizontal SiO\({}_{2}\) slot structure. After the very fine selective etching of SiO\({}_{2}\), the PhC NB cavity with the remaining SiO\({}_{2}\) can be mechanically stable and provide high sensitivity with a high Q-factor. The PhC NB cavity with the horizontal air gap can be considered promising for label-free compact optical sensors in photonic integrated circuits for TM waveguide systems.