Skip to main content

Classical force field model for simulating atomic force microscopy images.

Project description

codecov Build Status PyPI version Documentation Status PyPI-downloads

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

The standard way of installing ppafm is:

$ pip install ppafm

This should install the package and all its dependencies.

The most up-to-date installation guide can be found on the dedicated wiki page.

Command line interface (CLI)

Once ppafm is installed, a collection of command-line tools will become available to the user. Their names start with ppafm- preffix. To get more information about a given tool, run it with -h option, e.g.:

ppafm-generate-ljff -h

For more information, please consult the dedicated page on command line interface of ppafm.

Graphical User Interface (GUI)

The package comes with a convenient graphical user interface. Unlike CLI, this interface needs to be explicitly enabled during the installation. To enable it, check the dedicated section on the Install ppafm wiki page. To know more about the GUI interface, please consult PPAFM GUI wiki page.

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.

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.3.0.tar.gz (520.5 kB view details)

Uploaded Source

Built Distributions

ppafm-0.3.0-cp311-cp311-win_amd64.whl (975.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

ppafm-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (679.7 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ppafm-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl (557.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ppafm-0.3.0-cp310-cp310-win_amd64.whl (975.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

ppafm-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (679.7 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ppafm-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl (557.9 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ppafm-0.3.0-cp39-cp39-win_amd64.whl (975.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

ppafm-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (679.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ppafm-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl (557.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ppafm-0.3.0-cp38-cp38-win_amd64.whl (975.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

ppafm-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (679.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ppafm-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl (557.9 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ppafm-0.3.0-cp37-cp37m-win_amd64.whl (975.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

ppafm-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (679.7 kB view details)

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

ppafm-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl (557.9 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ppafm-0.3.0.tar.gz
  • Upload date:
  • Size: 520.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ppafm-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cb08130b483645d87c0e71767a604dfe2cf1950dbb55bf5c6b4537002ac645f3
MD5 f4801ec6b18269a84102813a6d48fe72
BLAKE2b-256 0a3364cfab12dd0b389c788effeaf6e289536de069976237239b49fb13353d39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 975.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ppafm-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 450719524a42cd33eb836aea510964868597b43e0472604684390a8e0e36e779
MD5 a55dcf4c78fb68db6b9ae19215ef52a0
BLAKE2b-256 2ce2780211590e3c07a6852f9060a2c5010ddb9672b2cb14407c394f604445d5

See more details on using hashes here.

File details

Details for the file ppafm-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0964f5ae10766c2927c9b3c90fc0f69f2e4a59ebbd63010e956c5d40f4d02d46
MD5 8ed0138e68bb7fa1f7734d44d2c64191
BLAKE2b-256 02d875f582c34c55e03ea58ef3626f991bb8da5a4bd2395126fd2d7b6e0c59a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 91f2875b8037c7efab80a8746bb61c69035636747ac58f1e0ae8f0952ff8e6d9
MD5 36e4c18353d1cbbe2ecdca5f5410be19
BLAKE2b-256 8043553445f81a2b7020c38b4ced96b0cced3806af249c6e3738a7efc5937560

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 975.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ppafm-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 778278706c472c27d06c68631fce61e66f18012766670d5cf8061bcbc79150cd
MD5 a0ac23cec99aab208d212ae7aa0c7906
BLAKE2b-256 092ac27c13a239ae7dd9da265f504301d045bb0d3a1d14f28f707cd1c761e950

See more details on using hashes here.

File details

Details for the file ppafm-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd44f7330ba219395f7fa9c5aeb7a801a07a1be6391561d8f05499749814eaf9
MD5 8e6ad73e6ea0242f8ea7e2d6b49669c2
BLAKE2b-256 358287c73eb35f5050b3cf6bc86cf372135824d0c8dbb6b58c6dce733dfea3c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 98f2f355fec667d952d8e0b2c89fdd175f08b18dc735d505783fc1b1ece514e0
MD5 04c9283aceb6c602a60a30e0b7d91637
BLAKE2b-256 b2364bebd4d4bde3a58b6664a360af21973207d79155ec8a5420137272b4c0af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 975.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ppafm-0.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 226346fc3496ac1074f340f8f7d45b980e9661f487d02eb00bde11908dcf0eef
MD5 8bf6295a4da6bb12f8254ccbcdc69277
BLAKE2b-256 2c4873829009dd4e4c99da71e49480662a43a5a6de6df40faf563b72e99dc426

See more details on using hashes here.

File details

Details for the file ppafm-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 06382ba19b814ff14eedb2fdb5690577b48250c2311fae455fd07f4f5fbb9367
MD5 418f8de721ae173487e1e211781b7aa9
BLAKE2b-256 4b2250e3d7bdf984bf44c61ebe5d634ed590dedc1fd2ca9e650a18bc500e5d22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 53914ed654a1656d5d11e8f1cec5eec1d3ce45155cc9c8e0aa1e234badf7687a
MD5 11734f482a96242b1cf0673aa77d8e3c
BLAKE2b-256 9657fd93b107c3939e08b33872d3eb73c5e2875e6c10a3a8ecff92c53148a588

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 975.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ppafm-0.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7d087e4155b0415a659f282fbd9697cbcb1ee4947691633c3330a516df72cae8
MD5 f261801b14e447ef1efd20ae8066a52a
BLAKE2b-256 7f6380fca1ce6d7c645e7399b016a180a4b16d301581a04336e7243ca082ce62

See more details on using hashes here.

File details

Details for the file ppafm-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6705f409c81a2e81b76ab35021e1f0650c821393bdf34c058e98d3272dd7c4d2
MD5 ae9887b65e6e61566a8b658afd1efcc1
BLAKE2b-256 412da6c431583d0c626c43586e0ac79226a5b381d951ec96761dedc5dfb1ce8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5dae476dbed8f42e1a87bf259291138ef55be2fb036a0cc647fb6c30030d24e2
MD5 decb948e14a0e38100b77e99e833db52
BLAKE2b-256 d78521083b0fe929cef63dc1e7421b8348df38cf309638936c13366118145e04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 975.7 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ppafm-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 eaec6efda2ea662cf937054e51e227fc79601730ae96ffab9b65e18b6c41cb10
MD5 c717a031ff43500fea5d9d82fd14c0e9
BLAKE2b-256 e81c337a3ffd95065c9966560e7d1486f425a4ed4b727b60b1912eb6e2c30ab7

See more details on using hashes here.

File details

Details for the file ppafm-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a47e4ece62bd642495329e4a815bbac2ee57c74670c2367f32e0be78fa414097
MD5 1e73d9312c95c46c825d752c534d08ef
BLAKE2b-256 3a16824c1317025b1a4113a3316bd056cf4d027126081863b3b2a3ba0a6eeb7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bf31377a26711fd4df8a4d5e610d387f3ab850a2fb2270ac4a996030cc26277c
MD5 890450081a95d6a7f0d3db6652e3ef31
BLAKE2b-256 56e1ea63d7e41bf48d4d8d83e4267f9a7dd984bfa26965242421c091abca006f

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