Creating Inputs - Probe-Particle/PPSTM GitHub Wiki
On this page:
Important note:
If you work with the flexible-tip=PP-AFM adjust the geometry into the necessary box for the force-field calculations. Don't forget to put the top-most atoms above ''0.0'', but lower part of the box in the z direction as well as leave enough place for the vacuum in-between (the periodic images of) slabs, so the electrostatics of the image slab above does not affect the Probe Particle (artificial flexible-tip) relaxation above the calculated structure.
DFT instructions:
For the best efficiency prepare your system with your top-most atoms as first, if possible! This is the opposite ASE.build convention; look for an example python script how to change the ASE atoms order. At the moment the PP-STM code can read inputs from following DFT codes:
Fireball
Official version of FireballTG can write out input files now. The important key-word in the OUTPUT section is iwrtcdcoefs = -2
. How to convert the ASE format/input files into the geometry bas input file is shown here.
McWEDA:
Input files can computed with McWEDA functional as well as with computing XC on a grid. Cluster systems as well as systems with Periodic Boundary Conditions (PBC) can be computed.
A fireball.in
file for calculations with McWEDA:
&OPTION
basisfile = 'answer.bas'
lvsfile = 'input.lvs'
kptpreference = 'input.kpts' ! only gamma point-calculations work at the moment
nstepf = 1
icluster = 0 ! 0 for PBC / 1 for cluster calculation
itdse = 0
iqout = 1
ifixcharge = 1 ! 0 if you don't have pre-calculated atomic charges in CHARGES
iquench = -1
&END
&OUTPUT
iwrtcdcoefs = -2 ! print the important files
&END
Kohn-Sham
A fireball.in
file for calculations with XC on a grid computations:
&OPTION
basisfile = 'answer.bas'
lvsfile = 'input.lvs'
kptpreference = 'samplek.kpts'
nstepf = 1
icluster = 0 ! 0 for PBC / 1 for cluster calculation
itdse = 0
iqout = 1
ifixcharge = 0
dt = 0.5
iquench = -1
iks = 1
imcweda = 0
idogs = 0
bmix = 0.05
&END
&OUTPUT
iwrtcdcoefs = -2
&END
In case of PBC calculations phik_0001_s.dat
, phik_0001_py.dat
, ... files are produced by the Fireball. In case of cluster calculations phik_s.dat
, phik_py.dat
, ... are outputs of the Fireball calculations. They serve as inputs for the PP-STM calculations. Inside they look like:
38 280 -5.37896401 Number of atoms Number of states (Molecular orbitals) The Fermi Level
-27.58251 -0.00004 0.00000 -0.00006 0.00000 0.00002 0.00000 ... Eigen-energy of the 1st state Real & Imaginary part for the LCAO coeficient for 1st state 1st atom for (s, py ... depending on the name of file) etc.
-27.58139 0.02716 0.00000 0.04766 0.00000 0.00660 0.00000 ... eigen-energy of the 2nd state Real & Imaginary part for the LCAO coeficient for 2nd state 1st atom for (s, py ... depending on the name of file) etc.
...
FHI-aims
Works for PBC calculations serial or parallel (mpi.scalapack) version. Ideally with the final geometry run a single point calculation with the following outputs added to your control.in
:
output eigenvectors
output band 0 0 0 0.5 0.5 0.0 2 G K
KS_method lapack_fast # for mpi-version (mpi.scalapack): The error message with HDF5 is not true in the aims output; use this keywords instead of recompilation #
See the CuPc example
In the case of hybrid functionals (B3LYP, PBE0, HSE) add also:
exx_band_structure_version 1 ## for hybrid functionals only; both options 1 and 2 are working (1 takes more memory) ##
into your `control.in` file.
The calculations produces: KS_eigenvectors.band_1.kpt_1.out
for spin-restricted calculations or KS_eigenvectors_dn.band_1.kpt_1.out
& KS_eigenvectors_up.band_1.kpt_1.out
in the case of spin-polarized calculations.
You will also need geometry.in
in the same directory. All of these files are supposed to be easily read by the PPSTM_simple.py script or within GUI.py.
Note: Under normal conditions, please use PBC calculations, Just adjust the geometry.in
with a suitable ''lattice_vector''s (for small molecules ''30.0 30.0 30.0'' box is enough). There is a possibility to run strict cluster calculations, but additional parsing through Mathematica scripts (and some additional outputs) have to be used for creating PP-STM inputs.
CP2K
into your input file YOUR_INPUT_FILE.inp
into FORCE_EVAL → DFT → PRINT section add:
&MO ON
EIGVECS
CARTESIAN
FILENAME cartesian-mos
&EACH
QS_SCF 0
&END EACH
&END MO
Examples of input (and output) files can be found in the code in examples/4N-coronene/CuPc/ and TOAT/ .
Note 1: Recently small post-processing of the output files could be needed. We tried to repair this, but was not tried for some time. Let us know if you run into problems .
Note 2: CP2K reading procedure was mainly written by Ole Schütt, those days working at EMPA, Switzerland.
Personal Warning: CP2K manual is very outdated and really bad/not all explaining on many places. I had went through many instability issues, during my computations. On the other hand, CP2K community is pretty big, so consider to register to their google group to get help (especially with the newer versions).
GPAW
Even though the GPAW is mainly used for representing the wave-function on a grid it can work in LCAO mode as well. For the purpose of making inputs for the PP-STM calculations the LCAO mode is necessary. Both - default or double-zeta (basis='dzp'; for more information look at the GPAW web page ) - basis sets can be used. The PP-STM code reads the stored *.gpw
binary produced by the GPAW calculations. GPAW is normally operated through python scripts. Here is an example of some GPAW script for the calculations of the input:
from ase import *
from ase.visualize import *
from ase.io import*
from gpaw import *
import numpy as npy
mol = read('input.xyz') # xyz geometry of the sample
cell = npy.loadtxt('input.lvs') # cell in which a sample is
mol.set_cell(cell)
mol.set_pbc(False) # cluster calculation, but PBC can be used as well: mol.set_pbc(True)
mol.center()
xc='LDA' # other XC like PBE, RPBE, PW91, BLYP can be used, too.
calc = GPAW(txt='out_LCAO.txt',xc=xc,mode='lcao',basis='dzp')
mol.set_calculator(calc)
en = mol.get_potential_energy()
print (en)
calc.write('out_LCAO_'+xc+'.gpw',mode='all') # saves the calculation into binary 'out_LCAO_LDA.gpw' file
The results of the GPAW calculations is stored in binary file out_LCAO_LDA.gpw
.
Warning: GPAW has not been used for some time, so please test on some small example. Also beware the d orbitals do not work properly and Hydrogen atoms has to be put as the last (from the considered layers) in the geometry input, before the electronic structure calculations!
ASE useful scripts:
ASE re-ordering:
ASE as well as GPAW is a library for python, that can create inputs for geometries for almost all DFT codes (except for Fireball, but xyz to bas is explained bellow). ASE can be operated on a python command line or python scrips. Here is an example of a script, that can be used for changing the order of atoms.
from ase import atoms
from ase.io import read, write
import numpy as np
atoms=read('YOUR_INPUT_FILE') # reads the input file and creates the atoms object out of it. #
New_atoms = atoms[np.argsort(-1*atoms.positions[:, 2])] # reorders to New_atoms by /z/ (highest the first) #
write('YOUR_OUTPUT_FILE',New_atoms) # Writes the re-ordered geometry into a file (xyz/geometry.in/traj ...)#
ASE save as bas file:
A script how to change a file, that is ASE readable to a Fireball bas format.
from ase import *
from ase.io import *
import numpy as np
slab = read('YOUR_INPUT_FILE')
at_nos = slab.get_global_number_of_atoms()
n_at = slab.get_number_of_atoms()
f=open('input.bas','w')
print (n_at, file=f)
X = np.zeros((n_at,4))
X[:,0] = at_nos
X[:,1:4] = slab.get_positions()
np.savetxt(f,X,fmt='%02d %10.5f %10.5f %10.5f')
f.close()