Ptychography of pure quantum states

Ptychography is an imaging technique in which a localized illumination scans overlapping regions of an object and generates a set of diffraction intensities used to computationally reconstruct its complex-valued transmission function. We propose a quantum analogue of this technique designed to reconstruct d-dimensional pure states. A set of n rank-r projectors “scans” overlapping parts of an input state and the moduli of the d Fourier amplitudes of each part are measured. These nd outcomes are fed into an iterative phase retrieval algorithm that estimates the state. Using d up to 100 and r around d / 2, we performed numerical simulations for single systems in an economic (n = 4) and a costly (n = d) scenario, as well as for multiqubit systems (n = 6logd). This numeric study included realistic amounts of depolarization and poissonian noise, and all scenarios yielded, in general, reconstructions with infidelities below 10−2. The method is shown, therefore, to be resilient to noise and, for any d, requires a simple and fast postprocessing algorithm. We show that the algorithm is equivalent to an alternating gradient search, which ensures that it does not suffer from local-minima stagnation. Unlike traditional approaches to state reconstruction, the ptychographic scheme uses a single measurement basis; the diversity and redundancy in the measured data—key for its success—are provided by the overlapping projections. We illustrate the simplicity of this scheme with the paradigmatic multiport interferometer.

conjugate domain, together with the diversity and redundancy in the data, attained by the multiple overlapping illuminations, make the initial estimate converge to the object function. Figure 1(b) outlines the process.
In the proposed quantum analogue of ptychographic CDI, sketched in Fig. 1(c), a set of n projectors "scans" overlapping parts of an input pure state and the moduli of the d Fourier amplitudes of each part are measured. These nd outcomes are fed into a PIE-based algorithm which estimates the state. For d up to 100, we simulated numerically the ptychographic reconstruction of single and multipartite states for different sets of projectors and, considering realistic noisy scenarios, obtained successful reconstructions in all cases. We also demonstrated the equivalence between our reconstruction algorithm and an alternating gradient search, which ensures that it will not stagnate at local minima. It is important to underline that quantum ptychography is a method to accomplish the task of quantum tomography for pure states. However, unlike most tomographic methods which use measurements in several bases, the ptychographic scheme uses only one basis and several projectors of rank greater than one. From the experimental point of view, this is advantageous as it requires much simpler settings in the setup. We illustrate this point through the paradigmatic multiport interferometer 31 . From the theoretical perspective, the main advantage of quantum ptychography is that it uses a phase-retrieval-like algorithm for postprocessing, which is much simpler than maximum-likelihood 11 or semi-definite programming methods 7 , commonly employed in usual tomographic methods. It would certainly be possible to use these in quantum ptychography, though. , which completely specify it. In our ptychographic approach, the role of the localized, scanning, and partially overlapping illumination probe will be played by a set of n projectors

Quantum
For this set of rank-r probe projectors we impose two conditions: (i) each projector in the set must have a partial overlap with at least one other partner, i.e., for any (ii) all levels in  d must be addressed at least once. Some examples of such sets are given later on, but until then, the discussion is general and applies to any set of probe projectors.
Given an ensemble of d-dimensional quantum systems described by the state |ψ〉, the ptychographic measurements on this state proceeds as follows: we first apply the -th probe projection on the input ensemble, generating an output sub-ensemble described by the (unnormalized) state Next, we apply a quantum Fourier transform (QFT) on this output, obtaining 1 is the set of Fourier transformed amplitudes of ψ | 〉  . Finally, we perform a projective measurement in the computational basis. This procedure is repeated for each  P and gives us a set of n count distributions , where  is a constant dependent on the particle flux (before projections) and detector efficiencies. These distributions form our ptychographic data set as , which, together with the a priori known set of probe projectors, will be the inputs to an iterative phase retrieval algorithm designed to reconstruct ψ | 〉. The entire process of quantum state ptychography is illustrated in Fig. 1(c). The iterative reconstruction algorithm we adopt is an adapted version of the PIE 29,30 . It proceeds by taking the estimate through the same steps that the ensemble of quantum systems was taken, imposing the measured data, and applying an update rule to the estimate. Its steps are the following: i. Start with a random estimate of the input state: ii. Apply the -th probe projector to |φ〉: iv. Use the -th measured ptychographic data, Π  , to correct the moduli of the coefficients of φ | 〉 , keeping their phases: Apply the inverse QFT to obtain an updated estimate for the output state: vi. Update the current estimate of the input state: where β is a feedback parameter, roughly within (0, 2], that controls the step-size of the update and can be adjusted to improve convergence (see Methods). vii. Use this updated estimate as input to repeat the steps (ii)-(vi) with a new value of .
This sequence is summarized in the diagram of Fig. 1(d): a single PIE iteration consists of n iterations through the closed loop [steps (ii)-(vii)], where each probe projector and corresponding ptychographic data is used once to update the state estimate. At each iteration we calculate the relative distance between the current and updated estimates, i.e., φ φ φ = | ′〉 − | 〉 | 〉 D / 2 2 ; the algorithm terminates when it achieves either a sufficiently small value of D or a preset maximum number of PIE iterations, delivering a pure state that must be normalized. equivalence to an alternating gradient search. By following the same reasoning that has been applied in classical ptychography 32,33 , we will show that the iterative algorithm we propose is equivalent to an alternating gradient search with a weighting factor. More precisely, we will show that an iteration using the projector  P is a gradient descent with respect to the error metric We will proceed to calculate the gradient of the metrics  E with respect to the coefficients γ  k of the estimate [Eq. (5)] and find the direction of fastest descent. To this end, we calculate the complex gradient of j k k k k j where γ ∂ ∂  / j denotes differentiation with respect to either the real or imaginary part of γ  j . The chain rule gives further www.nature.com/scientificreports www.nature.com/scientificreports/ The derivatives of γ k can be easily calculated through their Fourier transform relation to the coefficients γ  j , giving us Inserting these into Eq. (13), we arrive at This result should be compared to Eq. (9). To make this more convenient, let us take the latter's inner product with |j〉: if we let (17)] corrected by the factor βε j . While β controls the size of the step, ε j only allows for correcting in the dimensions which have been addressed by  P . This is similar to a Wiener filter approach 29 , where one trusts more on the correction term at points where the illumination was more intense and thus had a better signal-to-noise ratio. In our case, we have the analogue of a binary illumination, that is, each dimension either is or is not "illuminated", so that the Wiener-filter operator would just reduce to  P . Since the method uses several values of , it is equivalent to an alternating gradient search. The use of several different metrics is a mechanism for evading stagnation, which is a risk because of the algorithm's gradient-search nature. It is very unlikely that all the metrics have a local minimum at the same point. Therefore, in case the algorithm got stagnated at a local minimum of one of the metrics, an iteration corresponding to an  E which does not have a local minimum at that point would move the estimate away from it, and the algorithm would then proceed towards a common minimum.
The nature of the postprocessing algorithm demonstrated here is not, by itself, a guarantee of successful reconstructions. For this, it must be fed with ptychographic data having sufficient diversity and redundancy, which are determined by the defining features of the set of probe projectors (their form, n, r, and ). In that case, we will provide strong numerical evidence that the algorithm succeeds in reconstructing an unknow pure state without ambiguity (see next section). Before that, we must specify the sets of projectors we shall work with. construction of probe projectors. We have constructed three families of probe projectors to study the ptychographic protocol outlined above. We considered, initially, the projectors given by where r is its rank, ⊕ denotes addition modulo d and  s is a nonnegative integer that sets the skip between adjacent operators and may be arranged in a n-entry vector s (n) = (s 0 , …, s n−1 ). This is perhaps the simplest choice of projectors, with all of them being diagonal in the computational basis and encompassing contiguous dimensions of the Hilbert space.
We derived two families of the form given above. In both cases, we used ranks around d/2, chosen from a numerical analysis seeking those that optimized PIE's convergence (see Methods). For even dimensions we used r = d/2 whereas for the odd ones we alternated between = ⌊ ⌋ r d/2 and = ⌈ ⌉ r d/2 , selecting the one which provided better reconstructions. In general, both ranks gave similar results. The first family used n = 4 projectors about equally spaced along the dimensions of d  . This family requires 4d measurements to be carried, which is an amount comparable to other works in the literature of pure state reconstruction [13][14][15] . In this case, the vector of skips is given by which will give an average overlap of = 2/3  . The second family was made of n = d operators with a skip vector s (d) = (0, 1, …, d − 1), which gives an overlap  = − r 1 1/ . This family is overcomplete, as it requires d 2 measurements to be carried, much more than is required for pure state reconstruction. However, it is capable of reconstructing a class of states that the first family is not, but which forms a zero-measure set in d  . We will leave this discussion to the next section, though. Figure 2(a,b) illustrate the action of these families of probe projectors on the input states considering d = 8. (2019) 9:16066 | https://doi.org/10.1038/s41598-019-52415-y www.nature.com/scientificreports www.nature.com/scientificreports/ The third and last family was conceived for the case where the quantum system is comprised of N qubits. In this case, it is desirable to avoid operations that involve more than one qubit at a time, and use only local operations instead. This is because the latter are easier to implement experimentally 10 . We considered, therefore, the set of n = 6N probe projectors given by j are projectors onto the eigenstates of the Pauli operators σ x ( = + −  , ), σ y ( =  R L , ) and σ z ( =  0,1) of the j-th qubit, and Î is the identity in the qubit space. Therefore,  P j projects the part of the state on the j-th qubit subspace while leaving the remainder unchanged. These probe projectors have rank r = 2 N−1 and an ; most of them ( ≠  0, 1), unlike those in Eq. (19), are not diagonal in the computational basis. Thus, they are better visualized by their matrix components in that basis. Figure 2(c) illustrates this for a two-qubit system.
It is worth noting that there is plenty of freedom in constructing the family of projectors. The only requirements are those established in the beginning of this section, namely, that they must have some overlap and address all levels in  d . The reader is encouraged to pursue other families that might be best suited for his/her experimental setup, for example.

Results
Blind reconstruction. Using the three sets of probe projectors defined above, we performed a numerical study of the quantum ptychographic protocol. Our study comprised several dimensions up to d = 100. For each d, 10 4 input quantum states were randomly generated according to the Haar measure. The ptychographic data sets corresponding to these states were used to simulate experimental detections (more details next), which were then fed into the PIE algorithm. We chose for our feedback parameter the value β = 1.5, optimized numerically (see Methods). Our stop criteria consisted of two clauses: reaching D < 10 −5 or 100 PIE iterations, whichever happened first. If the algorithm was stopped by the second clause, we made it start again with a new random estimate. We allowed up to 100 such reinitializations. At the end, the quality of the reconstruction is quantified by computing the fidelity F = |〈φ pie |ψ〉| 2 and infidelity I = 1−F between the input state, |ψ〉, and the normalized estimate of the algorithm, |φ pie 〉.
We simulated the imperfect generation of states and the random nature of detections, which are unavoidable sources of uncertainty in actual experiments, with depolarization and Poissonian noise, respectively. The first can be modeled as a random fluctuation in the density matrix of the pure state (|ψ〉〈ψ|), so that the generated state will be ρ η ψ ψ ηρ rand where η is the noise level, and the random perturbation ρˆr and is drawn according to the Hilbert-Schmidt measure in the mixed-state space 34 . The probe projection followed by the QFT will produce ρ ρ = , provided the simulated data to which we applied a Poisson distribution of average λ| |  C k 2 , where λ is a count rate factor. In our simulations we used η = 0.05 and λ = 10 3 , in agreement with values found in the literature 4,11 , which we also checked to be realistic (see Methods). Note that www.nature.com/scientificreports www.nature.com/scientificreports/ although the noise will introduce mixedness in the input states, the PIE algorithm will treat the noisy data as if they came from a pure state, and it will deliver a pure state as well. Figure 3 shows the histograms of infidelity obtained in this case and Fig. 4 shows their averages; overall, I < 10 −2 , which attests that the reconstructions were excellent in general. Only a small fraction of them were not satisfactory. In d = 100, for instance, about 4% of input states have not been well characterized (i.e., had fidelities below 0.9) by the family with 4 projectors. A straightforward way to overcome this issue is including one or a few more probe projector(s) in the measurement at the expense of increasing the experimental cost. Alternatively, we may adapt to our protocol the recent improvements in the PIE algorithm that successfully handle difficult data sets 35 , but this is beyond the scope of the present work.
We have observed that the d-projector family of projectors took reasonably longer times than the 4-projector family to reconstruct the states. For example, to reconstruct 10 4 states of dimension d = 11 with projectors of rank r = 6, the scheme with n = 4 projectors took about 800 s, while about 10000 s were needed for n = d. For d = 100 and r = 50, the reconstruction times went to about 40 min and 6 h for n = 4 and n = d, respectively. This suggests that a greater diversity in the data makes the algorithm able to detect more imperfections in the estimate, so that more iterations are needed to reach the threshold fixed for D. To make an analogy, picture a carpenter that refines the shape of a wooden piece; by looking at the piece from two orthogonal angles, she is able to correct its shape to some extent. Then, by looking from an angle intermediate to those two, she is able to perceive other imperfections  www.nature.com/scientificreports www.nature.com/scientificreports/ that were not evident and correct them. Therefore, by using more diverse data, the algorithm is able to correct the estimate in a manner that would not be possible by just using more iterations of less diverse data. On the other hand, it could also make more efficient corrections to the estimate, as they will now happen on more subspaces of  d , so that it is not trivial to foresee how data diversity impacts convergence.
The algorithm required a few thousands of iterations to converge, in general. However, each iteration is extremely fast since the estimate is just a complex vector (as opposed to an array, for example), so the operations that need to be carried out are comparatively simple. Overall, with a modest laptop, the reconstruction of a single state took from fractions of a second, at smaller dimensions, up to a few seconds at greater ones, as can be inferred from the reconstruction times mentioned above.

non-overlapping projectors and sparse states.
In order to highlight the role of the overlap between probe projectors in the ptychographic measurements, we have also simulated reconstructions using non-overlapping  P 's. For d = 20, n = 4, r = 5, s (4) = (0, 5, 10, 15) in Eq. (19), and 10 4 random states, we obtained fidelities ranging from 10 −4 to 0.81 with an average of 0.15. These almost random results show that the multiple overlaps are crucial in the protocol: without them, the ptychographic problem becomes several disjoint standard phase retrieval problems 36 , which are known to suffer from nonuniqueness and stagnation issues 32 .
The ptychographic method, with the three projector families used so far, will suffer difficulties in the reconstruction of sparse pure states, i.e., states in which most of the components are zero. It succeeds only if every nonzero component was addressed with at least one other nonzero component by some probe projector, so that they could interfere. This is hindered, in general, when the state is sparse. The results is that the algorithm falls into a disjoint group of phase retrieval problems, as discussed above. One way to avoid this is to use the already considered set of n = d probe projectors [Eq. (19) with s (d) = (0, 1, …, d−1)], but now with rank ≥ + ⌊ ⌋ r d/2 1, because when the levels of d  are addressed cyclically, the biggest distance between nonzero components will be ⌊ ⌋ d/2 . A second way is to use an adaptive approach: first, one measures in the computational basis; if the state is verified to be sparse, then one applies the ptychographic method building the probe projectors according to the distribution of its nonzero components. Such an extra step is, in general, easy to carry out.

Discussion
The ptychographic method introduced here requires a total number of = nd  measurement outcomes-d QFT state-amplitudes for each of the n probe projections. In this regard, its experimental cost will be determined by the number of  P 's adopted. Along with the specific form of the projectors, this number also defines the diversity of the ptychographic data set and its degree of redundancy arising from the partially overlapping projections. When choosing n, one should be aware that a high value, although experimentally more demanding, provides more diversity and redundancy in the data set. This has consequences on the quality of the reconstructions and on the convergence of the algorithm, and our results revealed that there can be appreciable differences between projector families. Nevertheless, all the three families we studied gave good results, in spite of their differences, even with substantial amounts of noise included in the simulations.
To illustrate the simplicity of the quantum ptychographic scheme and, at the same time, discuss other of its general aspects, let us consider d-dimensional states encoded in the propagation modes of single photons (or any other type of radiation). A multiport interferometer (MI), sketched in the right box of Fig. 5 for d = 8, can implement any unitary transformation on this encoding 31 . Under these circumstances, the probe projectors given by Eq. (19) would be realized by mode filters at the input ports of the interferometer, as shown in the left box of Fig. 5. By setting the MI to perform F d , the ptychographic data would be collected simply by shifting the mode filters n times at the input ports and recording the counts at the output ports. For comparison, to reconstruct these states by measuring four or five observables [12][13][14][15] , the mode filters would not be necessary, but one would have to reconfigure the whole MI for each measurement basis employed. This shows a nice feature of the ptychographic method: the measurements are effectively performed in a single basis while the probe projectors are "shifted" through the Hilbert space.
From the experimental point of view, the implementation of quantum state ptychography should be straightforward. On one hand, the QFT has been experimentally realized in many different platforms including trapped ions 37,38 , superconducting qubits 39 , nuclear magnetic resonance 40 , neutral molecules 41 , and photonic systems [42][43][44][45][46] , both for single-particle and multiqubit scenarios. On the other hand, the families of probe projectors proposed here and given by Eqs. (19) and (20) are both of simple implementation for these scenarios. www.nature.com/scientificreports www.nature.com/scientificreports/ conclusion We have proposed and numerically studied a method to reconstruct pure quantum states based on a powerful coherent diffractive imaging technique called ptychography [16][17][18] . Our quantum ptychographic protocol was shown to be simple in regard to the required set of measurements and to possess a fast and robust postprocessing, regardless of the state-space dimension. It was also shown to be equivalent to an alternating-gradient search algorithm. Successful reconstructions were obtained in realistic noisy scenarios, which makes the method amenable to future experiments and a concrete alternative to standard tomographic techniques [12][13][14][15] .
Since the emergence of ptychography in its modern form with the works of Faulkner and Rodenburg 18,29 , the technique has evolved impressively. Subsequent advances included, in special, the recovery of the illumination probe 47 , the use of other propagators rather than the Fourier transform 48 , and the handling of mixedness both in the probe and in the object 49 . Our method, based on the simplest form of ptychography 18 , may follow a similar route and be extended in many directions, including the utilization of different types of probe operators and different measurement bases, the reconstruction of mixed states and processes both in discrete and continuous domains, among others. Thus, quantum ptychography has the potential to become a valuable tool for quantum information science.

Methods
optimization of the feedback parameter β. The parameter β [Eq. (9)] controls the step-size of the update in the PIE algorithm and can be adjusted to improve its convergence. For β = 1, the algorithm corrects the estimate strictly in the subspace spanned by  P ; higher values can make it progress faster and converge in less iterations; lower values can make it slower but more stable. Therefore, it is advisable to run a few reconstructions with several values of β and compare their performance.
Using the same initial estimated and target state, we obtained the optimal β by running the PIE and recording the relative distance φ φ φ = | ′〉 − | 〉 | 〉 D / 2 2 between current and last estimate, for several values of the parameter. Figure 6 (left panel) shows the evolutions for a few values of β. The best progression was achieved by β = 1.5, which we used in all later studies. optimal rank of projectors. To determine the optimal r of the probe projectors given by Eq. (19), we studied the convergence of the PIE algorithm as a function of this rank for a few state-space dimensions (d = 10, 15,20). For each combination of d and r, we reconstructed 10 4 random states and calculated the average number of iterations necessary until convergence. The results are shown in Fig. 6 (center panel) and indicate that a rank around d/2 works best. In our simulations we alternated between ⌊ ⌋ d/2 and ⌈ ⌉ d/2 . In general, we verified that both, as well as any other close value, produced similar results regarding the quality of the reconstructions. noise simulation. We introduced depolarization and Poissonian noise in the ptychographic data to study the protocol in a realistic scenario. As mentioned in the main text, we based our noise levels on experiments found in the literature, but we still wanted to verify if they were indeed realistic. To this end, we picked 10 4 random pure states, degraded their amplitudes with the two kinds of noise and computed the fidelities with respect to the original states. Figure 6 (right panel) shows a histogram of the degraded fidelities, which are indeed comparable-and even lower-to actual experiments 50 .

Data availability
The simulation codes and datasets generated during the current study are available from the corresponding authors on reasonable request.