Skip to main content

Classical force field model for simulating atomic force microscopy images.

Project description

Probe Particle Model (PPM)

Simple and efficient simulation software for high-resolution atomic force microscopy (HR-AFM) and other scanning probe microscopy (SPM) techniques with sub-molecular resolution (STM, IETS, TERS). It simulates deflection of the particle attached to the tip (typically CO molecule, but also e.g. Xe, Cl-, H2O and others).

Installation

To install the latest version of PPM, run:

$ pip install ppafm

This should install the package and all its dependencies. Once the installation is completed, the following commands should be available:

  • ppafm-generate-elff - command-line interface to generate electrostatic force field.
  • ppafm-generate-elff-point-charges - command-line interface to generate electrostatic force field using point charges.
  • ppafm-generate-ljff - command-line interface to generate Lennard-Jones force field.
  • ppafm-relaxed-scan - command-line interface to run a scan of the sample with the probe particle.
  • ppafm-plot-results - command-line interface to plot the results of the simulation.
  • ppafm-gui - GUI application for interactive simulation of AFM images. Requires some additional dependencies, see below.

Alternatives (Docker, Anaconda) and some notes on different platforms (Linux, MacOS, Windows) can be found on the wiki: Additional installation instructions

Install GPU GUI

The ppafm-gui application requires some additional dependencies. These dependencies should be installed automatically when you install the ppafm package with the opencl option:

$ pip install ppafm[opencl]

On Linux systems (tested on Ubuntu) you need to additionally install PyQt5 on your system

$ sudo apt install python3-pyqt5

Additionally, an OpenCL Installable Client Driver (ICD) for your compute device is required. On Ubuntu:

  • Nvidia GPU: comes with the standard Nvidia driver (nvidia-driver-xxx)
  • AMD GPU: sudo apt install mesa-opencl-icd (May not work on all AMD devices, see the Pro drivers)
  • Intel HD Graphics: sudo apt install intel-opencl-icd
  • CPU: sudo apt install pocl-opencl-icd

See additional instructions on the wiki: PPAFM GUI

Usage examples

We provide a set of examples in the examples directory. To run them, navigate to the directory and run the run.sh script. For example:

$ cd examples/PTCDA_single
$ ./run.sh

You can study the script to see how to run the simulation. Also, have a look at the params.ini file and the wiki to see how to set up the simulation parameters.

Once the simulation is finished, a number of files and folders will be created.

GUI

See the wiki: PPAFM GUI

Run GPU generator for machine learning

  • examples/CorrectionLoopGraphene use GPU accelerated PPM to iteratively improve the estimate of molecular geometry by comparing simulated AFM images with reference. This is work-in-progress. Currently, modification of estimate geometry is random (Monte-Carlo), while later we plan to develop a more clever (e.g. Machine-Learned) heuristic for more efficient improvment.
  • examples/Generator quickly generates a batch of simulated AFM images (resp. 3D data stacks) which can be further used for machine learning. Especially in connection with (https://github.com/SINGROUP/ASD-AFM).

Flavors of PPM

Since 2014 PPM developed into the toolbox of various methodologies adjusted for a particular use case.

  1. CPU version: - Original implementation using Python & C/C++. It can simulate a typical AFM experiment (3D stack of AFM images) in ~1 minute. It is the base version for the development of new features and methodology. All available simulation models are implemented in this version, including:
    1. Point charge electrostatics + Lennard-Jones: Original fully classical implementation allows the user to set up calculation without any ab-initio input simply by specifying atomic positions, types and charges.
    2. Hartree-potential electrostatics + Lennard-Jones: Electrostatics is considerably improved by using Hartree potential from DFT calculation (e.g. LOCPOT from VASP) and using the Quadrupole model for CO-tip. We found this crucial to properly simulate polar molecules (e.g. H2O clusters, carboxylic acids, PTCDA) which exhibit strong electrostatic distortions of AFM images. Thanks to implementation using fast Fourier transform (FFT) this improvement does not increase the computational time (still ~1 minute), as long as the input electrostatic field is accessible.
    3. Hartree-potential electrostatics + Density overlap: Further accuracy improvement is achieved when Pauli repulsion between electron shells of atoms is modeled by the overlap between electron density of tip and sample. This repulsive term replaces the repulsive part of Lennard-Jones while the attractive part (C6) remains. This modification considerably improves especially simulation of molecules with electron pairs (-NH-, -OH, =O group), triple bonds and other strongly concentrated electrons. Calculation of the overlap repulsive potential is again accelerated by FFT to achieve minimal computational overhead (2-3 minutes) as long as input densities of tip and sample are available.
  2. GPU version: - Version specially designed for generation of training data for machine learning. Implementation using pyOpenCL can parallelize the evaluation of forcefield and relaxation of probe-particle positions over hundreds or thousands of stream-processors of the graphical accelerator. Further speed-up is achieved by using hardware accelerated trilinear interpolation of 3D textures available in most GPUs. This allows simulating 10-100 AFM experiments per second on consumer-grade desktop GPU.
    • GPU version is designed to work in collaboration with machine-learning software for AFM (https://github.com/SINGROUP/ASD-AFM) and use various generators of molecular geometry.
  3. GUI @ GPU - The speed of GPU implementation also allows to make interactive GUI where AFM images of molecules can be updated on the fly (<<0.1s) on a common laptop computer while the user is editing molecular geometry or parameters of the tip. This provides an invaluable tool especially to experimentalists trying to identify and interpret the structure and configuration of molecules in experiments on-the-fly while running the experiment.

Other branches

  • master_backup - Old master branch was recently significantly updated and named main. For users who miss the old master branch, we provided a backup copy. However, this version is very old and its use is discouraged. If you miss some functionality or are not satisfied with the behavior of current main branch please let us know by creating an issue.
  • PhotonMap - implements the latest developments concerning sub-molecular scanning probe combined with Raman spectroscopy (TERS)y and fluorescent spectroscopy (LSTM).
  • complex_tip - Modification of probe-particle model with 2 particles allows a better fit to experimental results at the cost of additional fitting parameters.

For developers

If you would like to contribute to the development of the ppafm code, please read the Developer's Guide wiki page.

Further information

Notable publications using Probe Particle Model

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppafm-0.2.1.tar.gz (514.7 kB view details)

Uploaded Source

Built Distributions

ppafm-0.2.1-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11 Windows x86-64

ppafm-0.2.1-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (607.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

ppafm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl (599.2 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ppafm-0.2.1-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

ppafm-0.2.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (607.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

ppafm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl (599.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ppafm-0.2.1-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9 Windows x86-64

ppafm-0.2.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (607.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

ppafm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl (599.2 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ppafm-0.2.1-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

ppafm-0.2.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (607.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

ppafm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl (599.2 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ppafm-0.2.1-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

ppafm-0.2.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (607.9 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

ppafm-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl (599.2 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file ppafm-0.2.1.tar.gz.

File metadata

  • Download URL: ppafm-0.2.1.tar.gz
  • Upload date:
  • Size: 514.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for ppafm-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0268a54e09dd91f82cfe5d730437db0f52c6044aa3204a3c08ad48b10305186f
MD5 b410a4f32fd7fc19db2d558b0c5bbde1
BLAKE2b-256 456a2f6828d29868b5cd556f4694ea653bebdc962419952caf90ed616df236a5

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ppafm-0.2.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for ppafm-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fff9d4cd682fee616b9af43147240bcad712cff86faa22010c2a28c22649b051
MD5 c3bdcecccc3e584a1f1002339d7c70b8
BLAKE2b-256 5c8753ece2def94e842fdeb000abd1bb0b3a7610007a5a3c27510ed19266f649

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f26ff361c7099034d2730f68996cf546386f2c9f29130366c5999725e84c5de7
MD5 48e7322cf08011e33385dcc1c33b3d6e
BLAKE2b-256 c41e973c82ec507d46fe6960caa345b29b9099b7aca180e25f9468efa3b0858d

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6c779631b958366af4d192248f393ba4ba0792c1c48f35ef21381133eb91e2ca
MD5 55bc4492fad20c4e68eb2a8c2d9f8278
BLAKE2b-256 eb46113d04def8d1287c6819a3ad08befed50992a66e67536e3fe802039311ed

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ppafm-0.2.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for ppafm-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b59152c4b859025cd3050d9ea245eb798e5ab33e1508e31e42547a4e6c70bc2c
MD5 a9a613b07572c7c5b2502344794ca05a
BLAKE2b-256 9966168704fca6cad6e5d9add95bdb787e86e58b6ceec9854dd42a3a74c3b6f1

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c2b65851d7699fdeb392f319e77556aae82978a7ea89364c76a9f054d05bff8
MD5 61424cbcf62d88128eaf3226279a4990
BLAKE2b-256 8c349878bf62436c7179c67fb222207a152956b2b6c9a9a154a76107afbc9725

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d205ae44bdb33a314f0a881d022442afd90b458e185bd9821801ba4ddb351a59
MD5 d2c3202f21a005a0dc4be87d84380530
BLAKE2b-256 20df41258d11f444f944997853549fa6fb6b5409eb70d8a7abd05f5a42ec1bea

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ppafm-0.2.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for ppafm-0.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e305830e589dcddb1304ac7ccb17f2ecf325353a37f77f87b939ee2d6fff49d0
MD5 91ac6f6f97795cfc027f06770127905a
BLAKE2b-256 058e2a4e78ccc519f10502ef98fa762ae9104d686cfa70749d76d1021645cdde

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6857e5d58fb7748b979265ac64da640aba7686920205efdc03e0e607b6087f7
MD5 c240bcd8acee0d808dd8b5ce9a98fd25
BLAKE2b-256 32819a61ca0e1db8842e9483a31b9225f732205bd4041670bb2013049b7e6cf4

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fa2c2e0e918258018dc44e2e7ae38a70310836751f33f757e9c7d27aed78e6e3
MD5 a55e95c1f31009c3c1820e9ae0b2fc12
BLAKE2b-256 75b8f711139fe79138dc7dae728db0616e327dc56e94bf1cf5678199374d0a9a

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: ppafm-0.2.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for ppafm-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 50fd14441f2928eccf236bf10860fe126528d75cc9c8e50a6e72750cdae36129
MD5 df041f5e6642d48379befae61eead73d
BLAKE2b-256 7e76a3f49073e7a288b5aa03c625adb9b35191fa2d06d8754a281c23df5784e2

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 247570969f64dbc9552b2a01edb0dc3b3d52a48d1d3e9a1352fa11d1d6117a70
MD5 c0c0693674d1afdd29a005f4a7730302
BLAKE2b-256 7eac9c4e2dd85b7384cca8150033da20cba947c5e526584de79d44b201161e3b

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 51e12517e60e6762ee29e7d0904a5d4adacfd363f8ba302e2ae38da58d056213
MD5 b9060d073d98c5c211ddab1606dc3be1
BLAKE2b-256 7ac901b2effa0633be096145b5ff198f47d57e22ba5e42d0788e283bae2d3c6d

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: ppafm-0.2.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for ppafm-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a7fb451745f2c9017634882ce825aaae9dbe25ca89150c6040a85f389a354f18
MD5 76fb3d49cde4178c0cc179262bdce327
BLAKE2b-256 4b532f0f703340b0c048afbbeec92e54174fefa1b2c4a71effa03ab5ac470799

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57d599b74b5b7367ac9a323c51aad7dcb57fdd9e8ee639ced8db05f789094add
MD5 da0f2ec5091b861f24fc89cb7225b7be
BLAKE2b-256 1f3721a6983b0d06e2c4c370bad5c54cb4f6c19ad0006159dba68447fc3a143a

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 06fbb924ab7a9ba13c8138bce7b5d34067596b9699fefb2979d54974f3c88229
MD5 4a0060021eeec0b8e670da189bf4eef4
BLAKE2b-256 e87f1a1245b7a651cce1924ccdebc607dac784d44f57620a40740a52e4f17b43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page