The approach uses additional tool developled in Henkelman group.
Download binary 'bader' for Bader analysis and put it to ~/tools/ folder on your cluster.
In [1]:
#Usual preamble
from siman import header
from siman.header import db
from siman.SSHTools import SSHTools
from siman.calc_manage import add_loop, res_loop
from siman.set_functions import read_vasp_sets
from siman.database import read_database, write_database
from siman.analysis import calc_oxidation_states
read_database()
header.PATH2PROJECT = 'topologic' # path to project relative to your home folder on cluster
header.PATH2POTENTIALS = '/home/aksenov/scientific_projects/PAW_PBE_VASP' #path to VASP POTENTIALS
header.varset['static'].potdir = {83:'Bi_pv', 34:'Se'} #subfolders with required potentials
header.ssh_object = SSHTools()
header.ssh_object.setup(user="aksenov",host="10.30.16.62",pkey="/home/aksenov/.ssh/id_rsa")
In [5]:
#Creating new set 'bader' with parameters for Bader charges calculation
bader_pack = {'PREC':'Accurate', 'ADDGRID':'.TRUE.', 'EDIFF':1e-08,
'LAECHG':'.TRUE.', 'NELM':100, 'NSW':0, 'ICHARG':1, 'savefile' : 'acox'}
read_vasp_sets([('bader', 'static', bader_pack, 'override')]) #new set 'bader' from 'static'
Out[5]:
In [7]:
add_loop('Bi2Se3', 'bader', 1, input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR', run = 1) # Submitting VASP job
Out[7]:
In [10]:
res_loop('Bi2Se3', 'bader', 1) #reading results after the job is finished
write_database() # writing database
In [2]:
header.warnings = 'yY'
# Calculate Bader charges on cluster
db['Bi2Se3', 'bader', 1].get_bader_ACF()
Out[2]:
In [3]:
print(db['Bi2Se3', 'bader', 1].charges) # print calculated Bader charges
In [4]:
#Calculate oxidation states
calc_oxidation_states( db['Bi2Se3', 'bader', 1] )