PyNX: Python tools for Nano-structures Xtallography

Introduction

PyNX stands for Python tools for Nano-structures Crystallography. It is a python library with the following main modules:

  1. pynx.gpu: X-ray scattering computing using graphical processing units, allowing up to 2.5x10^11 reflections/atoms/seconds (single nVidia Titan X)
  2. pynx.gid: module using pynx.gpu for Grazing Incidence Diffraction calculations, using the Distorted Wave Born Approximation
  3. pynx.wavefield: X-ray wavefield propagation in the near, far field, or continuous (examples available at the end of wavefield.py)
  4. pynx.ptycho : simulation and analysis of experiments using the ptychography technique, using either CPU or GPU using OpenCL. Examples are available in the pynx/Examples directory.

Download

PyNX is available from:

Pynx.gpu and pynx.gid: X-ray scattering GPU computing

Description

This module aims to help computing scattering (X-ray or neutrons) for atomic structures, especially if they are distorted or disordered.

The library uses GPU computing (although parallel CPU computing is also available as a fall-back), with the following platforms:

  • nVidia's CUDA toolkit and the pyCUDA library
  • OpenCL language, along with pyOpenCL library.

Using GPU computing, PyNX provides fast parallel computation of scattering from large assemblies of atoms (>>1000 atoms) and 1D, 2D or 3D coordinates (>>1000) in reciprocal space.

Typical computing speeds on GPUs more than 10^11 reflections.atoms/s on nVidia cards (3.5x10^11 on 2xTitan, 2x10^11 on a GTX 690, 5x10^10 on a GTX295, 2.5x10^10 on a GTX465), more than 2 orders of magnitude faster than on a CPU.

Note that the main interest of pynx.gpu is the ability to compute scattering from any assembly of atoms (not regularly-spaced) to any set of points in reciprocal space. While a FFT will always be faster, it is much more restrictive since the FFT imposes a strict relation between the sampling in real (atomic positions) and reciprocal (hkl coordinates) space.

News

  • 2016/03: more changes to the OpenCL code, which should now avoid any issue with initialization
  • 2012/06/26: the OpenCL code has been improved, and should provide better performance and stability (avoid 'out of resources' issues)
  • 2011/10/01: the PyNX code has been updated to work both with CUDA and OpenCL

Citation & Bibliography

If you use PyNX for scientific work, please consider including a citation:

  • The PyNX article has been published: J. Appl. Cryst. 44(2011), 635-640. A preprint version is also available on ArXiv:1010.2641
  • Give a link to the project: http://pynx.sourceforge.net

License

The PyNX library is distributed with a CeCILL-B license (an open-source license similar to the FreeBSD one).

Pynx.wavefield: Wavefield propagation

This module allows to propagate 2D wavefield using either:

All calculations can either be done using CPU or GPU (OpenCL)

Note that this module is in heavy development (2016/05)

Pynx.ptycho: Ptychography simulation and analysis

This modules allows the simulation and analysis of ptychography experiments, with the following features: