{'fraction_non_alphanumeric': 0.03747385544968627, 'fraction_numerical': 0.015338136184057634, 'mean_word_length': 4.25587786259542, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Beam focus modifications by cropping partially coherent X-ray beams

We simulate the focusing of a partially-coherent X-ray beam emitted by an undulator in a fourth-generation storage ring performing coherent mode decomposition and wave optics propagation. The focus position is shifted, and its size is enlarged when an entrance slit crops the beam. This is the usual case when a slit is used to select the coherent fraction. The pairing of two focusing elements (mirrors, lenses or transfocators) to ensure a fixed focal position is also analyzed. Our results show that the image of a partially coherent source, such an undulator in a low-emittance storage ring, is a non-trivial function of the aperture used to control the coherence fraction.

Introduction. -Fourth-generation storage-ringbased X-ray synchrotron sources deliver photon beams with high brilliance and coherence. Although the transverse coherence of these beams is highly improved in the horizontal direction, the overall coherent fraction is of the order of a few per cent for hard X-rays (> 10 keV). Beamline optical elements such as pinholes and slits are then used to improve coherent fraction to values typically > 80% needed for applications exploiting coherence, such as X-ray photon correlation spectroscopy, coherent diffraction imaging, propagation-based phase-contrast imaging, and ptychography [1]. The coherent beam interaction with the optical elements produce diffraction, thus modifying the beam characteristics and also affecting the beam focusing, as discussed here.
Let us consider the case of an ideally focusing system of focal length f (made by a mirror or lens that focuses the source into the image plane). The position of the focus with respect to the focusing element q is given, in the framework of geometric optics, by the lens equation f −1 = p −1 + q −1 , with p the source-element distance. If the numerical aperture (NA) of the beam is reduced (for example by the finite dimension of the lens or mirror, or by using a slit) the location and dimension of the focus change as a result of diffraction. It has been shown [2] that the focal position of a Gaussian beam moves towards the lens position when the NA decreases. This shifting of the focal position is relevant for synchrotron beamlines, as demonstrated by Westfahl et al. [3]. These authors noticed a shift of the horizontal focal position upstream from the position given by geometrical optics (Fig. 7 ibid.) when the horizontal acceptance is reduced by a slit.
The diffraction effect (due to the slits and finite size of the optical elements) not only shifts the focal position (upor downstream), but also changes the focal dimensions. These facts must be taken into account in beamlines in fourth-generation synchrotron sources. They are critical when designing beamlines with several coupled focusing elements. We studied this phenomenon in the context of the project for the new "EBSL1" beamline at the upgraded EBS-ESRF storage ring. This beamline will produce highly coherent beams of variable cross section at the sample position. Two refractive systems (transfocators) will be paired to allow a varying focal size, whereas a slit placed upstream from the transfocators is used to control the coherent fraction. The optical matching of the transfocators is strongly correlated to the slit aperture (or coherent fraction). The performances of such systems are calculated in the framework of the partially coherent optics using a fast algorithm for decomposition of the undulator radiation in coherent modes that are propagated along the beamline using the algorithms presented in [4]. The suitability of this method is discussed (ibid.) and compared with other partial coherence simulation algorithms.
The key point is to treat separately the horizontal and vertical planes, therefore working with one-dimensional wavefronts. Focal position produced by a single focusing element. -Let us consider an aperture of dimension a placed between the source and a focusing optical element (here we consider a lens), at a distance p a from the lens (p a < p). The lens is set to focus the source into an image plane at q downstream from the lens. Following the geometrical optics, the position of the focal plane is defined by the lens equation (which does not depend on the aperture a), and the focal size is M × s (considering the aperture size a is larger than the source size s). M = q/p is the optical magnification. If a is smaller than the beam size, the aperture obscures part of the source reducing the beam intensity. However, the focal size and focal position (where the beam waist is found) are not modified. When the beam has a high coherence, these results predicted by geometrical optics are insufficient [5]. This section presents a numerical study of the position and size of the beam waist for different apertures taking into account the partial coherence of undulator emission. We simulated a U18 undulator (period λ u = 18 mm) with N u = 138 periods. The gap is tuned to have the first harmonic at E = 7 keV (deflecting parameter K = 1.851). We consider a Be lens with parabolic profile and radius at the apex R = 0.2 mm (f = 14.35 m at 7 keV), located at a distance p = 65 m from the source. A slit of variable aperture a is placed at p a = 29 m upstream from the lens.
We first suppose an ideal storage ring with zero emittance, therefore producing a fully coherent emission. The beam at the slit plane has a full-width at half-maximum (FWHM) a FWHM = 565 µm. The aperture a takes different values from fully opening (the whole beam passes the slit therefore the transmittivity is T = 1) to a very narrow aperture (T 1). The refracted beam is analyzed at different positions from the lens by calculating the FWHM of the intensity distribution. At the beam waist the FWHM presents a minimum. Fig. 1a shows the evolution of the coherent beam size after being focused by the lens. It also shows markers for the focal positions predicted by the lens equation: q = 18.417 m considering the source at the undulator position (blue line) and q a = 28.408 m if one considers the slit as an effective source (orange line). As expected, the beam waist calculated numerically converges to these respective values when the slit is opened (T = 1, Fresnel number N F = 78, grey line) and almost closed (T ≈ 0, blue line). For intermediate values of a, the beam waist "moves" from one case to another. For T = 0.93 (N F = 35, magenta line) the cropping by the slit is negligible so the situation does not change with respect to the open slit. For T = 0.56 (N F = 8.7, brown line) the waist presents a flat depression, increasing its minimum FWHM and also the depth of focus. Smaller values of T and N F shift the minimum to higher distances (e.g., T = 0.12, N F = 0.3, red line), and the minima become less pronounced. A small FWHM is found close to q a (orange marker) for T = 0.05 (N F = 0.09, green line), showing a twin minimum due to the interference fringes found in the intensity distributions. Both minima con-verge to this position for T = 0.01 (N F = 0.003, orange line), and T = 0.003 ≈ 0 (N F = 0.0009, blue line). The numeric values of the FWHM agree with those calculated using geometrical concepts only for the limiting cases of waist at q and q a . However, for intermediate slit apertures, where the waist position is in between q and q a , the waist size is different to that predicted by geometric optics, and significantly higher than the limiting values at q and q a , showing the envelope in Fig. 1a (dashed black line). This is an important fact: good focusing, i.e., a very small beam size is only obtained in the limiting cases of open slit and almost-closed slit. This means that for a fully coherent beam, the slit worsens the focusing. The diffraction at the slit creates a spurious divergence that affects the lens focusing. When the focal distance of the lens is reduced (using lenses with smaller radius, or piling several lenses), the q and q a positions shift to shorter distances, and become closer one to another (|q − q a | also reduces). They converge to a single position: the lens focal length q = q a = f . This happens when both source-lens and slit-lens distances can be considered infinite.
We used the EBS-ESRF emittance values 1 to perform the coherent mode decomposition of the undulator source. The details for that are presented in [4]. This is done for the horizontal and vertical directions, yielding coherent fractions (at 7 keV) CF h = 13% and CF v = 58%, respectively. These values are much higher than for the old ESRF-1 source, but still too low to apply the fullcoherence approximation. Therefore, we propagated a number of modes large enough to contain more than 99% of the source intensity (36 modes in H and 8 in V). The illumination at the entrance slit plane is 610 µm (H) × 566 µm (V). The slit aperture is effectively used to tune the coherence of the beam: closing the slit increases the CF . In the limit (zero aperture) the beam after the slit is fully coherent (CF = 1), but obviously with zero transmittivity (T = 0). The choice of the right slit aperture comes from a compromise between coherence and flux. Figures 1b and 1c show the focal size along the optical axis for several apertures in the horizontal and vertical planes. We calculated the case of the partially coherent beam (multi-mode, solid lines) and also the case of a fully coherent beam (only the first coherent mode, dashed lines). We observe that the focal positions (the minima of the plot lines) do not change significantly when passing from full to partial coherence. However, the focal dimension changes significantly in the horizontal direction for cases with CF h ≤ 70%. In the vertical direction, where the beam at the source was more coherent, there is not much difference in sizes when going from full (dashed lines) to partial coherence (solid lines). Looking at the focal position shift versus q a (orange marker) we find important differences in the horizontal and vertical directions. Closing the slit produces a gradual shift of the focal position from the position of the geometrical image of the undulator source (blue vertical line) to the geometrical image of the slit (orange vertical line). However, in the vertical plane, the slit crops the beam only slightly, and closing the slit to go from the source CF v = 58% to values up to 90% does not produce any focal shift from the position of the geometrical image of the undulator source. Only when the slit is very narrow (e.g., a v = 25 µm, red curve) the focal position shifts to the locus of the geometrical image of the slit. This case is in principle not interesting experimentally as it reduces the intensity from an already quite coherent beam (CF v = 90%). In summary, for practical values of aperture selected to increase the beam CF to values up to 90% the behaviour in vertical (V) and horizontal (H) directions is different: the better source coherence in V permits working with quite open slits thus the focusing system "sees" the source at the undulator position, whereas in H one needs a significant crop of the beam thus shifting and enlarging the beam waist. Notice that the good coherence of the beams emitted by the EBS-ESRF and other 4 th generation storage permits performing coherence experiments with a "conservative" use of slit (open in V and partially closed in H). By con-trast, these experiments at 3 rd generation sources require a drastic closing of the slits to a pinhole size.
Focal lengths and sizes for paired focusing elements. -Consider an ideal optical system composed of two focusing elements which have focal lengths f 1 and f 2 , and which are separated by a distance D. Following [6], the relationship between object-to-element-1 distance p 1 and the element-2-to-image distance q 2 given by the geometrical optics is: which corresponds to an hyperbola 2 in the (f 1 , f 2 ) plane. The global magnification is the product of the magnification of the individual focusing elements.
2 Expanding eq. (1) one gets f 1 (Dq 2 + p 1 q 2 ) + f 2 (Dp 1 + p 1 q 2 ) − f 1 f 2 (D+p 1 +q 2 ) = Dp 1 q 2 , with horizontal asymptote at The magnification is not dependent on D, however, the optical throw (length of the optical system L = p 1 +D+q 2 ) will change if one changes the focal distances of the elements. For a constant L one can change magnification by changing the inter-element distance D (zoom effect). In a synchrotron beamline, the transfocators are refractive focusing elements that allow changing the magnification by varying their focal lengths (by adding or removing lenses) [7]. Alternatively, two Kirkpatrick-Baez systems with bendable mirrors or multilayers can be used.
We consider an optical system made by two paired transfocators to get a variable magnification (variable focal size) in a fixed location (the sample position). The configuration match the requirements of the EBS-ESRF EBSL1 beamline. The source is a U18 undulator tuned at a photon energy of 7 keV (as used before). A slit of aperture a h × a v is placed at 36 m from the undulator. We represent the two transfocators by two real beryllium lenses of variable curvature radius R 1 and R 2 that correspond to focal distances f 1 and f 2 , with f 1,2 = R 1,2 /(2δ), δ = 6.96 × 10 −6 for Be at 7 keV. Lens-1 is placed at p 1 = 65 m from the source, and lens-2 at D = 105 m downstream from lens-1. The image plane, where the sample is placed, is at q 2 = 30 m downstream from the lens-2. The optical throw is L = p 1 + D + q 2 = 200 m. The slit is p a = 29 m upstream from lens-1 (i.e. at 36 m from the undulator).
For a given value of f 1 and the the fixed distances (p 1 , D and q 2 ), f 2 can be calculated analytically with eq. (1). The trajectory pairs (f 1 , f 2 ) obtained in this way guaranp-4 cropped X-ray beams tee that the focus is at the sample position (L = 200 m from source). However, as shown in the previous section, these results of the geometrical optics are not exact when partially coherent beams are cropped by a slit. Figure 2 shows the results of the numerical search of the f 2 to produce the waist at the sample plane. It is obtained by performing a map of the on-axis intensity I 0 of the beam at the sample plane versus (f 1 , f 2 ). Each pixel corresponds to a simulation to compute the pattern at the image plane, considering partial coherence, i.e., propagating many coherent modes. For a given f 1 value, one can select the f 2 value that produces the best focus at the sample position (picking the maximum of I 0 (f 2 ), which also corresponds to the minimum FWHM). The I 0 (f 1 , f 2 ) maps depend strongly on the slit aperture. In the horizontal direction, the low CF h of the source (13%) is strongly increased when the slit is being closed, producing an appreciable displacement of the pattern in Fig. 2a, thus requiring a fine tuning of f 2 to keep the beam focused at the sample plane. In the vertical direction, the source is more coherent (CF v = 58%), and closing the slit does not shift the waist position until reaching CF v ≈ 90%. However, when the slit is almost closed (a v = 25 µm) acting as a pinhole the patterns approach the (f 1 , f 2 ) trajectories resulting from the geometrical optics considering the source at the slit position. Figure 3 shows the calculated focal sizes. Analytical values (dashed lines), based on geometrical optics, i.e. eq. (2), are close to numeric values of beam sizes for the limiting cases of open slit (source at the undulator) or almost-closed slit (source at the slit). For other useful cases where the slit crops partially the beam, the numerically calculated values should be used. Here, the focal sizes cannot be predicted by geometrical optics (also seen in Fig. 1a), and cannot be simply interpolated from the sizes corresponding to the limiting slit openings. The size values calculated analytically have very limited applicability for practical cases where the beam is partially cropped by the slit.
In the horizontal direction, for slit apertures a h > 40 µm the sizes change considerably for small changes in a h . The focusing characteristics of the system highly depend on the diffraction effects produced at the slit. For the slit a h = 40.3 µm (CF h = 90%) the focal size can vary from roughly 10 to 50 microns. In the vertical direction the focal size can be changed from 5 to 100 µm at CF v = 90%.
In summary, it is shown that a slit that crops a partially coherent X-ray beam induces a diffraction effect in the beam originating an appreciable change in the focal characteristics (position and dimensions). In the case that two (or more) focusing elements are used, the basic concepts from geometric optics are insufficient to predict the conditions to pair them (define the focal lengths) for creating a focus in a precise position. Numeric methods for partially coherent optics based on coherent mode decomposition and wavefront propagation (as described in [4]) are used to predict the focal lengths of the focusing ele-ments and the resulting image size. The data that support the finding of this study are openly available 3 .