Header Ads Widget

Ab initio Calculations Using Wien2k Code

Last Posts

10/recent/ticker-posts

How to calculate the Spontaneous Polarization (Tutorial 1) using script (Under test)

 Spontaneous Polarization in BaTiO3

BaTiO3 is a ferroelectric material that exhibits a spontaneous polarization. For the calculation of spontaneous polarization of BaTiO3 two reference structures have been chosen. One is tetragonal non-centrosymmetric (lambda1), where the atoms are displaced from their equilibrium centrosymmetric positions in Z direction, and another structure is a centrosymmetric structure (lambda0).

 

We need 2 struct files and the script

lambda0.struct

lambda1.struct

Script Spontaneous-polarization.sh

#!/bin/bash

# Developped by Dr Abderrahmane Reggad
# Inspired from the script of Anton Bokhanchuk


clear

echo "Running Spontaneous Polarization"

# We begin with the low symmetry structure lambda1 (non-centrosymmetric)
mkdir lambda1
cp lambda1.struct lambda1/lambda1.struct
cd lambda1

# Initialize calculation
init_lapw -b -rkmax 4 -vxc 13 -ecut -6 -numk 230

# Run_lapw
run_lapw

# Run BerryPI
# Here we use the same k-mesh density as in the SCF calculation

berrypi -k6:6:6 > ../lambda1.out
tail -n 38 ../lambda1.out > ../summary1.pol


# We are still in the lambda1 directory

# Next we proceed with the case lambda0 (centrosymmetric)
mkdir ../lambda0

# Copy all files from lambda1 to lambda0 directory
cp * ../lambda0

# Change the current directory to lambda0
cd ../lambda0

# Remove the lambda1.struct file
rm lambda1.struct

# Copy
cp ../lambda0.struct lambda0.struct

# Rename all lambda1.* files to lambda0.* files
rename_files lambda1 lambda0


# At this point we intentionally avoid full initialization using init_lapw... to prevent
# Wien2k from realizing the full symmetry of the centrosymmetric structure
# Restore original k-mesh taking into account the symmetry with 230 k-points (shifted)

echo -e "230\n1\n" | x kgen

# Initialize the electron density for the new structure
x dstart

# Perform standard SCF calculation
run_lapw

# Run BerryPI

berrypi -k6:6:6 > ../lambda0.out
tail -n 38 ../lambda0.out > ../summary0.pol

cd ..

# Calculation of the Spontaneous polarization in the z direction
head -n 12 summary0.pol > summary00.pol
sed 's/\[//g; s/\]//g' summary00.pol > summary0.pol

head -n 12 summary1.pol > summary11.pol
sed 's/\[//g; s/\]//g' summary11.pol > summary1.pol

rm summary00.pol summary11.pol

p0z=$(grep TOTAL summary0.pol |awk '{print $7}')

echo " "
echo "Total polarization of lambda0 structure in z direction"
echo "$p0z"

echo " "
p1z=$(grep TOTAL summary1.pol |awk '{print $7}')
echo "Total polarization of lambda1 structure in z direction"
echo "$p1z"

echo " "
echo "Spontaneous polarization in z direction"
gnuplot -e "print $p1z-$p0z"
echo ""

 

Calculation

/wien2k-tutorials> mkdir BaTiO3
/wien2k-tutorials> cd BaTiO3
/wien2k-tutorials/BaTiO3> ls
lambda0.struct lambda1.struct Spontaneous-Polarization.sh

/BaTiO3> chmod +x Spontaneous-Polarization.sh
/BaTiO3> source Spontaneous-Polarization.sh
Total polarization of lambda0 structure in z direction
1.357662e-11

Total polarization of lambda1 structure in z direction
3.042756e-01

Spontaneous polarization in z direction
0.304275599986423

 

we will get 2 output files named summary0.pol and summary1.pol for lambda0 and lambda1 structures.

The content of  of the summary1.pol file is as follows:

SUMMARY OF POLARIZATION CALCULATION
=======================================================================================
Value | spin | dir(1) | dir(2) | dir(3)
---------------------------------------------------------------------------------------
Electronic polarization (C/m2) sp(1) [-8.724663e-12, -6.436757e-13, 4.803326e-01]
Ionic polarization (C/m2) sp(1) [ 1.365657e-11, 1.365657e-11, -1.760570e-01]
Tot. spin polariz.=Pion+Pel (C/m2) sp(1) [ 4.931907e-12, 1.301289e-11, 3.042756e-01]
---------------------------------------------------------------------------------------
TOTAL POLARIZATION (C/m2) both [ 4.931907e-12, 1.301289e-11, 3.042756e-01]
=======================================================================================

 

The content of  of the summary0.pol file is as follows:

SUMMARY OF POLARIZATION CALCULATION
=======================================================================================
Value | spin | dir(1) | dir(2) | dir(3)
---------------------------------------------------------------------------------------
Electronic polarization (C/m2) sp(1) [ 2.545874e-14, -1.091688e-13, -2.235612e-13]
Ionic polarization (C/m2) sp(1) [ 1.365657e-11, 1.365657e-11, 1.380018e-11]
Tot. spin polariz.=Pion+Pel (C/m2) sp(1) [ 1.368203e-11, 1.354740e-11, 1.357662e-11]
---------------------------------------------------------------------------------------
TOTAL POLARIZATION (C/m2) both [ 1.368203e-11, 1.354740e-11, 1.357662e-11]
=======================================================================================

 

References:

 https://github.com/spichardo/BerryPI/wiki/Tutorial-1:-Spontaneous-Polarization-in-BaTiO3

http://www.wien2k.at/reg_user/textbooks/WIEN2k_lecture-notes_2013/BerryPI-tutorial-1-Spontaneous%20polarization%20in%20BaTiO3.pdf 

 

 

 

 

 

 

Post a Comment

1 Comments