In [5]:
from siman import header
from siman.header import db
from siman.SSHTools import SSHTools
from siman.calc_manage import add, res
from siman.database import write_database, read_database
from siman.set_functions import read_vasp_sets
from siman.calc_manage import smart_structure_read
%matplotlib inline
read_database() # read saved database if available
Out[5]:
Configuration of siman package for each project can be provided in project_conf.py file, wich should be located in your project working directory. The example of this file can be found here. For global configuration put project_conf.py into your home directory (~) and rename to simanrc.py.
Pay attention that project_conf.py has higher priority and will overwrite specified parameters from simanrc.py Eventually all configuration parameters are available under the siman.header modul
In [8]:
#for the moment we need to provide path to VASP potentials
header.PATH2POTENTIALS = '/hdd/home/aksenov/scientific_projects/PAW_PBE_VASP' #path to VASP POTENTIALS
#and tell siman about remote cluster used for calculations
user = "d.aksenov"
host = "10.30.16.168"
header.CLUSTERS['1'] = {
'address':user+'@'+host, # this is used for ssh, make sure you have created passwordless [setup](https://www.thegeekdiary.com/centos-rhel-how-to-setup-passwordless-ssh-login/)
'vasp_com':'mpirun vasp_std', # command on your cluster to run VASP
'homepath':'/home/'+user, # your home folder on cluster
'schedule':'SLURM', # job scheduler on your cluster; other options: 'PBS', 'SGE', 'none' (no scheduler)
'walltime':'72:00:00', # time required for job
'corenum':16, # number of cores required for job
'modules':'module load Compiler/Intel/17u8; module load Q-Ch/VASP/5.4.4_OPT; module load ScriptLang/python/3.6i_2018u3; \nulimit -s unlimited\n',
}
#Instead of passwordless setup or for Windows you can use ssh_object (paramiko module is used):
header.ssh_object = SSHTools()
header.ssh_object.setup(user=user, host=host, pkey="/home/aksenov/.ssh/id_rsa")
In [6]:
header.varset['static'].printme()
In [10]:
st = smart_structure_read(input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR')
add('Bi2Se3', 'static', 1, input_st = st, it_folder = 'Bi2Se3', run = 0)
Out[10]:
Use run=1 to run your job
In [11]:
res('Bi2Se3', 'static', 1, check_job = 0)
Out[11]:
In [10]:
st = smart_structure_read(input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR')
add('Bi2Se3', 'static', 1, input_st = st, it_folder = 'Bi2Se3',
calc_method = 'uniform_scale', scale_region = (-5, 5), run = 1) # it_folder is a name of directory for this calculation
Out[10]:
In [15]:
res('Bi2Se3.su', 'static', list(range(1,8))+[100], up = 'up', show = 'fit', analys_type = 'fit_a', check_job = 0)
Out[15]:
In [ ]:
read_vasp_sets([('ion_relax', 'static', {'ISIF':2, 'NSW':20, 'EDIFFG':-0.025}, 'override')]) #new set 'ion_relax' from 'static' with 'NSW' = 20
print('NSW = ', header.varset['ion_relax'].vasp_params['NSW'])
In [ ]:
add('Bi2Se3', 'ion_relax', 1, input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR', run = 1) # no need
In [ ]:
res('Bi2Se3', 'ion_relax', 1)
print('Relaxation energy = {:.6} meV'.format(1000*(db['Bi2Se3','ion_relax', 1].energy_sigma0 - db['Bi2Se3', 'static', 1].energy_sigma0)))
In [12]:
Bi2Se3 = db['Bi2Se3.static.1'] # structure from database
Bi2Se3.run('ion_relax', run = 1)
#you can also use the command below, but it is deprecated
# add('Bi2Se3.su', 'ion_relax', 100, inherit_option = 'full', run = 0, override = 1)
# res('Bi2Se3.su.if', ['ion_relax'], [100], show = 'fo' )
Out[12]:
In [ ]:
#To read results run again
Bi2Se3.run('ion_relax')
In [ ]:
# you may need to recalculate your job, for this use
Bi2Se3.run('ion_relax', up = 'up2', add = 1)
In [ ]:
#several inherit options are available with iopt keyword:
#full - full inherit including magnetic moments
#full_nomag - inherit structure, but magnetic moments are initialized with default values for chosen set
#full_chg - inherit charge file
Bi2Se3.run('ion_relax', iopt = 'full')
#By default iopt = 'full_nomag'
In [ ]:
add('Bi2Se3.su', 'static', 100, inherit_option = 'supercell', run = 0, mul_matrix = [[2,0,0],[0,2,0],[0,0,2]])
In [ ]:
#or step by step
Bi2Se3 = db['Bi2Se3.static.1']
mul_matrix = [[2,0,0],[0,2,0],[0,0,2]]
sc = create_supercell(Bi2Se3, mul_matrix)
add('Bi2Se3.sc', 'static', 1, input_st = sc, it_folder = 'Bi2Se3', run = 0)
In [8]:
write_database()
In [ ]: