Introduction

Ptychographic methods are becoming increasingly important in many fields of microscopy. Synchrotron-based X-ray ptychography1 has developed rapidly over the last decade with the availability of highly coherent and brilliant light from third and fourth-generation synchrotron sources. Ptychography is a class of coherent diffraction imaging techniques that measures far-field diffraction patterns at many overlapping points on a sample and then uses an iterative phase retrieval algorithm to reconstruct amplitude and phase images of the object and probe. Ptychography was first demonstrated in transmission electron microscopy2. The evolution from electron to X-ray microscopy has been reviewed by Rodenburg3. Its implementation, capability, and application in the X-ray regime4 was reviewed by Pfeiffer in 20181. It is now widely used as an extension of scanning transmission X-ray microscopy (STXM)5. The advantage of ptychography over other coherent diffraction imaging methods is the combination of oversampling in detector space and overlapping illuminations of the object, which make the reconstruction algorithms6,7 particularly robust. Upgrading an existing STXM instrument to ptychography requires a relatively straightforward change from an integrating detector, such as a photodiode, to an imaging detector, such as a charge-coupled device (CCD) camera. Thus, ptychography is a convenient technique to improve spatial resolution in STXM since major modifications of the beamline optics are not required, and the images are computationally reconstructed from sets of diffraction images.

The analytical potential of spectroscopic and polarization contrast at the absorption edge of elements in material has led to rapid growth in soft X-ray spectromicroscopy8,9,10,11,12,13. STXM at the carbon K-edge (C 1 s, 280–320 eV) has been applied extensively to study polymers8,14,15, organic electronics16,17,18, aerosols important in climate change19,20, and biological materials21,22 among many other areas. These studies have shown the value of carbon K-edge spectromicroscopy to identify and quantitatively map carbon-based chemical species. Given the potential for improved spatial resolution, there is tremendous interest in using ptychography at the carbon K-edge. Although soft X-ray spectro-ptychography using photon energies below 1000 eV has been demonstrated23 and applied to a number of important problems24,25,26,27, to date there are no reports of X-ray ptychography at the carbon K-edge, to the best of our knowledge. The reason is that, at present, CCD X-ray cameras are used as the standard detector for soft X-ray ptychography. Although there are backside illuminated, BSI-CCDs with reasonable sensitivity in the C 1 s region28, their image transfer rate is slow, and most scientific CCD cameras have limited sensitivity to X-rays with energies lower than 500 eV. Notable exceptions are the DoE fast-CCD29 and the recently released e2V BSI-CCD30.

A new generation of backside-illuminated sCMOS cameras has been developed recently and proposed as an alternative detector for soft X-ray ptychography. However, the sCMOS cameras were still not efficient below 500 eV mainly because of a coating layer used to protect the sCMOS sensors which blocks low energy X-rays and reduces the sensitivity in the carbon K-edge region. Uncoated sensors have been developed very recently. We have used a new, uncoated sensor from Gpixel (gpixel.com) to perform soft X-ray ptychography below 500 eV, in particular, at photon energies in the carbon K-edge region. Supplemental Note 1 and Supplementary Fig. 1 compares the efficiency of sCMOS cameras equipped with the regular coated and the new, uncoated Gpixel GSENSE400BSI sensors, as a function of photon energy. The Tucsen Dhyana 95 sCMOS camera (http://www.tucsen.com/products) equipped with a prototype uncoated GSENSE400BSI-GP image sensor provides single X-ray photon sensitivity in the carbon K-edge region and rapid image transfer (24 fps frame rate, at full 2048 × 2048 pixels, with a pixel area of 11 µm × 11 µm and 12-bit analog to digital converter). This camera was recently implanted at the HERMES beamline31 of Synchrotron SOLEIL (Saint Aubin, France) and used for ptychographic imaging at the carbon K-edge. The readout time for the version of the camera used for these measurements, along with software overhead issues, meant the fastest sampling our system could achieve was 100 ms.

Most STXM-based soft X-ray ptychography experiments to date have been measured with the sample at the focus of the zone plate optic. Ptychographic reconstruction is also possible when the sample is out of the focal plane, as long as the defocus distance is known since this is used as an input parameter in the Python tools for Nano-structures Crystallography (PyNX) reconstruction code6,7,32. Defocus conditions have been used in previous STXM-based ptychography3,33 and in ptychography carried out in a full-field transmission X-ray microscope34. Defocusing has the advantage of larger and adjustable probe size. This can reduce the impact of positional instabilities, arising from various sources, on the ptychographic reconstruction32. Given the minimum 100 ms sampling time of our system, which is needed for measuring the weak diffraction signal, defocusing the X-ray beam was used to reduce the radiation dose to the sample. In the case of carbon K-edge imaging, the reduced photon density is an important advantage since it drastically reduces the radiation dose, which in turn reduces carbon contamination and radiation damage. In order to maintain the quality and spatial resolution of the reconstructed image compared to that provided with a focused beam, the overlap of the measured points is increased in defocus ptychography, typically from 40 to 90%. Despite using greater overlap, fewer diffraction images were measured in defocus ptycho mode. Relative to ptychography using a focused probe, ptychography with a defocused probe provides images with similar spatial resolution and signal to noise ratio, but with significantly lower X-ray dose and thus lower carbon contamination—see the estimated radiation dose delivered by each type of measurement (Supplementary Table 1). Also, since far fewer diffraction images were measured in our implementation of defocus ptychography, the acquisition time was much faster. This allowed for beam time efficient measurements of larger areas. Because the number of diffraction images was less, the computing time for reconstruction was reduced, compared to focused ptychography using the same camera pixel set. This twofold reduction in time is a significant advantage, especially considering the intense competition for the limited beam time available at synchrotron soft X-ray microscopy beamlines equipped for ptychography.

We report here, to the best of our knowledge, the first proof-of-principle ptychography at the carbon K-edge. The test sample used is partly oxidized single-walled carbon nanotube (CNT) bundles35,36,37,38 which were synthesized by a two-stage laser pyrolysis method39. Carbon nanotubes are extremely resistant to X-ray damage, which is helpful when developing methods that require long exposure times. Single-walled carbon nanotubes are a cylindrical form of graphene, where each carbon atom is σ-bonded to three other carbon atoms while having a π interaction perpendicular to the cylindrical surface40. This strongly asymmetric geometry means that X-ray absorption which excites the C 1 s electron to empty π* levels is favored when the electric vector of the photon is perpendicular to the long c-axis of the CNT, while excitation of the C 1 s electron to empty σ* levels is favored when the electric vector of the photon is parallel to the long c-axis of the CNT36. This results in a strong dependence of the carbon K-edge spectrum of a CNT on its orientation relative to the photon polarization vector, and thus a potentially strong X-ray linear dichroism (XLD) signal35,36,37,38. The XLD signal at 285.2 eV is a useful, quantitative probe of the spatial distribution of structural defects in CNT36,37,38, which is very important for practical applications, such as CNT-based electronic circuits. In this study, we have used carbon K-edge ptychography to characterize a CNT sample by imaging, spectroscopy, and XLD mapping. A ptychography study of oxygen K-edge XLD of CaCO3 crystal orientation in coral was reported very recently by Lo et al.41.

Results

To demonstrate the capability of our setup to perform ptychography at the carbon K-edge, results are presented on two different samples, as described in the Methods and Samples section. The first sample is a calibration standard with lithographed gold Siemens Star and other periodic patterns which are used to quantify the spatial resolution. The second sample is bundles of single-wall carbon nanotubes (CNT), with a diameter of 200 ± 40 nm. Both samples are deposited on a thin, soft X-ray translucent, silicon nitride membrane to allow transmission measurements.

Au test patterns

Siemens Star test patterns are traditionally used in evaluating spatial resolution and possible aberrations in many types of microscopy. Figure 1a presents the diffraction pattern generated by an X-ray beam of 285.2 eV (~5 × 106 ph/s) focused to ~62 nm, positioned at the edge of an Au bar of a Siemens Star test pattern (see Fig. 1b for location). The white circle in the center of Fig. 1a is the outer limit of the projected illumination from the 50 nm Fresnel zone plate (FZP). Its annular shape is seen more clearly in Fig. 2. There is a large amount of scattered X-ray signals outside of the annulus. The intensity of the scattered light drops below the thermal noise of the camera at scattering angles (and thus momentum values, q) smaller than the one corresponding to the edge of the camera. Figure 1b presents the reconstructed amplitude image of a 2 μm × 2 μm region at the center of the Siemens Star where the smallest lithographed features are located. The ptychographic dataset consists of a 50 × 50 square array of diffraction patterns like the one in Fig. 1a, recorded with the sample positioned in the focal plane of the FZP, and using 500 ms exposure time per pattern. The reconstruction procedure is described in the Methods and Samples section. Details of the acquisition and reconstruction parameters are summarized in Supplementary Table 1 for all ptychography results presented in this paper and the associated supplementary information. Figure 1c is the corresponding STXM image recorded with the 62 nm spot from the 50 nm FZP. The dramatic improvement in spatial resolution provided by ptychography is evident.

Fig. 1: Ptychographic imaging of a Siemens star test pattern.
figure 1

a Diffraction pattern from a focused, 62 nm diameter spot of 285.2 eV soft X-rays hitting the edge of an Au line of the Siemens Star pattern. The false-color scale is log10 of the X-ray counts averaged over 100 images, each recorded with 500 ms exposure time. The scale bar is the camera dimension. The white circle in (a) is the outer edge of the annulus of the projected beam through the Fresnel zone plate. The corners of the image correspond to a momentum of 0.0104 nm−1. b Amplitude image of the 50 nm half-pitch Siemens Star pattern from the reconstruction of a (50 × 50) array of ptychographic images (see Supplementary Table 1 for details of the acquisition and reconstruction parameters). c STXM transmission image measured simultaneously with the ptychography data of (a) and (b). The yellow circles in (b) and (c) indicate the location of the X-ray beam when the diffraction pattern in (a) was measured.

Fig. 2: Ptychographic imaging of the carbon nanotube (CNT) sample.
figure 2

a Diffraction image from a defocused, 1.0 μm spot of 285.2 eV soft X-rays hitting several carbon nanotubes. The false-color scale is log10 of the X-ray counts averaged over 30 images, each recorded with 500 ms exposure time. The corners of the image correspond to a momentum of 0.0160 nm−1. b Amplitude image of the CNT sample from the reconstruction of a ptychographic dataset measured at 285.2 eV in a region similar to that where (a) was measured. The yellow annulus indicates the 1.0 μm diameter annular probe used for defocus ptychography imaging. The scale bar is amplitude in arbitrary units (see Supplementary Table 1 for acquisition details). c STXM image of the same area acquired with the 62 nm FZP, just before the ptychography measurement.

CNT imaging

Figure 2a presents the diffraction image obtained with a 1.0 μm X-ray beam spot size (sample in defocus position) at 285.2 eV. Figure 2b presents the ptychography amplitude image (i.e., the amplitude image from the reconstruction of a ptychographic dataset) from a 2 μm × 2 μm area of the CNT sample. Supplementary Table 1 summarizes the details of data acquisition and ptychographic reconstruction, along with an estimate of the radiation dose imparted, using an excel spreadsheet described in Supplementary Note 2. The yellow dotted annulus in Fig. 2b indicates the area illuminated by the 1.0 μm defocused probe. X-ray scattering from the CNTs is clearly detectable, although the signal is weaker than that from the Siemens Star sample. Therefore, the maximum momentum transfer at which a usable signal can be detected on the camera is smaller. Figure 2c is an STXM image of the same area recorded with the 62 nm spot from the 50 nm FZP. Again, ptychography improves the spatial resolution, but to a much lower extent than with the Siemens Star sample, which is as expected, given that the scattering capability of Au is much stronger than that of the carbon nanotubes.

The ptychography amplitude images of the same area of the CNT sample measured using focused and defocused X-ray spots are very similar (see Supplementary Note 3 and Supplementary Fig. 3a, b), although the noise in the reconstruction of the defocused data is larger, which could be related to the lower dose. Very large areas can be measured efficiently using ptychography with defocused spot size. For example in Supplementary Fig. 3c, a 10 μm × 10 μm area of the CNT sample was measured in 720 s (using 200 ms dwell time per diffraction image), whereas ptychographic imaging of the same area using the fully focused 62 nm spot size, 100 ms dwell, and 50% overlap would have taken over 10,300 s and resulted in a much higher dose.

Figure 3 compares the ptychography amplitude image at 285.2 eV (Fig. 3a) with the STXM image of the same region of the CNT sample (Fig. 3b), recorded with the 31 nm focused spot from a 25 nm FZP (Fig. 3b). For better comparison, details of two particular regions are presented in Fig. 3c, e (ptychography) and Fig. 3d, f (STXM). Finer details can be seen in the ptychographic images despite the STXM image having been acquired with a much higher resolution zone plate (25 versus 50 nm diameter outmost zones).

Fig. 3: Comparison of CNT imaging by defocusing ptychography and high-resolution STXM.
figure 3

a Ptychography amplitude image of the CNT sample measured at 285.2 eV using a 1.0 μm defocused probe. The intensity limits are arbitrary units. b STXM transmission image of the same area measured with a zone plate having a 25 nm outer zone width. The intensity limits are count rate in MHz. c, e Ptychography image details from the blue and red boxes indicated in (a). d, f STXM image details of the blue and red areas indicated in (b). (see Supplementary Table 1 for acquisition details).

The spatial resolution of the amplitude images from ptychographic reconstruction was estimated from the sharpness of a 50 nm wide lithographic feature on the calibration standard and the abruptness of a sharp feature in a CNT ptychography image (see Supplementary Note 4 and Supplementary Fig. 4). The knife-edge-based spatial resolution from the test pattern gave an estimated spatial resolution of 36 ± 3 nm (Supplementary Fig. 4a, b). The edge sharpness from a CNT image gave an estimated spatial resolution of 30 ± 3 nm (Supplementary Fig. 4c, d). Within uncertainties, the spatial resolution estimated from these two samples are consistent with each other. The ptychographic spatial resolution is about two times better than the best resolution expected from the 50 nm FFZP (62 nm) and similar to that of the 25 nm FZP.

CNT spectroscopy and X-ray linear dichroic mapping

Figure 4 presents results of a carbon K-edge spectroscopic study of the CNT sample using linear horizontal (LH) and linear vertical (LV) polarized light in order to measure the X-ray linear dichroic (XLD) signal42 in both spectral and spatial dimensions. The origin of the dichroic response at the C 1 s → π*C=C transition (285.2 eV) of carbon nanotubes35,36,37,38 was detailed earlier. Figure 4a plots the X-ray absorption spectra of a horizontal region of a CNT (red spectrum) and a vertical region of a CNT (blue spectrum), both recorded using linear vertical polarization of the X-rays. These spectra were extracted from a carbon K-edge ptychography stack measured at 24 photon energies from 282 to 294 eV with 0.5 eV steps and a 1.0 μm beam size (see Supplementary Table 1 for details). The ptychographic amplitude images were converted to absorption (optical density, OD) images by applying the Beer–Lambert law (OD = -ln(I/Io), where I is the ptychography amplitude and Io is the incident photon intensity). The arrow in Fig. 4a indicates the C 1 s → π*C=C transition at 285.2 eV, which has the strongest X-ray linear dichroism. Figure 4bc are ptychographic absorption images at 285.2 eV recorded with LV and LH polarization, respectively. Figure 4d is the ptychographic XLD map at 285.2 eV, obtained by subtracting the LH image from the LV image. In this XLD map, white pixels are those with a positive XLD response which are horizontal CNT, while black pixels are those with a negative XLD response which are vertical CNT.

Fig. 4: Carbon K-edge spectroscopy and X-ray linear dichroic (XLD) imaging of the CNT sample.
figure 4

a C 1 s spectra of horizontally (red) and vertically (blue) oriented CNT, recorded with fixed linear vertical (LV) polarization, derived from the reconstruction of a ptychographic stack (282–294 eV, 0.5 eV step) measured using a 1.0 μm defocus spot. The intensity of the spectrum of the vertical CNT has been adjusted to have the same OD293–OD282 value as that of the horizontal CNT. b, c OD images of the CNT sample from reconstructed amplitude images derived from 1.0 μm defocused ptychography measured at 285.2 eV, using linear vertical (LV) and linear horizontal (LH) polarizations, respectively. The optical density (OD) intensity scale applies to both (b) and (c). d X-ray linear dichroic (XLD) image (LV–LH), obtained from the corresponding ptychographic images, (b) and (c). e XLD image (LV–LH) derived from STXM images of the same area recorded using a 25 nm FZP. The intensity scales in (d) and (e) are ΔOD. Scale bar is 500 nm in all images. (see Supplementary Table 1 for acquisition details).

In order to fairly compare ptychography to STXM at the carbon K-edge, STXM images at 285.2 eV were measured from the same area using a standard resolution 25 nm FZP, which gives a spot size of 31 nm10 (see Supplementary Table 1 for acquisition details). Figure 4e presents the STXM XLD response, obtained by the same treatment as used to generate Fig. 4d, from STXM images recorded with LV polarization and LH polarization. The STXM and ptychography data clearly show the same XLD signal. Relative to the STXM result, the contrast is significantly better in the ptychography XLD map than in the STXM XLD map, while the spatial resolution is similar. Ptychography improves the contrast by 60%, as measured by the full width at half maximum of the histogram of pixels in the ptychography and STXM XLD images (see Supplementary Note 5 and Supplementary Fig. 5). It is noteworthy that the elapsed time for the two measurements was similar: 4 × 104 points at 20 ms exposure time per point (800 s total) were measured in each STXM image, while 2.5 × 103 diffraction images at 200 ms exposure time (500 s total) were measured for each defocus ptychography image. In summary, relative to STXM with a 25 nm FZP, ptychography XLD provides significant contrast improvement, and the spatial resolution achieved is twice as good as that recorded in conventional STXM mode with the same FZP.

One of the main advantages of using defocused versus focused beam ptychography is the dramatic reduction in dose/image which greatly reduces radiation damage and carbon build-up artefacts. Since carbon nanotubes are particularly resistant to radiation damage (which is why they were chosen as the carbonaceous sample for this exploratory study), it is not easy to use radiation damage to demonstrate the gain from dose reduction using ptychography with defocused spot size. Instead, the extent of carbon deposition during focused and defocused ptychography measurements is used for this purpose. Supplementary Note 6 and Supplementary Fig. 6 compares STXM images recorded at 285.2 eV after a ptychography carbon K-edge stack using full focused (62 nm) spot size (estimated total dose of 860 MegaGrey (MGy)), with that recorded at 285.2 eV after a ptychography carbon K-edge stack using a defocused (1.0 μm) spot size (estimated total dose of 62 MGy). The advantage of using a defocused rather than a focused spot is abundantly clear.

Phase imaging and phase spectroscopy of CNT

Figure 5 presents results from ptychographic phase images of the CNT sample. Figure 5a is the average (after alignment) of all 24 ptychographic phase images in a stack measured from 282 to 296 eV, with 0.5 eV steps. LV polarization was used. The average of the 24 images is presented, in part to optimize statistics, and in part to show the stability of the STXM and the scanning system. Clearly, ptychography data sets recorded with this scanning platform retain high spatial resolution information across images recorded at multiple photon energies. The phase contrast is enhanced at the edges of the CNT on account of the refractive index change from the walls of the CNT to the adjacent silicon nitride membrane support. Figure 5b is the phase image at the energy of the largest phase contrast, 284.7 eV. Figure 5c compares the phase and absorption spectra of the same areas, extracted from nearly vertical (blue) and nearly horizontal (red) sections of individual CNT bundles, measured with LV polarization. The largest excursion in the phase spectra occurs 0.5 eV below the absorption peak.

Fig. 5: Carbon K-edge phase imaging and phase and absorption spectroscopy of the CNT sample.
figure 5

a Average over the phase images at all photon energies from a C 1 s energy stack (282–296 eV, 0.5 eV spacing) recorded using defocus ptychography with a 1.0 μm spot size. A scale factor of −1 was applied. b Phase image at 284.7 eV, corresponding to the C 1 s → π* absorption resonance. c Comparison of phase and amplitude spectra taken from the areas indicated by red and blue rectangles in (b). Linear vertical polarization, which highlights horizontal CNT, was used. The lines are smoothed versions of the measured data (points). The vertical line highlights the energy of the minimum of the C 1 s → π* phase resonance, which is 0.5 eV below the peak of the C 1 s → π* resonance in the absorption spectrum. (see Supplementary Table 1 for acquisition details).

Discussion

The results presented in this work show that an sCMOS camera with an uncoated sensor is able to record ptychographic data sets in the carbon K-edge energy range (280–320 eV) with sufficient signal to noise ratio and stable (thus subtractable) background to allow imaging and spectroscopy based on ptychography. The amplitude images of both the Siemens Star (Fig. 1b) and the CNTs (Figs. 2b, 3, 4) show that ptychographic data sets can be successfully reconstructed in this energy range despite the intrinsically smaller diffraction signal from light elements such as the CNT sample. These are the first carbon K-edge ptychography results, to the best of our knowledge. A spatial resolution of ~30 nm has been demonstrated on CNT and standard calibration samples.

High spatial resolution STXM spectromicroscopy at the carbon K-edge is challenging due to two factors: carbon build-up and radiation damage. In principle, the rate of carbon build-up can be reduced with an ultra-clean system (ultrahigh vacuum compatible vacuum chamber, stages, etc.), regular use of a cryo-trap close to the sample, and restricting measurements to non-volatile samples. Radiation damage is harder to avoid. Our beamline configuration delivers 5 × 106 photons/s into the focal spot at 285 eV under the conditions used for the measurements made with the 50 nm FZP. As outlined in Supplementary Note 3, the estimated radiation dose rate delivered at 285 eV to the CNT bundles (OD = 0.5) is 90 MGy/s at the focal point of the 50 nm FZP, and a blistering 340 MGy/s at the focal point of the 25 nm FZP. Given the 20 ms exposure time used for the STXM data recorded with the 25 nm FZP (Fig. 3b), the dose delivered in recording one image at 285 eV using the 25 nm FZP in focus is 7 MGy. Assuming a 50% overlap, using the 50 nm FZP and a 100 ms exposure time, focused ptychography delivers a dose of 36 MGy per image, about 5 times greater than the dose delivered by the 25 nm FZP. However, defocusing the beam to a 1.0 µm probe size, using 90% overlap and 100 ms exposure time, as done in this work (Figs. 3a,  4a–c), reduces the dose per image to only 3.5 MGy. The reduced dose, and thus reduced radiation damage and carbon build-up, is an important advantage of defocus ptychography at the carbon K-edge.

Ptychography provides information about the phase as well as the amplitude of X-ray scattering1,4. The phase spectrum (Fig. 5) indicates that one can use energies just below the onset of a strong carbon K-edge absorption feature to measure phase images of organic samples. The phase contrast images (Fig. 5a, b) highlight the edges of the CNT bundles with high contrast, reflecting a strong change in the X-ray scattering phase at the boundaries of the CNT. The phase spectral signal associated with the C 1 s → π* transition occurs ~0.5 eV below the peak of the absorption signal. This is expected from the Kramers–Kronig relationship43,44 which relates phase and amplitude signals. The shift of the phase signal associated with the characteristic, highly anisotropic C 1 s → π* transition to the energy where there is much less X-ray absorption means that phase measurements with chemical contrast can be carried out below the onset of absorption, thus further reducing the radiation dose. This approach could allow reduced damage studies of organic systems, which otherwise would be modified by radiation damage when irradiated at the peak absorption energies.

To conclude, for the first time to the best of our knowledge, we have shown that ptychography at the carbon K-edge is possible, in this case, enabled by the recent development by Gpixel of uncoated sensors for sCMOS cameras. Relative to conventional STXM, ptychography at the carbon K-edge provides at least as good spatial resolution as that achieved with typical high spatial resolution, 25 nm outer zone, Fresnel zone plates, and significantly lower radiation dose when a defocused spot is used. We are aware that sub-10 nm spatial resolution has been achieved in STXM mode with the very best FZPs45. However, these are extremely difficult to use, due to reduced focal distances, especially at the carbon K-edge. The possibility of ptychography at the carbon K-edge opens an easier experimental pathway to higher spatial resolution, carbon K-edge spectromicroscopy studies of carbon-based samples, with significantly reduced artefacts from radiation damage and carbon build-up when a defocused probe is used. The measurement and reconstruction procedures used in this work will be systematically optimized, resulting in further performance improvements. Since X-ray scattering by low-Z elements is weaker than that by high-Z elements, carbon K-edge ptychography will be limited by the intrinsic scattering characteristics of the sample. Despite this limitation, our work demonstrates that high-quality chemical and structural information, such as the C 1 s spectra (Fig. 4) and XLD dichroism (Fig. 5) of the CNT sample, can be acquired efficiently by ptychography. The results presented herein represent the start of a new era in spectromicroscopy at the carbon K-edge.

Methods

STXM

The beamline and the setup used for STXM measurement is described in detail elsewhere31. The Advanced Planar Polarized Light Emitter type-II 64 mm period elliptically polarizing undulator used for this study is optimized for photon energies from 250 to 800 eV. The focusing optics used are Fresnel Zone Plates (FZP) with an outermost zone width of 25 or 50 nm, supplied by Applied Nanotools Inc. (https://www.appliednt.com). In STXM mode, the X-rays transmitted through the sample are converted into visible photons by a phosphor and are detected in single event counting mode by a high-performance photomultiplier tube. The sample is placed on an XYZ piezoelectric stage. The position of the sample relative to the FZP optic is stabilized to a precision of 5 nm by a differential laser interferometer system46. Only rectilinear raster scans are implemented at present.

Ptychography

Supplementary Note 7 provides details of the implementation of the Tucsen Dhyana 95 camera in the HERMES’ STXM. Supplementary Figure 7 is a picture of the setup where the standard phosphor-PMT integrating detector used for conventional STXM is replaced by the sCMOS camera. The camera performance has been described elsewhere47,48,49. Briefly, the well depth is 3 × 104 electrons in the hybrid mode of operation used. The quiescent background rate without X-rays is 9 Hz, which comes largely from scattering of the interferometer laser into the camera. Most of that background is subtracted (before each ptychographic measurement, a statistically precise background is measured with the X-ray beam off). The effective background after subtraction is about 1 electron, giving a dynamic range of over 20,000. A specially designed holder allows the camera to be mounted on the STXM detector stage with enough positioning flexibility to center the diffracted image on the camera and tune the sample-to-camera distance. A water-cooling system for the camera was installed, as outlined in Supplementary Note 7. The control of, and data transfer from, the camera was via a USB 3.0 interface. The focusing optic was an FZP with outermost zone width of 50 nm, supplied by Applied Nanotools Inc (https://www.appliednt.com). In order to generate a 1.0 μm defocused spot, the sample was moved downstream by 23 μm, a distance calculated from10 dr/dz = D/f where (dr/dz) is the change in the spot size (dr) for a given change in sample-z position (dz), D is the diameter of the FZP, and f is the focal length given by f = Dδr/E where δr is the outermost zone width, and E is the photon energy. Rectilinear raster scanning was used. The chamber was maintained at a pressure of 4 × 10−6 mbar throughout the experiment. Ptychographic reconstruction was carried out using the open-source PyNX software50 developed at the European Synchrotron Radiation Facility. The Alternate Projection51 algorithm with a single probe function was used. The number of iterations varied between 600 and 1000 (see Supplementary Table 1 for details). Although the reconstruction computer is equipped with two graphical processing units, only one was used in these reconstructions. A typical, single image reconstruction took ~20 min. Recently PyNX has been improved to use multiple graphical processing units which will significantly reduce ptychography reconstruction times. When the data were acquired, the ethernet network at the HERMES beamline had an upper transfer rate of 1 Gb/s. Since the typical ptychographic dataset size is >10 Gb, data transfer from the acquisition & control computer to the PyNX workstation was a bottleneck. Recently the beamline was upgraded to 10 Gb/stransfer rate.

Samples

The calibration sample with both the Siemens Star and line-space patterns was fabricated at the Paul Scherrer Institute (Villigen, Switzerland) by the X-ray optics and applications group headed by Christian David. The carbon nanotube sample was synthesized by the Simard group (National Research Council, Ottawa, Canada) using a two-stage laser pyrolysis method39. It was the subject of an extensive study of its chemical functionalization using STXM, Raman, thermal analysis, and other methods38. The specific sample used for this study was subjected to air oxidation for about 10 years and thus exhibits much less dichroism than when studied originally38.