X-ray optics for the cavity-based X-ray free-electron laser

The design, manufacturing and characterization of X-ray optics for a cavity-based X-ray free-electron laser are presented.


Introduction
In the last two decades, the successful operation of single-pass X-ray free-electron lasers (FELs) with extreme brightness, transverse coherence and ultra-short pulse length (Emma et al., 2010;Ishikawa et al., 2012;Decking et al., 2020) has paved the way for diverse science applications, from investigation of the femtosecond dynamics of atomic and molecular systems (Bostedt et al., 2013;Callegari et al., 2021) to long-lived ultranarrow nuclear resonances (Shvyd'ko et al., 2023).However, self-amplified spontaneous emission (SASE) X-ray FEL (XFEL) pulses usually have poor longitudinal coherence owing to the stochastic start up from shot noise.
In this work, we report on the design, manufacturing and characterization of X-ray optical components for an X-ray cavity within the framework of the collaborative CBXFEL research and development project of Argonne National Laboratory (ANL), SLAC National Accelerator Laboratory (SLAC) and SPring-8 (Marcus et al., 2019).The X-ray optical components comprise four high-reflectivity Bragg-reflecting diamond crystal mirrors, including one with a drumhead diamond crystal structure containing a thin membrane for X-ray output coupling, two beryllium refractive lenses that are inside the X-ray cavity, extra-cavity channel-cut Si monochromators to monochromatize the outcoupled X-rays for diagnostics and user experiments, and an extra-cavity diamond in exact Bragg backscattering for accurate intra-cavity photon energy calibration and accurate initial angular alignment of the cavity crystals.
A schematic diagram of the CBXFEL experiment is shown in Fig. 1.The CBXFEL has an electron beam source, an undulator cascade to provide FEL interaction and a rectangular X-ray cavity with a total round-trip length of 65.50 m (round-trip time �218 ns) that monochromatizes and circulates the X-ray pulses for repeated FEL interactions with electron beams.The main physical parameters of the electron and X-ray pulses are listed in Table 1.The electron beam will be delivered in pairs with a �218 ns delay from the LCLS-II copper linac at 120 Hz (Decker et al., 2017;Kim et al., 2019).Owing to the small size of the electron and X-ray pulses (a few tens of micrometres in length and in the transverse direction, see Table 1), all cavity optical components have to be aligned with a sub-microradian angular precision and with a few tens of micrometres spatial precision to ensure three-dimensional overlap between the electron beam and the X-ray pulse (Marcus et al., 2019;Qi & Shvyd'ko, 2022).To achieve this alignment precision, a diagnostics system including various types of diagnostic components was developed and tested with X-rays (Liu et al., 2023a).

Figure 1
An overview of the experimental setup of the cavity-based X-ray free-electron laser (CBXFEL) project, which consists of an electron beam source, a cascade of undulators and two chicanes, and a rectangular X-ray cavity.The X-ray cavity consists of four diamond crystal mirrors (C 1 -C 4 ), reflecting X-rays in the 400 Bragg reflection at exactly 45 � with a photon energy of 9.831 keV, and two X-ray lenses (L 1 , L 2 ).Diamond crystal C 1 has a drumhead crystal structure (Kolodziej et al., 2016) with a �20 mm-thick membrane to outcouple X-rays (Kim et al., 2008;Kim & Shvyd'ko, 2009;Shvyd'ko, 2019) to diagnostics station G in the X-ray pump-probe (XPP) LCLS experimental hutch, which is located �250 m downstream of the undulators (Chollet et al., 2015).In station G, Si channel-cut monochromator crystals (CC) will be used to monochromatize the broadband X-rays to a narrow band centered on 9.831 keV for further diagnostics.A thin diamond C x in the 440 exact Bragg backscattering is used for precise energy calibration and C 1 angular alignment.The long-arm length L of the rectangle is 32.10 m and the short-arm length W is 0.65 m.A diamond grating (Li et al., 2020) downstream of C 2 will also be used for alternative output coupling for X-ray diagnostics in station E. The upper-left inset (a) shows the total reflectivity of the four diamond crystals and transmissivity of the drumhead crystal C 1 , with a drumhead membrane thickness of (left) 20 mm and (right) 15 mm.
The rectangular X-ray cavity consists of four high-reflectivity diamond crystal mirrors C 1 -C 4 and two beryllium refractive lenses L 1 and L 2 for X-ray mode control, as listed in Table 1.The diamond crystals C 2 -C 4 have a thickness of �500 mm and a reflectivity of > � 99% at the 400 Bragg reflection.The intra-cavity X-rays are outcoupled via the drumhead crystal C 1 (Kolodziej et al., 2016;Kim et al., 2008;Kim & Shvyd'ko, 2009;Shvyd'ko, 2019), with a membrane thickness of < � 20 mm, to the diagnostics station G (Liu et al., 2023a) in the X-ray pump-probe (XPP) experimental hutch, which is located �250 m downstream of the undulators (Chollet et al., 2015).With a thickness of 20 mm (or 15 mm), C 1 transmits about 1.7% (or 7%) of 9.831 keV X-rays, as shown in the transmissivity curves in Fig. 1(a).This plot also shows the reflectivity curves of the entire cavity of four crystals C 1 -C 4 , from which the energy bandwidth (FWHM) is evaluated to be �70 meV with a total reflectivity of �90%.Alternatively, a diamond grating (Li et al., 2020) placed downstream of C 2 will also be used to outcouple X-rays for various diagnostics in station E, which will be discussed in a separate report (Liu et al., 2024).
For this project, the goal is to measure the cavity ring-down and two-pass gain in both low-gain XFELO and high-gain XRAFEL schemes.These measurements require (especially for the low-gain XFELO case) an X-ray cavity with low-loss optical components.
Type-IIa diamond crystals grown under high pressure and high temperature (HPHT) selected for the project exhibit an almost flawless 2 mm � 2 mm working area.The crystals were furnished with strain-relief cuts for stable strain-free mounting.All crystal mirrors are required to have a Braggplane slope error (BPSE) of < 0.2 mrad mm À 2 within the working area.Detailed requirements for the diamond crystal mirrors are listed in Table 2.For X-ray wavefront preservation, wavefront distortion induced by each optical component including crystal mirrors, lenses and grating should be < � �/70 (� is the X-ray wavelength) over the CBXFEL beam footprint of 100 mm � 100 mm.This avoids significant distortions of the circulating X-ray beam, as preliminary simulation studies show.
The X-rays within the cavity reflection band are outcoupled from the cavity via crystal C 1 together with an intense � 100 eV broadband spontaneous radiation background.Specially designed four-bounce Si-crystal monochromators are intended to be used in station G to suppress the background and single out X-rays within the cavity bandwidth.
Another optical element in station G -diamond crystal C x in the 440 Bragg back reflection -was designed to tune the intra-cavity photon energy to the nominal value E 0 with millielectronvolt accuracy and to pre-align the crystal C 1 pitch (Bragg) angle to 45 � with microradian accuracy.
In the following sections, the detailed design and characterization of each type of optical element will be discussed in detail.All these optical components have been fully characterized with X-rays on the APS optics testing beamline 1-BM (Macrander et al., 2016).

Diamond crystal mirrors
The requirement for low losses in the X-ray cavity demands diamond crystals featuring (i) high (�98%) X-ray Bragg reflectivity, (ii) small Bragg-plane specific slope errors < � 0.2 mrad mm À 2 (r.m.s.) -much smaller than the r.m.s.angular divergence (�1 mrad) of the XFEL X-ray beam -and (iii) < � �/70 (r.m.s.) wavefront phase errors over a 100 mm � 100 mm footprint of the CBXFEL beam.These requirements call for almost flawless strain-free mounted diamond crystals with the specifications listed in Table 2.

High-reflectivity diamond crystal mirrors
The diamond crystals for this project were acquired from Sumitomo Electric Industries (Sumiya & Tamasaku, 2012).Diamond crystal stones were grown in the (100) orientation and cut into plates almost parallel to the (100) planes with a miscut (asymmetry) angle of < � 0.3 � [measured by fitting Laue diffraction patterns of the diamond crystal in back-reflection geometry (Huang, 2010)].The miscut angle � is the angle between the diffracting (400) planes and the crystal surface.It is critical to minimize the miscut angle to prevent substantial angular dispersion (Shvyd'ko, 2004) and the resultant potential defocusing of X-rays (Shvyd'ko, 2015) at the interaction region of X-rays and electrons within the undulator.The miscut angle � = 0.3 � is chosen to minimize the effect of defocusing �x ' Df �E H , where D ' 2�/E 0 is the angular dispersion rate in the case of a small miscut angle � � � H .For example, a miscut angle of � = 1 � in one crystal results in D = 3.5 mrad eV À 1 , and therefore in defocusing �x = 9 mm, which can be further amplified by miscuts in other crystals to become much larger than the electron beam size (see Table 1).
The diamond plates cut from the as-grown diamond stones had a thickness of � 500 � 100 mm and a transverse size of � 7 mm � 7 mm.Both surfaces of each diamond crystal plate were polished to a surface roughness of around 5 nm.Crystal plates with � 4 mm � 4 mm almost-defect-free areas [see Fig. 2(a)] were pre-selected using quasi-plane wave X-ray topography on the SPring-8 1 km beamline BL29XUL (Ishikawa et al., 2001) in a two-crystal Si(777)-C(800) Bragg reflection geometry with 16.55 keV X-rays.The pre-selected diamond plates were then examined with the rocking-curve imaging (RCI) X-ray topography technique (Stoupin et al., 2016;Pradhan et al., 2020) on the APS optics testing beamline 1-BM.The experimental setup of the RCI is shown in Fig. 3(a) with an Si(531) conditioning crystal C c (� 55.5 � asymmetry-cut angle) and sample crystal C s .
Figs. 3(b)-3(d) show photographs and RCI maps of the three best selected diamond crystals.The photographs were taken on a background of a 0.5 mm reference grid.FWHM and center-of-mass (COM) RCI color maps of the crystals in the 400 Bragg reflection of 8 keV X-rays are presented.The color maps show that the diamond crystals exhibit a good crystal quality, with the Bragg reflection FWHM close to the theoretical value of �17 mrad and small values of Bragg-plane slope errors.However, some defects or dislocations can also be seen on these selected diamond crystals.
In the next step, 4 mm � 5 mm rectangles comprising the high-quality regions were cut with a laser (Kolodziej et al.,  Photographs and X-ray rocking-curve imaging (RCI) color maps of the selected diamond crystal plates before laser machining.(a) Schematic of the experimental setup on APS beamline 1-BM (Stoupin et al., 2016;Pradhan et al., 2020).Full-width half-maximum (FWHM) and center-ofmass (COM) RCI maps measured in the 400 X-ray Bragg reflections are presented for selected crystals, (b) C 2 , (c) C 3 and (d) C 4 .All photographs were taken on a background of a 0.5 mm reference grid.2016;Shvyd'ko et al., 2021;Pradhan et al., 2022) from the selected plates and furnished with strain-relief cuts, as shown in Figs.2(b), 2(c) and 4. To avoid excitation of the simultaneous parasitic Bragg reflections, such as 404 and 220, which could impair the 400 Bragg reflectivity, the 400 Bragg diffraction plane was chosen to comprise the [100] and [101] reciprocal vectors.This choice determined the preferred orientation of the rectangles, as shown in Fig. 2(b).In addition, the cut patterns were fitted such that the highest-quality crystal area of � 2 mm � 2 mm -the working area where the CBXFEL X-ray beams were supposed to be reflected -was best protected by the strain-relief cuts from strain propagation from the clamping area where the crystal has to be firmly fastened [see Fig. 2(c)].Note that the optimal cut pattern varies for different crystals, as can be seen in Fig. 4.
Laser cutting induces crystal strain.However, the strain can be efficiently removed by annealing the diamond plates at a temperature of � 630 � C in air (Kolodziej et al., 2016;Pradhan et al., 2020).After laser cutting and annealing, the crystal quality of all the diamond crystal plates was examined again using the RCI technique.The photographs and RCI maps of the same three diamonds (as in Fig. 3) after laser cutting and annealing are shown in Fig. 4. A 2 mm � 2 mm working area with an r.m.s.COM value as small as < 0.1 mrad mm À 2 can be identified on all crystals and these areas are indicated on the crystal photographs with red squares.During the RCI measurements, the diamond crystals were firmly clamped to a crystal holder in the area indicated in Fig. 2(c).The RCI maps in Fig. 4 show that the mounting strain resulting in large FWHM and COM values does not propagate beyond the second strain-relief cut, in agreement with previous studies (Pradhan et al., 2020), thus ensuring mechanically stable mounting of the diamond crystals with no detectable strain in the working area.We note that the wavy contrast on the RCI maps (see Figs. 3 and 4) has nothing to do with the diamond crystal quality.It is due to refraction in the 1-BM beamline exit beryllium window (Pradhan et al., 2020).
A summary of the main characteristics of the selected diamond crystals is provided in Table 3.All crystals have a miscut angle of < � 0.3 � (5.2 mrad) in agreement with the specifications given in Table 2.The r.m.s.COM values in the working areas with sizes of 2 mm � 2 mm and 1 mm � 1 mm on each crystal also meet the requirement for the Bragg-plane slope errors of <0.2 mrad.
The residual crystal imperfections in the working regions of the selected diamond crystals can still produce undesirable X-ray wavefront distortions upon Bragg reflection.They were studied using an at-wavelength wavefront sensing (WS) technique in Bragg diffraction recently developed at the APS (Shi et al., 2023).The schematic of the wavefront sensing experiment is shown in Fig. 5(a).Monochromatic 14 keV X-rays pass first through a pre-designed coded mask that introduces random phase modulation in the X-ray wavefront (speckles).The modulated X-rays are then reflected from two CBXFEL diamond crystals with a reference crystal C r and a sample crystal C s at a Bragg angle of 29.77 � .The X-ray speckle pattern distorted by the reflections is measured using an X-ray pixel detector that is placed �0.9 m downstream of the sample diamond crystal C s .
The high-quality diamond crystals introduce small wavefront distortions.As a result, the speckle displacements in the measured images are very small.A high-resolution optical system with an effective pixel size of 0.65 mm is required to resolve them.The field of view of the detector is only � 1 mm � 1 mm, which is about 5.5 times smaller than that in the RCI measurements.With this small field of view, one WS measurement can only sample a small region on the crystal.To cover a larger area, the sample crystal C s is translated in the transverse plane (x, y).For all the diamond crystals, eight  locations in the working areas were sampled, and one of the eight measured images is used as the reference for relative wavefront phase reconstruction (Shi et al., 2023).
The reconstructed phase error maps of X-ray wavefronts upon Bragg reflection from the selected diamond crystals are shown in Figs.5(b)-5(d).The outline of the diamond strainrelief cuts is also shown in these plots to position each measured phase error map.The typical diameter of the CBXFEL beam footprint is expected to be around 100 mm.Therefore, the r.m.s.phase errors in the 100 mm � 100 mm regions are used to characterize the X-ray wavefront quality upon Bragg diffraction from the crystals.By sampling the 100 mm � 100 mm regions pixel by pixel in two directions, a distribution of the r.m.s.phase error can be obtained.Figs.5(e)-5(g) show such distributions in the corresponding crystals.Three statistical values of the distribution -the minimum, median and mean phase errors -are labeled in each graph.The median phase error is usually used as the indicator of the overall X-ray wavefront quality in Bragg diffraction from a crystal (Shi et al., 2023).The median r.m.s.phase error in the 100 mm � 100 mm regions is better than �/65, which is close to the requirement (Table 2).

Diamond drumhead crystal for output coupling
Crystal C 1 has an additional function of outcoupling a portion of the circulating X-rays from the cavity for diag-nostics and user experiments.An X-ray-transparent diamond single crystal with a small thickness (of the order of a few extinction lengths) has a reduced peak Bragg reflectivity and is permeable to X-rays.Reducing the thickness of a Bragg crystal mirror is one of the possible ways of outcoupling X-rays (Kim et al., 2008;Shvyd'ko, 2019).However, since the extinction length in the case of the 400 Bragg reflection in diamond is just 3.6 mm, a 7% outcoupling would require a 15 mm-thick diamond crystal [see Fig. 1(a)].It is not only difficult to manufacture such a thin crystal without introducing defects, but also practically impossible to mount it strain-free in a mechanically stable way.Drumhead crystals -monolithic crystal structures comprised of a thin membrane furnished with a surrounding thick solid collar -are a solution ensuring mechanically stable and strain-free mounting of the thin membrane with efficient thermal transport (Kolodziej et al., 2016;Shvyd'ko, 2019).
A drumhead crystal structure with two thin membranes was manufactured in the working area of crystal C 1 for outcoupling of the intra-cavity X-rays, as indicated in Fig. 2(d).The target membrane thickness was � 15 mm with a diameter of > � 250 mm.A recent research and development effort at ANL directed towards manufacturing defect-free and strainfree diamond drumhead crystals succeeded in the fabrication of diamond membranes as thin as 16-20 mm and 300 mm in diameter (Pradhan et al., 2022).
With this optimized procedure, two thin membranes were made in the working area, as shown on the photograph of crystal C 1 and the microscope image of the membranes M 1 and M 2 (light circles) in Figs.6(a) and 6(b), respectively.Both images were taken from the unmachined flat side.Fig. 6(c) shows a 3D model of the drumhead crystal from the machined side.
After drumhead fabrication and subsequent annealing (performed once more to remove crystal strain induced by laser machining), the crystal was examined again with the RCI and WS techniques.Fig. 6(d) shows an X-ray image of the crystal taken in the 400 Bragg reflection peak (RCI intensity map).Figs.6(e)-6(f) show RCI color maps of FWHM and COM.Importantly, the X-ray peak reflectivity is almost the same in both the membrane and surrounding areas.The reduced thickness in the membrane region leads to an increased FWHM of the Bragg reflection curve to around 19 mrad (reflected by the map color changing from green to red), which is close to the theoretical prediction.There is also a slight color change on the COM map, because the location of the peak reflectivity within the reflection range is more symmetric for thin crystals [see e.g.Shvyd'ko (2004)].The r.m.s.COM variation in a 100 mm � 100 mm region centered in M 1 and M 2 shows a Bragg-plane slope error of less than 0.2 mrad.This value is close to that measured before drumhead fabrication in the same region.
The Bragg reflection curves averaged over a 100 mm � 100 mm region centered on the M 1 and M 2 membranes [shown in black in Figs.6(g)-6(h)] were fitted to theoretical curves shown in red.The Bragg reflection curves of thin crystals typically exhibit reflectivity oscillations on the tails (equal thickness fringes), with the oscillation period inversely proportional to the crystal thickness (Shvyd'ko, 2004).The best fit that has the closest match to the theoretical oscillation periods indicates thicknesses of 16 mm and 16.5 mm for membranes M 1 and M 2 , respectively.This finding is consistent with the thickness measurements by optical metrology of 16-17 mm for both membranes.
Figs. 6(i) and 6( j) show wavefront phase error maps and distributions of r.m.s.phase errors in the membrane regions, respectively.They reveal a small median r.m.s.phase error of �/52 measured after the fabrication of the membranes.This value is close to the diamond crystal mirror specifications provided in Table 2.

Paraboloidal refractive beryllium lenses
We chose paraboloidal beryllium lenses (Lengeler et al., 1999(Lengeler et al., , 2005) ) as X-ray focusing elements in the cavity because of their X-ray transparency, minimal wavefront distortions and appropriate focal length (Kim et al., 2008;Kolodziej et al., 2018b).Such lenses are manufactured with discrete values of the radius of curvature R (RXOPTICS, https://rxoptics.de).In particular, with R = 200 mm, they have a focal length of f = R/2� = 28.3m, close to the value required to maintain stable cavity modes (Qi & Shvyd'ko, 2022).Here, � = 3.526 � 10 À 6 is a refractive index decrement in beryllium for the 9.831 keV photons in question.
A schematic diagram of the paraboloidal lens is shown in Fig. 7(a).It is a small circular piece (shown enlarged) mounted at the center of a stainless steel holder.The geometric aperture of the lens is about 0.9 mm and its thinnest part is d ' 34 mm.
More than 30 lenses made of two different beryllium grades (O30-H and IS-50M) were acquired from RXOPTICS for this project and characterized with a phase-contrast imaging technique at the APS (Qiao et al., 2021).Lenses made of IS-50M beryllium produce less of the detrimental small-angle X-ray scattering (Roth et al., 2014), but they tend to have larger thickness errors than the lenses manufactured from O30-H grade, owing to a higher density of voids.Therefore, only lenses made of beryllium grade O30-H were selected for use in the CBXFEL cavity.
The experimental setup of the phase-contrast imaging of the lenses is shown in Fig. 7(b).Similar to the wavefront sensing of diamond crystals in Fig. 5(a), a coded mask located downstream of the beamline exit Be window is used to introduce a random phase modulation into the X-ray wavefront at a  photon energy of 14 keV.The modulated X-rays propagate through a Be lens placed 189 mm downstream of the mask and are recorded by a pixel detector put 500 mm downstream of the lens.Two speckle images with and without the lens in the beam path are recorded, and from these two images a relative phase distortion profile �(x, y) induced by the lens can be extracted via tracking the speckle pattern shift.The phase shift profile �(x, y) can be used to derive the lens thickness profile T(x, y), A residual error profile can be obtained by extracting the bestfit paraboloid from the thickness profile.Figs.7(c) and 7(d) show the measured thickness profile and residual profile error, respectively, of one of the best lenses made of O30-H grade beryllium.A small r.m.s.thickness error of 0.76 mm is measured over the entire map in Fig. 7(d).When the thickness profile is considered in a smaller central region with a diameter of 100 mm (or 200 mm), an even smaller r.m.s.thickness error of 0.23 mm (or 0.42 mm) is measured.Two best and two backup lenses made of O30-H grade beryllium were selected for the project, all exhibiting an r.m.s.thickness error of less than 0.25 mm (��/140 at 9.831 keV) in the 100 mm central region, meeting the requirements for the CBXFEL lenses.

Silicon channel-cut crystal monochromators (for outcoupled X-rays)
The spontaneous radiation bandwidth of the CBXFEL undulator is � 100 eV, more than 1000 times broader than the 70 meV cavity bandwidth.Most of the radiation outside the cavity reflection band is transmitted through drumhead crystal C 1 , with close to 100% transmissivity, to the downstream diagnostics and user station G (Liu et al., 2023a).To single out X-rays within the cavity band from the broadband spontaneous radiation, monochromators are needed in station G with a bandwidth narrower than the 70 meV cavity bandwidth.For this purpose, four-bounce non-dispersive silicon (Si) monolithic channel-cut monochromators were designed.Their 3D models with four-bounce X-ray beam paths are shown in Fig. 8(a).The monolithic channel-cut design reduces the degrees of freedom for the monochromator alignment.Four bounces are applied for better rejection of the radiation background on the tails of the Bragg reflection curves.
Two types of the four-bounce channel-cut Si monochromators were designed, fabricated and tested.A 4 � Si(620) monochromator with a 60 meV bandwidth (Bragg angle of 47.25 � at 9.831 keV) is intended for cavity alignment.For clean measurements of the cavity ring-down and FEL gain, a 4 � Si(660) monochromator (Bragg angle 80.15 � ) is designed to reduce the bandwidth of the X-rays further to 20 meV.Both types of monochromator crystal were furnished with two strain-relief cuts to prevent the mounting strain from propagating to the crystal working area [Fig.8(a)].The crystals were designed to be mounted such that only fine tuning over a small range was required to set the crystal into the Bragg reflection peak.
The channel-cut crystals were manufactured in-house in the APS optics workshop.They were characterized with 9.831 keV X-rays on the APS 1-BM beamline in the setup shown in Fig. 8(b).In the first step, the crystal surface layer quality is characterized by recording Bragg-reflected X-rays after four bounces with a pixel detector.Only vertically narrow stripes of the crystals can be imaged in a single shot because of the limited angular acceptances of the 620 and 660 Bragg reflections.Larger crystal areas were mapped by sequentially scanning the crystals in the vertical y direction.Figs.8(c)-8(d) show maps of selected 4 � Si(660) and 4 � Si(620) crystals, respectively.The 4 � Si(660) crystal shows some polishing scratches on both edges.The central part of the crystal is scratch-free and is intended to be used as the working area.The maps of the unpolished 4 � Si(620) crystal reveal fewer scratches, with a relatively uniform region in the center part intended as the working area.
In the next step, the angular dependences of the Bragg reflections were measured.The X-rays were propagated through a pair of the same-type channel-cut crystals [CC 1 and CC 2 in Fig. 8(b)] in the non-dispersive geometry.The photodiode installed downstream of CC 2 measured X-ray intensity as a function of the pitch angle of CC 2 .The measured Bragg reflection curves of the 4 � Si(660) and 4 � Si(620) crystals are shown in black in Figs.8(e)-8( f ), respectively.The respective FWHM values are 13.8 mrad and 6.8 mrad.The experimental curves are compared with the theoretical curves calculated for perfect crystals using Shadow (Sanchez del Rio et al., 2011) in Oasys (Rebuffi & Sa ´nchez del Rı ´o, 2016;Rebuffi & del Rio, 2017).The simulation setup is the same as the experimental setup in Fig. 8(b), using source parameters listed by Macrander et al. (2016).The experimental Bragg reflection curves agree well with the simulated ones (shown in red) for both crystal types in terms of curve shape and FWHM.These results ensure the designed spectral bandwidths of 60 meV and 20 meV for the 4 � Si(660) and 4 � Si(620) channel-cut crystals, respectively.

Diamond Bragg back reflector for cavity energy calibration and alignment
The spectrum of the CBXFEL in the initial phase before it starts lasing is very broad.As a result, crystal C 1 can reflect X-rays with arbitrary photon energies in a broad angular range with a large deviation � from the nominal incidence angle of 45 � .Crystals C 2 -C 4 will pick up and amplify the error to 3�, 5�, 7� etc. (Qi & Shvyd'ko, 2022), leading to a potentially laborious cavity alignment.The following procedure allows a millielectronvolt-accurate selection of the proper energy and microradian-accurate angular alignment of C 1 .
The photon wavelength � (or photon energy E = hc/�) can be accurately determined in terms of a crystal lattice parameter d H (or Bragg energy E H = hc/2d H ) using Bragg's law, provided the glancing angle of incidence � H of the peak reflectivity can be accurately measured.Here, w H � 1 is the invariant for each reflection H Bragg's law refractive correction [see, for example, Shvyd'ko (2004)].
In the vicinity of exact Bragg backscattering (EBB) the incidence angle � H = �/2 À � H � 1 and therefore Bragg' s law can be well approximated by which reveals a very weak dependence of � or E on the incidence angle � H . Therefore, in the vicinity of EBB, even a relatively large angular uncertainty of � H < � 10 À 3 ensures a high invariance of Bragg-reflected photon energy �E/E H < � 10 À 6 .This property is used here to determine the correct cavity photon energy and set accurately the 45 � angle of the 400 Bragg reflection from crystal C 1 using the 440 Bragg back reflection from an additional reference diamond crystal C x (Fig. 9).This is possible because, due to the diamond crystal symmetry, the lattice parameters of these Bragg reflections have the relationship d 400 = ffi ffi ffi 2 p d 440 .As a result, the photon energy of the (400) Bragg reflection with � 400 ' 45 � is identical to the photon energy of the 440 Bragg back reflection, provided the angles � 440 and � 400 are related as To obtain this relationship, we combined equation (2) for the 400 reflection with equation (3) for the 440 reflection, assuming the same � values in both cases and the relationship w 400 = 2w 440 .
According to equation (4), crystal C 1 at exactly 45 � reflects photons with the same energy in the 400 Bragg reflection peak as crystal C x at the incidence angle � � 440 = ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi 2w 440 p = 3.87 mrad (0.22 � ), very close to the 440 Bragg back reflection.Here we have used w 440 = 7.5 � 10 À 6 [see Table I The possible alignment procedure is illustrated in Fig. 9.The incidence angle of crystal C x will be first set to � � 440 = 3.87 mrad using a YAG screen (with a hole for the direct beam) that is 0.5 m away from C x .The reflected beam will be seen on the YAG screen as a bright spot with a 3.87 mm offset from the incident beam.This defines the nominal cavity photon energy with an accuracy of �5 meV.The intensity of the back-reflected beam on the YAG screen is then monitored while crystal C 1 angle � 400 is scanned around 45 � .The intensity will drop to the minimum value when the energy of X-ray photons reflected from C 1 matches the energy of the 440 Bragg reflection.This procedure determines the correct angular orientation of crystal C 1 with an accuracy of �� 400 ' � 2 440 =2 ' 1 mrad and serves as a starting point for the cavity alignment.

Figure 9
Photon energy calibration and C 1 angular alignment using diamond crystal C x near the 440 Bragg back reflection.

Summary
In summary, we have designed, manufactured and characterized the X-ray optical components for the joint ANL-SLAC-SPring-8 cavity-based X-ray free-electron laser (CBXFEL) project.The optical elements include high-reflectivity diamond crystal mirrors to reflect and circulate X-ray beams in the cavity, a diamond drumhead crystal with a thin membrane (thickness less than 20 mm) for X-ray output coupling, beryllium compound refractive lenses for beam focusing and mode control, silicon channel-cut crystal monochromators that single out the out-coupled X-rays within the cavity bandwidth for diagnostics and user experiments, and a diamond Bragg back reflector for accurate energy calibration and cavity alignment.
High-quality type-IIa HPHT diamond crystals were selected as cavity Bragg-reflecting crystal mirrors with a 400 Bragg reflection angle of 45 � at a photon energy of 9.831 keV.Six diamond crystals with a miscut angle of < � 0.3 � were prepared for the project.They were cut into rectangular plates with two strain-relief cuts, which ensured a mechanically stable and strain-free mounting.On the basis of rocking-curve imaging (RCI) results for these crystals, all crystals have Bragg-plane slope errors (BPSE) of < � 0.2 mrad in a 2 mm � 2 mm working area.The diamond crystals were also characterized with a novel wavefront sensing technique in Bragg diffraction.All cavity crystals feature a small phase error of <�/65 on a 100 mm-diameter footprint.
On the basis of the recent research and development on manufacturing defect-and strain-free diamond drumhead crystals by laser ablation (Pradhan et al., 2022), a diamond drumhead crystal with two thin membranes of thickness �16 mm was successfully manufactured.The RCI measurement confirms a 0.2 mrad BPSE in the center region of both membranes, which is close to the value measured before drumhead fabrication.The wavefront sensing measurement also shows a minimal change with a small increase in the phase errors of both membranes after drumhead fabrication.
Paraboloidal Be lenses acquired from RXOPTICS were characterized with X-ray phase-contrast imaging.The best lenses made from O30-H grade beryllium were selected, exhibiting small thickness errors of less than 0.25 mm (wavefront phase error ��/140) on a 100 mm-diameter footprint.
Two different types of four-bounce Si channel-cut monochromator crystals -an Si(660) crystal with an energy bandwidth of 20 meV and an Si(620) crystal with an energy bandwidth of 60 meV -were fabricated and characterized with X-ray imaging and Bragg reflection curve measurement.The best crystals of each type, featuring a scratch-free region in the working area, were selected.Both types of crystal perform well in Bragg diffraction, with measured Bragg reflection curves closely matching the simulated curves of perfect crystals in terms of curve shape and width.
A diamond back-reflecting crystal was proposed to be used in the diagnostics station G for accurate photon energy calibration and C 1 crystal angular alignment.This diamond crystal operates in the vicinity of the 440 exact Bragg backscattering, which has a very weak dependence of the energy of the reflected X-ray photon on its incidence angle.The accurate photon energy calibration and C 1 crystal alignment using this diamond crystal serve as the starting point of the X-ray cavity alignment, followed by a systematic alignment procedure using the various types of diagnostics designed for this project (Liu et al., 2023a).

Figure 2
Figure 2 Drawings of the required diamond crystal plates: (a) as grown, (b) marked up for machining, (c) machined by laser cutting and (d) machined by laser ablation for thin membranes.

Figure 4
Figure 4Similar to Fig.3but showing photographs and RCI maps of the crystals after laser cutting and annealing.RCI was performed on the crystal plates firmly clamped in the bottom area indicated in Fig.2(d).The red rectangles indicate the highest-quality working areas.

Figure 5
Figure 5 Characterization of the X-ray wavefront upon Bragg diffraction from selected diamond crystals.(a) Schematic of the experimental setup on APS beamline 1-BM with a reference crystal C r and a sample crystal C s .(b)-(d) Measured X-ray wavefront phase error maps for the selected diamond crystals C 2 , C 3 and C 4 , respectively.(e)-(g) Distribution of the r.m.s.phase errors in 100 mm � 100 mm regions of the corresponding crystals.The minimum, median and mean r.m.s.phase errors are shown in each graph.

Figure 7
Figure 7 Paraboloidal beryllium (Be) lenses and their characterization.(a) Schematic of the lens (left) with an enlarged view (right) mounted in a holder.(b) Schematic of the experimental setup for phase-contrast imaging of Be lenses in the transmission geometry (Qiao et al., 2021).(c) The reconstructed thickness profile T(x, y) of one of the best Be lenses.(d) The thickness residual error after removing the best-fit parabola from (c).

Figure 6
Figure 6 Fabrication and characterization of the diamond drumhead crystal C 1 with two membranes.(a) A photograph of the crystal after drumhead fabrication, taken from the unmachined side.(b) A microscope image of the drumhead structure with two membranes M 1 and M 2 (light circles).(c) A 3D model of the crystal showing the drumhead structure from the machined side.(d) An RCI intensity map.(e)-(f ) RCI color maps of FWHM and COM, respectively.(g)-(h) The 400 Bragg reflection rocking curves measured (black) in 100 mm � 100 mm regions of drumhead membranes M 1 and M 2 , respectively, versus theoretical curves (red) calculated with a membrane thickness of (g) 16 mm and (h) 16.5 mm.(i) Wavefront phase error maps remeasured after drumhead fabrication in the region of the two membranes.(j) Distribution of the r.m.s.phase error in the 100 mm � 100 mm regions.

Table 2
Specifications of the 100 diamond crystal mirrors.Parameters of the electron beam, XFEL beam and X-ray optical components in the CBXFEL project.

Table 3
Summary of characteristics of CBXFEL diamond crystal mirrors C 1 -C 4 measured after laser machining, ablation and annealing.COM (r.m.s.) in working area and drumhead membranes (mrad)