[Wien] case.in1c missing for a centrosymmetric case doing U+SO
Peter Blaha
pblaha at theochem.tuwien.ac.at
Fri Apr 24 09:10:26 CEST 2020
Just beware of the typos in this summary. Don't use copy/paste (and
neglect the corresponding error messages).
See also my comments and recommendations.
I also include an updated init_orb_lapw, which fixes the bug for
MULT>1, so that editing of indm and inorb files is no longer necessary.
> I summarize correct steps for future readers:
>
> initialize spin-polarized case
# in most cases it would be highly recommended to create first a proper
# case.inst file using: instgen_lapw -ask
# define magnetic and non-magnetic atoms and desired AFM order)
> init_orb_lapw -orb (remove extra equivalent atoms in files)
# editing not necessary with updated init_orb_lapw
> init_so_lapw (polarized: yes / use new struct. either yes and no)
# always use: yes except you chose a wrong direction, ...
> copy case.indm to case.indmc
# this should have been created automatically (if you said "yes" in
# init_so_lapw). However, editing is necessary if the number of atoms
# has been changed during init_so. Therefore I recommend to reorder
# the commands:
init_so_lapw (polarized: yes / use new struct: yes)
init_orb_lapw -orb (-c) # see: init_orb -h
> runsp_lapw -org -so (-p)
# remember: the recommendation is to do this in steps in order to get
# more likely the groundstate for correlated compounds and usually you
# also want to see anyway what is the effect of SO and of U as compared
# to a plain PBE calculation
runsp_lapw (-p)
save_lapw PBE_no_so
runsp_lapw -so (-p)
save_lapw PBE_so
runsp_lapw -orb -so (-p)
save_lapw PBE_U_so
> create case.klist_band
> lapw1 -up -band (-p)
> lapw1 -dn -band (-p)
> lapso -up -orb (-p) # lapwso
> insert Ef in case.inso # case.insp
> spaghetti -up -so # (-p)
# and don't forget the "x " in front of those steps
--
Peter Blaha
Inst.Materials Chemistry
TU Vienna
Getreidemarkt 9
A-1060 Vienna
Austria
+43-1-5880115671
-------------- next part --------------
#!/bin/tcsh -f
# WLdH
# Initialization of a Bext + LDAU/EECE calculation
set file = `pwd`
set file = $file:t #tail of file-names
unset help
unset orb
unset eece
unset none
unset c
unset cx
unset force
unset b
set bu
set set_edit
set bext
set run
set cx = ""
set Nbarg=$#argv
echo ""
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> arguments
while ($#argv)
switch ($1)
case -[H|h]:
set help ;
shift; breaksw
case -orb:
set orb ;
shift; breaksw
case -eece:
set eece ;
shift; breaksw
case -b:
set b ; set bu="_U"
shift; breaksw
case -c:
set c ;
shift; breaksw
case -f:
set force ;
shift; breaksw
default:
echo "ERROR: option $1 does not exist" ;
set none;
shift; breaksw
endsw
end
if ($?help) goto help
if (! -e $file.struct) touch $file.struct
set cmplx1=`cut -b -6 $file.struct |awk 'BEGIN{c="c"};{if ($0 == "-1 0 0") {getline; {if ($0 == " 0-1 0"){getline; {if ($0 == " 0 0-1"){c= ""}}}}}};END{print c}'`
if !($?c) then
if("$cmplx1" == c ) set c
endif
if ($?c) then
set cx = "c"
else
set cx = ""
endif
if ( ($?none) || ($Nbarg == 0)) then
if ($Nbarg == 0) echo "An option is required."
goto help
exit(3)
else
if ($?eece) then
if($?b) set opt="-eeceext"
set opt_ini="-eece"
else if ($?orb) then
if($?b) set opt="-orbext"
set opt_ini="-orb"
else
echo "-orb or -eece options are necessary."
goto help
exit(3)
endif
goto set_edit
endif
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> Editor
set_edit:
if($?EDITOR) then
if ("$EDITOR" == vi ) then
alias editor 'xterm -e vi'
else
alias editor '$EDITOR'
endif
else
alias editor emacs
endif
goto indm
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> case.indm
indm:
echo ""
if( -e $file.indm$cx && ! $?force ) then
echo "$file.indm$cx already present, use -f to overwrite"
goto help
else
echo " You have the following atoms:"
# set index=`grep X= $file.struct|cut -c5-8|sed -e s/-//`
set atoms=`grep RMT $file.struct|cut -c1-5`
set nat=$#atoms
set nat_check=`head -2 $file.struct | tail -1 | cut -c28-30`
if($nat != $nat_check) then
echo "ERROR: number of atoms not consistent from RMT-lins and NAT: $nat $nat_check"
exit 9
endif
set i=1
while ($i <= $nat)
echo "$i : $atoms[$i]"
@ i ++
end
set atomlist=()
set l_list=()
set u_list=()
set j_list=()
atomselect:
if ($?orb) then
echo -n "Enter the name, l, U(Ry) and J of the Atoms (eg. Fe 2 0.3 0.0; exit with RETURN):"
set atomselect = ($<)
if("$#atomselect" == "0") goto indm1
if($#atomselect != 4) then
echo "You need to specify 4 values"
goto atomselect
endif
else
echo -n "Enter the name and l of the Atoms (eg. Fe 2; exit with RETURN):"
set atomselect = ($<)
if("$#atomselect" == "0") goto indm1
if($#atomselect != 2) then
echo "You need to specify 2 values"
goto atomselect
endif
endif
set i=1
while ($i <= $nat)
# foreach i ($index)
set atomtest=`echo $atoms[$i]|cut -c1-2`
if("$atomtest" == "$atomselect[1]") then
set atomlist=($atomlist $i)
set l_list=($l_list $atomselect[2])
if ($?orb) then
set u_list=($u_list $atomselect[3])
set j_list=($j_list $atomselect[4])
endif
endif
@ i ++
end
goto atomselect
indm1:
# write case.indm -----------------
echo "-12.0 Emin cutoff" >$file.indm$cx
echo "$#atomlist number of atoms">>$file.indm$cx
set i=1
while($i <= $#atomlist)
echo "$atomlist[$i] 1 $l_list[$i] index of atom, number of l, l">>$file.indm$cx
@ i++
end
echo " 0 0 r-index,(l,s) index">>$file.indm$cx
# --------------------------------
echo "Edit the $file.indm$cx file..."
sleep 2
# cp $WIENROOT/SRC_templates/case.indm $file.indm$cx
editor $file.indm$cx
echo "$file.indm$cx created."
endif
goto bext
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> case.inorb_Bext (Magnetic Field)
bext:
if( $?b ) then
echo ""
echo "Set the magnetic field."
if(-e $file.inorb_Bext && ! $?force ) then
echo "$file.inorb_Bext already present, use -f to overwrite."
else
set hkl = ` echo "0 0 1"`
echo "---->Please select the direction of the magnetic field ( h k l ) "
echo -n " (For R-lattice in R coordinates)(default $hkl): "
set hkl = ($<)
set CHhkl = `echo "$hkl nu"`
if ( $CHhkl[1] == "nu" ) set hkl = ` echo "0 0 1"`
set Bmag = ` echo 1`
echo "---->Please select the external magnetic field in T (default $Bmag)"
set Bmag=($<)
set dBmag = `echo "$Bmag nu"`
if ( $dBmag[1] == "nu" ) set Bmag = ` echo 1`
echo ""
echo "Edit the $file.inorb_Bext file..."
sleep 2
echo "3 $#atomlist 0 nmod, natorb, ipr" > $file.inorb_Bext
echo "PRATT 1.0 BROYD/PRATT, mixing" >> $file.inorb_Bext
set i=1
while($i <= $#atomlist)
echo "$atomlist[$i] 1 $l_list[$i] index of atom, number of l, l">>$file.inorb_Bext
@ i++
end
# echo "1 1 2 iatom nlorb lorb" >> $file.inorb_Bext
# echo "2 1 2 iatom nlorb lorb" >> $file.inorb_Bext
echo "$Bmag Bext in T" >> $file.inorb_Bext
echo "$hkl direction of Bext in terms of lattice vectors" >> $file.inorb_Bext
editor $file.inorb_Bext
echo "$file.inorb_Bext created."
endif
endif
if ($?eece) goto eece
if ($?orb) goto orb
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> case.inorb_U (LDAU/OP correction)
orb:
echo ""
echo "Set the LDAU/OP correction."
if(-e $file.inorb$bu && ! $?force ) then
echo "$file.inorb$bu already present, use -f to overwrite."
else
# write case.inorb -----------------
echo " 1 $#atomlist 0 nmod, natorb, ipt" >$file.inorb$bu
echo "PRATT 1.0 ">>$file.inorb$bu
set i=1
while($i <= $#atomlist)
echo "$atomlist[$i] 1 $l_list[$i] index of atom, number of l, l">>$file.inorb$bu
@ i++
end
echo " 1 nsic 0..AMF, 1..SIC, 2..HFM">>$file.inorb$bu
set i=1
while($i <= $#atomlist)
echo " $u_list[$i] $j_list[$i] U J (Ry)">>$file.inorb$bu
@ i++
end
# --------------------------------
echo "Edit the $file.inorb$bu file..."
sleep 2
# cp $WIENROOT/SRC_templates/case.inorb $file.inorb$bu
editor $file.inorb$bu
echo "$file.inorb$bu created."
endif
goto run
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> case.ineece (EECE/HYBR correction)
eece:
echo ""
echo "Set the EECE/HYBR correction."
if (-e $file.ineece && ! $?force ) then
echo "$file.ineece already present, use -f to overwrite."
else
# write case.ineece -----------------
echo "-12.0 $#atomlist Emin natom" >$file.ineece
set i=1
while($i <= $#atomlist)
echo "$atomlist[$i] 1 $l_list[$i] index of atom, number of l, l">>$file.ineece
@ i++
end
echo "HYBR HYBR / EECE">>$file.ineece
echo "0.25 amount of exact exchange">>$file.ineece
# --------------------------------
echo "Edit the $file.ineece file..."
sleep 2
# cp $WIENROOT/SRC_templates/case.ineece $file.ineece
editor $file.ineece
echo "$file.ineece created."
endif
goto run
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> running help
run:
if( $?b ) then
cat <<EOF
You have selected an additional magnetic field.
Now, run the calculation including $opt instead of $opt_ini
ex : runsp_lapw $opt ...
EOF
else
cat <<EOF
Now, run the calculation including $opt_ini
ex : runsp_lapw $opt_ini ...
EOF
endif
exit(3)
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# >> help
help:
cat <<EOF
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
USAGE: init_borb_lapw [-orb -eece -b -f -c]
PURPOSE: Initialization of Bext + LDAU / OP / EECE / HYBR
calculation
The case.inorb_Bext is automatically created, containing
the Bext contribution (UG 7.4)
OPTIONS:
-orb -> creates the case.inorb_U file needed fot the LDAU or OP
correction (UG 7.4)
-eece -> generates the case.ineece file for on-site exact-exchange
or hybrid functional calculation (UG 4.5.7)
-b -> add an additional magnetic field
-c -> Complex indm file (usually detected automatically, but
necessary for SO calculations and inversion)
-f -> force overwriting of existing files
EOF
More information about the Wien
mailing list