We present a deterministic approach to the ptychographic retrieval of the wave at the exit surface of a specimen of condensed matter illuminated by X-rays. The method is based on the solution of an overdetermined set of linear equations, and is robust to measurement noise. The set of linear equations is efficiently solved using the conjugate gradient least-squares method implemented using fast Fourier transforms. The method is demonstrated using a data set obtained from a gold–chromium nanostructured test object. It is shown that the transmission function retrieved by this linear method is quantitatively comparable with established methods of ptychography, with a large decrease in computational time, and is thus a good candidate for real-time reconstruction.