Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...





nebmake.pl POSCAR_polar POSCAR_anti-polar 10 ISYM = 0
NSW = 0
ISTART = 0
SYSTEM = AlN
PREC = Accurate
LCALCPOL = .TRUE.
DIPOL = 0.5 0.5 0.5
LORBIT = 10
ADDGRID = .TRUE.
IBRION = -1
ISMEAR = 0
LWAVE = .TRUE.
SIGMA = 0.01
ALGO = Normalconda create --name my_pymatgen python
source activate my_pymatgen # OSX or Linux
activate my_pymatgen # Windowsfrom pymatgen.core.structure import Structure
from pymatgen.analysis.ferroelectricity.polarization import Polarization, calc_ionic, zval_dict_from_potcar, get_total_ionic_dipole
from pymatgen.io.vasp.inputs import Poscar, Potcar
from pymatgen.io.vasp.outputs import Outcar
num_structs = 10
poscars = [Structure.from_file("POSCAR-" + str(i)) for i in range(num_structs)]
outcars = [Outcar("OUTCAR-" + str(i)) for i in range(num_structs)]
potcar=Potcar.from_file("POTCAR")
for i in range(num_structs):
outcars[i].zval_dict = zval_dict_from_potcar(potcar)
pol_from_out_struct_method = Polarization.from_outcars_and_structures(outcars,poscars,
calc_ionic_from_zval = True)
print(pol_from_out_struct_method.get_same_branch_polarization_data(convert_to_muC_per_cm2=True))
~
A guide to modeling charge transport properties and thermoelectric performance
This tutorial is based on VASP 5.4.4 and the VTST package developed and maintained by the Henkelman research group at UT Austin
This simplified tutorial use the Kestrel (HPC@NREL) as an example
















import numpy as np
from fdint import *k = 1.38E-23 # Boltzmann's constant
e = 1.602E-19 # Charge
me = 9.109E-31 # Free electron mass
h = 6.626E-34 # Planck's constant# Electrical conductivity
def Sigma_SPB(mu_w, eta, T, r):
return 8. * np.pi * e / 3 / h**3 * (2*me*k*T)**(3./2) * mu_w * (r+3./2) * fdk(k=r+1./2, phi=eta)
# Seebeck coefficient
def Seebeck_SPB(eta, r):
return k/e * (-eta + (r+5./2)*fdk(k=r+3./2, phi=eta)/(r+3./2)/fdk(k=r+1./2, phi=eta))
# Lorenz number
def Lorenz_SPB(eta, r):
return (k/e)**2 * ( (r+7./2)*fdk(k=r+5./2, phi=eta)/(r+3./2)/fdk(k=r+1./2, phi=eta) - ( (r+5./2)*fdk(k=r+3./2, phi=eta)/(r+3./2)/fdk(k=r+1./2, phi=eta) )**2 )# Electronic thermal conductivity
def Kappa_e_SPB(mu_w, eta, T, r):
return Lorenz(eta, r) * sigma(mu_w, eta, T, r) * Ttemperature = 300 # Temperature (K)
kappa_L = 1 # Lattice thermal conductivity (W/mK)
band_mass = 0.5*me # Effective electron mass (kg)
NV = 1 # Valley degeneracy
r = -1/2 # Scattering parameter (assumes acoustic phonon scattering)
tau0 = 1e-13 # Scattering prefactor (s)# Electrical conductivity within the two-band model
def Sigma_TwoBand(mu_w_maj, mu_w_min, eta_maj, eta_min, T, r):
sigma_maj = Sigma_SPB(mu_w_maj, eta_maj, T, r)
sigma_min = Sigma_SPB(mu_w_min, eta_min, T, r)
sigma_total = sigma_maj + sigma_min
return sigma_total# Seebeck coefficient within the two-band model
# NOTE: Assumes n-type material (electrons = majority)
def Seebeck_TwoBand(mu_w_maj, mu_w_min, eta_maj, eta_min, T, r):
sigma_maj = Sigma_SPB(mu_w_maj, eta_maj, T, r)
sigma_min = Sigma_SPB(mu_w_min, eta_min, T, r)
Seebeck_maj = Seebeck_SPB(eta_maj, r)
Seebeck_min = Seebeck_SPB(eta_min, r)
sigma_total = sigma_maj + sigma_min
Seebeck_total = (-sigma_maj*Seebeck_maj + sigma_min*Seebeck_min) / sigma_total
return Seebeck_totaldef Kappa_e_TwoBand(mu_w_maj, mu_w_min, eta_maj, eta_min, T, r):
sigma_maj = Sigma_SPB(mu_w_maj, eta_maj, T, r)
sigma_min = Sigma_SPB(mu_w_min, eta_min, T, r)
Seebeck_maj = Seebeck_SPB(eta_maj, r)
Seebeck_min = Seebeck_SPB(eta_min, r)
Lorenz_maj = Lorenz_SPB(eta_maj, r)
Lorenz_min = Lorenz_SPB(eta_min, r)
sigma_ratio = sigma_maj / sigma_min
sigma_total = sigma_maj + sigma_min
Seebeck_total = (-sigma_maj*Seebeck_maj + sigma_min*Seebeck_min) / sigma_total
kappa_e_total = (Lorenz_maj*sigma_maj + Lorenz_min*sigma_min)*T + sigma_total*T*(Seebeck_maj**2/(1.+1./sigma_ratio) + Seebeck_min**2/(1.+sigma_ratio) - Seebeck_total**2)
return kappa_e_totaltemperature = 300 # Temperature (K)
kappa_L = 1 # Lattice thermal conductivity (W/mK)
r = -1/2 # Scattering parameter (assumes acoustic phonon scattering)
Eg = 0.4 # Band gap (eV)
band_mass_e = 0.5*me # Effective electron mass (kg)
band_mass_h = 0.5*me # Effective hole mass (kg)
tau0_e = 1e-13 # Scattering prefactor for electrons (s)
tau0_h = 1e-13 # Scattering prefactor for holes (s)
NV_e = 1 # Valley degeneracy for electrons
NV_h = 1 # Valley degeneracy for holes1) gcc/8.4.0 2) comp-intel/2020.1.217 3) intel-mpi/2020.1.217
4) fftw/3.3.8/intel-impi 5) mkl/2020.1.217CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
LATT_CUR%A,LATT_CUR%B,IO%IU6)CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
TSIF,LATT_CUR%A,LAT T_CUR%B,IO%IU6)patch -p0 < vasp-5.4.4-mpmd.patchbbm.F, bfgs.F, chain.F, dynamic.F, fire.F, lanczos.F, neb.F, qm.F,
cg.F, dimer.F, dynmat.F, instanton.F, lbfgs.F, opt.F, sd.F. ....
hamil_rot.o \
bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \
fire.o lanczos.o neb.o qm.o opt.o \
chain.o \
dyna.o \
....nebmake.pl POSCAR_i POSCAR_f 5ISIF = 3 (need for SS-NEB; ISF=2 for NEB)
NELMIN = 5 (avoid ionic stpes with only two electronic scf steps)
ICHAIN =0 (for VTST package, this is the flag for NEB)
IMAGES = 5 (the number of intermediate images, end images not included)
SPRINGS = -5 (Spring constant for the elastic band. -5 generally works well)
LCLIMB = .FALSE. (FALSE is default value. Only turn on this flag when there is a clear maximum)
IOPT = 3 (3 for SS-NEB; 3→ 2 → 1 for CI-NEB)
IBRION = 3 (required for VTST)
POTIM = 0 (required for VTST)
LNEBCELL = .TRUE. (True for SS-NEB; otherwise normal NEB)for i in `seq -w 1 13`; do mv $i/CONTCAR $i/POSCAR;donenebbarrier.pl (create neb.dat file which has the information on relative energy, distance between image and forces along the bands)
nebspline.pl (forced based cubic spline interpolation for the MEP)from pylada.crystal import read,write,neighbors
import numpy as np
def myneighbors(strc=None, howmany=12, pos=None, tol=0.2):
"""
A function that replaces the original pylada
neighbors function that seems to be broken.
It still uses the original one, just makes sure
the output is correct. Also, it returns only the
first coordination shell.
The tolerance is in fraction of the distance to
the closest atom and is 20% by default (test first)
"""
nghs=[]
# Loop ove pylada neighbors (arbitrary small tolerance)
for ng in neighbors(strc,howmany,pos,0.1):
# If empty just add ng and the first one should have the shortest distance
if len(nghs)==0:
nghs.append(ng)
continue
# Make sure the distance is within the tolerance
elif nghs[0][-1]<=ng[-1]<=(1.+tol)*nghs[0][-1]:
nghs.append(ng)
return nghs
'''
This script assumes that it is the cations that are moving during polarization switching
'''
# Anion list; make sure all the anions in the dataset are added
anions = ['N','O','S','Se']
# read polar structure
strc = read.poscar('POSCAR_p')
# find polar direction
### first find all the cation-to-anion vectors
vectot = []
for atom in strc:
if atom.type not in anions:
nghs = myneighbors(strc,4,atom.pos,0.2) # based on our knowledge for wurtzite-like structure
for ngh in nghs:
vectot.append(ngh[1])
### The average should reveal the polar direction for wurtzite-like structure
tmp_dir = np.average(vectot,axis=0)
### Get rid of noise
polar_dir = np.round(tmp_dir/max(tmp_dir,key=abs),0)
#print(polar_dir)
shifts=[]
# find distance from the hexagonal plane along polar direction
for atom in strc:
if atom.type not in anions: # only look at cations
nghs = myneighbors(strc,4,atom.pos,0.2)
vecs = []
for ngh in nghs:
if np.linalg.norm(ngh[1]*polar_dir/np.linalg.norm(ngh[1])) < 0.9: # i.e. not in polarization direction, only the neighbors in the polar direction can get large number
vecs.append(ngh[1])
assert len(vecs) == 3, "The code only works for wurtzite like structure" # assert function to catch unexpected situtations
shifts.append(np.average(vecs,axis=0)) # the average of distance vectors from anion to cation in non-polar direction gives the distance from cation to hexagonal plane
shift = np.average(shifts,axis=0) # get the average value out of all the cations
for atom in strc:
if atom.type not in anions: # only move the cations
atom.pos = atom.pos + shift*2.0 # factor of 2.0 is to get to antipolar structure; factor of 1.0 is roughly hexagonal structure
with open("POSCAR_a", "w") as file: write.poscar(strc, file, vasp5=True)// Some codenebmake.pl (provided within the VTST package) can be used to do the linear interpolationADDGRID = .TRUE.
ISPIN = 2 # depends on the system of interest
ISTART = 1
ICHARG = 0
ISYM = 0
LMAXMIX = 4
LVHAR = .FALSE.
LORBIT = 10
LWAVE = .TRUE.
LCHARG = .TRUE.
LVTOT = .FALSE.
LPEAD = .FALSE.
LPLANE = .TRUE.
NELMIN = 5
NPAR = 3 # depends on the total number of requested cores and number of images
NELECT = 288.0 # for a supercell with charged defects
ALGO = Normal
EDIFF = 1e-06
EDIFFG = -0.01
ENCUT = 340.0
PREC = Accurate
NSW = 10 # small number since we want to restart the calculations to have updated FFT grid
IBRION = 3
ISIF = 3
ISMEAR = 0
SIGMA = 0.01
POTIM = 0
ICHAIN = 0
IOPT = 3
SPRING = -5 #default value generally works fine
LCLIMB = .FALSE.
LNEBCELL = .TRUE. # True is for SS-NEB; False is for NEB
IMAGES = 36 # number of intermediate images"custom_chain_SSNEB.py" is the name of the workflow above 865 ## Last yield should be an extraction object.
866 #if not program.success:
867 # raise RuntimeError("Vasp failed to execute correctly.")
868 #return program directories = [outdir] directories = [outdir, outdir+'/01/']
######################################
class SSNEB_Chain(object):
# Defining the folder tree structure
def __init__(self, no_iterations=10, no_images=24):
self.no_iterations = no_iterations
self.fnames = ['iter_%s'%(x+1) for x in range(no_iterations)]
self.no_images = no_images
# Defining the Extraction object
def Extract(self, jobdir):
'''
The success condition for the ss-neb calculation is based on all images
for each image, success = True when a VASP run is finished properly (with the timing information shown at the end of OUTCAR)
'''
from pylada.vasp import MassExtract, Extract
extract = MassExtract(jobdir)
#extract = Extract(jobdir)
success={}
from glob import iglob
if self.no_images > 99: digit = '/???'
else: digit = '/??'
for image in iglob(jobdir+digit):
success[image]=Extract(image).success
#for name in self.fnames:
# success[name]=Extract(jobdir+'/'+name).success
success=all(success.values())
#success = all(extract.success.values())
extract.success=success
return extract
def __call__(self, structure, outdir=None, vasp=None, **kwargs ):
from copy import deepcopy
from os import getcwd
import os
from os.path import exists
from os.path import join
from pylada.misc import RelativePath
from pylada.error import ExternalRunFailed
from pylada.vasp.extract import Extract, MassExtract
from pylada.vasp import Vasp
from pylada.vasp.relax import Relax
# make this function stateless.
structure_ = structure.copy()
outdir = getcwd() if outdir is None else RelativePath(outdir).path
############## NEB Loop ########################
for name in self.fnames:
#print("Stage of "+name)
iternum = int(name.split('_')[-1])
fulldir = join(outdir, name)
# create the folder if it does not exist
if not os.path.exists(fulldir):
os.makedirs(fulldir)
# check if the given iteration finished
if exists(fulldir+'/progress.dat'): continue
# restart from unfinished calculations;
# make sure it is not a empty CONTCAR before mv CONTCAR POSCAR
if exists(outdir+'/01/CONTCAR') and os.path.getsize(outdir+'/01/CONTCAR') > 0:
for i in range(1,self.no_images+1):
num = '%02d'%(i)
os.system('mv %s %s'%(outdir+'/'+num+'/CONTCAR',outdir+'/'+num+'/POSCAR'))
## functional
neb = Vasp(copy=vasp)
neb.add_keyword('IMAGES', self.no_images)
if iternum > 1:
neb.istart = 1 # use previous step's WF; but get new FFT grid
neb.icharg = 0
params = deepcopy(kwargs)
## if this calculation has not been done, run it
output = neb(structure_, outdir=outdir, **params)
#print(name+" finished")
# run nebefs.pl and record volume, energy, force, and stress
os.chdir(outdir)
os.system('/home/clee2/software/vtstscripts-967/nebefs.pl > %s'%(fulldir+'/progress.dat'))
os.system('cp stdout %s'%(fulldir+'/stdout'))
#os.chdir('-')
# move the CONTCAR to POSCAR and cp the new POSCAR to fulldir,i.e., the progress folders
for i in range(1,self.no_images+1):
num = '%02d'%(i)
os.system('mv %s %s'%(outdir+'/'+num+'/CONTCAR',outdir+'/'+num+'/POSCAR'))
os.system('cp %s %s'%(outdir+'/'+num+'/POSCAR',fulldir+'/POSCAR_'+num))
if os.system('grep "reached required accuracy" %s'%(outdir+'/stdout')) == 0:
break
else:
# remove the OUTCAR in 01/ such that extract.success remains False before SS-NEB converges
os.system('/home/clee2/software/vtstscripts-967/nebbarrier.pl')
os.system('rm %s'%(outdir+'/01/OUTCAR'))
#if not output.success:
# raise ExternalRunFailed(name+" calculation did not succeed.")
#########################
return self.Extract(outdir)from pylada.crystal import read
from pylada.vasp.specie import U
from copy import deepcopy
from glob import iglob
import sys
from custom_chain_SSNEB import SSNEB_Chain
######################################
from pylada.vasp import Vasp
vasp=Vasp()
vasp.program = '/home/clee2/software/vasp.5.4.4_VTST/bin/vasp_std'
vasp.prec = "accurate"
vasp.ediff = 1.0e-6 # total, not per atom
vasp.ediffg = -1.0e-2
vasp.encut = 340.0
vasp.lplane = True
vasp.addgrid = True
vasp.npar = 4
vasp.ismear = 0
vasp.sigma = 0.01
vasp.isym = 0
vasp.kpoints = "\n0\nAuto\n20"
vasp.lorbit = 10
vasp.lcharg = True
vasp.lwave = True
vasp.lmaxmix = 4
vasp.lpead = False
vasp.algo = "Normal"
### Key SS-NEB parameters defined here
vasp.ibrion = 3 # needed for VTST
vasp.nelmin = 5
vasp.isif = 3 # for ss-neb;
vasp.nsw = 10 # small number like 10 to have frequent restart and updated Fourier grid
vasp.add_keyword('POTIM', 0) # needed for VTST
vasp.add_keyword('ICHAIN', 0)
vasp.add_keyword('IOPT', 3)
vasp.add_keyword('SPRING',-5)
vasp.add_keyword('LCLIMB',False)
vasp.add_keyword('LNEBCELL',True)
pseudoDir = '~/software/pseudos'
vasp.add_specie = "Ag", pseudoDir + "/Ag", U("dudarev", "d", 5.0)
vasp.add_specie = "Al", pseudoDir + "/Al"
vasp.add_specie = "As", pseudoDir + "/As"
vasp.add_specie = "Au", pseudoDir + "/Au", U("dudarev", "d", 3.0)
vasp.add_specie = "B", pseudoDir + "/B"
vasp.add_specie = "Ba", pseudoDir + "/Ba"
vasp.add_specie = "Be", pseudoDir + "/Be"
vasp.add_specie = "Bi", pseudoDir + "/Bi"
vasp.add_specie = "Br", pseudoDir + "/Br"
vasp.add_specie = "C", pseudoDir + "/C"
vasp.add_specie = "Ca", pseudoDir + "/Ca"
vasp.add_specie = "Cd", pseudoDir + "/Cd"
vasp.add_specie = "Cl", pseudoDir + "/Cl"
vasp.add_specie = "Co", pseudoDir + "/Co", U("dudarev", "d", 3.0)
vasp.add_specie = "Cr", pseudoDir + "/Cr", U("dudarev", "d", 3.0)
vasp.add_specie = "Cs", pseudoDir + "/Cs"
vasp.add_specie = "Cu", pseudoDir + "/Cu", U("dudarev", "d" , 5.0)
vasp.add_specie = "F", pseudoDir + "/F"
vasp.add_specie = "Fe", pseudoDir + "/Fe", U("dudarev", "d", 3.0)
vasp.add_specie = "Ga", pseudoDir + "/Ga"
vasp.add_specie = "Ge", pseudoDir + "/Ge"
vasp.add_specie = "H", pseudoDir + "/H"
vasp.add_specie = "Hf", pseudoDir + "/Hf", U("dudarev", "d", 3.0)
vasp.add_specie = "Hg", pseudoDir + "/Hg"
vasp.add_specie = "I", pseudoDir + "/I"
vasp.add_specie = "In", pseudoDir + "/In"
vasp.add_specie = "Ir", pseudoDir + "/Ir", U("dudarev", "d", 3.0)
vasp.add_specie = "K", pseudoDir + "/K"
vasp.add_specie = "La", pseudoDir + "/La", U("dudarev", "d", 3.0)
vasp.add_specie = "Li", pseudoDir + "/Li"
vasp.add_specie = "Mg", pseudoDir + "/Mg"
vasp.add_specie = "Mn", pseudoDir + "/Mn", U("dudarev", "d", 3.0)
vasp.add_specie = "Mo", pseudoDir + "/Mo", U("dudarev", "d", 3.0)
vasp.add_specie = "N", pseudoDir + "/N"
vasp.add_specie = "Na", pseudoDir + "/Na"
vasp.add_specie = "Nb", pseudoDir + "/Nb", U("dudarev", "d", 3.0)
vasp.add_specie = "Ni", pseudoDir + "/Ni", U("dudarev", "d", 3.0)
vasp.add_specie = "O", pseudoDir + "/O"
vasp.add_specie = "P", pseudoDir + "/P"
vasp.add_specie = "Pb", pseudoDir + "/Pb"
vasp.add_specie = "Pd", pseudoDir + "/Pd", U("dudarev", "d", 3.0)
vasp.add_specie = "Pt", pseudoDir + "/Pt", U("dudarev", "d", 3.0)
vasp.add_specie = "Rb", pseudoDir + "/Rb"
vasp.add_specie = "Rh", pseudoDir + "/Rh", U("dudarev", "d", 3.0)
vasp.add_specie = "Ru", pseudoDir + "/Ru", U("dudarev", "d", 3.0)
vasp.add_specie = "S", pseudoDir + "/S"
vasp.add_specie = "Sb", pseudoDir + "/Sb"
vasp.add_specie = "Sc", pseudoDir + "/Sc", U("dudarev", "d", 3.0)
vasp.add_specie = "Se", pseudoDir + "/Se"
vasp.add_specie = "Si", pseudoDir + "/Si"
vasp.add_specie = "Sn", pseudoDir + "/Sn"
vasp.add_specie = "Sr", pseudoDir + "/Sr"
vasp.add_specie = "Ta", pseudoDir + "/Ta", U("dudarev", "d", 3.0)
vasp.add_specie = "Tl", pseudoDir + "/Tl"
vasp.add_specie = "Te", pseudoDir + "/Te"
vasp.add_specie = "Ti", pseudoDir + "/Ti", U("dudarev", "d", 3.0)
vasp.add_specie = "V", pseudoDir + "/V", U("dudarev", "d", 3.0)
vasp.add_specie = "W", pseudoDir + "/W", U("dudarev", "d", 3.0)
vasp.add_specie = "Y", pseudoDir + "/Y", U("dudarev", "d", 3.0)
vasp.add_specie = "Zn", pseudoDir + "/Zn"
vasp.add_specie = "Zr", pseudoDir + "/Zr", U("dudarev", "d", 3.0)
vasp.add_specie = "Gd", pseudoDir + "/Gd_3"
structures = {}
# to have name and structure (one of the end image)
for names in iglob('end_images/AlHfN_p083_random*/'):
strc = read.poscar(names+'POSCAR_p/CONTCAR') # e.g. pick the polar one for ferroelectric switching
name = names.replace('end_images/','SS-NEB_alloy/')
structures[name] = strc
#-------- setting up the jobfolder -----
from IPython.core.interactiveshell import InteractiveShell
from pylada.jobfolder import JobFolder
from pylada import interactive
from copy import deepcopy
jobfolder = JobFolder()
numI=39
for name, structure in structures.items():
job = jobfolder / name
job.functional = SSNEB_Chain(no_iterations=50,no_images=numI)
job.params["structure"] = structure # use the polar structure to have POTCAR
job.params['vasp'] = vasp
interactive.jobfolder = jobfolder
%savefolders ht_ssneb_alloy_AlHfN_p083.pkl
%explore ht_ssneb_alloy_AlHfN_p083.pklimport numpy as np
import os
from pylada.crystal import read
from glob import iglob
from pylada.vasp import Extract
# loop through all compounds
# choose an integer number for the number of intermediate images,
numI = 39 #
enforce = False # determine whether to create new POSCARs and overwrite existing poscars
# get current working directory
pathcwd = os.getcwd()
for names in iglob(pathcwd+'/end_images/AlHfN_p083_random*/'):
strc_p = names+'POSCAR_p/CONTCAR'
strc_a = names+'POSCAR_a/CONTCAR'
if Extract(names+'POSCAR_p/').success == True and Extract(names+'POSCAR_a/').success == True:
print('Relaxation of '+names+' finished')
strc = read.poscar(strc_p)
name = names.replace('/end_images/','/SS-NEB_alloy/')
if not os.path.exists(name):
os.makedirs(name)
print("Create new folder "+name)
os.chdir(name)
os.system('/home/clee2/software/vtstscripts-967/nebmake.pl %s %s %s'%(strc_p,strc_a,numI)) # 0.5 is that half of the atoms is cation ;
os.chdir(pathcwd)
elif enforce == True:
os.chdir(name)
os.system('/home/clee2/software/vtstscripts-967/nebmake.pl %s %s %s'%(strc_p,strc_a,numI))
os.chdir(pathcwd)
# copy OUTCAR to first and last folder
first = name+'00/'
last = name+ "%02d/" % (int(numI+1))
os.system('cp %s %s'%(names+'POSCAR_p/OUTCAR',first))
os.system('cp %s %s'%(names+'POSCAR_a/OUTCAR',last))
ssh -AY [user name]@hpcsh.nrel.govssh [user name]@kl2.hpc.nrel.govsource /nopt/nrel/apps/env.sh
module purge
module load anaconda3/2022.05
module load PrgEnv-intel/8.5.0
module swap cray-mpich cray-mpich-abi
module unload cray-libsci
module load intel-oneapi-compilers/2023.2.0
module load intel-oneapi-mpi/2021.10.0-intel
module load intel-oneapi-mkl/2023.2.0-intelconda create -n [name] python=3.9conda activate [name]module load gitpip install git+https://github.com/pylada/pylada-light~/.ipython/profile_default/ipython_config.py c = get_config()
c.InteractiveShellApp.extensions = [ "pylada.ipython" ]~/.pylada
vasp_has_nlep = False
################## QDEL definition ################
mpirun_exe = "srun --mpi=pmi2 -n {n} {program}" # Kestrel requires --mpi=pmi2 for vasp
qdel_exe = "scancel"
qsub_exe = "sbatch"
################### QSTAT definition ##############
def ipython_qstat(self, arg):
""" Prints jobs of current user. """
from subprocess import Popen, PIPE
from IPython.utils.text import SList
# get user jobs ids
jobs = Popen(['squeue', '-u', '[user name]','--format','%.18i %.9P %j %.8u %.2t %.10M %.6D %R'], stdout=PIPE, encoding='utf-8').communicate()[0].split('\n')
names = [lines.strip().split()[2] for lines in jobs[1:-1]]
mpps = [lines.strip().split()[0] for lines in jobs[1:-1]]
states = [lines.strip().split()[4] for lines in jobs[1:-1]]
ids = [lines.strip().split()[0] for lines in jobs[1:-1]]
return SList([ "{0:>10} {1:>4} {2:>3} -- {3}".format(id, mpp, state, name) \
for id, mpp, state, name in zip(ids, mpps, states, names)])
## return SList([ "{0}".format(name) \
## for id, mpp, state, name in zip(ids, mpps, states, names)])
##################### PBSSCRIPT #####################
pbs_string = '''#!/bin/bash -x
#SBATCH --account={account}
#SBATCH --nodes={nnodes}
#SBATCH --ntasks-per-node={ppn}
#SBATCH --export=ALL
#SBATCH --time={walltime}
#SBATCH --job-name={name}
###SBATCH --mem=176G. # uncomment to requrest specific memory (usually not needed)
#SBATCH --partition={queue}
####SBATCH --qos=high # uncommented if high qos is needed (usually not needed)
###SBATCH -o out
###SBATCH -e err
# Go to the directoy from which our job was launched
cd {directory}
# Make sure the library are loaded properly for vasp
source /nopt/nrel/apps/env.sh
module purge
module load anaconda3/2022.05
module load PrgEnv-intel/8.5.0
module swap cray-mpich cray-mpich-abi
module unload cray-libsci
module load intel-oneapi-compilers/2023.2.0
module load intel-oneapi-mkl/2023.2.0
module load intel-oneapi-mpi/2021.10.0-intel
source activate [path to virtual environment]
export OMP_NUM_THREADS=1 #turns off multithreading, needed for VASP
{header}
python {scriptcommand}
{footer}
'''
tar -zxvf atat3_36.tar.gzcd atatmake make installecho $?3.1284 0.0000 0.0000
-1.5642 2.7093 0.0000
0.0000 0.0000 5.0153
1 0 0
0 1 0
0 0 1
0.667 0.333 0.500 Al=0.08333333,Gd=0.91666667
0.333 0.667 0.000 Al=0.08333333,Gd=0.91666667
0.667 0.333 0.881 N
0.333 0.667 0.381 N4.983 0.000000 0.000000
0.000000 4.983 0.000000
0.000000 0.000000 4.983
0.000000 0.500000 0.500000
0.500000 0.000000 0.500000
0.500000 0.500000 0.000000
0.500000 0.500000 0.500000 N
0.000000 0.000000 0.000000 Al=0.08333333,Gd=0.91666667corrdump -l=lat.in -ro -noe -nop -clus -2=4.5 -3=3.2; getclusmcsqs -l=lat.in -n=48#!/bin/bash
#SBATCH --job-name="wz SQS Al=0.25,Sc=0.08333333,Gd=0.66666667"
#SBATCH --account=multiferro
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=104
#SBATCH --time=04:00:00
#SBATCH -o stdout
#SBATCH -e stderr
#SBATCH -p short
# Go to the directoy from which the job was launched
cd $SLURM_SUBMIT_DIR
for i in {1..104}
do
seed=$RANDOM
mcsqs -l=lat.in -n=48 -ip=$i -sd=$seed &
echo $i, $seed >> seed_record
done
waitmcsqs -l=lat.in -rc1
3 0 0
0 3 0
0 0 2# 48-atom
Correlations_mismatch= 0.055556 -0.027778 -0.027778 -0.027778 -0.027778 -0.027778 0.004630 0.004630 -0.078704 -0.078704 0.087963 0.087963
# 72-atom
Correlations_mismatch= 0.027778 -0.027778 0.027778 -0.027778 -0.027778 0.027778 0.032407 0.032407 0.032407 0.032407 0.032407 0.032407
# 96-atom
Correlations_mismatch= 0.013889 -0.027778 0.013889 -0.027778 -0.027778 0.013889 0.004630 0.004630 0.004630 0.004630 0.004630 0.004630
