Code Monkey home page Code Monkey logo

cubestm's Introduction

Introduction

CubeSTM is a tool to simulate STM images from .cube files.

Assuming constant density of states (DOS) at the tip and constant potential barrier height, the tunneling current is proportional to:

$$I \propto e^{-\alpha z}\int_{0}^{eV}\rho(r,E)dE,$$

where $\alpha$ is an intrinsic parameter related to the mass of the electron $m$ and the barrier height $\phi$: $\alpha = \frac{2\sqrt{2m\phi}}{\hbar}$.

The output STM .cube file from DFT tools such as FHI-aims contains the volumetric data of the integrated local electron density from the Fermi level to the applied voltage, e.g.

$$V(r)=\int_{0}^{eV}\rho(r,E)dE.$$

So by accounting for the exponential factor, we are able to simulate the tunneling current from the .cube volumetric data.

The magnitude of the tunneling current in CubeSTM is calculated in the following way:

$$I = \sum_{z}\sum_{xy}\exp(-\alpha_z * d_z)\exp(-\alpha_{xy} * d_{xy})V(r),$$

where the summation over $z$ runs over all voxels below a user input height, and the summation over $xy$ runs over all voxels within a user input neighbourhood. $d_z$ is the distance in z direction from the current point to the user input height:

$$d_z = r_z - z,$$

$d_{xy}$ is the distance in the x-y plane from the current point to the scanned point:

$$d_{xy} = \vec{r_{xy}} - \vec{xy}.$$

The decaying parameter $\alpha_z$ and $\alpha_{xy}$ are controlled separately by user input parameter z_decay and xy_decay. The stronger the decaying parameter, the less contribution from voxels far away from the current scanning point. As a result, a large xy_decay gives similar results as a small neighbourhood.

Last but not least, in order to show the electron clouds far away from the atoms, a logrithm normalization scheme is recommended. This is control by the cnorm parameter in the function. It can be cnorm = 'normal' to visualize the localized electron clouds, or cnorm = 'log' to visualize the overall electron clouds which resembles the experimental STM image.

Before running CubeSTM, please make sure:

  1. The x and y lattice vectors of the volumetric data in .cube file is the same as the original atomic structure.

    This is to make sure the atoms and the supercell are plotted correctly. The program still generates a plot if the lattice vectors do not match, but the supercell will not look good.

  2. The lattice vectors should be of the form:

    $$\begin{bmatrix} x_1 & x_2 & 0 \\ y_1 & y_2 & 0 \\ 0 & 0 & z_3 \end{bmatrix}.$$

Usage

The execution of CubeSTM is straightforward:

  1. Import the class
from cubestm import CubeSTM
  1. Read files and create instance
cube_path = './data/cube_001_stm_01.cube'
geo_path = './data/geometry.in'
instance = CubeSTM(cube_path, geo_path)
  1. Make the plot
instance.plot(show_atoms=['C','N'],
              z_decay=1.6,
              neighbourhood=4,
              xy_decay=1.5,
              vmin=1e-4,
              vmax=0.4,
              inset_size=0.45,
              atoms_size=1.2,
              atoms_edge=1.5)

Note that there are no required parameters for the functions plot() and plot_cell(). However, by tunning the parameters one can create an image close to the experimental one.

cubestm's People

Contributors

haoran-ni avatar

Stargazers

BPY avatar  avatar Zefeng Cai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.