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.1a2.tar.gz (514.8 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 Windows x86-64

ppafm-0.2.1a2-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.1a2-cp311-cp311-macosx_10_9_x86_64.whl (599.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

ppafm-0.2.1a2-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.1a2-cp310-cp310-macosx_10_9_x86_64.whl (599.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

ppafm-0.2.1a2-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.1a2-cp39-cp39-macosx_10_9_x86_64.whl (599.3 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

ppafm-0.2.1a2-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.1a2-cp38-cp38-macosx_10_9_x86_64.whl (599.3 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

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

Uploaded CPython 3.7m Windows x86-64

ppafm-0.2.1a2-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.1a2-cp37-cp37m-macosx_10_9_x86_64.whl (599.3 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ppafm-0.2.1a2.tar.gz
  • Upload date:
  • Size: 514.8 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.1a2.tar.gz
Algorithm Hash digest
SHA256 664766caac0c87ee782ae6b35a96d14d987367dc38707fec516a3589689852f0
MD5 954fd0ebd24891437c7c3e8923ff0aff
BLAKE2b-256 4eee24992fdfe4beeb85dfdc4618faac20fd689104eff03da58d0b327f40e138

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.2.1a2-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.1a2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1af99aac2abc87d47531736d646ee718ea4fa1f659c7e005cdf2d4a9c3b9d655
MD5 4d4e1a42e867295966a67bddc4df06d0
BLAKE2b-256 e5dcdd47e438e582d43af32b14bb13f48df852609016133409cfc344a17ab271

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1a2-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.1a2-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a98079c547a01c9940713ca5cf7484ec39aa733b315f5a8d233228bc6727abb
MD5 1be2ff381d19a8938eaa5883d9859209
BLAKE2b-256 ece52273e4c1dc370ddc2337220a9cb8c7a88821ab20dcf4aabe9cc59a30d834

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.2.1a2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 61b61930de2bcfc639dc3e489323bee854e3c35a8b368bb6a29661f74fa295a2
MD5 548973a762a7696d8d0c50f569b930a8
BLAKE2b-256 7f11f0ff735f9231ab9db03b0b22d6f2e8c89ef3779c2ab117056d9ec91ec04b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.2.1a2-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.1a2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bccb59165bac63dcf4c6679391b15c228c1d5fd8d24a0ab1ef79ecc6e4e6f355
MD5 0998433ea7c786223be2764defe1d349
BLAKE2b-256 d71c0ad40ac588c1c884b35e710b651184467ff6c72979f793a772f6caf44439

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1a2-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.1a2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d46e47cf0b13f163e49df9e25748339e3b4a2545172071cf0dcf0add5c8e20a9
MD5 e780ce6a17a7ba2f70d9ee661e1e88d4
BLAKE2b-256 1f88ac17fdbdba05ede9606fd7362762a95f0b189ce30e7326b8da9cf3d793a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.2.1a2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a404ffd14b1af5fd631aab381062a899486e28bf073f4ebc29cd9131c3858a4f
MD5 e34005a29337e1d6eb6aabff3da210ca
BLAKE2b-256 4f6ca350645055e2eabe17ae64cd50b93d36ad99bad39a04c103f132733ad2f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.2.1a2-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.1a2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 67cbf3ea4033803d06df8f6ceaaa9e4fa459dad5fb046f6cbde4cd5f23061781
MD5 283b6bb232cee55625326505bac8f6a6
BLAKE2b-256 8a6a0fc9463e5a3a332e0693fccf45b6fd1b55c9bd105e54dea52036215729c8

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1a2-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.1a2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9ad7d4ef743f94b09b48b0f7a46c71ddfc8ccdf2cf5b8db56582a373eba0cc4
MD5 35adb3d949c282c34b1b0b80438997dc
BLAKE2b-256 54ff431421966f216c6edc8d4bb37fdcee50181fe9604e922f9ef47fec32f3e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.2.1a2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 43a758f2712c77bcc8a3445eb93627fad92950ea67771526eb06c121d5926b5a
MD5 5ce47876c8cb94d1ee2a58b1fd4491bd
BLAKE2b-256 2feceecd9116577626b4e7f4939d74f0517c98ab4328ad7a76744859c4e1d549

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.2.1a2-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.1a2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 25f8bb9cdcd75dc7b66e223283dfbdf8ed3c48abc9828e27c3b2ecce7bca2090
MD5 d906b38a0bd16c7a494015e4e8e6764f
BLAKE2b-256 871d14482c6ff62473bb83ddf82e535f710209d03286cbcbb60f3c1f87f51c59

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1a2-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.1a2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e31cc8b3ef0392dca48e2a228c7fd30cc1b50e401f5a017f43356e9b21d8717e
MD5 d5bf6d44239bd11d1aaaed694c73850c
BLAKE2b-256 c094e374fcdff59b813371002561851016df0550b826aa4da83fceb07213d617

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.2.1a2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 637f227a65791af98224be1c591d2181e27998d516ce31b1df107ff65992e25f
MD5 14b3783da9caca3d65ebc9f938ee0661
BLAKE2b-256 16e00c3bff6e545825e9b15434b88b07cdcb7960dab72db7a889141643b9fed4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.2.1a2-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.1a2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 92f434f85f3e088e0c7d7c8b80c44c90a0cef7e7435adf8be3c875f682086ed5
MD5 440766931b5f52c658d233c66e7fb54e
BLAKE2b-256 64d1645c1e517c45e21fd27f5fde229f0029f82e099602badb95ec6166416c43

See more details on using hashes here.

File details

Details for the file ppafm-0.2.1a2-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.1a2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 691142e8827f9bccd242528d3e4296aba6053c60863b89f7134bcf69c404c163
MD5 1333e6e4771c597b75a86e2468bdacd0
BLAKE2b-256 3d3fe767c1521f89aff582abd328da4caff05bc860fabcf9a688422881a74c51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.2.1a2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cd61fd45a831855a5421358e869574938fdeb07d0c4cb14971c3fb7bee6b8e41
MD5 1cb2c56b3d1d056155ee12913993227a
BLAKE2b-256 c3736c290f01a21cc43cfc62956fefa1a43a6735823bdd3baa27a4b3bfcbcfff

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