Abstract
Phase-retrieval from coded diffraction patterns (CDP) is important to X-ray crystallography, diffraction tomography and astronomical imaging, yet remains a hard, non-convex inverse problem. We show that CDP recovery can be reformulated exactly as the minimization of a continuous-variable XY Hamiltonian and solved by gain-based photonic networks. The coupled-mode equations we exploit are the natural mean-field dynamics of exciton-polariton condensate lattices, coupled-laser arrays and driven photon Bose-Einstein condensates, while other hardware such as the spatial photonic Ising machine can implement the same update rule through high-speed digital feedback, preserving full optical parallelism. Numerical experiments on images, two- and three-dimensional vortices and unstructured complex data demonstrate that the gain-based solver consistently outperforms the state-of-the-art Relaxed-Reflect-Reflect (RRR) algorithm in the medium-noise regime (signal-to-noise ratios 10-40 dB) and retains this advantage as problem size scales. Because the physical platform performs the continuous optimisation, our approach promises fast, energy-efficient phase retrieval on readily available photonic hardware.
Similar content being viewed by others
Data availability
The authors declare that all data supporting the findings of this study are available within the supplementary information files of this paper.
Code availability
The code that supports the findings of this study is available from the first author (zw321@cam.ac.uk) upon request.
References
Stroev, N. & Berloff, N. G. Analog photonics computing for information processing, inference, and optimization. Adv. Quantum Technol. 6, 2300055 (2023).
Lucas, A. Ising formulations of many NP problems. Front. Phys. 2, 5 (2014).
Syed, M. & Berloff, N. G. Physics-enhanced bifurcation optimisers: all you need is a canonical complex network. IEEE J. Sel. Top. Quantum Electron. 29, 7400406 (2023).
Honjo, T. et al. 100,000-spin coherent Ising machine. Sci. Adv. 7, eabh0952 (2021).
Honari-Latifpour, M., Mills, M. S. & Miri, M.-A. Combinatorial optimization with photonics-inspired clock models. Commun. Phys. 5, 104 (2022).
Inagaki, T. et al. A coherent Ising machine for 2000-node optimization problems. Science 354, 603–606 (2016).
Kalinin, K. P. & Berloff, N. G. Polaritonic network as a paradigm for dynamics of coupled oscillators. Phys. Rev. B 100, 245306 (2019).
Kalinin, K. P. & Berloff, N. G. Networks of non-equilibrium condensates for global optimization. N. J. Phys. 20, 113023 (2018).
Parto, M., Hayenga, W., Marandi, A., Christodoulides, D. N. & Khajavikhan, M. Realizing spin Hamiltonians in nanoscale active photonic lattices. Nat. Mater. 19, 725–731 (2020).
Kim, K., Kumagai, M. & Yamamoto, Y. Combinatorial clustering with a coherent XY machine. Opt. Express 32, 33737 (2024).
Pal, V., Mahler, S., Tradonsky, C., Friesem, A. A. & Davidson, N. Rapid fair sampling of the xy spin Hamiltonian with a laser simulator. Phys. Rev. Res. 2, 033008 (2020).
Nixon, M., Ronen, E., Friesem, A. A. & Davidson, N. Observing geometric frustration with thousands of coupled lasers. Phys. Rev. Lett. 110, 184102 (2013).
Wang, R. Z. et al. Efficient computation using spatial-photonic Ising machines with low-rank and circulant matrix constraints. Commun. Phys. 8, 86 (2025).
Harrison, R. W. Phase problem in crystallography. J. Opt. Soc. Am. A 10, 1046 (1993).
Barnett, M. J., Millane, R. P. & Kingston, R. L. Analysis of crystallographic phase retrieval using iterative projection algorithms. Acta Crystallogr. Sect. D Struct. Biol. 80, 800–818 (2024).
Krist, J. E. & Burrows, C. J. Phase-retrieval analysis of pre- and post-repair Hubble Space Telescope images. Appl. Opt. 34, 4951 (1995).
Miao, J., Charalambous, P., Kirz, J. & Sayre, D. Extending the methodology of X-ray crystallography to allow imaging of micrometre-sized non-crystalline specimens. Nature 400, 342–344 (1999).
Shechtman, Y. et al. Phase retrieval with application to optical imaging: a contemporary overview. IEEE Signal Process. Mag. 32, 87–109 (2015).
Huang, M. & Xu, Z. No existence of a linear algorithm for the one-dimensional Fourier phase retrieval. J. Complex. 86, 101886 (2025).
Eldar, Y. C. & Mendelson, S. Phase retrieval: stability and recovery guarantees. Appl. Comput. Harmon. Anal. 36, 473–494 (2014).
Bendory, T., Khoo, Y., Kileel, J., Mickelin, O. & Singer, A. Autocorrelation analysis for cryo-EM with sparsity constraints: improved sample complexity and projection-based algorithms. Proc. Natl. Acad. Sci. USA 120, e2216507120 (2023).
Fienup, J. R. Phase retrieval algorithms: a comparison. Appl. Opt. 21, 2758 (1982).
Chen, C.-C., Miao, J., Wang, C. W. & Lee, T. K. Application of optimization technique to noncrystalline x-ray diffraction microscopy: guided hybrid input–output method. Phys. Rev. B 76, 064113 (2007).
Latychevskaia, T. Iterative phase retrieval in coherent diffractive imaging: practical issues. Appl. Opt. 57, 7187 (2018).
Tradonsky, C. et al. Rapid laser solver for the phase retrieval problem. Sci. Adv. 5, eaax4530 (2019).
Candès, E. J., Li, X. & Soltanolkotabi, M. Phase retrieval from coded diffraction patterns. Appl. Comput. Harmon. Anal. 39, 277–299 (2015).
Fannjiang, A. & Liao, W. Phase retrieval with random phase illumination. J. Opt. Soc. Am. A 29, 1847 (2012).
Fannjiang, A. & Strohmer, T. The numerics of phase retrieval. Acta Numer. 29, 125–228 (2020).
Candès, E. J., Strohmer, T. & Voroninski, V. PhaseLift: exact and stable signal recovery from magnitude measurements via convex programming. Commun. Pure Appl. Math. 66, 1241–1274 (2013).
Waldspurger, I., d’Aspremont, A. & Mallat, S. Phase recovery, MaxCut and complex semidefinite programming. Math. Program. 149, 47–81 (2015).
Candès, E. J., Eldar, Y. C., Strohmer, T. & Voroninski, V. Phase retrieval via matrix completion. SIAM J. Imaging Sci. 6, 199–225 (2013).
Elser, V. The complexity of bit retrieval. IEEE Trans. Inf. Theory 64, 412–428 (2018).
Levin, E. & Bendory, T. A note on Douglas–Rachford, gradients, and phase retrieval. arXiv: 1911.13179 (2020).
Elser, V., Lan, T.-Y. & Bendory, T. Benchmark problems for phase retrieval. SIAM J. Imaging Sci. 11, 2429–2455 (2018).
Chen, Y. & Candès, E. J. Solving random quadratic systems of equations is nearly as easy as solving linear systems. Commun. Pure Appl. Math. 70, 822–883 (2017).
Cha, E., Lee, C., Jang, M. & Ye, J. C. Deepphasecut: deep relaxation in phase for unsupervised Fourier phase retrieval. IEEE Trans. Pattern Anal. Mach. Intell. 44, 9931–9943 (2022).
Cummins, J. S., Salman, H. & Berloff, N. G. Ising Hamiltonian minimization: gain-based computing with manifold reduction of soft spins vs. quantum annealing. Phys. Rev. Res. 7, 013150 (2025).
Berloff, N. G. et al. Realizing the classical xy Hamiltonian in polariton simulators. Nat. Mater. 16, 1120–1126 (2017).
Toebes, C., Vretenar, M. & Klaers, J. Dispersive and dissipative coupling of photon Bose–Einstein condensates. Commun. Phys. 5, 59 (2022).
Litvinenko, A. et al. A spinwave Ising machine. Commun. Phys. 6, 227 (2023).
Pierangeli, D., Marcucci, G. & Conti, C. Large-scale photonic Ising machine by spatial light modulation. Phys. Rev. Lett. 122, 213902 (2019).
Veraldi, D. et al. Fully programmable spatial photonic Ising machine by focal plane division. Phys. Rev. Lett. 134, 063802 (2025).
Kalinin, K. P. & Berloff, N. G. Global optimization of spin Hamiltonians with gain-dissipative systems. Sci. Rep. 8, 17791 (2018).
Gerchberg, R. W. Holography without fringes in the electron microscope. Nature 240, 404–406 (1972).
Marchesini, S. et al. X-ray image reconstruction from a diffraction pattern alone. Phys. Rev. B 68, 140101 (2003).
Berloff, N. G. Padé approximations of solitary wave solutions of the Gross–Pitaevskii equation. J. Phys. A: Math. Gen. 37, 1617 (2004).
Yefsah, T. et al. Heavy solitons in a fermionic superfluid. Nature 499, 426–430 (2013).
Serafini, S. et al. Vortex reconnections and rebounds in trapped atomic Bose–Einstein condensates. Phys. Rev. X 7, 021031 (2017).
Ku, M. J. H. et al. Motion of a solitonic vortex in the BEC–BCS crossover. Phys. Rev. Lett. 113, 065301 (2014).
Bulgac, A., Forbes, M. M., Kelley, M. M., Roche, K. J. & Wlazłowski, G. Quantized superfluid vortex rings in the unitary fermi gas. Phys. Rev. Lett. 112, 025301 (2014).
Huang, G. B., Mattar, M., Berg, T. & Learned-Miller, E. Labeled faces in the wild: a database for studying face recognition in unconstrained environments. In Workshop on Faces in ’Real-Life’ Images: Detection, Alignment, and Recognition, Marseille, France (eds Learned-Miller, E., Ferencz, A. & Jurie, F.) (2008).
van der Walt, S. et al. scikit-image: image processing in Python. PeerJ 2, e453 (2014).
Acknowledgements
The authors acknowledge the support from HORIZON EIC-2022-PATHFINDERCHALLENGES-01 HEISINGBERG Project 101114978. R.Z.W. and N.G.B. acknowledge the support from the Julian Schwinger Foundation Grant No. JSF-19-02-0005. N.G.B. also acknowledges support from Weizmann-UK Make Connection Grant 142568 and the EPSRC UK Multidisciplinary Centre for Neuromorphic Computing (grant UKRI982).
Author information
Authors and Affiliations
Contributions
R.Z.W. developed the simulation code and performed numerical simulations. G.L. performed large-scale numerical simulations, produced Fig. 4, and provided comments during manuscript preparation. S.G., D.P., M.C.S., and C.C. contributed implementation considerations for physical hardware, including expected operating timescales, and provided input on experimental feasibility. R.Z.W. wrote the initial manuscript draft. N.G.B. substantially revised and edited the manuscript. N.G.B. supervised the study.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Communications Physics thanks Mostafa Honari, Roman Khymyn and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Wang, R.Z., Li, G., Gentilini, S. et al. Phase retrieval via gain-based photonic XY-Hamiltonian optimization. Commun Phys (2026). https://doi.org/10.1038/s42005-026-02525-7
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s42005-026-02525-7


