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

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 the deflection of the probe particle attached to the tip, where the probe particle represents a flexible tip apex (typically CO molecule, but also e.g. Xe, Cl-, H2O and others). The Python package is named as ppafm.

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.

See also the tutorial for using the Python API for running GPU-accelerated simulations.

Run GPU generator for machine learning

  • examples/CorrectionLoopGraphene use GPU accelerated ppafm 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).

ppafm simulation models and implementations

Since 2014 ppafm 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) and fluorescent spectroscopy (LSTM).
  • complex_tip - Modification of the 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.2.tar.gz (526.2 kB view details)

Uploaded Source

Built Distributions

ppafm-0.3.2-cp312-cp312-win_amd64.whl (979.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

ppafm-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ppafm-0.3.2-cp312-cp312-macosx_11_0_arm64.whl (564.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ppafm-0.3.2-cp311-cp311-win_amd64.whl (979.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

ppafm-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ppafm-0.3.2-cp311-cp311-macosx_11_0_arm64.whl (564.0 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ppafm-0.3.2-cp310-cp310-win_amd64.whl (979.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

ppafm-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ppafm-0.3.2-cp310-cp310-macosx_11_0_arm64.whl (564.0 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ppafm-0.3.2-cp39-cp39-win_amd64.whl (979.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

ppafm-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ppafm-0.3.2-cp39-cp39-macosx_11_0_arm64.whl (564.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ppafm-0.3.2-cp38-cp38-win_amd64.whl (979.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

ppafm-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ppafm-0.3.2-cp38-cp38-macosx_11_0_arm64.whl (564.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ppafm-0.3.2-cp37-cp37m-win_amd64.whl (979.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

ppafm-0.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.9 kB view details)

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

File details

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

File metadata

  • Download URL: ppafm-0.3.2.tar.gz
  • Upload date:
  • Size: 526.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppafm-0.3.2.tar.gz
Algorithm Hash digest
SHA256 ca6f2a885af6201bdf230ea39af6dce569ca506499c6775ed6cc0b736b839168
MD5 489ba12537695f956edba180540d119a
BLAKE2b-256 ab34c34c2ed6ffbffa581af7853c546b1311734b174ac8350f9928709812ba39

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ppafm-0.3.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 979.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppafm-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0ea357930f0003520899ae3fa62320d47316c2c90053949bc32390f837e8c2cc
MD5 f0c10dfcb8ca3247664d786484d51b02
BLAKE2b-256 b411dcef039253324f8756730f23b4e8ac189e87f3a69e61e60cd7d8ddcd428c

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4866b194b7a9aeeed37602f65d089cf6957e97b8404b1206737ff674c3d8c7aa
MD5 4c83daba7729a16ec332af392f8d7452
BLAKE2b-256 77b1a9742d618d969b969506e57930c3a183e09a7520dee5282c84af9b7cbbc5

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9a00338d5698c56b65ebc299a72a0c742fae22710672b925933056826dc3876
MD5 09d5d77e6b21e6059009a683d0d7bc85
BLAKE2b-256 31006047c4f2af3d1fefb159f5d7b2afe7e6b511a9514fe8b9464be6204608fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 979.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppafm-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2dc690c5e20bd4668738499be99f666a5b6aa45a6e6894952abc28255388581a
MD5 46570f215b5dfa0d7acea16d166b2d7c
BLAKE2b-256 b7aea4737d736ee14f89b8975818fcec05414303d1b16ae8f2e6de97a4113dd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f39a57d4986c6053d375ef993b621f93ddc1db863f912fe7854437b83b7798b6
MD5 380aa3f1faf48eb1e17d7000f1e2e16e
BLAKE2b-256 aef233cd6b04fdb28736b527d6f20e4085aec806dc861725ffd3a2dd760b8e65

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0739326d0461ac3233a54c51ed087cf5c059b08d6cd31a9d9769b6ae4197017
MD5 a840d3796c1c928a2079f011c1968638
BLAKE2b-256 2355538cbb902d4a5eb8daef50e539f68cdcc5958ecfcb4ee95e39d624f21f31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 979.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppafm-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8679b0697ac0e297c1c59e2943a7dadb8bfc9fb7516db3de661f6556e5430d5f
MD5 8977ec21f79b9367ca5980ad0046fca6
BLAKE2b-256 d9f87f7007145d10f4459c4873dc4e6d4c48a7d1b86cf21f0b95cedd990ba367

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 490870133cc08c4c0dce0417531b609b291d132e900d79b60e088713641aefcc
MD5 8a598bac584566f25a348480564de1e2
BLAKE2b-256 5186231bf6a82ab3909a5ec5e4b9cc088ec02ee322a31698333a483c1c12097e

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54d296eb38115cd99de2e9e2653c028642495074f276f30a20cd92eff22981c5
MD5 e00ff223c153e2718879653fbdb7014e
BLAKE2b-256 0004068730ee7987782322d56fcd469fd47b8cd4b7680d9fd88c75f2206d7d31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 979.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppafm-0.3.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b16cc689ac2dc09f03f3124fec38d1c5f9730c6d9a13f6367f7d5f1a89857427
MD5 d6322d139ab046e3d216e18cb6581a73
BLAKE2b-256 eceafc0aefdd0cac537d4e832c4283485b594b160798abf30c656708857f5bb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dff77d0e71bd6a005555cd4643fe5cfc82d6f11f3e9d10813a8254660bd50c2c
MD5 ca118b3a356ae975a1f16ca368272776
BLAKE2b-256 b57a353d635dee120b49295e9f833a9d6f4f0b703f8752cbadaeb8d91eb29d5a

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4a1442566831ce7d05d9ddb289bbdb9a4ac4f7edba5cbeb027062c223e8f6ca
MD5 0e32efc2a8ae3b6a9060f5f2555d779a
BLAKE2b-256 a70596a51c41770550f3325aecdf5ebbdc6c38fdd88834e0bd858d4435ef7ed1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.3.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 979.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppafm-0.3.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 589948a213f28662ff04ec0084a1b3e13773ec48e48c6320e32811524efb14c6
MD5 a18c52606e30a4f94e1a87ada53b7ee0
BLAKE2b-256 6ba4d3e183bd6ce9f7cadf69720d6a8bfa630f23ca89d092a8817bd8ec30ac80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13ed1a301548278eb798197d3cc3b6bd06343af67639a1e70b865050f23a8dd4
MD5 a99ebf801a1ee76f600cd2656466ceb2
BLAKE2b-256 66585700272cc859dd65ccf90461d7ab5ecf853a5932dae5be10e9df0c6f1410

See more details on using hashes here.

File details

Details for the file ppafm-0.3.2-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ppafm-0.3.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c0d0d859da681286fa544c02fecbf3cfba0b2649202445645b695a935c58360
MD5 a6acc2e9d7e5239b9a806c66991e1dbf
BLAKE2b-256 fdf896778a300bdf0549d4dbef4a8355277cc4b7bc7e5a5d060405ed25a89fd1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ppafm-0.3.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8411dc5fabdb139800e5a81005b6ee0d4693756fee5337e3aad3de0b2ca059c5
MD5 2d42efe2cba7e66d9ddda4b2a779e0fb
BLAKE2b-256 a51867005986ff28e3ccd274df74280327994ec36b1a1132c426dedd4dbc2ce5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b33b51ba0c8c9df12bb78d8e5297480b293339fc464c62cb5b9b36a94c7c17c8
MD5 8f657c1cf2e235bafbf6ca8857c9b84a
BLAKE2b-256 f0c276b0525c1f457be0852ccd7a12bfbd9e1754d9ac3953e054e378f71c5de8

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