Skip to main content

CP2K Scanning Probe Microscopy tools.

Project description

DOI

CP2K Scanning Probe Microscopy tools

Library and scripts to perform scanning probe microscopy simulations based on a CP2K calculation.

Features include:

  • Processing the various output files of CP2K, including the .wfn file
  • Scanning Tunnelling Microscopy and Spectroscopy (STM/STS) analysis
  • Fourier-Transformed STS analysis for finite cutouts of periodic systems
  • Orbital hybridization analysis for adsorbed systems
  • High-resolution STM (HRSTM) simulations

Installation

The package requires an MPI implementation to be available on your system for mpi4py. You can install it:

  • On Linux: through your package manager (e.g., apt install mpich or yum install mpich)
  • On macOS: through Homebrew (brew install mpich)
  • On Windows: through conda (conda install -c conda-forge mpich)

Then install the package with pip:

pip install cp2k-spm-tools

Or, for development:

git clone https://github.com/nanotech-empa/cp2k-spm-tools.git
cd cp2k-spm-tools
pip install -e .[dev]

Command Line Tools

The package provides several command-line tools, including:

  • cp2k-stm-sts-wfn: STM/STS analysis from wavefunction files
  • cp2k-cube-from-wfn: Create cube files from wavefunction files
  • cp2k-bader-bond-order: Bond order analysis based on Bader basins

Use --help with each command to see its options.

Example Usage

When everything is set up correctly, the bash scripts in examples/ folder can be executed without any further input and illustrate the usage of the various scripts. For example example/benzene_stm/run_stm_sts_from_wfn.sh evaluates the STM/STS signatures of isolated benzene at each orbital energy (out/orb/) as well as in an arbitrary energy range (out/stm/). The corresponding CP2K calculation is included in the repository.

NB: In all cases, the underlying DFT calculation has to be performed with the diagonalization algorithm rather than orbital transformation (OT).

Python API Example

Most of the functionality of this library is built on top of the possibility to evaluate the Kohn-Sham orbitals encoded in the .wfn file on an arbitrarily defined grid. This is illustrated by the following script applied for a nanographene adsorbed on a Au(111) slab (total of 1252 atoms and 10512 electrons):

from cp2k_spm_tools.cp2k_grid_orbitals import Cp2kGridOrbitals

### Create the gridding object and load the cp2k data ###
cgo = Cp2kGridOrbitals()
cgo.read_cp2k_input("./cp2k.inp")
cgo.read_xyz("./geom.xyz")
cgo.read_basis_functions("./BASIS_MOLOPT")
cgo.load_restart_wfn_file("./PROJ-RESTART.wfn", n_occ=2, n_virt=2)

### Evaluate the orbitals in the specific region ###
cgo.calc_morbs_in_region(
    dr_guess = 0.15,                          # grid spacing
    x_eval_region = None,                     # take whole cell in x
    y_eval_region = [0.0, cgo.cell_ang[1]/2], # half cell in y
    z_eval_region = [19.0, 24.0],             # around the molecule in z
)

cgo.write_cube("./homo.cube", orbital_nr=0)

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

cp2k_spm_tools-1.4.4.tar.gz (63.9 kB view details)

Uploaded Source

Built Distribution

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

cp2k_spm_tools-1.4.4-py3-none-any.whl (76.7 kB view details)

Uploaded Python 3

File details

Details for the file cp2k_spm_tools-1.4.4.tar.gz.

File metadata

  • Download URL: cp2k_spm_tools-1.4.4.tar.gz
  • Upload date:
  • Size: 63.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for cp2k_spm_tools-1.4.4.tar.gz
Algorithm Hash digest
SHA256 8295f56120d57ca16511de99c6714ca1b45b30b008ae0c8ecc32be95ed07904d
MD5 03748b4342ba54becb8e00b672bf2bca
BLAKE2b-256 1927939468a4ad7f1227482bc6112df0a4fae4c91cd32cd5cf6ae804a772ef15

See more details on using hashes here.

File details

Details for the file cp2k_spm_tools-1.4.4-py3-none-any.whl.

File metadata

  • Download URL: cp2k_spm_tools-1.4.4-py3-none-any.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for cp2k_spm_tools-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7888c12cf6f46f1dbc6ddf1076a6fe596cf246cc1d1fbd2fc628dca6f283c44d
MD5 eff47c5977dda45207fd1da980547e09
BLAKE2b-256 6daf8e55027e5e9f7bf2e93b0c7f03712b4cbc22636e136950459284b77ec7f3

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