Example for berry's phase electric field with pw.x

P.U.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2376 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
umari 2005-10-26 14:11:11 +00:00
parent 7fd9356437
commit cb52f273e1
1 changed files with 395 additions and 0 deletions

395
examples/example31/run_example Executable file
View File

@ -0,0 +1,395 @@
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
EXAMPLE_DIR=`pwd`
# check whether echo has the -e option
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
$ECHO
$ECHO "$EXAMPLE_DIR : starting"
$ECHO
$ECHO "This example shows how to use pw.x to perform electronic structure"
$ECHO "calculations in the presence of a finite homgenous electric field "
$ECHO "described through the modern theory of the polarization. The example"
$ECHO "shows how to calculate high-frequency dielectric constant of bulk Silicon"
# set the needed environment variables
. ../environment_variables
# required executables and pseudopotentials
BIN_LIST="pw.x"
PSEUDO_LIST="Si.pbe-rrkj.UPF"
$ECHO
$ECHO " executables directory: $BIN_DIR"
$ECHO " pseudo directory: $PSEUDO_DIR"
$ECHO " temporary directory: $TMP_DIR"
$ECHO " checking that needed directories and files exist...\c"
# check for directories
for DIR in "$BIN_DIR" "$PSEUDO_DIR" ; do
if test ! -d $DIR ; then
$ECHO
$ECHO "ERROR: $DIR not existent or not a directory"
$ECHO "Aborting"
exit 1
fi
done
for DIR in "$TMP_DIR" "$EXAMPLE_DIR/results" ; do
if test ! -d $DIR ; then
mkdir $DIR
fi
done
cd $EXAMPLE_DIR/results
# check for executables
for FILE in $BIN_LIST ; do
if test ! -x $BIN_DIR/$FILE ; then
$ECHO
$ECHO "ERROR: $BIN_DIR/$FILE not existent or not executable"
$ECHO "Aborting"
exit 1
fi
done
# check for pseudopotentials
for FILE in $PSEUDO_LIST ; do
if test ! -r $PSEUDO_DIR/$FILE ; then
$ECHO
$ECHO "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
$ECHO "Aborting"
exit 1
fi
done
$ECHO " done"
# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
$ECHO
$ECHO " running pw.x as: $PW_COMMAND"
$ECHO
# clean TMP_DIR
$ECHO " cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/*
$ECHO " done"
# molecular dynamics calculation
cat > new1.in << EOF
&control
calculation='scf'
restart_mode='from_scratch',
prefix='silicon',
gdir=3,
nppstr=7,
lelfield=.false.,
nberrycyc=1
pseudo_dir='$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 1, celldm(1)=10.18, nat= 8, ntyp= 1,
ecutwfc = 20.0, nosym=.true.
/
&electrons
diagonalization='david',
conv_thr = 1.0d-8,
mixing_beta = 0.5,
startingwfc='random',
efield=0.
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS
Si -0.123 -0.123 -0.123
Si 0.377 0.377 -0.123
Si 0.377 -0.123 0.377
Si -0.123 0.377 0.377
Si 0.123 0.123 0.123
Si 0.623 0.623 0.123
Si 0.623 0.123 0.623
Si 0.123 0.623 0.623
K_POINTS
63
0. 0. 0. 1
0. 0. 0.142857143 1
0. 0. 0.285714286 1
0. 0. 0.428571429 1
0. 0. 0.571428571 1
0. 0. 0.714285714 1
0. 0. 0.857142857 1
0. 0.333333333 0. 1
0. 0.333333333 0.142857143 1
0. 0.333333333 0.285714286 1
0. 0.333333333 0.428571429 1
0. 0.333333333 0.571428571 1
0. 0.333333333 0.714285714 1
0. 0.333333333 0.857142857 1
0. 0.666666667 0. 1
0. 0.666666667 0.142857143 1
0. 0.666666667 0.285714286 1
0. 0.666666667 0.428571429 1
0. 0.666666667 0.571428571 1
0. 0.666666667 0.714285714 1
0. 0.666666667 0.857142857 1
0.333333333 0. 0. 1
0.333333333 0. 0.142857143 1
0.333333333 0. 0.285714286 1
0.333333333 0. 0.428571429 1
0.333333333 0. 0.571428571 1
0.333333333 0. 0.714285714 1
0.333333333 0. 0.857142857 1
0.333333333 0.333333333 0. 1
0.333333333 0.333333333 0.142857143 1
0.333333333 0.333333333 0.285714286 1
0.333333333 0.333333333 0.428571429 1
0.333333333 0.333333333 0.571428571 1
0.333333333 0.333333333 0.714285714 1
0.333333333 0.333333333 0.857142857 1
0.333333333 0.666666667 0. 1
0.333333333 0.666666667 0.142857143 1
0.333333333 0.666666667 0.285714286 1
0.333333333 0.666666667 0.428571429 1
0.333333333 0.666666667 0.571428571 1
0.333333333 0.666666667 0.714285714 1
0.333333333 0.666666667 0.857142857 1
0.666666667 0. 0. 1
0.666666667 0. 0.142857143 1
0.666666667 0. 0.285714286 1
0.666666667 0. 0.428571429 1
0.666666667 0. 0.571428571 1
0.666666667 0. 0.714285714 1
0.666666667 0. 0.857142857 1
0.666666667 0.333333333 0. 1
0.666666667 0.333333333 0.142857143 1
0.666666667 0.333333333 0.285714286 1
0.666666667 0.333333333 0.428571429 1
0.666666667 0.333333333 0.571428571 1
0.666666667 0.333333333 0.714285714 1
0.666666667 0.333333333 0.857142857 1
0.666666667 0.666666667 0. 1
0.666666667 0.666666667 0.142857143 1
0.666666667 0.666666667 0.285714286 1
0.666666667 0.666666667 0.428571429 1
0.666666667 0.666666667 0.571428571 1
0.666666667 0.666666667 0.714285714 1
0.666666667 0.666666667 0.857142857 1
EOF
$ECHO " running the PW calculation for bulk Si no electric field ...\c"
$PW_COMMAND < new1.in > new1.out
$ECHO " done"
cat > new2.in << EOF
&control
calculation='scf'
restart_mode='restart',
prefix='silicon',
gdir=3,
nppstr=7,
lelfield=.true.,
nberrycyc=1
pseudo_dir='$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 1, celldm(1)=10.18, nat= 8, ntyp= 1,
ecutwfc = 20.0, nosym=.true.
/
&electrons
diagonalization='david',
conv_thr = 1.0d-8,
mixing_beta = 0.5,
startingwfc='random',
efield=0.
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS
Si -0.123 -0.123 -0.123
Si 0.377 0.377 -0.123
Si 0.377 -0.123 0.377
Si -0.123 0.377 0.377
Si 0.123 0.123 0.123
Si 0.623 0.623 0.123
Si 0.623 0.123 0.623
Si 0.123 0.623 0.623
K_POINTS
63
0. 0. 0. 1
0. 0. 0.142857143 1
0. 0. 0.285714286 1
0. 0. 0.428571429 1
0. 0. 0.571428571 1
0. 0. 0.714285714 1
0. 0. 0.857142857 1
0. 0.333333333 0. 1
0. 0.333333333 0.142857143 1
0. 0.333333333 0.285714286 1
0. 0.333333333 0.428571429 1
0. 0.333333333 0.571428571 1
0. 0.333333333 0.714285714 1
0. 0.333333333 0.857142857 1
0. 0.666666667 0. 1
0. 0.666666667 0.142857143 1
0. 0.666666667 0.285714286 1
0. 0.666666667 0.428571429 1
0. 0.666666667 0.571428571 1
0. 0.666666667 0.714285714 1
0. 0.666666667 0.857142857 1
0.333333333 0. 0. 1
0.333333333 0. 0.142857143 1
0.333333333 0. 0.285714286 1
0.333333333 0. 0.428571429 1
0.333333333 0. 0.571428571 1
0.333333333 0. 0.714285714 1
0.333333333 0. 0.857142857 1
0.333333333 0.333333333 0. 1
0.333333333 0.333333333 0.142857143 1
0.333333333 0.333333333 0.285714286 1
0.333333333 0.333333333 0.428571429 1
0.333333333 0.333333333 0.571428571 1
0.333333333 0.333333333 0.714285714 1
0.333333333 0.333333333 0.857142857 1
0.333333333 0.666666667 0. 1
0.333333333 0.666666667 0.142857143 1
0.333333333 0.666666667 0.285714286 1
0.333333333 0.666666667 0.428571429 1
0.333333333 0.666666667 0.571428571 1
0.333333333 0.666666667 0.714285714 1
0.333333333 0.666666667 0.857142857 1
0.666666667 0. 0. 1
0.666666667 0. 0.142857143 1
0.666666667 0. 0.285714286 1
0.666666667 0. 0.428571429 1
0.666666667 0. 0.571428571 1
0.666666667 0. 0.714285714 1
0.666666667 0. 0.857142857 1
0.666666667 0.333333333 0. 1
0.666666667 0.333333333 0.142857143 1
0.666666667 0.333333333 0.285714286 1
0.666666667 0.333333333 0.428571429 1
0.666666667 0.333333333 0.571428571 1
0.666666667 0.333333333 0.714285714 1
0.666666667 0.333333333 0.857142857 1
0.666666667 0.666666667 0. 1
0.666666667 0.666666667 0.142857143 1
0.666666667 0.666666667 0.285714286 1
0.666666667 0.666666667 0.428571429 1
0.666666667 0.666666667 0.571428571 1
0.666666667 0.666666667 0.714285714 1
0.666666667 0.666666667 0.857142857 1
EOF
$ECHO " running the PW calculation for bulk Si E_field=0.0 a.u. ...\c"
$PW_COMMAND < new2.in > new2.out
$ECHO " done"
cat > new3.in << EOF
&control
calculation='scf'
restart_mode='restart',
prefix='silicon',
gdir=3,
nppstr=7,
lelfield=.true.,
nberrycyc=3
pseudo_dir='$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 1, celldm(1)=10.18, nat= 8, ntyp= 1,
ecutwfc = 20.0, nosym=.true.
/
&electrons
diagonalization='david',
conv_thr = 1.0d-8,
mixing_beta = 0.5,
startingwfc='random',
efield=0.001
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-rrkj.UPF
ATOMIC_POSITIONS
Si -0.123 -0.123 -0.123
Si 0.377 0.377 -0.123
Si 0.377 -0.123 0.377
Si -0.123 0.377 0.377
Si 0.123 0.123 0.123
Si 0.623 0.623 0.123
Si 0.623 0.123 0.623
Si 0.123 0.623 0.623
K_POINTS
63
0. 0. 0. 1
0. 0. 0.142857143 1
0. 0. 0.285714286 1
0. 0. 0.428571429 1
0. 0. 0.571428571 1
0. 0. 0.714285714 1
0. 0. 0.857142857 1
0. 0.333333333 0. 1
0. 0.333333333 0.142857143 1
0. 0.333333333 0.285714286 1
0. 0.333333333 0.428571429 1
0. 0.333333333 0.571428571 1
0. 0.333333333 0.714285714 1
0. 0.333333333 0.857142857 1
0. 0.666666667 0. 1
0. 0.666666667 0.142857143 1
0. 0.666666667 0.285714286 1
0. 0.666666667 0.428571429 1
0. 0.666666667 0.571428571 1
0. 0.666666667 0.714285714 1
0. 0.666666667 0.857142857 1
0.333333333 0. 0. 1
0.333333333 0. 0.142857143 1
0.333333333 0. 0.285714286 1
0.333333333 0. 0.428571429 1
0.333333333 0. 0.571428571 1
0.333333333 0. 0.714285714 1
0.333333333 0. 0.857142857 1
0.333333333 0.333333333 0. 1
0.333333333 0.333333333 0.142857143 1
0.333333333 0.333333333 0.285714286 1
0.333333333 0.333333333 0.428571429 1
0.333333333 0.333333333 0.571428571 1
0.333333333 0.333333333 0.714285714 1
0.333333333 0.333333333 0.857142857 1
0.333333333 0.666666667 0. 1
0.333333333 0.666666667 0.142857143 1
0.333333333 0.666666667 0.285714286 1
0.333333333 0.666666667 0.428571429 1
0.333333333 0.666666667 0.571428571 1
0.333333333 0.666666667 0.714285714 1
0.333333333 0.666666667 0.857142857 1
0.666666667 0. 0. 1
0.666666667 0. 0.142857143 1
0.666666667 0. 0.285714286 1
0.666666667 0. 0.428571429 1
0.666666667 0. 0.571428571 1
0.666666667 0. 0.714285714 1
0.666666667 0. 0.857142857 1
0.666666667 0.333333333 0. 1
0.666666667 0.333333333 0.142857143 1
0.666666667 0.333333333 0.285714286 1
0.666666667 0.333333333 0.428571429 1
0.666666667 0.333333333 0.571428571 1
0.666666667 0.333333333 0.714285714 1
0.666666667 0.333333333 0.857142857 1
0.666666667 0.666666667 0. 1
0.666666667 0.666666667 0.142857143 1
0.666666667 0.666666667 0.285714286 1
0.666666667 0.666666667 0.428571429 1
0.666666667 0.666666667 0.571428571 1
0.666666667 0.666666667 0.714285714 1
0.666666667 0.666666667 0.857142857 1
EOF
$ECHO " running the PW calculation for bulk Si E_field=0.001 a.u. ...\c"
$PW_COMMAND < new3.in > new3.out
$ECHO " done"
$ECHO
$ECHO "$EXAMPLE_DIR : done"