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 the ppafm- prefix. To get more information about a given tool, run it with the -h option, e.g.:

ppafm-generate-ljff -h

For more information, please consult the dedicated page on the 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 the 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, several 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 a 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 improvement.
  • 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 a matter of a few minutes. 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 by specifying atomic positions, types and (optionally) charges.
    2. Hartree-potential electrostatics + Lennard-Jones: Electrostatics is considerably improved by using Hartree potential from DFT calculation 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.
    3. Hartree-potential electrostatics + Density overlap: Further accuracy improvement is achieved when Pauli repulsion between electron shells of atoms is modelled 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 the simulation of molecules with electron pairs (-NH-, -OH, =O group), triple bonds and other strongly concentrated electrons.
  2. GPU version: - Version specially designed for the 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. The 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 enables 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 for 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 is the old master branch that 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.
  • PhotonMap implements the latest developments concerning sub-molecular scanning probes combined with Raman spectroscopy (TERS) and fluorescent spectroscopy (LSTM).
  • complex_tip is a modification of the Probe-Particle Model with 2 particles that allows a better fit to experimental results at the cost of additional fitting parameters.

For contributors

If you miss some functionality or have discovered issues with the latest release - let us know by creating an issue. If you would like to contribute to the development of the ppafm code, please read the Developer's Guide wiki page. Small improvements in the documentation or minor bug fixes are always welcome.

Further information

Publications describing the Probe-Particle Model

If you have used ppafm in your research, please cite the following articles:

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ppafm-0.4.0-cp312-cp312-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.12Windows x86-64

ppafm-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (687.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ppafm-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (566.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ppafm-0.4.0-cp311-cp311-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.11Windows x86-64

ppafm-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (687.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ppafm-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (566.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ppafm-0.4.0-cp310-cp310-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.10Windows x86-64

ppafm-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (687.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ppafm-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (566.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ppafm-0.4.0-cp39-cp39-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.9Windows x86-64

ppafm-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (687.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ppafm-0.4.0-cp39-cp39-macosx_11_0_arm64.whl (566.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

ppafm-0.4.0-cp38-cp38-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.8Windows x86-64

ppafm-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (687.5 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ppafm-0.4.0-cp38-cp38-macosx_11_0_arm64.whl (566.7 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: ppafm-0.4.0.tar.gz
  • Upload date:
  • Size: 529.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f02a2c3f08f42bc8f243b9a730753a7f4c1ad93e00d63860f51820b39caf24be
MD5 1535e3cbb89520285edc54af366e6b8c
BLAKE2b-256 c1697e95e611f1d5999d793033f6278e2ef65a64ee02d2b07701f9bf4d0a8174

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8daef765932a3f1b8805773ccf772aa0c70b4fc5b07bbe81ea6c71c1d5113ec1
MD5 59f2f1adec893ddb6db95bb867635f6d
BLAKE2b-256 1ec44538ab5d75b027d127d1a87c059b882e43380a4781a734d7b3dfe0463047

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a64ebfa8c79435fc5b3fe6e9deb70a2235cb84f71a3115eeebb7f0f286b9d8d6
MD5 5725a5299f2744b9c6f60e422833882c
BLAKE2b-256 83bc3e052324b0fb780946a7fb79807aa23f769b381c06e92d0a0190a3e07fa5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3853238640813ee3252b20a6776bc755d2cdb6e583efa92b9f54fa1f9ddca4fa
MD5 3074a7c34e1d9e0ee8660a5165d703d4
BLAKE2b-256 92db4f7aeff6cf94e4af00285226ee8400f0f4cf84a219a4100e1821cee413fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 04096c3f21fd988317a3093190c1dc2cf895b428236bedf6df65d1bef985592a
MD5 7c9c1646d3c33cb6e037382954eafe18
BLAKE2b-256 0e9878753b6e0a925cc8c216d0f5a0aa651296a6c19a663e2ed68994bb7f7065

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf7a76dbac27ee66bbff905bd167943177f8fb19077c75cf10ae02bba40d7557
MD5 0f4ff03a96af224553cdb8051cc9b390
BLAKE2b-256 91d3b269e0d3d17ec8ce5b2bddb762678cf1badf11b46a3e16aa1fe3988806a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5db198b1fcfc2fea6085a03b0067d28cd1206568b955fe4633cb467b6f752016
MD5 cf79547c7180bad537a05c04ecf1ed48
BLAKE2b-256 88862595d35b1eadc8566070c30c1cfb6bc0f447529dda5a9d428817e866f9ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ec4740e4a1e337fa62d717b0a4cb632568348808558fb793bac19b7991c93b68
MD5 3181edff0e408818d92b373ab158cb3c
BLAKE2b-256 d0535d567afb2481a5dd15e3cad838aadb05ef4624587ae16c976e9e9d3dd24e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca6d5f2c94c496bbef0d63063cc00194b0cb29d2688a6cff76b869694d3452dd
MD5 9fb1171e362dc84402341ee4b376f25d
BLAKE2b-256 faf9f2ae237d18ec5d9fb510d138a8a8fe4e4fc4f4e63559c2e772155785be10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e589a887cb5693ddd748c27da7577e31ae8a4081270010a4f59abfdbd3bca8c3
MD5 68b92b979074be7a7c53ac9ea6f95439
BLAKE2b-256 bf7dfa65389b2ec501b64401c44f4af7e24cf22b2a9cfdb2dd3a9eeada0fc3ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 345afb443dbcfa419afeaec0f5bc70fcda7c87822e7fcdc9619c83d111a89edd
MD5 23dd503356842ae8f1ab1f4f5808f990
BLAKE2b-256 4a4e10ce74f23cd446b8e3af6ae377bdfb08e17c608fcc1ce34b71b7c6d0c61a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d51946c133b95817f7da29fa635fe060ff01398c627838c12e0d451c442dde7b
MD5 9d665226890d8d6bd643f05eff4e406d
BLAKE2b-256 c80e28b4367a77a2914cd89528844d7d093c0e2a798103f890ab93106617c9b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 566.7 kB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a97f4ddb788747c61a633539282097394c3e4e66f5449fd88bd7f7bcafcd872
MD5 0ac20390369ffe5351205515e87279df
BLAKE2b-256 117bfdc331c0bdbb5bf5a1e237eec790aa17f56fffebe06f042a5984a29d1c0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2aae4cda9787f3157b67c47af95dafc0edd55ca5fac4c9f50365b501d62e3427
MD5 416314d473a0c29668b4e7b649110d59
BLAKE2b-256 d3c36663511a6dc2a6e2fdebcc2e1b5d06ad43b69e3041d726cd96a668a9088c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppafm-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 baa5caed5e00d165f3c7d32de36e65643d95c7aaad8cb3ade03a4ade8d6590fb
MD5 f21ea9f4eda293b1fb07e437c69f58fa
BLAKE2b-256 cac3b8b7978c0d8bfb0221e5e59bad5542b5b00b5c23c8eddf9bd08d31f10ebb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppafm-0.4.0-cp38-cp38-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 566.7 kB
  • Tags: CPython 3.8, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ppafm-0.4.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45d2131abb17e19bb5532319576d60912d951f198293074dd6440cd60c1b46a0
MD5 35238a9d1cb40fbc72c159a9822eedef
BLAKE2b-256 8556ee7720947041f67cc106d45f5ca0b4bea127b7f5deaec71d8961525e4ab0

See more details on using hashes here.

Supported by

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