## 3 Theoretical Analysis and Simulation  
The light shift, normally referring to the frequency shift of an atomic magnetic resonance, originates from the AC Stark effect caused by the oscillating electric field of the pumping light [22; 23]. It was systematically and theoretically studied by [PERSON] and [PERSON], who showed that the atomic ground-state transition frequencies can be shifted by two distinct processes involving real and virtual absorption of light [24]. Light shift can be decomposed into vector light shift (VLS) and tensor light shift. In our experiments, since the laser wavelength is near \(D_{0}\) line (\(2^{3}\)S\({}_{1}\)\(\sim\)\(2^{3}\)P\({}_{0}\)) and there is only one sublevel for the excited state \(2^{3}\)P\({}_{0}\), only the virtual light shift needs to be taken into consideration, and acts on the Zeeman sublevels like a fictitious magnetic field [25]. The light shift depends on both the frequency and intensity of the light field [26], given by  
\[\Delta\omega_{LS}\sim I(z)\cdot\delta\omega_{LS}(\
u), \tag{1}\]  
where \(I(z)\) is the light intensity at the position \(z\) and \(\delta\omega_{LS}(\
u)\) is the shift related to laser frequency \(\
u\). In this work, we demonstrate that the VLS in the cell depends on the local light intensity, rather than the total light power averaged over the cell volume.  
Here, we assume that the atoms within a volume element with very small length \(\Delta z\) experience approximately the same light intensity and the local light intensity is given by  
\[I(z+\Delta z)=I(z_{0})\exp\left(-nQ_{A}\Delta z+\frac{nQ_{M}\Delta z}{\hbar} \left\langle{I_{z}}\right\rangle\right), \tag{2}\]  
where \(I(z_{0})\) is the initial light intensity incident on \(\Delta z\), \(n\) is the numbers density of the metastable \({}^{4}\)He atoms, \(Q_{A}\) is the absorption cross section, \(Q_{M}\) is the (dichroic) monitoring cross section, \(\left\langle{I_{z}}\right\rangle\) is the polarization in the volume element [12; 27]. The optical absorption of the polarized \({}^{4}\)He atoms in the cell gradually weakens along the light-propagation direction \(z\). This means that the light shift will be greater where the beam enters the cell than where it exits. The centers of the magnetic resonance signals are shifted differently in every volume \(\Delta z\) because of different light shifts. The amplitude of the magnetic resonance signal \(R\) is the superposition of all the absorption signals of all the volume.  
According to Ref [27; 28], we have  
\[\left\langle{I_{z}}\right\rangle=J_{0}\left(1-\frac{\gamma^{2}\text{B}_{1}^{2 }T_{1}T_{2}}{1+\gamma^{2}\text{B}_{1}^{2}T_{1}T_{2}+(\omega-\omega_{0}+\Delta \omega_{LS})^{2}T_{2}^{2}}\right), \tag{3}\]  
where \(J_{0}\) is the equilibrant angular momentum when no magnetic field is applied, \(1/T_{1}\) and \(1/T_{2}\) are respectively the total longitude and transverse relaxation rates, and \(\gamma\) is the gyromagnetic ratio of the metastable \({}^{4}\)He atoms. The variation of \(\left\langle{I_{z}}\right\rangle\) with \(\omega\) is an absorption curve with the maximum absorption at \(\omega=\omega_{0}-\Delta\omega_{LS}\). The local light shift \(\Delta\omega_{LS}\) is different for each \(\Delta z\) unit, and thus results in a different absorption maximum for each \(\Delta z\) unit. The signal line shape of laser absorption by the polarization \({}^{4}\)He in the cell can be thought of as the superposition of several \(\Delta z\) units and behaves asymmetric. With Equations (1)-(3), the magnetic resonance signal is calculated and is shown in Figure 2b. If the light intensity gradient is not considered, the absorption line is shifted symmetrically even though the laser frequency is detuned. If the light intensity gradient is considered, as shown in Figure 2b (blue or red line), not only the frequency shift exists but also the amplitude of the demodulated magnetic resonance signal is not zero at the maximum absorption. We use the relation between the in-phase component and the laser detuning to lock the laser frequency.