## 2 Experimental Measurements
The duration of the generated SH pulses was within the duration of the fundamental optical pulses (for the Gaussian pulse, the SH pulse duration is estimated to be \(\sim\)50 fs). The energy of the SH pulses depended on the time delay between fundamental optical and terahertz pulses. Bearing in mind the strong absorption of the SH radiation in the bulk of most samples (except for SiO\({}_{2}\)), we performed measurements in reflection geometry. In the case of SiO\({}_{2}\), the SH radiation generated in the transmission direction reached the exit sample surface and produced an additional SH beam due to Fresnel reflection. This radiation was also registered separately (by using a diaphragm shown in Figure 1b) and was used to calibrate our measurements. In view of the low nonlinear conversion efficiency, the generated SH photons were detected by a Hamamatsu R4220P photomultiplier tube (PMT) operated in the photon counting mode (with quantum efficiency \(\sim\)20% at the 395 nm wavelength). The generated SH energy (signal) \(S\) corresponds to the number of the detected PMT pulses \(N\) from 15,000 laser pulses (in case of a high SH signal, when \(N>5000\) pulses, we used a calibrated neutral filter to attenuate the signal). Taking into account a possible single PMT response to the arrival of several SH photons, the SH signal was calculated by \(S=N(1+N/15,000)\). The fundamental optical and external radiations were filtered by BG39 and band-pass (BP) filters placed before the PMT. The polarizations of the terahertz and fundamental fields were set parallel and normal to the drawing plane (corresponding to the incident s-polarization), the second optical harmonic was measured with the same \(s\)-polarization. An essential feature of the TFISHG scheme used is that during the joint propagation of optical and terahertz radiation in the gas surrounding the sample, a concomitant SH  
Figure 2: Open (blue) and closed (red) aperture z-scan traces for (**a**) TWLA, (**b**) TWLB, (**c**) IKS23. Incident optical energy is depicted in the corresponding figures. radiation is generated (using a vacuum chamber evidently solves the problem, but significantly complicates the experiment). Despite the typically small gas nonlinearity, due to the large coherence length, the magnitude of the second harmonic from the ambient gas can be comparable to or even exceed the SH signal from the sample. To take into account the gas contribution to the total SH signal correctly, the sample and a part of the experimental setup were placed in a hand-made plastic container filled with helium or ambient air. The choice of helium as an additional gas is explained by its small nonlinearity which is approximately 20 times less than that of air [47; 48]. Hence, it was expected that in the helium atmosphere, the measured SH signal will correspond to the signal from the sample. However, as it is shown below, this is not always so. Figure 3a-d shows normalized SH signals (normalized coefficients are depicted for the corresponding signals) from the exit facet of the SiO\({}_{2}\) sample and from the entrance facet of the SiO\({}_{2}\), TWLA, and As\({}_{2}\)S\({}_{3}\) samples, respectively, as a function of time delay between the optical and terahertz pulses. The data were obtained in air and helium atmosphere. It is seen that the SH signal measured in air is always ahead of the SH signal from the same sample in helium. This is a result of faster THz pulse propagation between the parabolic mirrors PM1 and PM2 (see the inset in Figure 1b) when the box was filled with helium. Several other features can be identified in Figure 3. First, the magnitudes of SH signals for different glass families differ significantly (the smallest signal was obtained from SiO\({}_{2}\), and the largest from chalcogenide glasses), which is consistent with their markedly different nonlinearities [2]. Second, the amplitudes of SH signals differ in air and helium atmosphere, which demonstrates the influence of the SH generated in the ambient gas.