PtyNAMi: ptychographic nano-analytical microscope

The ptychographic nano-analytical microscope (PtyNAMi) is designed for in situ/operando high-resolution imaging in two and three dimensions with high sensitivity and structural, elemental, chemical and electronic contrast.


Introduction
Understanding the structure and function of matter on the microscopic scale is of utmost importance to develop new functional materials or understand complex processes in nature and technology. Ideally, studies to this end are carried out under in situ or operando conditions in order to image the sample evolving in its natural environment. While electron microscopy can push the spatial resolution to the extreme in very small and carefully prepared samples, hard X-rays can penetrate thicker samples in a larger and more realistic environment. X-rays give access to local structural, electrical, elemental or chemical information from the inside of even thick samples with high spatial resolution. Hard X-ray microscopy is therefore a powerful method for structure determination in three dimensions, and it is applied in a variety of scientific fields, such as biology, chemistry (including catalysis), physics, materials science and nanotechnology.
The hard X-ray microscopy setup on the PETRA III beamline P06 provides access to different contrast mechanisms such as X-ray absorption spectroscopy, X-ray fluorescence, X-ray beam-induced current and X-ray diffraction . It is designed to produce focused hard X-ray beams with sizes of 50 nm (FWHM) and below. Furthermore, the standard scanning techniques, which are typically limited in spatial resolution by the X-ray focus size, can be combined with scanning coherent X-ray diffraction microscopy (ptychography) Rodenburg et al., 2007;Thibault et al., 2008;Pfeiffer, 2018), potentially yielding structural information in three dimensions with an even higher spatial resolution of 10 nm and below (Schropp et al., 2012). Since ptychography is based on coherent diffraction, it is in principle limited in performance only by the available coherent photon flux, rather than the focus size  or the radiation hardness of the sample.
Many practical aspects of such an X-ray microscope hinder the optimal performance, and further instrumental developments were needed in order to reach a resolution regime below 10 nm in X-ray imaging on a routine basis. Our efforts to reach this goal cumulated in an upgraded nanoprobe setup on beamline P06, denoted ptychographic nano-analytical microsocope (PtyNAMi).
The setup is optimized in order to enable scanning hard X-ray microscopy with the highest possible spatial resolution and sensitivity using the aforementioned X-ray analytical contrast mechanisms, and it provides all degrees of freedom required for 2D and 3D imaging experiments . It is furthermore compatible with additional auxiliary experimental equipment required for in situ or operando experiments . The instrumental design was developed following the experimental requirements for highresolution X-ray ptychography, which may be summarized as (i) high-performance X-ray optics (Section 4), (ii) high mechanical stability and control (Section 5), (iii) low scattering background (Section 6), (iv) optimized coherent flux (aperture matching). These instrumental developments, requiring both a high mechanical and temperature stability and positioning control, are strongly driven by the upcoming synchrotron radiation sources of the fourth generation, such as MAX IV (Tavares et al., 2018), ESRF-EBS (Raimondi, 2016) or PETRA IV Schroer, Rö hlsberger et al., 2019). These new ultralow-emittance X-ray sources will provide a considerably higher coherent photon flux optimal for hard X-ray microscopy. Various microscopy setups are currently being developed at many synchrotron radiation sources worldwide in order to finally close the current resolution gap in X-ray imaging between about 10 nm and the atomic scale (da Silva et al., 2019;Martinez-Criado et al., 2016;Nazaretski et al., 2017;Holler et al., 2018;Deng et al., 2019;Takahashi et al., 2011).
This article is structured mainly in three parts, starting with a general introduction to beamline P06 (Section 2). This is followed by a detailed description of instrumental developments implemented on PtyNAMi and the specific performance characteristics of the setup (Sections 3 to 6). Finally, some representative high-resolution nano-imaging results obtained with the new setup are shown (Section 7).

Beamline P06 at PETRA III
The ptychographic nano-analytical microscope (PtyNAMi) is installed in the nanohutch of beamline P06, the hard X-ray micro/nanoprobe at the synchrotron radiation source PETRA III (DESY, Hamburg). The storage ring is characterized by its low emittance of 1.3 Â 0.013 nm rad in the horizontal (h) and vertical (v) directions, respectively. Beamline P06 shares a low-section (Sector 4) of the storage ring with the imaging beamline P05. The X-ray light on P06 is produced by a 2 m long U32 undulator ( U = 31.4 mm and K max = 2.7), creating a small X-ray source with a size of about 36 mm (h) Â 6.9 mm (v) (r.m.s. at E = 12 keV) and a source divergence of 28 mrad (h) Â 4 mrad (v) (r.m.s. at E = 12 keV). A schematic layout of beamline P06 is shown in Fig. 1 [see also  (a) An overview of Sector 4 at PETRA III. Beamline P06 shares this sector of the storage ring with the imaging beamline P05. (b) The P06 optics hutch comprises a multilayer monochromator (MLM), a channel-cut crystal monochromator (CCM), a double-crystal monochromator (DCM), horizontal offset mirrors (HO mirrors), and 1D refractive silicon lenses (1D lenses) and beryllium compound refractive lenses (CRLs) for prefocusing. Indicated position values refer to the distance from the middle of the undulator to the different devices. (c) A CAD drawing of the experimental hutches on beamline P06.

P06 optics hutch
The optics hutch on beamline P06 [see Fig. 1(b)] lies between 31.8 and 44.15 m from the X-ray source. It contains a two-bounce multilayer monochromator (MLM) with a bandwidth of a few percent, a cryogenically cooled double-crystal monochromator (DCM) with a fixed vertical offset and a channel-cut crystal monochromator (CCM). Both crystal monochromators are equipped with Si(111) crystals. Horizontal-offset mirrors (HO mirrors) with Si, Cr and Pt coatings suppress higher harmonics of the X-ray beam with cutoff energies between 6 and 30 keV. Prefocusing X-ray lenses at the end of the optics hutch can be used to adapt the photon flux or the coherence properties of the X-ray beam to the optics of the X-ray microscopes in both the micro-and nanohutch (aperture matching) .
Recently, 1D nanofocusing lenses made out of silicon were implemented in an additional small vacuum chamber in order to prefocus the X-ray beam in the vertical direction, thereby collecting a larger coherent fraction of the X-ray beam [see Fig. 1(b)]. The X-ray energy can be continuously tuned between 6 and 18 keV or 2.4 and 50 keV using the channel-cut or the double-crystal monochromator, respectively. The multilayer monochromator offers an energy range between 10 and 100 keV.
In addition, beamline P06 is equipped with various slit systems and beam monitors along the X-ray beam path. The high-power slits PS1 and PS2 are located still within the PETRA III ring tunnel, while a quadrant beam-position monitor is positioned about 1 m behind the DCM and followed at a close distance by a retractable beam monitor (LM2) in the optics hutch. Another beam monitor (LM2b) is installed directly behind the new 1D focusing system, facilitating the alignment of the 1D silicon lenses and HO mirrors. A slit system in the optics hutch (OH slits) is used to further define the X-ray beam before it passes through the 2D prefocusing system based on beryllium compound refractive lenses (Be CRLs) (Lengeler et al., 1999). The CRL prefocusing system can accommodate a maximum of six cartridges, each containing a different combination of Be CRL stacks. Details of the specific CRL assemblies in the different cartridges are summarized in Table 2.
The current prefocusing configuration is equivalent to a system of lens stacks containing integer binary exponentials of Be CRLs with a radius of curvature of R = 1.5 mm, except for the last one which is slightly more focusing. In particular, the six cartridges contain an equivalent of N = 2, N = 4, N = 8, N = 16, N = 32 and N = 67.5 lenses with R = 1.5 mm, respectively. The first cartridges are typically used to maximize the photon flux, whereas the last, more strongly focusing, ones are inserted in order to enhance the spatial coherence at the microscope by creating a virtual source between the optics and the experimental hutch. Each cartridge can be inserted independently into the X-ray beam and therefore a variety of different lens configurations are possible. In this way, the monochromatic beam can be optimally shaped over a wide X-ray energy range, depending on the specific experimental needs at the position of the X-ray microscopes in either the micro-or the nanohutch.

P06 microhutch
The next beam monitor (LM3) is positioned closely downstream of the optics hutch at a distance of 44.66 m from the undulator source. From there, the X-ray beam can propagate freely until it enters the P06 microhutch at a distance of 86.05 m from the source (see Fig. 1). At the beginning of the microhutch another beam monitor (LM4), followed by a second quadrant beam-position monitor (QBPM micro), are used to measure the position and direction of the X-ray beam. Just downstream of these components, a fast shutter (Azsol SLS 200) is implemented to control the exposure time precisely. It is followed by an absorber box containing 12 foils (three silicon wafers with thicknesses from 380 to 3000 mm and nine aluminium foils with thicknesses from 5 to 2000 mm) in order to attenuate the X-ray beam if this is required experimentally (see the position details in Table 1).
This first experimental hutch on beamline P06 comprises the microprobe setup, a hard X-ray scanning microscope based on Kirkpatrick-Baez (KB) mirrors as the main focusing  Table 2 The prefocusing system on beamline P06 provides space for six individual Be CRL cartridges, each containing an individual lens configuration defined by the number N of CRLs with a specific radius of curvature R. Table 1 Beamline components on P06 and their distance from the centre of the undulator [updated from ]. system (Kirkpatrick & Baez, 1948;Mimura et al., 2007). Here, X-ray microbeams with a size below 500 nm (FWHM) are routinely used (Boesenberg et al., 2016;Rumancev et al., 2020).
Recently, Be CRLs in combination with corrective phase plates were also implemented as alternative X-ray nanofocusing optics. By using this setup, the coherent part of the X-ray beam can be focused to a size of about 100 nm (FWHM) Schropp et al., 2018), and it is often used if the beamline is operated in combined mode using both the micro-and nanohutches [see Fig. 1(c)]. In this experimental scenario the full space available on P06 is used, with a distance of up to approximately 8 m between the sample (located in the microhutch) and the diffraction detector (positioned at the end of the nanohutch). The beamline extends further to the nanohutch, starting at about 96.2 m from the undulator source. This second experimental hutch on beamline P06 provides a high temperature stability of about 0.1 K in order to minimize the influence of thermal drifts. Further experimental or technical equipment, which can potentially act as a heat or vibration source, is located outside the hutch. PtyNAMi is installed in this highly stable environment.

PtyNAMi
At the beginning of the nanohutch, an ionization chamber and a 2D X-ray detector (X-ray eye) are positioned at distances of about 115 and 50 mm in front of the entrance slits of the microscope in order to optimize the intensity and visualize the X-ray beam before it enters the instrument, respectively. The entrance slit system (PI miCos GmbH) with integrated pairs of high-precision slit blades (Advanced Design Consulting USA Inc.) is used to confine the incident X-ray beam size further. A transmission diode is implemented a short distance behind the slit system in order to determine the incoming photon flux before the X-ray beam hits the nanofocusing X-ray optics. At a short distance in front of the nanofocus, a pinhole is implemented to clean the X-ray beam from parasitic scattering created within the optics or other optical components upstream. The sample is then positioned close to the focal plane of the optics. Table 3 summarizes some position values of these components for a typical lens configuration using nanofocusing lenses (NFLs; Schroer et al., 2003 with a working distance of 30 mm. Depending on the particular focusing requirements, these values may vary for other lens configurations or different nanofocusing X-ray optics.   In Fig. 2 an overview of different components of the setup is given. It is mainly divided into two parts, namely the lens and sample platform, and a detector device [see Fig. 2(a)]. The core of the microscope holding the X-ray lenses is built on a stiff and stable titanium and Invar frame [see Fig. 2(b)], which forms the base on which to mount the various X-ray optics such as NFLs, Fresnel zone plates (FZPs) or, recently, multilayer Laue lenses (MLLs). The accurate alignment of these optics requires up to 2 Â 6 degrees of freedom, which was realized by implementing two hexapods (SmarAct GmbH), both hanging at an angle of 45 from the top of the scanner frame. In the case of cylindrical optics that focus in one dimension only, each of them carries a lens for either horizontal or vertical X-ray focusing. The sample mount is realized by a stack of linear stages for coarse alignment in the horizontal (CS-430, PI miCos GmbH) and vertical direction (NPE-200, PI miCos GmbH). On top of these, an air-bearing rotation stage (UPR-160, PI miCos GmbH) is installed, allowing rotation of the sample over 360 around the vertical axis. If the interferometric position control using the glass ball retroreflector is active, an angular range of more than 180 can be accessed (see Fig. 4). The fine positioning is then further implemented using a piezo scanner (QNP40-100, Aerotech Inc.), allowing the user to scan samples with nanometre accuracy over a maximum travel range of 100 mm in the x, y and z directions. In addition, two linear centring stages (Q-545, PI miCos GmbH) are used below the scanner to align a sample to the axis of rotation, which is required for tomographic applications. Although the centring stages are not absolutely required, since alignment errors in tomography could also be compensated using the linear stages below the rotation stage, they typically facilitate the sample alignment procedure considerably. Future stability-enhanced upgrades might not consider the use of centring stages in order to further stiffen the setup.
The detector device is optimized to support an in-vacuum diffraction detector (Eiger X 4M, Dectris Ltd). The entire detector setup is fully motorized, allowing the user to switch easily between different detector configurations. In Fig. 3 different geometric scenarios are summarized, showing that the distance between the sample and the in-vacuum diffraction detector can be varied continuously from 1.44 to 3.34 m and the evacuated tube can be swivelled with respect to the direct beam by a maximum angle of ' max ' 20 [see Figs. 3(a)-3(c)]. The different components of the detector device, such as the nozzle of the evacuated tube pointing towards the sample and the small vacuum chamber containing the detector at the end of the tube, can be moved independently, providing maximum flexibility in setting up a specific detector geometry.
If required, the evacuated tube can be completely retracted from the X-ray beam path, opening up space for an optical microscope or any additional 2D X-ray detectors which need to be positioned in the vicinity of the sample. While the optical microscope is typically used to align a sample visually, near X-ray detectors are employed for wide-angle X-ray scattering applications [see Fig. 3 Table 3 PtyNAMi components and their distance from the beam-defining slits.
Given values refer to a set of NFLs with a working distance of 30 mm.

PtyNAMi component
Position (  In Fig. 4 the core part of the microscope is shown. It consists of the X-ray lenses for horizontal and vertical focusing, each mounted on a hexapod providing six degrees of freedom for alignment, a pinhole downstream of the lenses, and the sample scanner. The sample is mounted on the scanner with a kinematic mount that includes a ball lens retroreflector whose position is monitored by three interferometer heads mounted in the plane perpendicular to the X-ray beam at angles of approximately À15, 15 and 45 . They point towards the ball lens retroreflector, measuring the position of the sample at a sampling frequency of up to 156 kHz. With this device, the position and mechanical vibrations of the sample can be measured with high accuracy in the plane perpendicular to the X-ray beam. However, the sampling frequencies typically used are smaller than 20 kHz, which is sufficient to cover the main vibrational modes of the setup. The noise level of the interferometers is specified to well below 1 nm, regardless of the streaming frequency. To date, the interferometers are only employed to measure the sample position at high sampling frequencies, but they could in principle also be used for closed-loop positioning control of the sample. The sample motion along the beam axis is not monitored externally, as the depth of focus of the X-ray optical system is typically much larger than all deviations from the nominal position along the optical axis. The interferometer and pinhole holder can be aligned with linear piezo stages (SLC-series, SmarAct GmbH).
The ball lens retroreflector is made out of glass with a refractive index of n ' 2 (Edmund Optics) and has a diameter of 10 mm. Sample positioning works reliably as long as the sample position stays within a range of about 10% of the sphere's diameter, i.e. about 1 mm in all dimensions. The collimated interferometer beam has a size of about 400 mm. According to the manufacturer, shape errors of the sphere are below 2 mm. Half of the sphere is coated with chromium to enhance the retroreflected signal. Using this device for retroreflection has the main advantage that the interferometer signals can still be received while the sample is rotated in X-ray tomography experiments. In the current design using the half-coated sphere the sample can be rotated over an angular range of more than 180 . The interferometer heads are connected via 20 m long optical fibres to the interferometer controller (PicoScale, SmarAct GmbH). The working wavelength of the interferometer is 1530 nm. A visible-light alignment laser can be activated independently. The position acquisition is triggered synchronously with the area detectors and fluorescence pulse processors of the beamline and permits fast continuous scanning with image acquisition rates of the order of 1 kHz. As the maximum sampling frequency is 156 kHz, the sample motion during each exposure can be analysed individually even with such rapid data acquisition. Besides the sample displacement, the raw quadrature signal can also be saved for more detailed analysis. Positioning inaccuracies of the sample related to tilt errors introduced by the piezo scanner are not tracked with the current setup. They are specified by the manufacturer with a maximum error of 6 mrad, leading to a maximum induced parallax error in the range of 100 nm. Further instrumental improvements will be needed to measure and compensate for this effect.

X-ray optics and nanobeam characterization
The core part of PtyNAMi is designed to accommodate different nanofocusing X-ray optics, such as NFLs (Schroer et al., 2003(Schroer et al., , 2004 for the harder X-ray regime above E = 10 keV and FZPs Gorelick et al., 2011;Parfeniukas et al., 2016;Mohacsi et al., 2016) for the lower X-ray spectrum below E = 10 keV. The setup is quite flexible, providing a general platform for the characterization of new X-ray optics (Seiboth et al., 2014;Lyubomirskiy et al., 2019). In particular, adiabatically focusing lenses (AFLs) Patommel et al., 2017) or multilayer Laue lenses (Kang et al., 2008;Bajt et al., 2018) can reach the sub-20 nm resolution regime on a routine basis. Fig. 5 shows different high-performance X-ray optics typically implemented in PtyNAMi. In the case of cylindrical   lenses focusing in one dimension only (1D focusing), such as NFLs or MLLs, two such lenses have to be implemented in a crossed geometry in order to create a 2D point focus. Each lens is then mounted on a hexapod to align the lens fully with six degrees of freedom, i.e. three translations and three rotations. At a distance further downstream a pinhole is implemented in order to reduce parasitic scattering created within the lenses or other upstream components. For the FZP, on the other hand, the lens is typically mounted on one of the lens hexapods, while the other one holds a beam stop to block the central unfocused part of the X-ray beam. In this case the pinhole acts as an order-sorting aperture, cleaning the nanofocused X-ray beam of other diffraction orders of the zone plate.
In Fig. 6 a typical result for nanobeam characterization by ptychography is shown, which was measured using the previous nanoprobe setup before the upgrade. Here, a resolution test chart by NTT-AT (model ATN/XRESO-50HC) made of tantalum with a material thickness of 500 nm was scanned over an area of 2 Â 2 mm on a 2D grid with 50 Â 50 steps. At each scan position, a far-field diffraction pattern was recorded with an exposure time of 0.5 s at an X-ray photon energy of E = 18 keV using a Pilatus detector (Dectris Ltd). The detector has a pixel size of p = 172 mm and was positioned at a distance of 2.24 m downstream of the sample. From the total of 2601 measured diffraction patterns, both the complexvalued transmission function of the sample and the illumination function can be recovered at the same time using e.g. the standard ePIE algorithm (Maiden & Rodenburg, 2009). In Fig. 6 the result of this beam-characterization experiment is summarized, showing the phase of the object transmission function and the illumination function recovered in the sample plane. The amplitude of the illuminating complex wavefield is encoded by brightness and the phase by hue (compare inset). Note the relatively strong smearing of the smallest features with a size of 50 nm, especially in the horizontal direction [see Fig. 6(a)], which was often observed with the old setup.
With the knowledge of the complex-valued illumination function, full information about the X-ray optics is obtained and the beam caustic can be retrieved by numerically propagating the wavefield along the X-ray beam path [see Fig. 6(b)], indicating that the X-ray focus is almost perfect with only lowintensity side lobes. The size of the nanofocus was determined to be 44 nm (h) Â 52 nm (v) (see Fig. 7 Horizontal and vertical intensity profiles in the focal plane obtained from the reconstructed illumination function shown in Fig. 6(a). SEM images of (a) an NFL structured in silicon , (b) an FZP made out of gold with typical layer height from 0.85 to 1 mm and smallest outermost zone width of 50 nm , and (c) an MLL (Bajt et al., 2018).

Figure 6
Characterization of a nanofocused X-ray beam by ptychography using the previous nanoprobe setup on beamline P06. (a) The illumination and object function were reconstructed using the ePIE algorithm. (b) Caustics of the nanofocused X-ray beam in the vertical and horizontal planes. than the theoretical diffraction limit of 40 nm (h) Â 51 nm (v) for this lens configuration.

Mechanical stability and control
In a first step the mechanical setup of the microscope was considerably improved by stiffening the microscope frame using titanium struts and an Invar casing to reduce the effects of temperature drift. The construction was then optimized by finite element methods in order to reduce the amplitudes of vibrational modes as much as possible and push the eigenfrequencies as high as possible. The result of this process is the standard PtyNAMi setup as illustrated in Fig. 8(a). In this configuration, the setup provides the greatest flexibility to carry out 3D X-ray imaging experiments requiring all stages for coarse sample alignment, rotation and centring. In order to give further control over the position of the sample during the experiment, a set of three optical interferometers was implemented. In this way, sample drifts or image distortions related to inaccuracies of the high-precision piezo scanner can be corrected. In addition, position values can now be recorded at sampling rates considerably above the scanning frequency, revealing information on the vibration modes of the sample relative to the frame during the acquisition time of single exposures.
It has been observed that the stability of the microscope improves still further as soon as all stages for coarse sample positioning are removed. In this 'ultrastable' configuration of PtyNAMi, the piezo scanner is directly attached to the Invar frame of the optics [see Fig. 8(b)]. Here, the sample tower is substantially smaller, thereby reducing the influence of relative motions and instabilities between the X-ray lenses and the sample. Of course, in this configuration the setup is less flexible and only 2D imaging experiments on pre-aligned samples can be carried out. While long-term drifts can often be corrected numerically, the ultrastable configuration has the main advantage that the influence of mechanical vibrations during single exposures, which otherwise lead to an incoherent superposition of diffraction data, is reduced effectively.
The stability of these two configurations of the setup can be assessed with the help of the interferometer data measured e.g. during typical step scans. Since these devices are operated Upper plots: histograms of the standard deviation (STD) and the width of the distribution containing 95% of the position values, determined from the interferometer data during a typical 2D ptychographic scan in the case of (a) the standard tomographic setup and (b) the ultrastable configuration. Lower plots: frequency spectra obtained from the same scans. For the ultrastable configuration, the resonance frequencies are reduced by about an order of magnitude, especially in the lower-frequency regime. The frequency spectra use the same arbitrary units on the ordinate.  at a high repetition rate, a large number of position values can be recorded for each scan point, which can then be further analysed by statistical means. In Fig. 9 the stability statistics are given for both the standard and the ultrastable setup. For each position in the scan, the centre of mass and the standard deviation of the point cloud are calculated. In addition, the width of the point cloud is determined that includes 95% of all points, discarding the outermost 2.5% of the points on each side of the distribution. Fig. 9 shows the histograms of the standard deviation and the 95% width in the vertical (black lines) and horizontal (light-blue lines) directions, respectively. In the standard setup, typical vibrational excursions lie in the range of tens of nanometres horizontally [ Fig. 9(a)] and up to 10 nm vertically (95% width). In the ultrastable setup, the point cloud is significantly smaller, covering an area of 2 nm (h) Â 4 nm (v) (95% width). Low-frequency vibrations are considerably reduced using the ultrastable setup, as can be recognized in the corresponding Fourier spectra (see lower graphs in Fig. 9).
In the standard setup, the relatively large vibrational level compared with that of the ultrastable setup can be attributed to the coarse sample stages. In the ultrastable setup, a high degree of stability is obtained at the expense of flexibility of the scanning modes, limiting applications to 2D scans of well pre-aligned samples. Currently, the sample scanner has been redesigned to combine the advantages of both setups, yielding high stability and allowing flexible alignment of more complicated sample environments and tomographic scanning modes.
In the following, we illustrate high-resolution imaging using the ultrastable setup of PtyNAMi in view of positioning errors.
In particular, different positioning data are used in the reconstruction, as well as different reconstruction models (Fig. 10).
The imaging experiment was carried out on the same resolution test chart as shown in Fig. 6. In this case, an area of 2 Â 2 mm was scanned on a 2D quadratic grid with 60 Â 60 equidistant steps and an exposure time of 0.5 s per scan point. The result is summarized in Fig. 10, which shows different reconstruction runs using encoder position values [ Fig. 10(a)] and values measured by the optical interferometers [ Fig. 10(b)]. Also shown are ptychographic reconstructions starting with the interferometer positioning data, which are then iteratively refined using a brute-force local search approach [ Fig. 10(c)], and the final result starting with the reconstruction result shown in Fig. 10(c) but additionally refined with one iteration using an algorithm further correcting incoherence effects related to sample vibrations during single exposures [Fig. 10(d)] (manuscript in preparation). It demonstrates a considerable improvement in image quality, showing that the finest structures of the resolution test chart of 50 nm are clearly resolved. In order to retrieve a value for the achieved spatial resolution, the images were evaluated by Fourier ring correlation (FRC) ( van Heel & Schatz, 2005;Banterle et al., 2013). For this calculation, the data set was split into two parts containing only half of the data points each, which was still sufficient for ptychographic phase retrieval. The two independently reconstructed images were then analysed by FRC, yielding a half-pitch spatial resolution of 8.6 nm if the half-bit criterion was applied [see Fig. 11  errors or distortions are corrected by using the interferometer data. In this case, the spatial resolution is mainly limited by the available coherent photon flux at the instrument. Additionally, an example line profile over a single bar of the resolution test chart was extracted, indicating an edge sharpness of approximately 13 nm [see Fig. 11(b)]. The position of the line profile is indicated by a dashed orange line in Fig. 10(d).

Signal-to-background optimization for high resolution and sensitivity
In the standard ptychographic model, the far-field diffraction pattern is generated by scattering the probe beam off the sample. In a real ptychographic experiment, radiation from other sources can contribute to the measured signal, such as scattering from optical components, windows or residual gas along the beam path. The additional signal is interpreted by the algorithm as being part of the object, leading to reconstruction artefacts (Reinhardt et al., 2017). While this additional background radiation can in principle be included in the ptychographic model (Bernert et al., 2017), it can cover up the signal from more weakly scattering parts of the sample if, for example, the noise level of the background exceeds the signal level of the weakly scattering objects. This limits the sensitivity and resolution of the method .
To improve the sensitivity of PtyNAMi, the scattering background along the beam path behind the sample is minimized. This is achieved by mounting a windowless SAXS detector (Eiger X 4M) inside a vacuum tube (see Fig. 3). To keep the sample environment as flexible as possible, e.g. to accommodate special sample environments (see Section 7.2), the sample stage is in air. The only optical element between the sample and the detector is the entrance window at the tip of the nozzle very close to the sample and far away from the detector. The entrance window can be a single-crystal diamond (thickness 100 mm) or Kapton window (thickness 25 mm) to minimize the scattering from it. We typically prefer to use the diamond window since the small-angle X-ray scattering background is low for single-crystalline materials.    However, the Kapton window performs similarly well in most cases because prominent Kapton scattering emerges at larger scattering angles beyond the small-angle regime covered in ptychography and therefore does not contribute to the background signal. Fig. 12(c) shows the far-field image on the detector of a nanobeam generated by an FZP at E = 9.3 keV [see Schroer, Seyrich et al. (2019) for details]. With the flight path flushed with nitrogen at ambient pressure, the relative intensity of the background in the far-field image of the nanobeam drops by about five orders of magnitude relative to the direct beam [see Fig. 12(a)], while with an evacuated flight path the background improves by three orders of magnitude to a level of 10 À8 relative to the direct beam.
This is an appropriate level to image nanoparticles of a few tens of nanometres in size , but it will not be sufficient to image more weakly scattering singledigit-nanometre objects. The main factors contributing to this residual background need to be investigated further.

High-resolution X-ray microscopy on PtyNAMi
In this section, we present a few representative results of nano-imaging experiments carried out on PtyNAMi. They highlight the different operation modes of the instrument and the scientific opportunities that arise from them. For example, by combining X-ray ptychography with scanning microscopy with various contrasts, the structure-function relationship of solar cells can be assessed directly (Section 7.1). Catalytic materials can be ptychographically imaged under in situ conditions, following processes with high spatial resolution at varying elevated temperatures (Section 7.2). Small catalytic particles of a few micrometres in diameter can be imaged with improved quality in three dimensions by direct coupling of ptychographic and tomographic methods (Section 7.3).

Multi-modal X-ray imaging
A main strength of scanning hard X-ray microscopy is that different X-ray analytical contrasts can be accessed all at once (Schropp et al., 2011;Kahnt et al., 2018;Falkenberg et al., 2018;Stachnik et al., 2020). This multi-modal approach allows one to investigate functional materials such as thin-film solar cells under different scientific perspectives and correlate, for example, their function with their elemental composition or structural properties . Despite its strict stability requirements, PtyNAMi provides enough flex-ibility to carry out such experiments. Fig. 13 highlights the result of such an experiment that was carried out on a solar cell with a 2 mm thick CuIn 1Àx Ga x Se 2 absorber layer on an X-ray-transparent substrate (Carron et al., 2019). The sample was mounted perpendicular to the incident X-ray beam and scanned over an area of 6 Â 6 mm on a 2D grid with 100 Â 100 steps and an exposure time of 0.5 s per scan point. X-rays with an energy of E = 15.25 keV were focused onto the sample surface by a set of NFLs. The focus size was determined to be 105 nm (h) Â 120 nm (v).
Here, ptychography was combined with X-ray fluorescence (XRF) and lock-in amplified X-ray beam-induced current (XBIC) measurements (Ossig et al., 2019). This allowed the simultaneous assessment of the X-ray transmittance [ Fig. 13(a)], the XRF signal of selenium (sum of K and K) [ Fig. 13(b)], the XBIC signal [ Fig. 13(c)] and the ptychographically reconstructed phase of the transmission function of the sample. For the ptychographic image, a spatial resolution of 39 nm was determined by FRC (see Section 5). Note that the ptychographic reconstruction did not suffer from significant artefacts, due to the X-ray chopper that was located in the microhutch and which modulated the X-ray beam at a frequency of 9763.6 Hz for the highest signal-to-noise ratio of the XBIC measurements. Beyond the intrinsic advantage of point-by-point correlation that is enabled by the simultaneous Multi-modal X-ray imaging of a solar cell with a CuIn 1Àx Ga x Se 2 absorber layer. 2D maps of (a) the X-ray transmission signal (maximum intensity scaled to 1), (b) the XRF signal (sum of K and K) of selenium (counts per second), (c) the XBIC signal (nanoamperes) and (d) the ptychographically reconstructed phase of the object transmission function (radians). See also the greyscale bars in each image. assessment of different modalities, the combination with ptychography offers the correction of imprecise position data for the co-measured XRF and XBIC data.
The (anti-)correlation of the four maps is striking and can easily be explained: the transmittance is a lowresolution equivalent to the phase shift representing the projected electron density in the solar-cell stack. In both maps, topological variations in the solar-cell absorber layer (Avancini et al., 2018), represented here by the Se area density, dominate and govern the electrical performance that is evaluated as XBIC.
Of greater scientific interest are the deviations from this pattern. A detailed statistical analysis of the correlations, such as by Stuckelberger et al. (2020) or West et al. (2017), can provide insights into the recombination mechanisms of specific defect types, the impact of stoichiometric inhomogeneities or defect passivation at topological features such as voids.

In situ hard X-ray ptychography
In order to expand the experimental capabilities of PtyNAMi towards heterogeneous catalysis research, a series of in situ sample environments were developed for the instrument, described in detail in a previous publication by Fam et al. (2019). In summary, the in situ cells [see Fig. 14(a)] permit excellent control of environmental conditions, including localized temperature treatment up to above 1273 K with a stability of around AE0.1 K by resistive heating, and controlled gas environments up to 1 ml min À1 total flow. The sample holders utilize microelectromechanical systems (MEMS) chips (Wildfire, DENSsolutions BV) originally designed for electron microscopy and tomography, here repurposed for high-resolution X-ray nano-imaging. This allows for treatments such as oxidation and reduction, along with catalytic conditions at atmospheric pressure. The gas environment and potential products are monitored by mass spectrometry of the outlet gas stream.
Samples are directly loaded onto the MEMS chips via focused ion beam milling combined with scanning electron microscopy (FIB-SEM) [ Fig. 14(b)], in this case performed at DESY NanoLab (Stierle et al., 2016). Fig. 14(b) shows a sample of CoMn 2 O 4 spinel with a hollow-sphere structure, consisting of a dense spinel core and a thin spinel shell of the same material, with an air buffer in between. Such samples are     suggested as potential candidates for chemical conversions in confined environments, with the small air buffer and permeable exterior shell forming a small 'nanoreactor' (Arnal et al., 2006;Sun et al., 2013). Such hollow spheres also have potential applications in gas sensing (Li et al., 2004). Due to their characteristic structure, these materials are a suitable case study to demonstrate in situ nano-imaging during thermal decomposition, with length-scale changes of the order of several hundreds of nanometres expected.
As shown in Fig. 15, a single hollow-sphere sample was imaged by ptychography in the in situ cell during sequential thermal treatment up to 773 K in synthetic air. Here, the experiment was carried out at an X-ray photon energy of E = 9 keV using an FZP as focusing optics, and a spatial resolution of about 20 nm was determined by FRC for this ptychographic in situ experiment (see Section 5). The in situ cells effectively enable the structural deactivation effects of catalytic materials to be monitored under precisely controlled conditions, and with sample sizes greatly exceeding those possible using transmission electron microscopy (TEM) or electron tomography. It should be noted that the MEMS chips can in fact be used directly for complementary TEM imaging, if the sample size permits. In addition, limited-angle rotation has shown potential for the acquisition of ptycho-tomographic data under in situ conditions, with the potential to examine 3D structural changes in greater detail (Yang et al., 2020).

3D ptychography
Sample alignment on the nanometre scale is especially critical for ptychographic imaging in three dimensions, since many projections of a sample need to be recorded from different perspectives in order to finally extract volumetric information (Dierolf et al., 2010). Due to the still limited coherent flux at third-generation X-ray sources, such a 3D data set is typically recorded over many hours, and sample vibrations, drifts or angular misalignments can considerably complicate the subsequent data analysis. Although some of these experimental inaccuracies, e.g. the mutual alignment of images, can be corrected quite well numerically, the stability of the setup is still important to obtain sharp and undistorted 2D projections, which are essential for optimal results in 3D ptychography.
In Fig. 16 the result of such a 3D ptychographic experiment carried out on PtyNAMi is summarized . Similarly to the previous example, the experiment was carried out at an X-ray photon energy of E = 9 keV using an FZP as focusing optics to create a nanofocus with a size of about 70 nm (FWHM). In this case, a freestanding macroporous zeolite particle composed of porous silica and alumina [ Fig. 16(a)] was raster-scanned through the coherent nanobeam at a distance of 1 mm behind the focal plane and over an area about 4 Â 4 mm. Each 2D projection was then reconstructed from a set of 121 diffraction patterns (11 Â 11 scan points), each exposed for 1 s. Altogether, 90 2D projections were captured over an angular range of 180 , requiring a total measurement time of about 7 h for the whole 3D ptycho-graphic experiment. Fig. 16(b) shows an example of the reconstructed phase of the sample transmission function in a single 2D projection.
From this 3D data set the sample volume can be reconstructed, and an iso-surface rendering [Fig. 16(c)] clearly highlights the macroporous structure of the zeolite particle with a spatial resolution of about 65 nm. Additional detailed information on 3D ptychographic data evaluation and the achieved spatial resolution can be found in the report by Kahnt et al. (2019) and supplementary material therein. Furthermore, ptychographic and tomographic algorithms were directly coupled in this case, taking advantage of mitigating sampling or dose requirements in 3D ptychography. The direct tomographic reconstruction method may also facilitate the often time-consuming position refinement steps during data evaluation.

Summary and outlook
Hard X-ray ptychography has developed considerably over the past decade and the method has matured to become a standard technique at various synchrotron radiation sources worldwide. Here, we have presented our efforts on beamline P06 to redesign and build a new generation of scanning X-ray microscopes by optimizing the instrument from the point of view of mechanical stability, positioning control and reduced background scattering. In the standard tomographic  configuration a typical spatial resolution of a few tens of nanometres can be reached, depending on sample contrast and measurement time. Up to now, this has mainly been limited by vibrations introduced by the coarse alignment stages, which we aim to replace in the near future.
Hard X-ray nano-imaging at a spatial resolution of slightly below 10 nm could be demonstrated using an ultrastable configuration of the setup, but further improvements are necessary if the full flexibility of the setup, including sample rotation for tomographic applications or other auxiliary equipment, is required. We consider these instrumental improvements to be crucial in order to push the spatial resolution in hard X-ray microscopy towards the single-digit nanometre regime. These developments are driven strongly by upcoming fourth-generation X-ray sources, which will provide a considerably larger coherent photon flux, making these instruments excellent 3D microscopes to image structural, chemical or physical processes on all length scales down to the atomic scale.