quantem is a quantitative electron microscopy data analysis toolkit built on PyTorch. It brings together tools for reconstructing or analyzing a wide range of transmission electron microscopy (TEM) techniques, including nanobeam diffraction, phase retrieval, real-space imaging and tomography, spectroscopy, and related analyses within a consistent, GPU-accelerated API.
- Ptychographic phase retrieval: ML-enabled iterative reconstruction (McCray et al., 2025) and direct methods (Varnavides et al., 2026).
- Tomography: fast and accurate HAADF tomography using implicit representations (Lim et al., 2025).
- Imaging: drift correction and lattice analysis for (S)TEM images.
- Data structures & I/O: a unified
Datasethierarchy that reads common electron-microscopy formats and serializes to Zarr. - Visualization: publication-quality figures with perceptually-uniform colormaps.
- GPU-accelerated & ML-ready: a PyTorch backend with neural object representations and multi-GPU / multi-node reconstruction.
- Spectroscopy: GPU-accelerated spectra fitting for EDS and EELS, under development.
- Diffraction: multi-angle precession electron diffraction (MAPED), under development (Ribet et al., 2025).
quantem is available on the Python Package Index and requires Python 3.11+:
pip install quantemThis installs PyTorch as a dependency. For CUDA-specific PyTorch builds, follow the official PyTorch install guide for your platform first.
To install from source or set up a development environment, see CONTRIBUTING.md. A local install can also be used to access the newest development features of individual modules that exist on feature branches prior to PRs.
For custom CUDA kernels that accelerate tomography, ptychography, and io behind a torch-native API, see the companion quantem-cuda package (optional, more coming soon).
The quantem-tutorials repository contains Jupyter notebooks that walk through the main workflows for each module.
If you use quantem in your research, please cite this repository as well as the relevant paper(s) for any module(s) that you used:
-
quantem (software): please cite the version you used. Ready to use citations can be copied from the Zenodo record, or from the "Cite this repository" button on GitHub.
-
Iterative ptychography: McCray, A. R. C., Ribet, S. M., Varnavides, G., & Ophus, C. (2025). Deep generative priors for robust and efficient electron ptychography. arXiv:2511.07795. https://arxiv.org/abs/2511.07795
-
Direct ptychography: Varnavides, G., Bekkevold, J. M., Ribet, S. M., Scott, M. C., Jones, L., & Ophus, C. (2026). Relaxing Direct Ptychography Sampling Requirements via Parallax Imaging Insights. Microscopy and Microanalysis, 32(2), ozaf139. https://doi.org/10.1093/mam/ozaf139
-
Electron tomography (implicit neural representations): Lim, C., Casert, C., McCray, A. R. C., Lee, S., Barnum, A., Dionne, J., & Ophus, C. (2025). Missing Wedge Inpainting and Joint Alignment in Electron Tomography through Implicit Neural Representations. arXiv:2512.08113. https://arxiv.org/abs/2512.08113
-
Multi-angle precession electron diffraction (MAPED): Ribet, S. M., Dhall, R., Ophus, C., & Bustillo, K. C. (2025). Multi-angle Precession Electron Diffraction (MAPED): A Versatile Approach to 4D-STEM Precession. Microscopy and Microanalysis, 31(6), ozaf103. https://doi.org/10.1093/mam/ozaf103
Contributions are welcome! See CONTRIBUTING.md for the development setup and workflow, and CONTRIBUTORS.md for the people who have built quantem.
quantem is free and open source software, distributed under the MIT License.
