The MING proposal at SHINE: megahertz cavity enhanced X-ray generation

The cavity-based X-ray free-electron laser (XFEL) has promise in producing fully coherent pulses with a bandwidth of a few meV and very stable intensity, whereas the currently existing self-amplified spontaneous emission (SASE) XFEL is capable of generating ultra-short pulses with chaotic spectra. In general, a cavity-based XFEL can provide a spectral brightness three orders of magnitude higher than that of the SASE mode, thereby opening a new door for cutting-edge scientific research. With the development of superconducting MHz repetition-rate XFEL facilities such as FLASH, European-XFEL, LCLS-II, and SHINE, practical cavity-based XFEL operations are becoming increasingly achievable. In this study, megahertz cavity enhanced X-ray generation (MING) is proposed based on China’s first hard XFEL facility - SHINE, which we refer to as MING@SHINE.


Introduction
X-ray free-electron lasers (XFELs) are game changers for fundamental research [1][2][3][4][5][6][7][8]. They have become one of the most vigorously studied and successful new research tools, opening up new opportunities in a wide variety of fields, including atomic and molecular science, ultrafast chemistry and catalysis, fluid dynamics, clean energy systems, structural biology, high-energy density science, photon science, and advanced materials. They allow for new methods to capture rare chemical events, determining protein structures from small crystals, and revealing quantum processes in matter. All of these methods are enabled by nonlinear, multidimensional, and coherent X-ray techniques that are only achievable using X-ray lasers.
In 2017, an 8 GeV high-repetition-rate XFEL facility equipped with a continuous-wave (CW) superconducting radio frequency linear accelerator (RF linac), named SHINE, was proposed for operations in Shanghai, China [9]. To fulfill the significant user demand, the FEL wavelengths at SHINE will be available in both the soft and hard X-ray regions (from 0.4 keV to 25 keV). Thus, three undulator lines will be constructed to support different wavelength ranges, and each will be driven by the same 8 GeV electron beam from the upstream superconducting RF linac. In general, all three undulator lines are based on the self-amplified spontaneous emission (SASE) mode [10,11], which delivers brilliant, nearly fully transversely coherent, and ultra-short X-ray pulses, but has low longitudinal coherence and poor stability.
Therefore, it will be beneficial to provide an additional option to improve longitudinal coherence and stability beyond those available using the SASE mode. In the soft X-ray regime, advanced seeding techniques will be implemented to generate stable, fully coherent pulses. In the hard X-ray regime, a self-seeding technique will be used, which can significantly enhance longitudinal coherence. The corresponding experimental results have demonstrated that the bandwidth can be reduced by a factor of 40-50 [12][13][14][15][16]. However, self-seeding schemes are based on SASE, resulting in relatively high intensity jitter. In addition to these technologies, considerable attention has recently been paid to the use of cavity-based XFELs to generate fully coherent pulses.
Cavity-based FELs are promising candidates for producing fully coherent laser-like X-ray pulses. In such FELs, X-ray pulses stored in an optical cavity are successfully amplified via interactions with fresh electron bunches as they pass through undulators. Cavity-based FELs include XFEL oscillators (XFELOs) [17][18][19][20][21] and X-ray regenerative amplifier FELs (RAFELs) [22][23][24][25][26], all of which rely on the same fundamental techniques and components to attain their full potential. In general, these systems consist of an electron bunch with a high repetition rate, an undulator to provide gain, and a crystal cavity to circulate and store the X-ray pulses. The difference between these two solutions is that XFELO employs a high-Q cavity and a low singlepass gain, whereas RAFEL uses a low-Q cavity with a relatively larger gain. Thus, RAFEL requires long undulators or shorter electron bunches with a higher peak current. In addition, the higher gain in RAFEL reduces the requirement for X-ray cavity alignment accuracy, but produces a higher output coupling and a broader spectrum. In contrast, XFELO produces the highest spectral brightness and stability.
Based on a CW superconducting linac, SHINE [9] and LCLS-II-HE [27] can provide 8 GeV electron bunches at ∼ 1 MHz, making them highly suitable for the operation of a cavity-based XFEL. Megahertz cavity enhanced X-ray generation within the context of SHINE (MING@ SHINE) is proposed to generate X-rays in the energy range of 6-15 keV. As the most typical cavity-based XFEL, the low-gain XFELO is the major research topic in the current MING proposal. Moreover, XFELO can be expanded for RAFEL operations with long undulators. The bandwidth of XFELO pulses can be as low as a few meV, which will serve as the frontier for scientific applications in high-resolution spectroscopy, imaging, quantum optics, and nonlinear optics. As a new proposal for an X-ray laser, MING will stimulate the interest of many scientists and lead to the development of related techniques in the SHINE construction process.

Scientific cases
XFELO sources are distinguished by their significantly improved longitudinal coherence compared to SASE XFELs. For instance, the bandwidth of XFELO pulses can be as low as a few meV with a duration of a few hundred femtoseconds (i.e., nearly transform-limited). In contrast, radiation from the SASE XFEL has a very short temporal length (can be less than a femtosecond), and its spectral bandwidth is a few tens of eV (i.e., far away from the transform limit). Thus, the XFELO pulse is expected to have very high spectral brightness, whereas the SASE pulse has very high peak power. Additionally, the spectra of XFELO pulses are expected to consist of a single spike, whereas the SASE spectra are characterized by complicated multiple-spike structures. Furthermore, XFELOs generate extremely stable X-ray pulses with shot-to-shot variations of less than 1%, whereas the high-gain SASE and self-seeded XFEL exhibit poor pulseto-pulse stability. Consequently, the unique characteristics of an XFELO will provide new scientific opportunities in several areas, such as spectroscopy, imaging, and higher transverse mode control. It should be noted that part of the argument in this section is taken from a report based on discussions of scientific applications enabled by an XFELO during a workshop held by the Stanford Linear Accelerator Center (SLAC) in 2016 [28]. It is also important to note that only a limited number of applications are currently available. Other XFELO applications will be discussed and planned in the future.

X-ray lasers
The development of X-ray technologies has been among the most important scientific achievements of the last century. Today, X-rays are used not only for fundamental research, but also for applications in medicine, chemistry, and public security. The research and applications of X-ray technology in various fields are strongly dependent on the development of X-ray light-source technology. The revolution in X-ray sources began with the inception of synchrotron radiation light sources, which cover the spectral range from terahertz to hard X-rays, and provide significantly higher intensities than X-ray tubes [29]. However, the synchrotron radiation light source, despite having many valuable applications, is still far from being a truly high-power X-ray laser.
Coherent, high-intensity X-ray lasers in the Ångstrom wavelength with femtosecond pulse duration allow for imaging of periodic and non-periodic systems, identifying non-crystalline structures, investigating dynamic systems far from equilibrium, and studying high-energy density science. To provide coherent laser-like X-ray pulses, significant strides have been made in the development of XFELs, which provide a very short pulse duration, extreme peak brightness, and high spatial coherence [10,[30][31][32]. These features distinguish XFELs from third-generation synchrotron light sources and establish them as the next generation of revolutionary X-ray sources.
Over the past ten years, XFEL applications have undergone significant and rapid development because of the high demand from the scientific user community, which is the driving force behind the rapid expansion of XFEL facilities and related experimental technologies. Currently, most XFELs in operation are based on the SASE mode and produce very high peak power and excellent transverse coherence in the Ångstrom wavelength region, but have limited longitudinal coherence with a relative bandwidth of 0.1%.
Following the requirements of the user communities, FEL development is currently directed toward the generation of transform-limited FEL pulses with laser-like properties [13,17,[33][34][35][36]. Among the existing schemes capable of producing fully coherent pulses, XFELOs are highly promising candidates [17]. XFELO pulses have bandwidths as low as a few meV. In comparison to the SASE XFEL, the XFELO can be a true X-ray laser with high stability and controlled statistical properties. Thus, XFELO is an important development direction for realizing advanced X-ray lasers.
In addition, the newly proposed X-ray laser oscillator (XLO) is an alternative method for generating fully coherent X-ray pulses [37]. The XLO uses a SASE pump pulse to generate population inversion, which is a necessary step in the workings of a standard laser. Similar to other cavitybased lasers, XLO requires an X-ray cavity formed by crystal mirrors to continue the amplification process.

Inelastic X-ray scattering
In third-generation facilities, inelastic X-ray scattering (IXS) has proven successful in investigating many disparate aspects of material dynamics [39]. Figure 1 shows a schematic of an IXS experimental setup [38]. Methodological improvements are essential for high-resolution IXS experiments. The primary parameter of interest for most IXS experiments is spectral brightness. Therefore, high-repetition-rate XFELs in self-seeding mode, whose average spectral flux is approximately two orders of magnitude greater than what is possible with storage-ring-based radiation sources, are alternative high-spectral brightness sources for IXS applications [40]. Furthermore, an XFELO could produce approximately four orders of magnitude higher spectral flux (and seven orders of magnitude higher brightness) than existing third-generation light sources, which is superior to IXS and many other X-ray scattering technologies.
The application of XFELO in IXS was first considered in [41] using a tunable X-ray cavity. Because of the significantly increased spectral brightness of XFELO, the scope of IXS technology can be greatly expanded in previously unimaginable ways, such as fully examining materials under extreme conditions [38] and directly probing intersystem couplings to comprehend complex materials [42]. XFELO also allows one to increase the signal rate while reducing the radiation damage per scattering event. As a result, the lifetime of the sample will also be extended owing to the higher spectral flux and, correspondingly, lower integrated flux. In addition, the increased spectral flux reduces the measurement time, e.g., from a few days using older systems to only a few minutes using XFELO. Furthermore, this may stimulate completely new approaches and applications, which can have a significant influence in multiple fields.
XFELO is capable of generating X-ray pulses in the energy range of 6 to 25 keV while maintaining a high-energy resolution (meV). With an extended energy range, XFELO will increase signal rates, reduce radiation damage, and provide better capability to penetrate into different types of sample materials under different environments. The increased energy range also implies that more edges are available for resonant scattering studies as well as nuclei for nuclear resonance scattering experiments. In particular, XFELO can access the 14.4 keV resonance of 57 Fe with extremely high spectral flux [41], allowing for more productive methods. In addition, the extended energy range and higher spectral density allow for significantly more flexible optical schemes for non-resonant techniques that can be used to probe electronic excited-state structures and study atomic dynamics with higher resolution.
In principle, resonant IXS (RIXS), where the incident beam energy is tuned to be near to the atomic transition or edge, allows the study of atomic dynamics with a resolution in the meV range [43,44]. RIXS is currently one of the most cutting-edge areas in IXS. The resolution of hard X-ray RIXS is nearing a level of general interest in atomic dynamics, but the resolution has yet to reach the several meV level. Therefore, we see great potential benefits in exploring it in XFELO applications, as RIXS exhibits greater sensitivity to electronic excitations, magnetic excitations, complex mixed spin-charge excitations, and phonons.
Therefore, RIXS is one of the most effective methods for potentially studying complex quantum materials that present strong electronic correlations or some type of electronic order, exhibiting a plethora of exciting physical phenomena of immediate technological interest, such as superconducting or magnetic properties. Additionally, meV-RIXS has the potential for direct implementation of anomalous scattering measurements, which may help identify atomic species that contribute to specific spectral features. Although such tests require an increased resolution, they will become feasible as techniques to increase the XFELO flux are developed.

X-ray laser with extreme light
According to quantum electrodynamics (QED) theory, a vacuum can be polarized by an ultra-intense laser, thus producing two different refractive indices in the two polarization directions of the incident light. Thus, the slight differences in the refractive index of vacuum particles caused by electric and magnetic fields lead to a birefringence effect when light passes through. Although vacuum birefringence has been predicted for a long time, it has not been experimentally verified to date. Experimental verification of this effect has important implications in the field of QED [45].
Experimentally, the most likely measurement technique for vacuum birefringence requires ultra-intense lasers and X-rays with very high polarization purity [46]. After vacuum birefringence occurs, the exit beam becomes elliptically polarized. Finally, the polarization-flipped X-ray photons must be measured using a high-precision analyzer and detector. The measurement accuracy is related to the number of photons that pass through a polarimeter, which is highly dependent on the spectral brightness of the X-ray pulse. With the development of X-ray free-electron laser facilities and ultra-intense and ultrafast lasers, it should now be possible to study the phenomenon of vacuum birefringence in the laboratory.
The 100 PW laser at the extreme light station (SEL) of SHINE [47] will be operational in 2024 and SEL will combine 100 PW laser pulses with XFEL beams at a later date. With a focus size of 5 μ m, the peak intensity of the 100 PW laser will reach 10 23 W∕cm 2 , which should allow for the observation of vacuum birefringence. After colliding with a 100 PW laser, the polarization purity of the 12.914 keV X-ray beam will change by a factor of 10 −10 . Thus, the polarization purity of the X-ray beam is expected to be in the range of 10 −10 to 10 −9 . The basic conceptual design to use SEL for measuring vacuum birefringence is shown in Fig. 2. Using this approach, the X-ray beam before collision requires a large number of X-ray photons in the laser focal volume as well as fine control of the polarization purity.
Compared to SASE, the spectral brightness of XFELO is increased by three orders of magnitude. In addition, the polarization purity of the XFELO pulses is higher because of the relatively short undulator and because the pulses are contributed by multiple electron beams. Therefore, XFELO can provide more photons that can pass through the polarizer. This can significantly improve the signal-to-noise ratio of the experiment and reduce the thermal load on the polarizer.

X-ray optical vortices
Optical vortices are spirally phased beams that have a phase dependence of exp(il ) , where l denotes the topological charge and denotes the azimuthal coordinate in the plane perpendicular to the beam propagation path. As demonstrated, the orbital angular momentum (OAM) of optical vortices is l [48]. The past few decades have experienced a succession of breakthroughs in vortex and OAM applications, including ultra-high resolution imaging, microparticle manipulation using optical tweezers, high-capacity communications, quantum optics, and laser thermal noise reduction in gravitational wave detection [49]. Although X-ray OAM is much less common, it is expected that the interaction between matter and X-ray optical vortices will give rise to new phenomena. The ability to enable X-ray OAM opens up attractive new opportunities for exploring different materials. In particular, XFEL can provide unprecedentedly bright X-ray vortices, which will significantly stimulate the development of experiments and methods [50,51].
Recent advances have led to the generation of OAM beams in a single-pass FEL seeded with fundamental Gaussian mode lasers and helical undulators [52][53][54][55]. In general, Fig. 2 (Color online) Concept for measuring vacuum birefringence by colliding a 100 PW laser with an XFEL beam two schemes have been developed to generate FEL OAM pulses. The first scheme uses spirally microbunched electron beams, which can be generated by the high-harmonic interactions of the lasers and electron beams in a helical undulator to produce OAM light. The second is based on the harmonic emission of a helical undulator, which natively carries OAM. In this scheme, the electron beam is microbunched by fundamental Gaussian mode lasers in a planar undulator and then passes through a helical undulator to generate OAM light.
Unlike single-pass FELs used to produce OAM beams, XFELO is well suited for producing coherent radiation with high power and high repetition rates in the hard X-ray regime [17,56]. Compared to other schemes, the generation of OAM light in XFELO does not require a helical undulator or seed laser. Thus, an XFELO that generates OAM can achieve a shorter wavelength. Without the use of an additional monochromator, the XFELO scheme also provides significantly higher intensity for experiments. Thus, XFELO can enable a new method to generate bright optical vortices, stimulating the development of entirely new experiments in areas such as imaging and quantum optics.

SHINE overview
Considering the rapid progress in the development of XFEL around the world and in response to growing demands from the Chinese science community, a new high repetition rate XFEL, SHINE, is currently under construction and is one of the major research infrastructure projects in China [9,[57][58][59]. The SHINE facility consists of a low emittance continuous-wave (CW) injector, a high-performance superconducting radio-frequency (SCRF) linac that can accelerate electrons to 8 GeV with 1 MHz repetition rate, three undulator lines to cover 0.4-25 keV photon energies, and ten end stations. When it becomes operational in 2025 (planned), SHINE will be the first high-repetition-rate XFEL user facility in China, designed specifically to enable new science opportunities.
SHINE will be located in Zhang Jiang High-Tech Park, close to the Shanghai Synchrotron Radiation Facility (SSRF) campus and ShanghaiTech University. The major facility will be installed underground at a depth of ∼ 38 m, whose total length will be approximately 3.1 km, as shown in Fig. 3. SHINE will have one accelerator tunnel and three undulator tunnels with the following beamline tunnels. In each undulator tunnel, two undulator lines can be accommodated. In the initial phase, three undulator lines will be located in two undulator tunnels. Using these undulator lines, SHINE will cover both the soft and hard X-ray regions, from 3 nm to 0.5 Å.
The SHINE accelerator comprises the following parts: a photo-injector, which generates electron beams with a repetition rate of up to 1 MHz and accelerates them to ∼100 MeV, and the main SCRF linear accelerator, where electron beams are accelerated to ∼8 GeV and are longitudinally compressed to a peak current of 1.5 kA. The photo-injector is based on a VHF photocathode gun [60,61]. The SHINE injector can produce a 10 ps full width at half maximum (FWHM) pulse with a 100 pC bunch charge, and a root mean square (RMS) normalized transverse emittance of 0.4 mm·mrad at 90-120 MeV. A laser heater is used to suppress any microbunching instability. The ∼100 MeV electrons then enter the L1 structure (containing two cryomodules) to be accelerated to ∼320 MeV. A 3.9 GHz SCRF harmonic cavity is located before the first bunch compressor (BC1), which compresses the electrons longitudinally to increase the peak current. The L2 structure (containing 18 cryomodules), located between BC1 and BC2, accelerates the electron beams from 270 MeV to ∼2.1 GeV. After BC2, the electron beams are further accelerated to approximately 8 GeV in the L3 structure (containing 54 cryomodules). Subsequently, a metallic corrugated structure designed to cancel the linear chirp of the electron beam is located at the end of the linac. A beam distribution system is used to deliver the electron beams from the linac to the three undulator lines. The initial undulator lines are referred to as FEL-I, FEL-II, and FEL-III. FEL-I will generate X-rays with photon energies from 3 keV to 15 keV with an undulator period of 26 mm; FEL-II will cover the photon energy range of 0.4-3 keV with an undulator period of 55 mm; FEL-III will cover the photon energy range of 10-25 keV using superconducting undulators (period of 16 mm). Both FEL-I and FEL-III will run in the SASE mode with a self-seeding option. The high-brightness SASE mode will also be implemented in FEL-I. The echo-enabled harmonic generation (EEHG) and afterburner scheme with an elliptically polarized undulator (EPU) will be available in FEL-II.
The SHINE scientific instruments will enable the investigation of the structural dynamics of materials, including physical and chemical behaviors in condensed matter and biomaterials at the fundamental ∼ Å and ∼ fs length scales. SHINE will serve as the most powerful probing tool for clean energy, environmental engineering, material science, and life science applications.
The total length of the undulator hall is 400 m, and the FEL-I undulator line of approximately 200 m will be located in the middle of the hall. A two-stage self-seeding scheme will be implemented. Two electron beam delay chicanes are placed after the number 7 and number 17 undulator segments, respectively. An optics chamber, which mounts the crystal to form the optical cavity, can be located in the middle of the chicanes. Thus, it is possible to place the X-ray cavity between the switchyard and the self-seeding chicanes, or between the self-seeding chicanes and the electron beam dump at the end of the undulator line.

Basic XFELO physics
An XFELO is typically a low-gain device in which an X-ray pulse stored in an X-ray optical cavity is successively amplified by interacting with a fresh electron beam as it passes through an undulator [62][63][64]. In general, XFELO requires a high-repetition-rate electron beam and an undulator to provide the gain, as well as a crystal cavity to circulate and store the X-ray pulses. In the undulator, the electron beam amplifies the circulating X-ray pulses during the FEL process (amplification factor of 1 + G for the single-pass gain). With each pass through the undulator, the FEL process causes the beam electrons to undergo microbunching. When the intensity is higher, the electrons rotate faster in phase space and absorb power from light near the end of the undulator. This will cause the gain to decrease. Saturation occurs when the gain is equal to the total cavity loss. Hence, the XFELO operates much like traditional lasers. In addition, when the gain is low, the optical mode is almost entirely determined by the optical system of the resonator. In this manner, XFELO is expected to produce highly stable X-ray beams with high average power and ultra-high spectral brightness, enabling new opportunities complementary to those provided by SASE XFELs.
Small signal gain The power evolution in XFELO can be described as follows: where P n is the power of the X-ray pulse at the n th pass through the cavity, G is the FEL gain, and R is the total reflectivity of the optical cavity. The net single-pass gain is R(1 + G) and the power increases if R(1 + G) > 1 . In an oscillator FEL, the radiation stored in the cavity interacts with electrons successively, leading to an increase in the radiation intensity and to microbunching of the electron beams in each pass. The power increases exponentially with n before reaching saturation. However, the power eventually becomes sufficiently large to over-microbunch the electron beam, which significantly reduces the gain. When R(1 + G) = 1 , the system reaches its steady state.
With a low-out-coupling cavity, the oscillator FEL generally operates in the low gain region, and the gain is the well-known small-signal gain that can be defined by [64] i n w h i ch L g = 1∕2k u √ 3 i s t h e o n e -d i m e nsional power gain length, is the FEL parameter, ; k u = 2 ∕ u with u is the undulator period, K is the dimensionless undulator strength parameter, L = N u u is the undulator length, I p is the peak current of the electron beam, I A ≈ 17 kA is the Alfvén current, e and are the RMS transverse size of the electron beam and the electron energy in units of the rest energy, respectively, = 4 N u Δ ∕ r is the detuning parameter in the energy, and [JJ] is the Bessel factor. For a planar undulator, [JJ] is the difference between two Bessel functions: The maximum value of the small-signal gain is proportional to the FEL parameter , which depends on the six-dimensional phase space density of the electron beam. The gain function is plotted in Fig. 4. It can be seen that the gain function is antisymmetric with respect to . There is no gain for an initial phase velocity of = 0 in phase space, which means zero detuning in beam energy (or equally in wavelength). It can be observed that the maximum gain occurs for an initial beam energy detuning of = 2.606 . Thus, to achieve the maximum gain in an XFELO, one must select an electron beam energy detuning that is slightly positive (beam energy larger than the FEL resonance energy). Conversely, at a fixed beam energy, the lasing wavelength is longer than the resonance wavelength. In summary, the small-signal gain should be optimized by increasing the FEL parameters and carefully changing the detuning. Undulator choice The main parameters considered for the undulator include the magnetic field strength and the period. When an undulator is built, the period is usually fixed, whereas the magnetic field can be changed by changing the gap between the magnetic poles. The fabrication of undulators is limited by current technology. If the period is too short, the undulator will not provide sufficient magnetic field strength. This severely limits the adjustable range of the photon energies that can be provided. In physics, the undulator period and the corresponding parameter K should satisfy the resonant condition where is the beam energy and r is the resonant wavelength. For a fixed beam energy, this constrains the wavelength tuning range.
In this case, undulator parameter K itself is a function of the undulator period: K = 0.934 u (cm)B u (T) . In most cases, the appropriate value for K will lie between 1 and 3. If K is too small, then the radiation gain may be too weak. Moreover, for a given radiation wavelength and undulator period, the FEL parameter is ∝ (K[JJ]) 2∕3 ∕(2 + K 2 ) 1∕2 . Therefore, it can be determined that K has an optimum value leading to a maximum gain when K = 1.556 , as shown in Fig. 5.
In practice, tuning of the FEL wavelength is realized by changing the intensity of the undulator magnetic field or the energy of the electrons; however, the former method is used more often. Thus, the value range of K should be in the neighborhood of 1.56. The variation in the wavelength as the intensity of the undulator parameter K changes is shown in Fig. 6. For the range K = 1 − 3 , the X-ray energy increases by more than a factor of three. For photon energies ranging from 5 to 15 keV, the undulator period can be 26 mm. For a higher energy above 15 keV, a shorter undulator period,  such as 16 mm, should be used to provide sufficient gain in an XFELO. Finally, the XFELO in harmonic mode can also reach photon energies above 15 keV.
As mentioned above, all SHINE undulators have been chosen to allow alterable gaps. The wavelength can be tuned by changing the undulator gap at a constant electron beam energy. The magnetic length of each undulator is 4.0 m (26 mm undulator period) for FEL-I. Thus, MING can use the same undulators as used in FEL-I. In addition, the same devices installed between the undulator segments to monitor and correct the electron trajectory can be used, such as cavity beam position monitors, phase shifters, quadrupoles, correctors, and quadrupole movers.
Optical cavity design In XFELO, the cavity is essentially a feedback system of electromagnetic fields that travel along a closed loop formed with Bragg reflecting mirrors and focusing elements. To match the repetition rate of the electron beam of SHINE (approximately 1 MHz), a cavity with a total trip length of approximately 300 m should be formed using two or four Bragg mirrors. Bragg-reflecting mirrors are used because the Bragg reflection in the X-ray regime can reach a very high reflectivity at a near-normal angle incidence [65,66], as shown in Fig. 7. It can be determined that the spectral width of the high reflectivity, called the Darwin width, is only 15 meV at 14 keV and 150 meV at 7 keV. Within the Darwin width, the crystal can provide a reflectivity above 90%. Diamond crystals, characterized by low absorption and high thermal conductivity, can even provide a reflectivity greater than 99% in the hard X-ray regime [65]. In addition, the phase variation within the Darwin width due to Bragg diffraction produces an additional time delay in X-ray pulses, which can be compensated for by detuning the cavity length [18]. Otherwise, the longitudinal mismatch between the X-ray pulses and electron beams may lead to a significant reduction of the FEL gain.
In addition to mirrors, X-ray focusing elements are required to maintain the stability of the optical cavity [18,67]. For example, beryllium (Be) parabolic compound refractive lenses (CRLs) with a very high transmissivity of approximately 99% can be used [68,69]. When the gain is small, the transverse mode is typically determined by the optical cavity. The propagation of an X-ray pulse inside the cavity can be analyzed by the ABCD matrix method [70], which is a linear ray optics formalism that describes light beam propagation through optical elements. The cumulative effects of the optical elements are written as matrices in the form where r and r ′ indicate the position and angle of the ray, respectively, and n indicates the n th propagation in the cavity. The stability of the cavity is then determined by the eigenvalues of the ABCD matrix. If the cavity is stable, the eigenvalues are real and positive. This produces the condi- The simplest cavity is formed by two crystal mirrors with normal incidence (exact backscattering). In this case, a sapphire crystal should be selected to avoid the effects of multiple-beam diffraction, leading to the low reflectivity associated with exact backscattering [71,72]. Silicon or diamond single crystals are unsuitable for use as exact backscattering X-ray mirrors because of their multiple-beam diffraction effects. A sketch of this type of cavity is shown in the top image of Fig. 8. Additionally, the bottom image in Fig. 8 presents a contour plot of the |(A + D)∕2| parameter as a function of CRL focusing length f and the distance from the CRL to the cavity center L 1 . With CRLs having a focusing length of approximately 56 m, L 1 can be chosen as 50 m, corresponding to a distance of 100 m between two CRLs within a 150 m cavity. The structure of the cavity built from two mirrors is simple, but has two main drawbacks [41]. First, not all crystal types can be used as reflectors. This is because of the multiple-beam diffraction effect, which results in a collapse of the reflectivity at near-normal incidence. Second, the working energy of such cavities is not tunable because the reflecting angle cannot be adjusted. To achieve energy tuning by changing the reflecting angle, a cavity composed of a minimum of four crystals is required. For example, a cavity with a bowtie structure can tune the photon energy within a 5% range. The stability of such cavities can also be analyzed as discussed previously.
The top plot of Fig. 9 shows a schematic of a potential bow-tie X-ray cavity. Four diamond or Si crystal plates are mounted in strain-free crystal holders [73], which are installed on motion stacks to achieve high moving resolution. The four-crystal cavity also allows for the use of different reflection planes in the crystals. The contour plot of the parameter |(A + D)∕2| as a function of the focal length f and the distance between the CRL and the center of the cavity L 1 is illustrated in the bottom image of Fig. 9. It can be observed that there is a large area in which a stable cavity can be achieved.
Another consideration is how to extract the X-ray power from the cavity. Generally, it is necessary to choose a relatively thin crystal (with only a few extinction lengths) to be located downstream of the undulators, where the reflectivity is not particularly high and some X-rays can be transmitted through the crystal. For RAFEL, this requires a much higher outcoupling efficiency, therefore requiring very thin crystals, which are almost impossible to process using current technology. Therefore, a pinhole crystal should be used. Another possible approach is to utilize intra-cavity beam splitters, which are capable of coupling X-rays such that the output amount can be varied from zero to close to 100% [74].

XFELO performance
The initial phase of the SHINE XFELO aims to provide coherent X-ray radiation spanning an energy range from 6 to 15 keV. A natural cutoff in the photon energy is approximately 15 keV because the gain provided by 26 mm undulators drops significantly at larger photon energies. Thus, using three or four undulator segments, the XFELO mode can cover the fundamental photon energy range of 6 to 15 keV with excellent longitudinal coherence. To achieve higher energies, one can use the harmonic mode of the XFELO operation, which significantly reduces the undulator or electron energy requirements. The main parameters of the XFELO system are presented in Table 1. Three-dimensional (3D) simulations were performed using a combination of GENESIS [75], OPC [76] and BRIGHT [77].
To illustrate the performance of the XFELO intended for SHINE, we consider two schemes for the X-ray cavity based on four photon energies. The first cavity is a rectangular X-ray cavity, in which four Bragg reflecting mirrors with a Bragg angle of 45 degrees are used. In this scheme, Si and diamond crystals are chosen to form the cavity. For the Si crystal, the (4 0 0) and (8 0 0) Bragg reflection planes are considered, where the reflection photon energies are 6.46 keV and 12.91 keV, respectively. For the diamond, the (4 0 0) Bragg reflection is used, which can reflect X-rays at 9.83 keV. In the second scheme, two sapphire crystals using the (0 0 0 30) Bragg reflection are chosen to form the cavity, which can circulate X-rays at 14.31 keV. In all cases, CRLs with a focusing length of 56 m are used to control the transverse mode of the cavity. The undulator is split into eight modules, each 4 m in length. A thin crystal with an output coupling efficiency of 20% is used to couple the photons from the X-ray cavities.
6.46 keV Figure 10 illustrates the XFELO output performances near a photon energy of 6.46 keV. In this case, Si crystals with a (4 0 0) reflection plane are used as the mirrors. Three undulator segments are used to provide the gain. The evolution of the output pulse energy is shown in the upper panel of Fig. 10. The steady-state output pulse energy is approximately 320 μ J, corresponding to 3 × 10 11 X-ray photons. The profiles of the radiation output are shown in the bottom-left plot in Fig. 10. In the bottom-right plot, we show the corresponding output spectrum (the solid line), indicating that the spectral FWHM is approximately 100 meV, corresponding to a relative value of ∼ 1.5 × 10 −6 , or approximately 1.8 times the Fourier transform limit (0.44) for a Gaussian pulse profile. The typical spot size and diffraction  In this case, the bandwidth is narrower than the reflectivity width of the crystals (shown by the dashed line). This is because the radiation power profile at saturation is nearly identical to that of the electron beam current. Thus, the radiation spectrum profile is also defined by the Fourier transform of the electron current profile.
The detuning curves obtained from the simulations are shown in Fig. 11. In the figure, we plot the output pulse energy versus cavity detuning for a photon energy of 6.46 keV. Here, the cavity detuning is plotted relative to the nominal zero-detuning length. As shown in the figure, we find a full-width detuning range of approximately 24 μ m and an FWHM detuning range of approximately 18 μ m. The results are in reasonable agreement with the estimate based on a slippage length of 0.15 μ m and an extinction depth of 1.7 μm.
In the above simulation, the electron bunch is much longer than the slippage distance. The situation may be different in the RAFEL operation because it uses shorter electron bunches and longer undulators. When the pulse length is on the order of the slippage distance, the operation of the FEL then becomes subject to a variety of "short pulse effects", such as limit cycle oscillations of the pulse energy [78,79]. This type of oscillation occurs when the saturated light pulse moves away from the electron pulse due to slippage, whereas the sub-pulse formed at the rear of the optical pulse moves forward and grows periodically. In the hard X-ray region, the slippage distance is typically less than 2 μ m in MING. As a result, limit cycle oscillations are only possible under a low-charge mode, e.g., 20 pC. 9.83 keV Figure 12 shows the XFELO output performances near a photon energy of 9.83 keV. Diamond crystals with a (4 0 0) plane are used as mirrors. The gain is provided by three undulator segments. The evolution of the output pulse energy is shown in the upper panel of Fig. 12. The steady-state output pulse energy is approximately 310 μ J, corresponding to ∼ 1.9 × 10 11 X-ray photons. The radiation output profiles are shown in the bottom-left image of Fig. 12. In the bottom-right image, we show the corresponding output spectrum (solid line), indicating that the spectral FWHM is approximately 50 meV, corresponding to a relative value of ∼ 5.1 × 10 −6 , or approximately 1.2 times the Fourier transform limit (0.44) for a Gaussian pulse profile. The typical spot size and diffraction angle of the X-ray source are approximately 38.8 μ m (FWHM) and 1.53 μrad (FWHM), respectively. These steady-state pulses are reached after ∼ 60 passes.
12.91 keV The output performance of the XFELO near a photon energy of 12.91 keV is shown in Fig. 13. In this case, Si crystals with (8 0 0) reflection plane are chosen as the mirrors. Three undulator segments are used to provide the gain. The evolution of the output pulse energy is shown in the upper panel of Fig. 13. The steady-state output pulse energy is approximately 240 μ J, corresponding to ∼ 1.1 × 10 11 X-ray photons. The profiles of the radiation output are shown in the bottom-left image of Fig. 13. In the bottom-right image, we show the corresponding output spectrum (solid line), indicating that the spectral FWHM is approximately 20 meV, corresponding to a relative value of ∼ 1.5 × 10 −6 , or approximately 1.1 times the Fourier transform limit (0.44) for a Gaussian pulse profile. The typical spot size and diffraction angle of the X-ray source are approximately 36 μ m (FWHM) and 1.47 μrad (FWHM), respectively. These steady-state pulses are reached after ∼ 100 passes.
14.31 keV Figure 14 illustrates the XFELO output performances near a photon energy of 14.31 keV. In this case, two sapphire crystals with (0 0 0 30) reflection planes are chosen as the mirrors. With an undulator period of 26 mm and a beam energy of 8 GeV, the FEL gain at 14.31 keV drops significantly. Four undulator segments are therefore used to provide sufficient gain. The evolution of the output pulse energy is shown in the top panel of Fig. 14. The steady-state output pulse energy is approximately 160 μ J, corresponding to ∼ 7 × 10 10 X-ray photons. The profiles of the radiation output are shown in the bottom-left plot in Fig. 14. In the bottom-right plot, we show the corresponding output spectrum (solid line), indicating that the spectral FWHM is approximately 10 meV, corresponding to a relative value of ∼ 7 × 10 −7 , or approximately 1.3 times the Fourier transform limit (0.44) for a Gaussian pulse profile. The typical spot size and diffraction angle of the X-ray source are approximately 35 μ m (FWHM) and 1.18 μrad (FWHM), respectively. These steady-state pulses are reached after ∼ 250 passes.  Compared with the result for 6.46 keV, the electron beam Fourier transform provides a bandwidth larger than the reflectivity bandwidth of the crystal. Therefore, the temporal distribution of the radiation pulse is distorted by the bandwidth. It is also important to note that these results can be further optimized.

Start-to-end simulations
The operation of an XFELO requires a relatively long electron bunch with a linear energy chirp because of the ultranarrow spectral acceptance of the crystal Bragg reflection. The baseline SHINE case provides electron bunches with 100 pC total charge, which are compressed to a 1500 A peak current. The slice emittance is approximately 0.4 μm , whereas the slice energy spread is below 0.01%. To obtain a 700 A electron beam with a flat longitudinal phase space, we employ an evolution algorithm to optimize the injector and linac parameters, including the drive laser pulse profile, the R 56 of the two bunch compressors, the dechirper parameters, and the phase and gradient of the three main linacs as well as of the harmonic cavity. The optimized solution is then validated using ELEGANT [80] simulations with 2 M macroparticles. The final bunch phase space distribution, current, and slice energy spread at the undulator entrance are shown in Fig. 15. The flat part in the beam phase space is approximately 130 fs. The slice energy spread in the core section is approximately 0.5 MeV.
Using the start-to-end simulated electron beam, the results of the FEL simulation are presented in Fig. 16. The XFELO adopts a rectangular geometry with four diamond crystals. Using the C (4 0 0) reflection plane with an incidence angle of 45 • , the XFELO operates near a photon beam energy of 9.83 keV. The efficiency of the output coupling is 20%. The output pulse energy reaches 320 μJ , corresponding to 2.0 × 10 11 photons per pulse. The temporal power profile and the corresponding spectrum in this case are shown in the bottom plots of Fig. 16.

Tolerances
The tolerances are established by requiring the displacements in position and angle to be much less than the fundamental mode size and angular divergence, respectively. The tolerances related to the orientation of the crystal can be determined using the ABCD matrix method [18]. For typical XFELO parameters, the mode size r is approximately 15 μm , the divergence is approximately 1μrad , and the cavity round-trip is approximately 300 m at ∼1 MHz. Consequently, the angular tolerance is approximately 10 nrad . In fact, it is very difficult for current stabilization methods to achieve a ≤ 10 nrad angular stability while also considering the necessary cooling of the crystal [81].  Figure 17 shows the pulse energy evolution of the XFELO for different angular jitter values of the mirrors near a photon energy of 9.81 keV. The angular displacement is introduced in every shot. The optimized number of undulator segments, N u , is 3. With N u = 3 , the maximum output can reach 300 μJ . As mentioned above, the impact of angular deviation The photon energy is approximately 9.83 keV on the output is negligible when the angular jitter is lower than 10 nrad, but will significantly affect the stability of the XFELO output when the angular jitter is greater than 20 nrad. To suppress the effect of angular jitter, one possible method is to add undulators, which can compensate for the gain loss due to beam position displacement. When the undulator line is increased to five segments, the jitter tolerance can reach 50 nrad, which is currently achieved at synchrotron radiation facilities. A disadvantage of this approach is the drop in oscillator output energy, which is inversely proportional to N u .

OAM mode
In particular, light beams with a spatial phase dependence of exp(il ), where denotes the azimuthal coordinate and l is an integer referred to as the topological charge (order), carrying an orbital angular momentum (OAM), represent one of the most intensively studied topics in optics. In this regard, OAM beams in the visible and infrared wavelength regimes have already been utilized in diverse applications, such as micro-manipulation, quantum information, and optical data transmission. In the X-ray regime, the use of OAM beams can enable the direct alteration of atomic states through an OAM exchange and facilitate the development of new methods to study the quadrupolar transitions of materials. However, practical applications of X-ray beams utilizing OAM are currently limited owing to the lack of suitable optics and the difficulties in constructing practical, coherent light sources.
XFELO can be used to generate OAM beams using a newly proposed method, which essentially facilitates the preservation of OAM beam amplification at the fundamental wavelength and avoids the need for external optical elements. The method is very simple, as it requires only adjustment of the resonant condition of the XFELO operation. This method is based on the important fact that the resonant condition for each transverse mode is slightly different. Consequently, the gain profile of each transverse mode is shifted over the spectrum. The combined effect is that XFELOs can operate in a specific spectral regime in which radiation in a high-order transverse mode can be obtained at maximum gain. Because the laser saturation state is governed only by the gain and cavity loss, this effect enables XFELOs to select transverse modes that carry OAM. This approach significantly reduces both the electron-beam control elements and the external optical elements, thereby significantly increasing the optical efficiency.
We performed a simulation with a photon energy of 9.81 keV. The simulation results are shown in Figs. 18 and 19. Figure 18 shows the pulse energy as a function of the number of round trips and the evolution of the transverse mode. The saturation power reaches 200 μ J, approaching the Gaussian mode operation level. In the short period ranging from 20 to 50 round trips, mode competition or mode completion is observed. Consequently, a short time period is required for completing the symmetric doughnut-like transverse intensity profile and the helical phase. The outcome is robust because the system must reach a stable state determined by the gain tuned for the l = −1 mode.
At saturation, the characteristic hollow profile and helical phase can be observed, as shown in Fig. 19. It is evident from the phase distribution that the dominant mode is the l = −1, p = 0 Laguerre-Gaussian (LG) mode. The intensity of l ≠ −1 modes is negligible. The longitudinal power profile and the spectrum are shown in Fig. 19. As the total power increases to 200 μ J, the peak power exceeds 1.5 GW with an FWHM spectrum width of 40 meV.

Inclined undulator
To directly produce the 45-degree polarized X-rays desired by the SEL station, XFELO using several inclined undulators is considered. The main specifications and parameters of the inclined undulator U26 (undulator with a 26 mm period) are listed in Table 2. A variable gap is made possible using four independent servomotors driving this undulator. The challenges involve series production, straight alignment, and synchronization of the undulator modules. The magnet arrangement of the undulator adopts a standard hybrid magnet structure. Magnetic arrangements are formed by the periodic arrangement of neodymium iron boron permanent magnets and soft magnetic poles to generate an approximately sinusoidal magnetic field in the air gap. The basic design idea involves typical C-type mechanical structures located on a 45-degree inclined frame, as shown in Fig. 20. The gap is measured using absolute linear encoders. The motion control, motors, and programmable logic controller (PLC) are based on the Beckhoff motion control system. All electronic racks are mounted on the support structure and therefore will be located in the machine tunnel.
Magnet design The magnetic field calculation indicates that the effective peak magnetic field of 1.03 T can  be obtained at a minimum magnetic gap of 7.2 mm. The center magnetic structure design will be a typical variablegap hybrid magnet device, in which the poles will consist of pure soft iron, as shown in Fig. 21. The magnetic performance of U26 was calculated using RADIA [82]. To achieve the required field of 1.03 T at a 7.2 mm gap, the optimized dimensions of the magnet blocks are 45 mm (width), 45 mm (height), and 9 mm (thickness). There is a 4 mm deep, 45 • cut at each corner to clamp each block in its respective holder. The blocks are made of NdFeB with a minimum remanence of 1.25 T (an intrinsic coercivity HcJ > 21000 Oe) and must be coated with NiCu or Ni. Vanadium is selected as the pole material (pole dimensions are 4 mm thickness, 33.75 mm height and 27 mm width). A 4 × 4 mm 2 ear extends out on each side to secure the pole within the pole holder. The roll-off requirement of U26 was determined by applying the field uniformity requirement ( ΔK eff ∕K eff < 0.0002 ) over a beam position accuracy of 0.5 mm. Because the rolloff requirement is more difficult to satisfy for larger gaps, the X-ray tuning range limits the relevant gap range to between 7.2 and 20 mm. The magnet width in U26 is thus selected as the force-minified type and is sufficiently narrow to maintain the field uniformity requirement, as shown in Fig. 22.
End design The design of the magnet arrangement at the entrance and exit (the first and last few periods) of each undulator segment is very important because it allows the electrons to wiggle along the undulator axis without incurring a kick angle or offset. The end design of the undulator should also ensure that the first and second field integrals remain at zero over the entire gap range.
The magnet model for U26 shown in Fig. 23 can be used in the design of the end sections. The undulator shown in Fig. 23 is asymmetric, with 12 full-size poles and two thin end-section poles. The end sections consist of two magnet blocks and one pole separated by air spaces. This implies that only the normal second integral is non-zero. The normal first integral, the skew integrals, and all integrated multipoles are zero in the model undulator, owing to its symmetry. We tune the undulator end sections to obtain a small  and close-to-constant averaged first integral in the middle of the model undulator to avoid strong variations in the normal second integral. Figure 24 shows the magnetic field distribution of the 12-pole module and the extrapolated vertical second integral for this asymmetric undulator at different gaps.
The influence of beam deformation on phase error The magnetic field of undulator U26 is approximately 1.0 T, and the total length of the undulator is 4 m. The results of the magnetic force calculation show that the maximum attractive force between the upper and lower magnets is approximately 2.5 tons when the air gap is 7.2 mm, as shown in Fig. 25. The deformation of the air gap in the center and at both ends of the beam will cause a variation in the magnetic field distribution, resulting in an increase in the RMS phase error that significantly inhibits the amplification of the free electron laser, as shown in Fig. 26. Table 3 lists the RMS phase errors of the undulator radiation with respect to the maximum relative change in the gap variation of 5 μm , 10 μm , and 20 μm . It can be seen that the deformation of the beam directly affects the performance of the undulators. The specification for U26 requires that the RMS phase error of the different magnetic gaps be less than 5 degrees. However, better rigidity requires a much greater beam thickness. Excessive rigidity of the beams inevitably increases the difficulty of the mechanical design and the weight of the machine. Therefore, we consider that the maximum deformation of the magnetic gap must be less than 10 μm for U26.
Mechanical design In the designed magnetic structure, magnets are mounted to module keepers made of aluminum alloy to match the thermal expansion characteristics of the beams. Each magnet keeper mounts three magnets together and is fixed to beams, which allows for magnetic tuning through keeper height adjustment and rearrangement techniques based on flipping and swapping keepers. The keepers are located along the beam direction by pins to maintain precise periodic spacing.
The beams for the inclined U26 are made of low-cost carbon steel, which is isolated from the magnetic arrangement by a 50 mm aluminum alloy girder. The beam can be moved toward either side using linear guide rails fixed on the bracket to adjust the magnetic air gap. Each beam is driven at two points using two transmission systems fixed on a bracket. The frame support is anchored to the ground using bolts. The undulator adopts four independent subsystems to drive the left and right beams to create a symmetrical opening and closing movement based on the beam center to change the magnetic gap. The gap is measured using absolute linear encoders. The motion control, motors, and PLC are based on the Beckhoff motion control system. All electronic racks are mounted on the support structure and therefore will be located in the machine tunnel.
Magnetic measurement and correction The performance of the inclined undulator should be checked at SSRF. Magnetic measurements show that the stability at room temperature should be within ±0.5 o C. The Hall probe system is a basic component measuring 350 mm × 600 mm × 7050 mm. The magnetic assembly of the linear motor is mounted between two high-precision guiding rails along the top of a granite block. The Hall probe PCB is fabricated with three separate sensors that measure the magnetic field. These sensors produce a Hall voltage that is proportional to the magnetic field that is passed to the sensing area. The Hall sensor can serve as a transducer of the SENIS Hall probe S type, which has good calibration accuracy, better broadband noise immunity, and a resolution near 1 μ T. The sensor's parameters are very important for determining the dominant correction features to be adjusted in order to achieve a straight electronic trajectory.
A large Helmholtz coil will be built around the measurement room to apply external fields to a small number of undulators in order to characterize the resulting field in the gap and the necessary current in the trim windings for field-correction purposes. A map of the magnetic field in the tunnel will be created in the future. The difference between the tunnel field and the field in the MMF, along with the characterization of the test undulator in the large Helmholtz coil, will determine how to set the current in the trim windings for each undulator position in the tunnel.
Undulator shimming will be implemented by changing the pole or magnet heights and angles (or the dislocation in the x-direction). The effects of pole or magnet motion will be measured and parameterized. These parameterizations will be used in a computer program or by a tuning expert to determine the pole motions necessary to correct the trajectories, phase, etc., and is performed at the minimum gap. Thus, undulator field errors are corrected when the effect of the field errors is at its largest. As the gap increases, the effects of both the field errors and correction fields decrease. If the field errors and corrections do not track each other as the gap opens, additional corrections must be made, which change with the gap setting. This will be performed using powered correction coils. Coils will also be required to compensate for external fields as the gap is changed.
Undulator control For the control aspect, an undulator line (or system) can be divided into many similar constitutional cells (undulator cells). Each undulator cell is composed of an undulator, quadrupole mover, and phase shifter mover. An undulator consists of two magnet arrays, and the gap between them ultimately determines the wavelength of the laser light. Four servomotors equipped with two drivers are adopted to drive the relative reducers and screw systems  of the undulator. For the intersection segment, three servomotors are applied: two for a quadrupole mover and one for a phase shifter. All of the above moving structures are equipped with a linear absolute encoder (LAE) with high position acquisition resolution (0.1 μm).
Undulator control is dedicated to providing fast gap and taper control with micrometer accuracy, magnetic pole center height modulation with high precision, and synchronization with low following error, thus offering safe operation and failure detection, prevention of damage, and limitation of movement under emergency conditions. The undulator motion control modes consist of three primary modes: gap, taper, and center modes.
• Gap mode, modulation of gap between magnetic poles and keeping the values of the four encoders below 2 μm. • Taper mode, modulation of deviation between the entrance gap and the exit gap, keeping it within a certain range. • Center mode, modulation of magnetic pole height.

X-ray cavity
Compound refractive lenses In refractive optics, light is guided by refraction from surfaces between different materials, which can be described by Snell's law. Usually, the difference between the refractive index and 1 is called the index decrement. For X-rays, the index decrement of most materials is only slightly less than one. Therefore, the focusing lenses are thinner at the center than at their edges, resulting in a biconcave shape. The parabolic geometry of the refracting surfaces is well suited for focusing X-rays that are parallel to the optical axis [83,84]. A schematic diagram of the refractive lens of the paraboloid compound refractive lens is shown in Fig. 27.
The absorption of X-rays in high-Z materials is high; therefore, the lens material must be a low-Z material, and we mainly employ beryllium, aluminum, and nickel as the lens materials. Metallic lens materials also have the advantages of being highly resistant to radiation damage and having high heat conductivity. Additionally, we choose beryllium (Be) as the material for the CRL used by the XFEL.
Hundreds of neatly arranged lenses with very small radii of curvature can form refractive X-ray lenses with focal lengths of less than 1 m, which can be used for high-power density X-ray experiments. However, the main characteristics of the XFELO that we are concerned with are as follows: the energy range is from 6 to 15 keV; the beam size is 100 μ m. Thus, for XFELO cavities, the desired focus length is usually in the range from tens to over a hundred m, and only a few lenses are required. The focal length f can be calculated as based on the radius of curvature R, number of lens elements N, and index decrement . The focal lengths for a single CRL of different dimensions at various energies are shown in Fig. 28. It is best to choose a CRL with a radius of 500 μ m in the 50-100 m focal length range, and the web thickness of the lens should be less than 40 μm@6 keV to achieve aa transmission efficiency greater than 98%.
Stabilization feedback The XFELO requires extremely high stability regarding beam position and angle. Therefore, it is necessary to establish a high-precision detection system to monitor the beam position and a feedback system to adjust the reflective crystals. The XFELO optical path with length of 50-100 m requires the drift of the beam to be controlled within 10% (5 μ m) of the spot size, that is, the offset of the beam angle must be below 50 nrad. Additionally, the resolution of the position detector should be 1 μ m and the angle monitoring resolution should be 10 nrad.
Drift in the FEL beam is mainly monitored by a highprecision X-ray beam position monitor (XBPM) which is usually installed at a specific position in the optical path [85]. The structure of the beam position monitoring system is shown in Fig. 29, in which the four-quadrant structure XBPM is inserted in the reflection light path. Currently, the resolution of this type of detector developed by SSRF is 0.1 μ m at a distance of 10 m, which can realize an angle resolution of 10 nrad and achieve a sampling rate in the kilohertz range at the same time [86]. However, this detection method cannot measure the deviation of the beam angle directly. For this reason, it is necessary to develop a detection system devoted to detecting the deviation of the beam angle.
Diffraction couples the photon wavelength or energy to the incident angle of the lattice planes within the crystal, and the output beam will contain a spread of energies due to the vertical divergence of the photon beam from the source [87]. Therefore, an analysis crystal arranged orthogonally to the monochromator crystal is used to disperse the output beam in the horizontal direction, as shown in Fig. 30, in which the angle of the output beam can be decoupled from the wavelength and measured directly. Combined with high-speed and high-resolution 2D-imaging detectors, we can achieve a ∼ μs-level sampling rate and nano-radians angular resolution. Furthermore, this detection method does not need to consider the synchronization problem when X-rays are transmitted over a long distance.

R and D for non-vacuum system
It is difficult to establish an experimental system and accomplish detection in a vacuum environment. In the initial stage, the XFELO test system was established based on synchrotron radiation, and different methods were attempted to realize the circulation and high-precision detection of the optical path.
To compensate for the effect of atmospheric absorption, the energy of the X-ray beam used for the experiment is 12.914 keV, where the corresponding lattice index for the silicon crystal is (8 0 0). The design of this scheme is based on a rectangular cavity, in which a closed optical path is formed by four reflective crystals with an incidence angle of 45 • , as shown in Fig. 31. Crystal 1 needs to provide a channel through which the beam can be introduced, and the elicitation of the beam can be realized by critically adjusting the angle of the crystal.
The four crystals must meet the diffraction conditions at the same time, implying that the adjustment mechanism will be very complicated. In order to reduce the difficulty of the online experiment, the first experiment uses two crystals cut from a whole, as shown in Fig. 32. The (8 0 0) and (0 0 8) planes of the crystal lattice were used to realize the 90-degree deflection of the beam. A channel was cut at the lower side of the first crystal to introduce the beam, and another channel was cut at the same position on the second crystal to elicit the beam.
To increase the optical distance of the light beam, the tilt angle of Crystal 2 in Fig. 31 is slightly rotated to cause a slight displacement in the light beam in the horizontal direction. When the crystal is 50 mm wide and the distance between the two crystals is 1500 mm, then 10 cycles of diffraction can be achieved with a 4 mm one-cycle offset in the horizontal direction, and the one-cycle period is approximately 100 ns, which can be recorded by high-speed cameras. Based on the preliminary experiment, the two-crystal system can eventually be changed to a four-crystal system to finally meet the needs of XFELO.

Fast phase shifter
The phase shifter is usually realized by a chicane-like structure made of several bending magnets. Within the phase shifter, a bypass trajectory is built beside the straight trajectory. The electron beam passes through the phase shifter with a longer pass length, thus reducing the arrival time compared to the straight trajectory. When it is applied in the undulator section of an FEL facility, the phase between the electrons and the radiation can be controlled, and their interaction can be changed to vary the property or the quality of the radiation. For example, when a crossed planar undulator is used, the XFEL can switch the X-ray polarization rapidly with a fast phase shifter.
To achieve this, the need to delay the 8 GeV, 1 MHz electron beam bunch-by-bunch with the fast phase shifter is expected. For this purpose, the bending magnets of an ordinary chicane-like phase shifter are replaced by fast kickers with a high repetition rate. When the kicker is on, the beam is delayed for phase shifting, whereas the beam passes through directly without any delay when the kicker is off. In Based on the parameter requirements above, the fast phase shifter is designed to be a chicane-like structure consisting of four fast kicker magnets having 200 mm effective length. The maximum bending angle of the kicker magnet is 35 μrad and the angle is adjustable for various phase change requirements. To avoid disturbances between two successive kicker magnets, their separation should be approximately 200 mm. All four kicker magnets are installed in the same vacuum case and excited by the same power supply to reduce structural complexity. Figure 33 shows the structure of this fast phase-shifter.
For the fast switching requirement, the kicker magnet used here should be able to perform a bunch-by-bunch deflection of the 8 GeV, 1 MHz electron beam. The requirement for the repeat stability of the magnetic field created by the kicker magnets is also very high and should be less than 100 ppm to meet the orbit stability requirement of the downstream FEL process. Based on these requirements, a single-turn coil kicker magnet is selected for the fast phase shifter. The mechanical structure and the field distribution are shown in Fig. 34.
Just as its name implies, the single-turn coil kicker magnet is excited by a single-turn coil. The excitation coil is made of oxygen-free copper with a 10 × 7 mm 2 sectional area. The magnet core is made of NiZn soft magnetic ferrite, which has a fair high-frequency response. The initial permeability can reach 1500, while the saturation flux density achieving than 0.4 T. The electrical resistivity of this magnet is high, the loss tangent is low, and the permeability temperature factor is low. All of these properties allow it to meet the fast kicker requirements.
The key component to guarantee fast and stable operation of the fast kicker magnet is the pulsed excitation power supply. The power supply should operate in a sufficiently fast and stable mode with a high repetition rate. The fundamental principles and the waveform of the output current are shown in Fig. 35.
The circuit of the single-turn coil kicker magnet consists of a combination of resistors, capacitors, and  inductors. First, a resistor and capacitor are connected in parallel, and then an inductor is connected in parallel. A MOSFET is used to turn the circuit on and off for pulse generation. When the MOSFET is turned on, a step response is formed in the circuit. The circuit should work in an underdamping condition to obtain a faster pulse front and peak current. When the MOSFET is off, the energy stored in the inductor (the magnet) is leaked through the resistor with a damping time constant of L/R. With such a design, the high repetition rate and high stability requirements of the power supply can be satisfied with a sufficiently high deflection magnetic field strength. Some of the main parameters of the pulsed excitation power supply for the fast phase-shifter are listed in Table 4.

Mechanical support system of BBA
SHINE is a significant national science and technology infrastructure. SHINE includes an electron-gun, focusing magnets, cryomodules, various magnets including quadrupoles and dipoles, undulators, electron beam diagnostics and control systems, and other associated equipment. All components will be installed and stably supported to the correct position within the tolerances required by beam physics. The mechanical support system is designed not only to support them, but also to be capable of adjusting them to their proper positions. The stability of the electron beam is one of the most important factors that influence the properties of FEL. The increasing demands of beam position stability require higher position stability for key components such as undulators and quadrupole magnets. Because the mechanical support system for the FEL provides support, location, and position adjustment, high mechanical stability of the supports is necessary. This section focuses on the research pertaining to the mechanical support system for beam-based alignment (BBA).
The BBA system is used for the support of the key components of FEL, such as quadrupole magnets and the cavity BPM (CBPM) installed between two undulators [88]. The design concept combines optimized mechanical properties with an 'easy-to-manufacture' design. Figure 36 shows the mechanical structure of the BBA support design prototype for magnets and other key components.
The BBA prototype support system contains two marble slabs with a low thermal expansion coefficient and three layers of steel plates located below the marble slabs. The bottom steel plate (called the grouting plate) is fixed to the ground with four tightening bolts and high-strength nonshrinkage cement. Four shims are placed at the four corners between the grouting plate and the fixed marble plate. Threedimensional changes can be made by adjusting the shims located on the steel plate and four M16 jack screws. The electric sliding table adjusted by remote electronic control is located between the marble and the second-layer support of the beam elements (magnets, CBPM, etc.). The adjustable amount of the sliding table regarding height and horizontal direction can reach ±5 mm. In addition to being adjustable, it can also be used to compensate for any settlement of the foundation in the future.  There is a higher requirement for the stability of the quadrupole magnets in BBA during SHINE operations. For this purpose, we develop active damping equipment. The device can realize both nano-positioning and active vibration reduction. It consists of a piezoelectric ceramic and flexible hinge structure and is driven by four piezoelectric ceramic elements in the vertical direction and one piezoelectric ceramic element in the horizontal direction. A closed-loop controller with internal strain displacement sensor can realize nanoprecision positioning adjustment of the quadrupole at micron precision levels using an electric slide mechanism. Vibration sensors are arranged externally to monitor the background vibration of the table. According to the signals from the vibration sensors, a piezoelectric ceramic feedback drive is used to attenuate the vibration transmitted from the support platform to the quadrupole.

Survey and alignment
Straight Lines Reference System (SLRS) To ensure the high precision of the undulator tunnel control network, a straight lines reference system is built to ensure the absolute accuracy of the undulator tunnel control network. The SLRS will provide correction parameters for the geodetic network ( Δx , Δz ). SLRS works like a ruler placed in the seemingly bent (refraction) tunnel network. There will be no direct connection between the SLRS and the components. Calibrated transfer pieces will be used to connect the SLRS to the tunnel network to obtain measurements.
As shown in Fig. 37, a laser light source emits coherent light. Only the fiber end, an aperture, and an achromatic lens are used to generate the expanded and collimated beam. Spheres placed along the measuring section produce a position spot behind the center of each sphere, which can be viewed with a CCD camera. The center of a sphere and the center of its position spot in the image should generate a straight line. A lens system focuses the expanded beam to the dimensions of the CCD sensor. Correlation algorithms are then used to calculate the center positions of the image.
The fiducialization of the undulator The alignment method for SSRF undulators is used to transfer the geometric center of the magnetic component mounting surfaces to the target on the base frame of an undulator. An X-ray freeelectron laser device has a relatively small field region, so the requirement for the undulators' alignment will be high, and a new calibration method for undulator fiducialization is needed. We design and manufacture a "Magnetic Landmark" and use it to achieve high-precision undulator magnetic fiducialization, as shown in Fig. 38.
High-precision undulator fiducialization is achieved by the Magnetic Landmark, as shown in Fig. 39. First, we determine the relative relationship between the magnetic center of the undulator and that of the magnetic target with the coordinate measuring machine; then, using the position relationship between the magnetic center of the Magnetic Landmark and its mechanical center, we obtain the magnetic center coordinates of the undulator.
The measurement accuracy in the horizontal direction is 34 μm and 28 μm in the vertical direction. This meets the design objective for the Magnetic Landmark, which provides a future reference for undulator alignment in the FEL device.

beamline designs
The energy range of XFELO is 6-15 keV. The FEL pulses will be injected into the FEL-I and transported along the same path as the SASE source. Fig. 40 shows the layout, where the shaded red-box parts indicate new parts or changes needed for XFELO operation. The SASE source position is the 0 m mark, and the XFELO source is located at -300 m. The original FEL-I beamline includes CRL1, offset mirrors (M1, M2a, M2b), DCM, CRL2, HSS-KB mirrors, and CDS-KB mirrors. When the XFELO beam is injected, two compound refractive lenses are added to collimate and focus the X-rays. One is CRL-C, which is designed to collimate or weakly focus the beam. This will ensure a 6 acceptance of the offset mirrors. The other is CRL4, which focuses the beam to the SEL sample position. The original CRL2 can focus the beam to the HSS sample position. The DCM is changed to a high resolution QCM to fulfill the requirements of high resolution RIXS experiments.
The CRL-C is located at 30 m. Its focal length is 330 m. Parameters are provided in Table 5. Using these parameters, the transmittance of all energy is higher than 96%. The CRL4 is located at 1185 m and is designed to focus to 1197 m. The relevant parameters are provided in Table 5. Fig. 41 shows the focusing power, effective aperture, focal length difference, and transmittance. The focal length difference is less than ±0.1 m, and a translation is set along the beam direction to compensate for this difference. The transmittance is greater than 75% for energy levels less than 9 keV and is higher than 90% for the 9-15 keV range.

X-ray diagnostics
X-ray diagnostics will be an essential tool for SHINE operations. Because of the complicated structure of the diagnostics systems, various variables monitored during experiments tend to drift and need to be measured and controlled. Experimental data collected by users should be corrected based on the position, intensity, polarization, spectral, and temporal parameters of X-ray FEL pulses [89].
The development of X-ray diagnostic systems should be based on the properties of the XFELO line. The XFELO line will be part of the SHINE facility, and the energy range of XFELO is 5-15 keV based on the configuration of SHINE, which encompasses the 0.4-25 keV energy range. To facilitate operation and provide users with the full characteristics of shot-by-shot pulses, most photon diagnostic systems should be capable of measuring related parameters within a pulse cycle of 1 μ s. Beam intensity and position monitors, and single-shot spectrometers (using linear array detectors) are capable of providing single-shot resolution. Some diagnostic systems such as the wavefront sensor [90][91][92][93][94], the imager, and similar systems cannot diagnose on a shotby-shot basis because of acquisition speed, damage to the wavefront, or heat load limitations. As described above, X-ray diagnostics requires a complicated system, including multiple components, instruments, and techniques. In particular, the X-ray structure generated by XFELO is complex, and it is difficult to build a common diagnostic system that is effective for some pulse structures. Therefore, various instruments may be employed during XFELO operations, such as a polarimeter [95][96][97][98][99], online spectrometer [100][101][102][103], K-Monochromator [104,105], pulse length measurement device [106][107][108], and other related equipment. In this case, the diagnostic device could consist of invasive and non-invasive devices, where the noninvasive devices are usually gas-based monitors.
Wavefront monitor The wavefront properties of FEL X-rays are significant for several types of experiments, such as contrast imaging of nano-structures, microscopic biomolecules, or coherent diffraction imaging [109,110]. Thus, calibration of the wavefront is essential for users after transmitting through multiple mirrors. The most commonly used measurement methods are point diffraction and Talbot-type interferometers, which are used in the soft and hard X-ray regions, respectively. In view of the energy range associated with MING, the Talbot-type interferometer will be used to measure X-ray wavefront information.
A wavefront sensor based on single-grating Talbot interferometry mainly consists of a phase grating and a 2-D imaging array. In the hard X-ray range, Talbot interferometry can use a -phase shift checkerboard pattern with pitch d as the imaging component [92]. The phase grating divides the incident light into two wave components with a small shear angle V s = 2 ∕d ( is the wavelength and d is the period of the grating). For the hard X-ray range, d needs to approach the micrometer level to provide adequate shearing, which will increase performance. A lower pitch d will improve the resolution of the interferometer. However, common imagers cannot resolve the pattern when d is only a few micrometers. Some Talbot interferometers have solved this problem by detecting the Moiré pattern with a second analyzer grating [111,112]. A single-grating Talbot interferometer has been developed to accurately diagnose the single-shot wavefront property in LCLS [94]. As shown in Fig. 42, the wavelength of the X-ray is 0.13 nm. From the spot profiles, the intensity distribution is obtained by integration over all pixels within a single sub-aperture, followed by an adapted bi-cubic spline interpolation. The wavefront can then be reconstructed from the rectangular array of the spot distribution.
An orbital angular momentum (OAM) beam is an advanced tool in modern research, applicable to optical manipulation, quantum information technology [113,114], remote sensing, and optical communications. For most applications, it is essential to measure the states of the OAM beams. Several methods have been proposed to measure the states of OAM beams, such as amplitude diffractive optical elements [115], methods based on the Mach-Zehnder interferometer [116,117], methods based on plasmonics [118], and use of Dammann vortex gratings for multiplexed OAM beams [119].
OAM is characterized by its wavefront and intensity information; therefore, the OAM property can also be reconstructed by solving the Talbot pattern [120][121][122]. The experimental results of OAM with various topology charge values (l = 0, ±1 , ±2 , ±3 ) are shown in Fig. 43.
X-ray intensity and beam position monitor One of the most useful non-invasive photon diagnostic devices is represented by gas-based monitors that measure the intensity and beam position of X-ray pulses [123,124]. These two characteristics are integrated into one device, called a gas monitor detector (GMD). The GMD is integrated into a gasbased monitor system via multiple stages of pressure differential chambers, where the gas pressures are mbar level and 10 −5 − 10 −3 mbar in the beam attenuation chambers and the GMD device, respectively. Additionally, the pressures in the up-stream undulators and down-stream X-ray beamlines are both below 10 −8 mbar. The length of the X-ray attenuation chambers is 4 ∼ 6 m, filled with typical gases (e.g., N, Ne, Xe, Ar). As a non-destructive diagnostic device, the GMD (whose longitudinal length scale is ∼ 0.1 m) can accurately calibrate the X-ray intensity associated with the X-ray pulse energy on a shot-by-shot basis. Because of the high transmission and small photon-absorption coefficients for X-rays above 3 keV energy, a solid attenuator using CVD-diamond and SiC materials is also proposed. Diamond thin foil with thicknesses from 500 μm to 1.5 mm can adequately attenuate photon energy in the 3-15 keV range, and SiC thin foil with a similar thickness ( ∼ 1.5 mm) can be effective for photon energies below 25 keV. An X-ray beam position monitor (XBPM) is composed of four groups of detectors placed at 90 degree intervals along a circle. Both the gas and solid position monitors resolve the position information by solving for the charge differences among the four detectors when the incident position of the X-ray changes. The spatial resolution of CVD-diamond-based XBPM is less than 7 μm at 0.15 nm in Spring-8 [125]. Using the aforementioned parameters, the intensity and position can be calculated accurately using recorded data of the current generated from the interaction between the X-ray pulse and the gas or solid foil.
X-ray spectrometer Because of the SASE mechanism, the spectra usually change in the single-shot acquisition mode. However, for many experiments, accurate shot-byshot spectra are desirable to improve resolution. Hence, a single-shot spectrometer is essential for operations across the full X-ray energy range under consideration. In addition, the spectrometer with high energy resolution can be applied to diagnose the central energy of FEL-I at SHINE, which will run in the SASE and self-seeding mode.
For photon energies above 5 keV, the Bragg diffraction crystal-based spectrometer is always employed in the beamline. The diamond crystal spectrometer is considered the best choice for the hard X-ray range, which results in   [120] only a small loss of X-ray pulses. Thus, this spectrometer could be used as a non-destructive monitor. In addition, the bent silicon crystal spectrometer has been in operation at both LCLS and European XFEL. As shown in Fig. 44, the spectral resolution can be solved for using the expression E∕ΔE = R(sin B ) 2 ∕(H cos B ) [126], where B is the Bragg angle, R is the meridional radius of the bending crystal, and H is the meridional footprint within the principal plane. Taking into account the high repetition rate and the distortion of the wavefront of the X-ray pulse, the bent diamond crystal spectrometer represents the most feasible solution. The spectral resolving power of the spectrometer based on use of a bent crystal at the European XFEL is 60000 W at a photon energy of 9.3 keV, and the spectral resolution of the spectrometer in LCLS is 2 × 10 −5 [100,101].
Most recently, we have proposed a non-invasive gasbased spectrometer for SHINE [127]. A specially optimized electron optical system will improve the collection efficiency of ionized electrons and reduce the divergence of the arrival time of ionized electrons with the same kinetic energy, which can theoretically achieve a spectral resolution of 0.2 eV and an energy window of 20 eV.
X-ray temporal profile Ultra-short pulses are essential in many fields, such as dynamics or phenomena in atomic structures, crystal lattices, molecular compounds or clusters, photochemical or photo-catalytic reactions, and single particle molecules via FEL pulses themselves or in combination with external laser pulses, e.g., a laser pulses in the visible-NIR-MIR range, THz radiation pulses, or higher order harmonics laser pulses (HHG). Therefore, measuring and monitoring the time delays between the X-ray FEL pulses and external radiation pulses as well as determining the detailed structure of X-ray pulse profiles on a shot-by-shot basis are very significant for ultrafast dynamic measurement applications.
The state-of-the-art techniques and methods of measuring the X-ray profiles have developed quickly in recent years, and tremendous effort has been expended to realize robust and persistent X-ray photon diagnostics for routine operations. Temporal diagnostics can be differentiated into two major categories: X-ray photon pulse length measurement, and X-ray photon pulse arrival. The former measures the duration of X-ray pulses, the detailed pulse profile, and the longitudinal radiation power distribution. The latter is mainly related to the characteristics of time-delay and shotby-shot temporal jitter in X-ray pump-probe experiments, which are important for the measurement of ultrafast dynamics when implementing XFEL. X-ray timing devices are discussed below.
The direct method to measure duration and longitudinal coherence is to develop and fabricate an X-ray auto-correlator such as the EUV-and XUV-region device developed at FLASH [128,129] and FERMI using the wave-front split and delay scan technique. Currently, an autocorrelation technique for the hard X-ray region is still in development at SCALA and LCLS [130,131], where single X-ray pulse splitting is performed by Laue crystal diffraction to keep the device compact. An X-ray auto-correlator is constructed similar to a visible light auto-correlator: the beam is split into two identical replicas through a split-delay unit (SDU), the mutual delay between the two replicas is generated via a scanning stage, and finally the two replicas are recombined to create a nonlinear signal, from which the photon pulse duration as well as the phase information can be retrieved and determined.
X-ray transverse deflecting structures (XTDSs) can also be used to measure the temporal profile of X-ray pulses. Equipped with transverse deflecting structures (TDSs) in conjunction with an electron beam spectrometer downstream, the precise phase space and energy losses of electron bunches can be obtained. Thus, by comparing the measured phase spaces obtained for on and off lasing, the matched X-ray temporal profile emitted by FEL processes can be derived. At LCLS, the temporal resolution is approximately 4 fs RMS for 10.2 keV hard X-ray FEL pulses using RF transverse deflectors working at the X-band frequency (11.424 GHz), where the electron bunch charge and beam energy are 150 pC and 15.2 GeV, respectively [132]. The MING project has also deployed an XTDS detector based on the experience at SXFEL and a timing resolution of 1 fs is the target.
X-ray pulse arrival monitor The X-ray pump-probe measurement is a cross-correlation method in which the X-ray pulse induces a perturbation in a system within an ultra-fast timescale, while another external short radiation pulse is set to arrive at various time delays to monitor and Fig. 44 (Color online) Dispersion geometry of a bent thin crystal spectrometer for hard X-rays. Represented from [126] characterize the ultra-fast changes of the system in real time [133]. The external sources could be a visible or NIR laser pulse, a long wavelength radiation pulse (THz), or the HHG atto-second pulse of an optical laser, to name a few. Spatial encoding & single-shot imaging is frequently used to measure the temporal jitter between the X-ray and optical laser pulses, which has advanced the photon energy to approximately 90 eV at FLASH using XUV pulses. The single-shot imaging is recorded while the X-ray pulse and the optical laser overlap both in space and time. The ideal X-ray pulse arrival diagnostics should have a resolution of a few femtoseconds and eventually achieve a temporal resolution of ≤ 10 fs, and should be effective at high photon energies of a few keV.
Polarization diagnostics The polarization properties of X-ray FEL pulses can be characterized by measuring the angular distribution of the photo-ionized electrons' angular distribution (PAD) [134]. The PAD for s-shell electrons ionized by polarized photon pulses is well-known, from which the linear polarity and polarization angle can be retrieved. The electron time-of-flight (e-TOF) technique, routinely called 'e-TOF based', can record the flight time of electrons and discriminate those that come from s-shells. It is a noninvasive method because only a small fraction of the total photons interact with the rarefied gas in the e-TOF instrument, and the other photons are unaffected. However, higher resolution can be achieved because of the beam's high intensity. In recent years, instruments based on monitoring the angular distribution of photoelectrons, the so-called "Cookiebox", were successfully deployed for the diagnosis of X-ray FEL polarization at DESY [135]. Inspired by this research, an angular-resolved instrument has been designed for the Shanghai soft X-ray free-electron laser facility (ARPolar), and the ARPolar instrument aims to measure the charge distribution of photoelectrons from the s-shell for polarization diagnosis using 16 detection channels [99], as shown in Fig. 45. Recently, a multiresolution instrument was also proposed at SLAC, with the aim of noninvasively monitoring the spectral, temporal, and polarized characteristics of LCLS-II. Simply stated, X-ray polarization can be fully obtained using an ARPolar-alike instrument.
Similarly, artificial channel-cut crystals (ACCs) can be used for high-definition hard X-ray polarimetry. The scheme includes a polarizer, a slit, an analyzer, and a photo-diode. Perfect crystals mounted on a rotatable polarizer are used to reflect FEL pulses consecutively at 2 = 90 degrees, where is the Bragg angle. Both the polarizer and the analyzer are rotatable. The photo-diode detector is then used to monitor the intensity of the photons at the exit, and the polarity can be derived [136,137]. The material of the perfect crystal is selected to match the photon energy and to reduce multibeam diffraction. A polarization purity of 2.4 × 10 −10 and 5.7 × 10 −10 was reported for 6.45 keV and 12.914 keV FEL pulses with Si(400) and Si(800) crystals, respectively [137]. More recently, equipped with four well-aligned single-crystal diamonds, a polarization purity of 1.4 × 10 −10 for 9.8 keV with C(004) was reported, which is close to ideal, as determined by X-ray divergences [46].

Summary
The X-ray free-electron laser brings significant improvements in the tools used to conduct fundamental research at Å lengths and fs time scales. In terms of facility development, superconducting RF linac-based high-repetition-rate X-ray free-electron lasers are making great strides. Starting in early July 2017, the first high-repetition-rate hard X-ray XFEL, European XFEL, achieved initial lasing. Now under development, LCLS-II is expected to begin operating in 2025. Additionally, the LCLS-II-HE project proposes an energy upgrade to LCLS-II. As a new highrepetition-rate X-ray FEL, SHINE is currently under construction and is one of the major research infrastructure projects in China. SHINE will be the first high-repetitionrate XFEL user facility in China, designed to enable new scientific opportunities when it launches in 2025. SHINE consists of a low emittance injector, a high performance continuous-wave 8 GeV linac using superconducting RF technology, three undulator beamlines, and 10 end-stations. An adjustable photon energy ranging from 0.4 to 25 keV will be produced using SHINE. The main facility will be constructed in ∼ 38 m-deep tunnels ∼3.1 km in length.
Cavity-based XFELs have the potential to produce highintensity fully coherent laser-like X-ray pulses, which will be a remarkable milestone in the evolution of XFELs. SHINE can produce 8 GeV electron bunches at 1 MHz, which are appropriate for a cavity-based XFEL. It is now a good time to propose the construction of cavity-based XFEL. Thus, we propose a cavity-based X-ray free-electron laser for SHINE: the megahertz cavity enhanced X-ray generation at SHINE (MING@SHINE). The goal of MING is to generate high-intensity, fully coherent X-rays in the energy range of 6-15 keV, driving advanced applications and the development of related technology.
In the current design, MING will be equipped with a 45 • inclined undulator. The undulator period is chosen to be 26 mm, which is the same as the FEL-I undulator to be used by SHINE. In the initial phase, MING will use silicon crystals as Bragg reflecting mirrors. Then, the possibility of using diamond will be actively evaluated. Based on the proposed parameters, MING can easily achieve pulse energies greater than 300 μ J for operations below the 10 keV photon energy, and the corresponding bandwidth is close to the Fourier transform limited value. Above 10 keV photon energy, the pulse energy for MING will be reduced to 100-200 μ J. Overall, the output pulse energy of MING is similar to that of the SASE mode of FEL-I, but the spectral bandwidth is decreased by 2-3 orders of magnitude, resulting in a tremendous increase in spectral brightness. In addition to the increased brightness, XFELO can provide controllable polarization with a very high degree of purity. Furthermore, MING can also deliver OAM light, requiring only a slight change in the resonance condition of the XFELO mode. The results obtained thus far indicate that MING holds great potential in providing a significant boost to the performance of SHINE.
Finally, the proposed MING is planned to start construction after the initial operation of SHINE. The SHINE project is expected to be fully completed in five years.

Author Contributions
All authors contributed to the study conception and design. Hai-Xiao Deng supervised and instructed on the manuscript. Nan-Shun Huang wrote the first draft of the manuscript. All authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.