## Abstract

Coherent X-ray Diffraction Imaging (CDI) and X-ray ptychography both heavily rely on the high degree of spatial coherence of the X-ray illumination for sufficient experimental data quality for reconstruction convergence. Nevertheless, the majority of the available synchrotron undulator sources have a limited degree of partial coherence, leading to reduced data quality and a lower speckle contrast in the coherent diffraction patterns. It is still an open question whether experimentalists should compromise the coherence properties of an X-ray source in exchange for a higher flux density at a sample, especially when some materials of scientific interest are relatively weak scatterers. A previous study has suggested that in CDI, the best strategy for the study of strong phase objects is to maintain a high degree of coherence of the illuminating X-rays because of the broadening of solution space resulting from the strong phase structures. In this article, we demonstrate the first systematic analysis of the effectiveness of partial coherence correction in ptychography as a function of the coherence properties, degree of complexity of illumination (degree of phase diversity of the probe) and sample phase complexity. We have also performed analysis of how well ptychographic algorithms refine X-ray probe and complex coherence functions when those variables are unknown at the start of reconstructions, for noise-free simulated data, in the case of both real-valued and highly-complex objects.

© 2015 Optical Society of America

## 1. Introduction

Recent intense development in coherent X-ray diffraction imaging (CDI) and X-ray ptychography has attracted enormous attention in both condensed matter physics and computational algorithm advancement [1, 2]. X-ray ptychography is the elegant amalgamation of scanning X-ray microscopy (STXM) with CDI, where partially overlapping illumination provides extra real-space constraint that expands the sample of interest to large extended objects with high-resolution. Unlike conventional CDI, X-ray ptychography, iterative algorithms that incorporate real-space scan position correction [3, 4] and partial coherence properties of illuminating X-rays, in both longitudinal [5, 6, 7] and transverse [8, 9] directions have brought strong interests in the CDI community. Previous studies have demonstrated feasibility of partial coherence correction in CDI by introducing known broadband spectra of an undulator source to improve data reconstruction efficiency and quality [6]. Also, a modified algorithm that includes *ab initio* correction of transverse partial coherence in measured data results to better reconstructions in gold nano-crystals [9]. While this latter has been cast as a blind deconvolution, Thibault and Menzel [10] recently demonstrated that the ptychographic method provides enough redundancy in datasets to allow high-quality reconstructions through complete recovery of X-ray illumination modes (and object ’states’ in the case of dynamical sample). This work also opened up the exciting possibilities of information mutliplexing [11] and dynamical systems imaging [12] with ptychography. Numerical simulation studies on complex-valued sample [13, 14] with X-ray diffraction imaging phase retrieval algorithms [15] have shown the feasibility of high quality data convergence. Previously [16], we conducted a systematic study applying partial coherence correction to both real-valued and highly-complex valued simulated test objects in CDI, and we observed no obvious improvement of partial coherence correction on highly-complex objects in CDI. In order to fully understand the role of partially coherent illumination in X-ray ptychography, we performed detailed analyses on partial coherence correction on simulated ptychography data, varying the degree of coherence properties of X-rays and sample phase structure complexity, and phase diversity of X-ray probe. We aim to understand whether a real-space overlap constraint in ptychography that leads to over-determination in phase retrieval solutions could result in better data reconstruction compared to CDI for strong-phase objects. Our reconstruction results reported within strongly suggest that better data convergence can be achieved with partially coherent illumination for ptychography compared to CDI. As a result, we envisage that X-ray ptychography will have an overwhelming advantage over conventional CDI for investigation into highly-complex objects of scientific interest, and that suitable samples for ptychography can be of relatively large area, ranging from hundreds of nanometers to microns.

Joseph W. Goodman describes statistical properties of thermal or pseudo-thermal electromagnetic radiation [17], by considering photon-counting statistics, one can estimate the experimental integrated intensities of an electromagnetic wave by the introduction of a number of coherence cells of the light wave. According to the analytical solution obtained on solving the representation of electromagnetic wave spectral distribution, one can postulate the wave spectral to be Gaussian, Lorentzian or rectangular spectral profiles depending on the parameter that represents the number of coherent modes of the electromagnetic wave vs. (average measurement time/coherence time used for spectral measurement). For simple approximations, some researchers propose Gaussian-shell model [18, 19] for electromagnetic radiation from an undulator source from synchrotron-based radiation facilities. This approximation is based on the fact that electrons in an undulator source radiate in a random and uncorrelated fashion to each other. A recent study shows that one can approximate the central cone of electromagnetic radiation from an undulator source by an ensemble of Gaussian limited waves [20]. Nevertheless, some researchers suggest by incorporation of a higher-order of intensity correlation functions, the integrated spectral of electromagnetic wave can be either Gaussian or non-Gaussian distributions [21]. In conventional ideal cases of light scattering in medium, generalized Siegert relations can be used [21] to approximate the intensity probability density function of a scattered coherent electromagnetic wave that propagates as an electric field, resembling a random Gaussian variable with zero mean. This approximation is generally valid for electromagnetic waves from an undulator source in synchrotron facilities, if higher-order intensity correlation functions (3rd and 4th orders) are neglected, thus only second order correlation of Siegert relations is considered.

Thibault and Menzel[10] have looked at partial coherence via modes decomposition method recently. Their findings on incorporation of partial coherence modes into ptychographic reconstructions are the first for experimental demonstration with inclusion of partially-coherent (PC) illumination in ptychography. Joseph W. Goodman [17] proposed a mathematical equivalence of X-ray illumination modes to a mutual coherence function in the general case of plane-wave illumination. For exploring variation of performance, the complex coherence function, which is a Fourier transform of mutual coherence function can be approximated to be a simple alternative Gaussian function with one adjustable parameter *σ*. The detailed expression of Gaussian function for mutual coherence function is described in Eq. (3).

## 2. Theory behind partial coherence correction in CDI and ptychography

Conventional CDI and ptychography algorithms utilise projections of both real-space and reciprocal-space constraints, in an iterative scheme, finally reaching data convergence when both constraints are successfully satisfied [22]. In the reciprocal-space part of the algorithm, usual projection is the modulus
$\sqrt{{I}_{m}}(\mathbf{q})$ of the experimentally known diffraction intensity on detector in the far field geometry *I _{m}*(

**q**), subject to compliance with the square of the amplitude component of the propagated object exit complex wave-field

*ψ*(

**r**), through updating of the Fourier representation:

*ψ̂*(

**q**) =

*ℱ*[

*ψ*(

**r**)],

**r**is the sample space coordinate,

**q**is the reciprocal-space coordinate and the Fourier transform

*ℱ*acts as a free-space propagator. However, this simple reciprocal-space projection assumes illuminating X-rays of full spatial coherence, ignoring any imperfection of the coherent X-ray source that might introduce complexity of the recorded Fourier-space diffraction intensities. Often, the far-field intensity formed by light scattered from a sample with a complex transmission function

*ψ*(

**r**) under conditions of partial transverse coherence is described through the mutual optical intensity

*J*(

*r*

_{1},

*r*

_{2}) at two points in space

**r**,

_{1}**r**:

_{2}The complex coherence function in real-space *μ*(Δ*x*, Δ*y*) can be approximated as a two-dimensional Gaussian function as follows:

*x*and Δ

*y*to represent real-space unit pixel size in x and y directions in our numerical simulations for this study.

When the illumination demonstrates a statistically stationary mutual intensity function which depends only on the difference **r _{1}** −

**r**, the measured partially coherent intensity

_{2}*I*(

_{pc}**q**) adopts a particularly simple form:

*I*(

_{fc}**q**) is the fully-coherent (FC) intensity obtained through the usual Fourier transform of the wavefield exiting the sample,

*γ̂*(

**q**) is the Fourier transform of the complex coherence function, and ⊗ denotes convolution. To introduce a partial transverse coherence function that acts as a point-spread function, which causes fully coherent diffraction intensities to be blurred, one can employ spatially partial coherent X-ray illumination in the form of two-dimensional Gaussian function. The degree of the spatial coherence in the complex coherence function

*μ*(Δ

*x*, Δ

*y*) between any two points then relates to the standard deviation

*σ*. The Fourier transform of the complex coherence function, is also a Gaussian function, with parameters

*σ̂*=

*N*/(2

*πσ*) with

*N*the number of square pixels (in a given direction) of the camera. To accommodate for partial coherence, the Fourier projection is modified accordingly,

In the limit of full coherence, *γ̂*(**q**) → *δ* (where *δ* is the Dirac delta function) and Eq. (5) becomes the usual Fourier modulus constraint that sets the modulus (absolute value of amplitude) of the iterate to square root of the measured intensity while retaining the phase (Eq. (1)).

In ptychography a dataset is composed of *j*-th intensity measurement
${I}_{m}^{j}$, constructed by stepping (or rastering) a partially coherent probe across an object with step sizes adjusted so that adjacent probe positions overlap. The modified CDI equation (Eq. (5)) is adapted here for ptychography by trivial modification of the projector associated with the Fourier constraint Π* _{F}* in the difference map update (Eq. (9) in [2]). At each iteration k, Π

*→ Π*

_{F}*incorporates for partial coherence,*

_{pc}
Eq. (6) is computed (in parallel) over the entire ptychographic subset of exit-fields or (’views’),
${\psi}_{j}^{k}={P}_{j}.O$, while the overlap projector Π_{0} that computes an object *O*(**r**) and a probe *P*(**r**) from all the subsets together (in series with Eqs. (7)–(8) in [2]), does not need to be modified.

## 3. Investigation of effect of probe diversity on ptychography reconstructions

In this paper, we intend to perform a systematic study on how probe diversity affects fidelity of ptychographic reconstructions. We have selected our object and probe with a various degree of diversity to satisfy two important criteria. First, simulated object and probe should bear very little correlation with each other, however, they should be in the same category of the spatial frequency spectrum. Secondly, neither object nor probe can be too simplistic or too general (completely uncorrelated in spatial frequency). As a result, we have used simulated probes with incrementing phase diversity with a maximum probe phase of *P _{ϕ}* = 0 to 2

*π*with a 0.5

*π*step size. As already explained in the previous part of this section, we used an entirely fictitious test sample using the canonical Lena image as a magnitude component and the same image rotated clockwise 180 degree as a phase component. The Lena probes used in this study are of square shape and all appropriately zero-padded with soft-edges to mimic real X-ray probes in most experimental conditions. The Lena probes are convolved with a two-dimensional Gaussian function so that the blurred probe profiles are smooth throughout the structures. We used

*σ/L*(

*probe*) to define the relative degree of coherence.

*L*(

*probe*) is the size of probes used in the simulations (100 pixels).

## 4. Simulation details

To examine the effects of partial transverse coherence on the quality of ptychographic reconstructions, we performed reconstructions using simulated data in which the Lena object (*L*) under illumination was the canonical Lena test image of size 512×512 pixels. We used a scaled version of the image with maximum value of unity as the magnitude of the test object, and a similarly scaled version with a 90-degree rotation as the phase component of (*L′*). We control the complexity of the sample through an additional scaling parameter of the phase component. In all cases, we model the object through as:

We use the luminosity of the Lena image as the relative thickness of a fictitious physical sample while tuning *ϕ _{max}* within the range of (0, 2

*π*) producing a real-valued or fully complex-valued real-space sample. For a maximum phase delay

*ϕ*= 2

_{max}*π*, the fictitious sample would compare with a real-sample of aluminium with a maximum sample thickness of 1

*μ*m illuminated by 500eV photons [16]. Figure 1 illustrates the complex object scheme used for ptychographic data simulations.

Having the luxury of knowing the simulated object *O*
^{0}, we can define a real-space error metric to provide absolute quantification that is previously used by Parks et al[16]:

_{nj}, Δ

_{mj}gives pixel coordinates. Reconstructed complex-valued images are corrected with global phase offset removal as used by Chapman et al [24], therefore, arbitrary phase offset has been removed from reconstructions by maximising the real part of the complex images multiplied by a phase factor.

To understand how X-ray probe affect ptychographic reconstructions with partially coherent illumination, two classes of X-ray probes are used: 1) A soft-edged square of side-length 100 pixels within a CDI window [23] of 200 pixels Fig. 1 d); 2) The same soft-edged square but as the magnitude component of the probe, with phase structure provided by a version of the Lena image rotated by 180 degrees. In the second class, we use two sub-types of smooth complex Lena probe with soft-edges. One sub-type probe has flat amplitude with 180-rotated phase image, the other sub-type has structure introduced into the magnitude component of the probe by using the Lena image flipped upside down, and has the same phase image as the first sub-type. In both sub-types of the second class of probes, we control the maximum phase of the probe through a *ϕ _{max}* component as we do with the object.

In these simulations, we raster the illumination across a regular grid to provide overlapping views of the sample. The illumination function *P _{j}* at a raster site

*j*is therefore a shifted version of the original illumination function

*P*:

_{nj}is the raster pixel coordinate along the x-axis, Δ

_{mj}is the raster pixel coordinate along the y-axis, and Δ(Θ) is the number of pixels required to achieve the overlap ratio Θ. In these simulations, we conduct the reconstruction in a grid fashion, with

*n*and

_{j}*m*taking on integer values between zero and five. In all simulations, we calculate the shift value Δ(Θ) as 100*Θ, where Θ is the overlap ratio in the range 0 to 100 %. We simulated diffraction data with degrees of overlap in a range of 0.1 to 0.9. Both fully-coherent (FC) and partially-coherent (PC) projection were used in reciprocal-space part of the algorithm.

_{j}We used *σ*
_{0} as the standard deviation of the complex coherence function to simulate partially coherent ptychographic datasets. To start we use deviated *σ* as input. To access the degree of deviation of parameter sigma from the true simulated sigma values that can be tolerated for reconstructions, PC projection step is categorised into three parts: 1) use the exact known partial coherence parameter *σ* to do PC; 2) use under-determined *σ/σ*
_{0} ratios, 0.7 or 0.9 for PC projection; 3) finally, use over-determined *σ/σ*
_{0} ratios, 1.1 or 1.4 for PC projection. ptychographic reconstructions were performed with the modified difference-map algorithm adapted for transverse partial coherence correction (Eq. (5)) with 100 iterations of FC followed by 100 iterations of PC projections. A single convolution step of reciprocal-space complex coherence function with calculated diffraction intensities can be exact, over-determined or under-determined depending on the initial starting value of *σ* used for PC projection. No optimisation of the complex coherence function parameter sigma was performed in the initial simulations in order to reduce computational time required for this analysis. The reconstruction results of both fully and partially coherent projection methods were compared and analysed.

## 5. Interpretation of ptychographic reconstruction results

One expects that with robust overlap constraint in real-space, ptychography is much more tolerant to imperfection of X-ray illumination, reaching better data convergence comparing to that of conventional CDI. Figure 2 demonstrates using a simple soft-edged square function, how ptychographic reconstructions with PC and FC projections perform, when perfect knowledge of complex coherence function and probe is assumed. The reconstructed results have supported this claim; we have observed better quality in reconstructed data with ptychography compared to CDI[16], under spatially partial coherence conditions. This improvement of data reconstructions occur in the coherence definition parameter (*σ/L*) from 0.5 to 1, however, there has been no significant improvement in reconstruction results with *σ/L* values that are outside of this range. With *σ/L* being more than 1, FC and PC projections with either over- or under-determined complex coherence function produce similar acceptable reconstructed results. This is expected because of a very high degree of coherence of *σ/L* is bigger than unity. For degree of overlap between 10 to 40%, FC projections with partially coherent diffraction data do not converge at all. However, with PC projections being introduced, data reconstruction quality improved significantly, almost reaching to the level of acceptance. For example, with *σ/L* equals to a 0.5 and 10% overlap, the best PC projection occurs at exact estimation of partial coherence parameter *σ*, with relatively similar result for over-determined value of *σ/σ*
_{0} = 1.4, with relatively poorer result of *σ/σ*
_{0} = 0.9 when complex coherence function is under-determined. The best reconstruction quality is achieved with overlap of 90%, the highest of the attempts, showing the best real-space R-factor error metric of FC to PC projection, even for the maximum object phase of 2*π*.

Figure 3 shows ratio of the real-space R-factor error metrics (FC/PC) as a function of *σ/L* for objects with various degree of phase maxima and overlap of 70%. Better data convergence always tend to happen at higher *σ/L* for object with phase maximum of both 2*π* and 0.5 *π*.

The reconstruction results show that lower overlap values reduce reconstructed bonus fidelity (where the bonus fidelity is defined by Parks et al[16] to be ratio of FC/PC projections) and objects with maximum phase 2*π* suffer the most. The cut-off degree of overlap values where PC projection gives bonus fidelity is at 40 %, below which, when object maximum phase values exceed *π*, the PC projection is worse than that of FC. Nevertheless, at overlap values lower than 40 %, the PC projection reconstructions are still better in comparison to that of FC projection with object maximum phase being less than *π*. In cases when overlap values are higher than 40 %, the PC projection always show better reconstruction results than FC projection for all object maximum phase values, ranging from 0 to 2*π*. This may be a direct consequence of powerful real-space overlap constraint that provides over-redundant information in diffraction intensities, which help iterative algorithms to find correctly converged solutions, when the X-ray illumination is partially coherent.

For further evaluation of the effectiveness of PC projection, the reconstruction fidelity analysis was performed with various degrees of phase complexity of Lena probe. This was performed in such as a way that perfect knowledge of probe and complex coherence function are incorporated in ptychographic reconstructions to minimize the number of unknowns. We found that the highest phase-diversity probe is the most robust type with the best quality of ptychographic reconstructions and the highest bonus fidelity according to real-space metrics. Within the class of Lena complex probes, we found that the maximum phase of 2 *π* (phase only complex Lena probe with amplitude being flat) gives the best bonus fidelity of reconstructions. By decreasing the complexity of maximum phase structure of Lena probe; real-space bonus fidelity reduces accordingly. Figure 4 shows a comparison of reconstruction bonus fidelities of the complex Lena probe with various phase complexity at maximum object phase values ranging from 0 to 2*π*, with 50% and 70% degrees of overlap for a wide range of *σ/L* values. Previous studies [25] have demonstrated the advantage of using illumination phase diversity in CDI reconstructions, our simulation results show this advantage also applies in ptychography [26]. The results presented in Fig. 4 demonstrates that a higher phase-diversity of the probe gives rise to much better data reconstructions, especially when object has high phase structures.

Although the partial coherence correction in ptychography is extremely robust, there is a cut-off limit for the degree of coherence below which ptychography fails to reach convergence even with the highest degree of overlap. We have performed a detailed analysis for a degree of overlap of 70% and with a maximum object phase structure of 0.5*π* and 2*π*, many degree of coherence *σ/L* values with fine increments were studied. The detailed analysis of the cutoff degree of coherence *σ/L* for both object maximum phase = 0.5 *π* and 2*π* is illustrated in Fig. 2, with both real-space and reciprocal-space error metrics being plotted as a function of degree of coherence (*σ/L*). According to the real-space error metric, the ptychographic reconstructions with PC projection become unacceptable when *σ/L* is smaller than 0.25, (which is the cut-off value of degree of coherence for acceptable reconstruction) results when a complex object with maximum phase of 2*π*. For maximum object phase of 0.5*π*, the cut-off degree of coherence is slightly lower than that of 2*π*, about 0.125, which manifests the finding that for X-ray diffraction imaging, the demand for X-ray coherence is lower for weak/flat phase objects, and for strong phase objects, the requirement for coherence property of X-rays is higher. In our previous report, we find similar trend for simulated CDI analysis [16].

The degree of coherence defined as *σ/L* can be bigger than unity, where transverse coherence length reaches infinity when X-ray probe becomes fully-coherent mathematically. In real synchrotron radiation beamlines, X-ray sources are considered to be fully-coherent when *σ/L* values approach unity. Reconstruction results become very similar when *σ/L* ratios are bigger than unity in our simulation analyses. Therefore, we conclude that there are no significant changes in reconstruction results when *σ/L* is much bigger than unity.

Figure 3 shows real-space R-factor error metrics analyses for both object maximum phase of 0.5*π* and 2*π*. By looking at reconstructed images in Fig. 2 combined with real-space metric suggest minima cut-off coherence properties of X-rays are expected for various degrees of object complexities to achieve successful reconstructions, of noise-free simulated datasets.

## 6. Refinement of partial coherence function

Based on the premise that in real experiments, we would never know the exact complex coherence function for experimental data (owing to the experimental complexity and instrumental instabilities at synchrotron beamlines), we therefore conducted a simulation study on the refinement and optimisation of both X-ray probe and complex coherence function during ptychographic iterative reconstructions, with the aim to gain a good understanding of how well ptychographic algorithms with partial coherence correction perform for reaching global data convergence. The modified CDI algorithm developed by Clark [9] has the ability to *a posteriori* retrieve the complex coherence factor of the illumination from a single diffraction pattern, thus skipping the need for ’laborious’ interferometric measurements [27, 28, 29]. Prior to the application of the intensity constraint (Eq. (4)) it is suggested [9] to update the numerical estimate of *γ̂ ^{k}*(

**q**) by employing a Richardson-Lucy (RL) algorithm,

*I*

^{Δk}(

**q**) is formed by a combination of the previous and current iterates estimate of the coherent intensities. Straight forward adaptation of the RL refinement algorithm to ptychography is realised by using,

*γ̂*

^{k,Δnj}(

**q**) →

*γ̂*

^{k,Δmj}(

**q**) will be now referring to the index

*j*of each ptychographic subset, meaning that (all) the measured diffraction patterns are taken into account in the update process. To reduce computation time, the complex coherence function is only updated every 10 iterations. Alternatively, the update of

*γ̂*can be done by minimisation of the reciprocal-space quantity

^{k,j}*σ̂*.

We have performed systematic numerical studies on how partial coherence algorithms optimise and refine the complex coherence function and X-ray probe during iterative reconstructions. To fully isolate our simulation studies to investigate only the performance of partial coherence correction in the case where both probe and complex coherence function are unknown, no noise is added into the simulated ptychographic diffraction datasets. We have simulated partially coherent ptychographic datasets (*σ/L*) in simulated diffraction data to be a range of 0.1 to 0.9 with small incremental steps, where we used a ratio of *σ/σ*
_{0} of 1.5 for the initial complex coherence function guess to start iterative reconstructions, and we gradually refine the complex coherence function for every 10 iterations during the reconstruction process. To mimic real experimental analyses, we used a ratio of *P/P*
_{0} of 1.5 for the initial guess of the soft-edge probe function with a random guess for the phase component, and let it to be refined during the reconstructions. Several initial guesses of *σ* parameters of both probe and complex coherence function are fed into algorithms, with the starting values of the ratio of *σ/σ*
_{0} values being scattered between 1.5 and 2.

Figure 5 shows the refinement of coherence function with one variable *σ* when the correct coherence function is unknown at the start of the ptychographic reconstructions. This analysis shows that we have observed the ability to retrieve complex coherence functions using a Clark et al. partial coherence correction, where the lower limit for degree of coherence for the successful recovery of the partial coherence function is about 0.1, for an object maximum phase of 0.5*π*. This is lower than the limit of the degree of coherence for acceptable reconstruction (as indicated earlier as 0.125) and this might suggest that the complex coherence function retrieval is more robust than object data convergence for low coherence conditions when the object maximum phase is 0.5*π*. When the object maximum phase is increased to 2*π*, the lower limit cut-off of degree of coherence is approximately the same for both good coherence function retrieval and object data convergence, of around (*σ/L*) 0.25.

To accurately refine and optimise the complex coherence function during experiments, we suggest experimentalists to retrieve the coherence function from a simple test object, similar to the method for extracting a complex probe structure through a well-known test pattern in transmission-geometry ptychography. Once the complex coherence function is obtained, better data reconstructions can be achieved for real complex objects by feeding the correct complex coherence function into iterative algorithms.

Previous study by Thibault and Menzel [10] has demonstrated the feasibility of incorporation of multi-modes of X-rays into ptychographic reconstructions, and this particular approach accommodates arbitrary complex coherence function in the iterative algorithms. In this study, we use a two-dimensional Gaussian-Shell model to approximate possible arbitrary complex coherence function as suggested by K.A. Nugent [18]. Future studies can extend this approximation to more complex forms of mutual coherence function, and we believe studies of multi-modes of X-rays in ptychography can be explored more intensively in the near future because of its promises of high-resolution diffraction imaging of extended objects with high efficiency.

## 7. Variables that are of importance for ptychography

This paper is focused on partial coherence correction on various degree of probe and object diversities; the degree of overlap; and the relative coherence length *σ/L*. Recent studies on other important variables such as degree of binning of diffraction intensities; the fundamental ptychographic sampling (FPS) [30]. which is related to the oversampling ratio in the reciprocal-space diffraction intensities. Edo et al. discovered[30] that converged reconstructions are obtained with an oversampling ratio of 0.5, much lower than the conventional lower limit of oversampling ratio of 2 in CDI, that is the Nyquist sampling requirement in conventional diffraction imaging. Interestingly, this study demonstrates that certain requirements could be relaxed in ptychography compared to that in CDI, such as the minimum sampling ratio that is needed in reciprocal-space diffraction plane. That is, the ptychographical reconstructions are independent of sampling ratio in reciprocal-space diffraction intensities as long as the requirements of sampling ratio in real-space as a function of probe size and position on sample is satisfied.

## 8. Importance of the parameters used in numerical simulations

The followings are the discussions of the importance of the parameters used in our simulations:

Degree of coherence: The degree of coherence *σ/L* represents the ratio of X-ray beam size on sample to the transverse coherence length of X-ray illumination at a particular beamline at a particular X-ray energy. Our study shows that 20% of degree of coherence *σ/L* is sufficient for data convergence for all samples used in experiments. This strongly implies that for a fixed X-ray illumination size on a sample the size of the coherence defining aperture (a typical component in hard X-ray coherence beamlines where coherence of X-ray illumination is mainly controlled by a coherence defining aperture that is usually placed upstream of sample) can be 5 times wider than the X-ray beam size on a sample. Therefore slits can be selected to be bigger to allow more X-ray flux arriving at a sample. This finding is very useful since a lot of samples of scientific interests are relatively weak scatterers, higher incident flux can help to reduce exposure time (therefore reduce total data acquisition time required in ptychography experiments) and to increase signal-to-noise ratio in ptychography experiments.

X-ray probe phase diversity: In our study we have demonstrated that in simulation high phase diversity X-ray probe gives best ptychography reconstructions. This is particular important in real experiment because unwanted noises are present in experimental data due to various origins such as Poisson counting noises of CCD detector; cosmic rays; or instrumental instabilities etc. that would reduce data quality. If we introduce high diversity probe to ptychography experiments, better data convergence can be obtained when other experimental parameters are kept the same.

Sample phase diversity: Real samples can be real; weakly-complex or highly-complex structures. In transmission-geometry ptychography experiments when majority of samples of this geometry are deposited on a thin SiN membrane samples can exhibit both real and imaginary components which correspond to absorption and phase contrasts. The absorption and phase components are direct measurements of imaginary and real parts of the complex refractive index (*β* and *δ*). This is particular important for analysing chemical component of sample. In Bragg-geometry the real part of the complex sample exit wave-function corresponds to the electronic density and the phase part (imaginary part of complex sample exit wave-function) corresponds to atomic displacement in crystal lattice which encodes quantitative information on crystal lattice perturbations. The cases in our simulation contain real-valued weakly-complex and highly-complex sample functions which represent samples with no lattice distortion; weak lattice distortions and highly-strained crystal lattice state. All of which can exist in real samples.

## 9. Conclusion and future outlooks

We have performed systematic analyses of the role of partial transverse coherence correction in ptychography. We have shown convincingly that this correction leads to significantly improved reconstructions over a wide range of coherence and overlap parameters. We have found that the coherence corrected ptychography reconstructions converged well whenever the *σ/L* value was above 0.25, and the overlap ratio was above 40%. A complex Lena probe gave the best convergence, for all coherence, overlap and maximum object phase values, according to error metrics analyses. Earlier researchers found that data convergence in CDI was dramatically improved with high phase diversity probes, and here we came to the same conclusion for ptychography. Moreover, we proved that, according to both real-space and reciprocal-space error metrics, ptychography with partial coherence correction works well for objects with phase ranges above, suggesting that ptychography is a very robust technique for typical materials that usually exhibit the strong phase structures when they are strained. We found there were limits to the degree of partial coherence, below which ptychographic reconstructions fail to converge at all. We have formally established the lower phase cut-off limits and we hope our results can provide useful criteria to experimentalists for the selection of coherence properties. In the case of weak-scattering samples, sufficient coherence is needed to achieve enough signal-to-noise ratio for good quality ptychographic reconstructions.

## Acknowledgments

The work of XS, DP, and SK was partially supported by the U.S. Department of Energy, Office of Basic Energy Sciences, Division of Materials Science and Engineering under Grant No. DEFG02 11ER46831. The Advanced Light Source is supported by the Director, Office of Science, Office of Basic Energy Sciences, of the U.S. Department of Energy under Contract No. DEAC02- 05CH11231.

The Research conducted at University College London, United Kingdom was carried out under grants EP/G068437/1 and EP/I022562/1 from the UK Engineering and Physical Sciences Research Council (EPSRC).

Use of the Advanced Photon Source, an Office of Science User Facility operated for the U.S. Department of Energy (DOE) Office of Science by Argonne National Laboratory, was supported by the U.S. DOE under Contract No. DE-AC02-06CH11357. Beamline 34-ID-C was built with a grant from the National Science Foundation DMR-9724294. This research was carried out under grants EP/G068437/1 and EP/I022562/1 from the UK Engineering and Physical Sciences Research Council (EPSRC).

J.N.C. gratefully acknowledges financial support from the Volkswagen Foundation.

The authors thank David Shapiro and Stefano Marchesini from Lawrence Berkeley National Laboratory for fruitful discussions.

## References and links

**1. **J.M. Rodenburg and H.M.L. Faulkner, “A phase retrieval algorithm for shifting illumination,” Appl. Phys. Lett. **85**, 4795–4797 (2004). [CrossRef]

**2. **P. Thibault, M. Dierolf, O. Bunk, A. Menzel, and F. Pfeiffer, “Probe retrieval in ptychographic coherent diffractive imaging,” Ultramicroscopy **109**, 338–343 (2009). [CrossRef] [PubMed]

**3. **M. Guizar-Sicairos and J.R. Fienup, “Phase retrieval with transverse translation diversity: a nonlinear optimization approach,” Optics Express **16**, 7264–7278 (2008). [CrossRef] [PubMed]

**4. **F. Zhang, I. Peterson, J. Vila-Comamala, A.D.F. Berenguer, R. Bean, B. Chen, A. Menzel, I.K. Robinson, and J.M. Rodenburg, “Translation position determination in ptychographic coherent diffraction imaging,” Optics Express **21**, 13592–13606 (2013). [CrossRef] [PubMed]

**5. **R.A. Dilanian, B. Chen, G.J. Williams, H.M. Quiney, K.A. Nugent, S. Teichmann, P. Hannaford, L.V. Dao, and A.G. Peele, “Diffractive imaging using a polychromatic high-harmonic generation soft-x-ray source,” J. Appl. Phys. **106**, 023110 (2009). [CrossRef]

**6. **B. Abbey, L.W. Whitehead, H.M. Quiney, D.J. Vine, G.A. Cadenazzi, C.A. Henderson, K.A. Nugent, E. Balaur, C.T. Putkunz, A.G. Peele, G.J. Williams, and I. McNulty, “Lensless imaging using broadband x-ray sources,” Nat. Photonics **5**, 420–424 (2011). [CrossRef]

**7. **B. Chen, R.A. Dilanian, S. Teichmann, B. Abbey, A.G. Peele, G.J. Williams, P. Hannaford, L. VanDao, H.M. Quiney, and K.A. Nugent, “Multiple wavelength diffractive imaging,” Phys. Rev. A **79**, 023809 (2009). [CrossRef]

**8. **L.W. Whitehead, G.J. Williams, H.M. Quiney, D.J. Vine, R.A. Dilanian, S. Flewett, K.A. Nugent, A.G. Peele, E. Balaur, and I. McNulty, “Diffractive imaging using partially coherent x rays,” Phys. Rev. Lett. **103**, 243902 (2009). [CrossRef]

**9. **J.N. Clark, X. Huang, R. Harder, and I.K. Robinson, “High-resolution three-dimensional partially coherent diffraction imaging,” Nat. Commun. **3**, 993 (2012). [CrossRef] [PubMed]

**10. **P. Thibault and A. Menzel, “Reconstructing state mixtures from diffraction measurements,” Nature **494**, 68–71 (2013). [CrossRef] [PubMed]

**11. **D.J. Batey, D. Claus, and J.M. Rodenburg, “Information multiplexing in ptychography,” Ultramicroscopy **138**, 13–21 (2014). [CrossRef] [PubMed]

**12. **J.N. Clark, X. Huang, R.J. Harder, and I.K. Robinson, “Dynamic imaging using ptychography,” Phys. Rev. Lett. **112**, 113901 (2014). [CrossRef] [PubMed]

**13. **W. Chen and X. Chen, “Quantitative phase retrieval of a complex-valued object using variable function orders in the fractional Fourier domain,” Opt. Express **18**, 13536–13541(2010). [CrossRef] [PubMed]

**14. **W. Chen and X. Chen, “Quantitative phase retrieval of complex-valued specimens based on noninterferometric imaging,” Appl. Opt. **50**, 2008–2015(2011). [CrossRef] [PubMed]

**15. **J. Miao, D. Sayre, and H.N. Chapman, “Phase retrieval from the magnitude of the Fourier transforms of nonperiodic objects”, J. Opt. Soc. Am. A **15**, 16621669 (1998). [CrossRef]

**16. **D.H. Parks, X. Shi, and S.D. Kevan, “Partially coherent x-ray diffractive imaging of complex objects,” Phys. Rev. A **89**, 063824 (2014). [CrossRef]

**17. **J.W. Goodman, *Statistical Optics* ISBN: 978-0-471-39916-2, 572 (The Wiley Classics Library, 2000).

**18. **K.A. Nugent, “Coherent methods in the X-ray sciences”, Advances in Physics , **59**(1), 1–99 (2010). [CrossRef]

**19. **V. Kohn, I. Snigireva, and A. Snigirev, “Direct Measurement of Transverse Coherence Length of Hard X Rays from Interference Fringes,” Phys. Rev. Lett. **85**, 2745 (2000). [CrossRef] [PubMed]

**20. **C.G. Schroera and G. Falkenberg, “Hard X-ray nanofocusing at low-emittance synchrotron radiation sources”, J. Synchrotron Radiat. **21**, 996–1005 (2014). [CrossRef]

**21. **P.A. Lemieux and D.J. Durian, “Investigating non-Gaussian scattering processes by using nth-order intensity correlation functions”, J. Opt. Soc. Am. A **16**, 7 (1999). [CrossRef]

**22. **J.R. Fienup, “Phase retrieval algorithms: a personal tour,” Appl. Opt. **52**, 45–56 (2013). [CrossRef] [PubMed]

**23. **N. Burdet, G.R. Morrison, X. Huang, X. Shi, J.N. Clark, F. Zhang, M. Civita, R. Harder, and I.K. Robinson, “Observations of artefacts in the x-ray ptychography method,” Optics Express **22**, 10294–10303 (2014). [CrossRef] [PubMed]

**24. **H.N. Chapman, A. Barty, S. Marchesini, A. Noy, S.P. Hau-Riege, C. Cui, M.R. Howells, R. Rosen, H. He, J.C.H. Spence, U. Weierstall, T. Beetz, C. Jacobsen, and D. Shapiro, “High-resolution ab initio three-dimensional x-ray diffraction microscopy”, JOSA A **23**, 5 (2006). [CrossRef]

**25. **A. Fannjiang and W. Liao, “Phase retrieval with random phase illumination,” JOSA A-Optics Image Science and Vision **29**, 1847–1859 (2012). [CrossRef]

**26. **A.M. Maiden, G.R. Morrison, B. Kaulich, A. Gianoncelli, and J.M. Rodenburg, “Soft x-ray spectromicroscopy using ptychography with randomly phased illumination,” Nat. Commun. **4**, 1669 (2013). [CrossRef] [PubMed]

**27. **C. Chang, P. Naulleau, and D. Attwood, “Analysis of illumination coherence properties in small-source systems such as synchrotrons,” Appl. Opt. **42**, 2506–2512 (2003). [CrossRef] [PubMed]

**28. **A. Singer, I.A. Vartanyants, M. Kuhlmann, S. Duesterer, R. Treusch, and J. Feldhaus, “Transverse-coherence properties of the free-electron-laser flash at desy,” Phys. Rev. Lett. **101**, 053850 (2008). [CrossRef] [PubMed]

**29. **F. Pfeiffer, O. Bunk, C. Schulze-Briese, A. Diaz, T. Weitkamp, C. David, J.F. Vander Veen, I. Vartanyants, and I.K. Robinson, “Shearing interferometer for quantifying the coherence of hard x-ray beams,” Phys. Rev. Lett. **94**, 164801 (2005). [CrossRef] [PubMed]

**30. **T.B. Edo, D.J. Batey, A.M. Maiden, C. Rau, U. Wagner, Z.D. Pesic, T.A. Waigh, and J.M. Rodenburg, “Sampling in x-ray ptychography”, Phys. Rev. A **87**053850 (2013). [CrossRef]