[Wien] Constrained LDA calculations to find effective U

Gavin Abo gsabo at crimson.ua.edu
Fri Jun 17 08:24:02 CEST 2016


The calculation in 
http://www.wien2k.at/reg_user/textbooks/Constraint_U.pdf is from an 
older version of WIEN2k. So it probably cannot be reproduced exactly 
with the latest WIEN2k version (14.2), but you should be able to get a 
result close to it.

Try the attached script that gave me 0.441 Ry with WIEN2k 14.2, which is 
quite close to the 0.438 Ry.

At least on my system, the entire calculation ran from the beginning to 
the end by executing the script in a terminal using:

username at computername:~/wiendata$ mv NiO.sh.txt NiO.sh
username at computername:~/wiendata$ dos2unix NiO.sh
username at computername:~/wiendata$ chmod 777 NiO.sh
username at computername:~/wiendata$ ./NiO.sh
...
in  1 files:
NiO.scf::FER  : F E R M I - ENERGY(GAUSS-.M.)=   0.4780996800
NiO.scf::3DD001: 3D*                  0.109629972 Ry
NiO.scf::3D 001: 3D                   0.126221709 Ry
in  1 files:
NiO.scf::FER  : F E R M I - ENERGY(GAUSS-.M.)=   0.5181842639
NiO.scf::3DD001: 3D*                 -0.292400769 Ry
NiO.scf::3D 001: 3D                  -0.274004694 Ry
F_eff = 
(4*0.109629972+5*0.126221709)/9-(4*-0.292400769+5*-0.274004694)/9-0.4780996800+0.5181842639

F_eff = .4411129148 Ry

If you open the attached file in a text editor (e.g., gedit NiO.sh), you 
can see that it contains mostly just a list of WIEN2k and Linux commands 
that could be entered into a terminal.

On 6/16/2016 6:40 AM, SOHAN LAL wrote:
> Respected Dr. P. Blaha,
>
>            Thank you for your reply.  I tried to reproduce the 
> effective U for NiO according to the procedure given in the textbook 
> section of wien2k.at <http://wien2k.at>. I computed the value of 
> U=0.09 Ry, which is much less than as mentioned in notes where U=0.438 
> Ry. I think some mistake may be done in modifying the various files 
> like in1, in2 and inc etc. I have attached the separate file 
> containing these modified files and the procedure to calculate U. 
> Please shed a light on this. I shall be thankful to you for your kindness.
> Thanks & Regards
> Sohan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20160617/ee6966ee/attachment-0001.html>
-------------- next part --------------
#!/bin/bash

# Makes directory NiO and changes into NiO directory
mkdir NiO
cd NiO

# Creates the NiO.struct from Constraint_U.pdf
cat << EOF > NiO.struct
NiO                                                                            
F   LATTICE,NONEQUIV.ATOMS:  2                                                 
MODE OF CALC=RELA unit=bohr                                                    
  7.927000  7.927000  7.927000 90.000000 90.000000 90.000000                   
ATOM   1: X=0.00000000 Y=0.00000000 Z=0.00000000
          MULT= 1          ISPLIT= 2
Ni         NPT=  781  R0=0.00005000 RMT=    2.3000   Z: 28.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM   2: X=0.50000000 Y=0.00000000 Z=0.00000000
          MULT= 1          ISPLIT= 2
O          NPT=  781  R0=0.00010000 RMT=    1.6500   Z:  8.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
   0      NUMBER OF SYMMETRY OPERATIONS
EOF

# Input to generate 2x2x2 supercell using "x supercell"
cat << EOF > supercell_input
NiO.struct
2
2
2
0
0
0
F
EOF

# Creates supercell of NiO
x supercell < supercell_input

# Copies the supercell as NiO.struct
cp NiO_super.struct NiO.struct

# Adds label of 1 to Ni in NiO.struct
sed -i -e '7s/Ni /Ni1/g' NiO.struct

# Runs "x sgroup"
x sgroup

# Copies struct file from sgroup to NiO.struct
cp NiO.struct_sgroup NiO.struct

# Creates the NiO.inst from Constraint_U.pdf
cat << EOF > NiO.inst
Ni
Ar 3 5  
3, 2,2.0  P
3, 2,2.0  P
3,-3,3.0  P
3,-3,1.0  P
4,-1,1.0  N
4,-1,1.0  N
Ni
Ar 3 5  
3, 2,2.0  N
3, 2,2.0  N
3,-3,2.0  N
3,-3,2.0  N
4,-1,1.0  N
4,-1,1.0  N
Ni
Ar 3 5 
3, 2,2.0  N
3, 2,2.0  N
3,-3,2.0  N
3,-3,2.0  N
4,-1,1.0  N
4,-1,1.0  N
O
He 3 5  
2,-1,1.0  N
2,-1,1.0  N
2, 1,1.0  N
2, 1,1.0  N
2,-2,1.0  N
2,-2,1.0  N
O
He 3 5 
2,-1,1.0  N
2,-1,1.0  N
2, 1,1.0  N
2, 1,1.0  N
2,-2,1.0  N
2,-2,1.0  N
****
****         END of input (manually made)
EOF

# Input for the initialization
cat << EOF > initialization_input
2
c
c
c
N
5
-6
c
1
c
y
N
EOF

# Initializes the calculation
init_lapw -s nn < initialization_input

# Sets rkmax to 5
sed -i -e '2s/7.00/5.00/g' NiO.in1

# Runs scf calculation for NiO
runsp_lapw -i 60

# Saves the NiO calculation
save_lapw -d NiO_orig

# Sets d energy to 2 Ry (2 Ry above Fermi level of 0)
sed -i -e '6s/0.30/2.00/g' NiO.in1

# Other changes to match in2 from Constraint_U.pdf
sed -i -e '6s/0.30/2.00/g' NiO.in1
sed -i -e '5s/0.001/0.005/g' NiO.in1
sed -i -e '6s/0.005/0.000/g' NiO.in1

cp NiO.in1 NiO.in1_

# Creates the NiO.in2_+.50 from Constraint_U.pdf
cat << EOF > NiO.in2_+.50
TOT             (TOT,FOR,QTL,EFG,FERMI)
     -9.0     167.5 0.50 0.05                EMIN, NE, ESEPERMIN, ESEPER0
GAUSS    0.006          (GAUSS,ROOT,TEMP,TETRA,ALL      eval)
  0 0  4 0  4 4  6 0  6 4
  0 0  4 0  4 4  6 0  6 4
  0 0  2 0  2 2  4 0  4 2  4 4  6 0  6 2  6 4  6 6
  0 0  1 0  2 0  3 0  4 0  4 4  5 0  5 4  6 0  6 4
  0 0  4 0  4 4  6 0  6 4 -3 2
 12.00          GMAX
NOFILE        FILE/NOFILE  write recprlist
EOF

# Creates the NiO.incup_+.50 from Constraint_U.pdf
cat << EOF > NiO.incup_+.50
 7 1.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
3,2,4               ( N,KAPPA,OCCUP)
3,-3,5               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 0
EOF

# Creates the NiO.in2_+.50 from Constraint_U.pdf
cat << EOF > NiO.incdn_+.50
 7 1.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
3,2,4               ( N,KAPPA,OCCUP)
3,-3,4               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 0
EOF

# Copies +.50 files to input files
cp NiO.in2_+.50 NiO.in2
cp NiO.incup_+.50 NiO.incup
cp NiO.incdn_+.50 NiO.incdn

# Runs scf calculation for +.50
runsp_lapw -i 60

# Saves the +.50 calculation
save_lapw -d NiO_+.50

# Restores the NiO calculation
restore_lapw -f -d NiO_orig

# Creates the NiO.in2_+.5-1 from Constraint_U.pdf
cat << EOF > NiO.in2_+.5-1
TOT             (TOT,FOR,QTL,EFG,FERMI)
     -9.0     168.5 0.50 0.05                EMIN, NE, ESEPERMIN, ESEPER0
GAUSS    0.006          (GAUSS,ROOT,TEMP,TETRA,ALL      eval)
  0 0  4 0  4 4  6 0  6 4
  0 0  4 0  4 4  6 0  6 4
  0 0  2 0  2 2  4 0  4 2  4 4  6 0  6 2  6 4  6 6
  0 0  1 0  2 0  3 0  4 0  4 4  5 0  5 4  6 0  6 4
  0 0  4 0  4 4  6 0  6 4 -3 2
 12.00          GMAX
NOFILE        FILE/NOFILE  write recprlist
EOF

# Creates the NiO.incup_+.5-1 from Constraint_U.pdf
cat << EOF > NiO.incup_+.5-1
 7 1.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
3,2,4               ( N,KAPPA,OCCUP)
3,-3,5               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 0
EOF

# Creates the NiO.incdn_+.5-1 from Constraint_U.pdf
cat << EOF > NiO.incdn_+.5-1
 7 1.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
3,2,4               ( N,KAPPA,OCCUP)
3,-3,2               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 5 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
2,-1,2               ( N,KAPPA,OCCUP)
2, 1,2               ( N,KAPPA,OCCUP)
2,-2,4               ( N,KAPPA,OCCUP)
3,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 1 0.00  0  NUMBER OF ORBITALS (EXCLUDING SPIN), SHIFT, IPRINT
1,-1,2               ( N,KAPPA,OCCUP)
 0
EOF

# Copies +.5-1 files to input files
cp NiO.in1_ NiO.in1
cp NiO.in2_+.5-1 NiO.in2
cp NiO.incup_+.5-1 NiO.incup
cp NiO.incdn_+.5-1 NiO.incdn

# Runs scf calculation for +.5-1
runsp_lapw -i 60

# Saves the +.5-1 calculation
save_lapw -d NiO_+.5-1

# Change into NiO_+.50 directory
cd NiO_+.50

# Get energies for +.50
grepline :fer 'NiO.scf' 1
grepline :3dd001 'NiO.scf' 2 | head -2 | tail -1
grepline ':3d 001' 'NiO.scf' 2 | head -2 | tail -1

a=$(grepline :fer 'NiO.scf' 1 | grep -o '\-\?[0-9]\+\.[0-9]\+')
b=$(grepline :3dd001 'NiO.scf' 2 | head -2 | tail -1 | grep -o '\-\?[0-9]\+\.[0-9]\+')
c=$(grepline ':3d 001' 'NiO.scf' 2 | head -2 | tail -1 | grep -o '\-\?[0-9]\+\.[0-9]\+')

# Change into NiO_+.5-1 directory
cd ..
cd NiO_+.5-1

# Get energies for +.5-1
grepline :fer 'NiO.scf' 1
grepline :3dd001 'NiO.scf' 2 | head -2 | tail -1
grepline ':3d 001' 'NiO.scf' 2 | head -2 | tail -1

d=$(grepline :fer 'NiO.scf' 1 | grep -o '\-\?[0-9]\+\.[0-9]\+')
e=$(grepline :3dd001 'NiO.scf' 2 | head -2 | tail -1 | grep -o '\-\?[0-9]\+\.[0-9]\+')
f=$(grepline ':3d 001' 'NiO.scf' 2 | head -2 | tail -1 | grep -o '\-\?[0-9]\+\.[0-9]\+')

# Calculate F_eff
ans=$(echo "scale=10; (4*$b+5*$c)/9-(4*$e+5*$f)/9-$a+$d" | bc -l)
echo "F_eff = (4*$b+5*$c)/9-(4*$e+5*$f)/9-$a+$d"

echo ""
echo "F_eff = $ans Ry"
echo ""
-------------- next part --------------
_______________________________________________
Wien mailing list
Wien at zeus.theochem.tuwien.ac.at
http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
SEARCH the MAILING-LIST at:  http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html


More information about the Wien mailing list