PtyPy [1] is a framework for scientific ptychography compiled by P.Thibault and B. Enders and licensed under the GPLv2 license.

It comprises 7 years of experience in the field of ptychography condensed to a versatile python package. The package covers the whole path of ptychographic analysis after the actual experiment - from data management to reconstruction to visualization.

You will find suitable classes for many concepts of ptychography in PtyPy. Using these or other more abstract base classes, new ideas may be developed in a rapid manner without the cumbersome overhead of data management , memory access or distributed computing. Additionally, PtyPy provides a rich set of utilities and helper functions, especially for input/output.

Get started quickly here or with one of the examples in the templates directory.


  • Difference Map [4] algorithm engine with power bound constraint

  • Maximum Likelihood [3] engine with preconditioners and regularizers.

  • Fully parallelized (CPU only) using the Massage Passing Interface (MPI). Simply execute your script with:

    $ mpiexec -n [nodes] python <your_ptypy_script>.py
  • A client-server approach for visualization and control based on ZeroMQ . The reconstruction may run on a remote hpc cluster while your desktop computer displays the reconstruction progress.

  • Mixed-state reconstructions of probe and object [2] for overcoming partial coherence or related phenomena.

  • On-the-fly reconstructions (while data is being acquired) using the the PtyScan class in the linking mode linking mode