Code simulating various STM techniques, especially for tilting tips (depending on ProkopHapala/ProbeParticleModel ) This is implementation of efficient and simple model for simulation of High-resolution scanning tunneling microscopy (STM). Normall STM simulations using Chen's approximattion is part of the code as well
- BEWARE - after repairing misteake in d-orbitals the results for FePc are different. We are investigating it.
- currently developed Python3/C++ version of the PPSTM code:
- works in python3.12, matplotlib, cpp>=4.4.8 (look at wiki instruction for problems with MAC compilation), PyQt5 (for GUI ),for some parts ASE and GPAW are imporatant;
- Part of the code regarding simulations with tilting tips is depending on the PPAFM developed by Prokop Hapala and co. (https://github.com/Probe-Particle/ppafm), you can easilly install it with
pip install ppafm>=0.2.0a3.
For easy introduction to this code and its functionalities, try Graphic User Interface (GUI) or PPSTM_simple.py script.
Constant current simulations are now available through const_cur_tutorial.ipynb jupyter notebook from npz or xsf. There is also former Mathematica notebook which works only with xsf.
Documentation is here at Wiki.
It can also simulate IETS images of molecules, if the imaging mechanism is driven by the amplitude of the IETS peak.
The pip installation requires:
- Python 3.12.13
- GCC/G++ 15.2
pipbuild
Run the following commands from the repository root:
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip build
python -m pip install .To install optional features, specify one or more extras:
python -m pip install ".[opencl,pytorch,gui,gpaw,ase]"Available extras are opencl, pytorch, gui, gpaw, ase.
The opencl extra also requires an OpenCL Installable Client Driver (ICD) for your device. On Ubuntu, for example:
- NVIDIA GPU: included with the NVIDIA driver
- AMD GPU:
sudo apt install mesa-opencl-icd
See the AMD Pro drivers if necessary. - Intel GPU:
sudo apt install intel-opencl-icd - CPU:
sudo apt install pocl-opencl-icd
On Linux, create a simple Conda environment with:
conda env create -f environment.yml
conda activate ppstmIf you use Jupyter, optionally register the environment as a kernel:
python -m ipykernel install --user --name ppstmFurther options can be found at installation wiki page.
- Run all tests (verbose):
pytest tests -v
- Run only fast tests (skips tests marked as slow):
pytest tests -v -m "not slow"
Measure code coverage to identify untested code paths.
To show coverage statistics by file and list lines not covered by tests:
pytest --cov=ppstm --cov-report term-missing testsTo create a detailed HTML report with coverage by file, function, and class:
pytest --cov=ppstm --cov-report html:coverage testsOpen coverage/index.html in your browser to explore the results interactively.