Merge pull request #1065 from jautschbach/iboloc-improvements

IBO code improvements
This commit is contained in:
Edoardo Aprà 2025-01-16 17:34:43 -08:00 committed by GitHub
commit 394039d5cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 640 additions and 460 deletions

View file

@ -1,4 +1,4 @@
argument 1 = /home/workspace/jochena/nwchem/loc-bugfix/QA/tests/localize-ibo-aa/localize-ibo-aa.nw
argument 1 = /home/workspace/jochena/nwchem/iboloc-improvements/QA/tests/localize-ibo-aa/localize-ibo-aa.nw
@ -89,7 +89,7 @@ task scf property
Northwest Computational Chemistry Package (NWChem) 7.2.1
Northwest Computational Chemistry Package (NWChem) 7.2.3
--------------------------------------------------------
@ -122,17 +122,17 @@ task scf property
Job information
---------------
hostname = ja04
program = /home/workspace/jochena/nwchem/loc-bugfix/bin/LINUX64/nwchem
date = Wed Jan 3 09:35:21 2024
hostname = ja31
program = /home/workspace/jochena/nwchem/iboloc-improvements/bin/LINUX64/nwchem
date = Thu Jan 16 16:36:35 2025
compiled = Wed_Jan_03_09:30:30_2024
source = /home/workspace/jochena/nwchem/loc-bugfix
nwchem branch = 7.2.1
nwchem revision = nwchem_on_git-5270-g7a744690ee
compiled = Thu_Jan_16_16:28:10_2025
source = /home/workspace/jochena/nwchem/iboloc-improvements
nwchem branch = 7.2.3
nwchem revision = nwchem_on_git-5635-gd15debf189
ga revision = 5.8.0
use scalapack = F
input = /home/workspace/jochena/nwchem/loc-bugfix/QA/tests/localize-ibo-aa/localize-ibo-aa.nw
input = /home/workspace/jochena/nwchem/iboloc-improvements/QA/tests/localize-ibo-aa/localize-ibo-aa.nw
prefix = testjob.
data base = ./testjob.db
status = startup
@ -144,8 +144,8 @@ task scf property
Memory information
------------------
heap = 6553594 doubles = 50.0 Mbytes
stack = 6553599 doubles = 50.0 Mbytes
heap = 6553598 doubles = 50.0 Mbytes
stack = 6553595 doubles = 50.0 Mbytes
global = 13107200 doubles = 100.0 Mbytes (distinct from heap & stack)
total = 26214393 doubles = 200.0 Mbytes
verify = yes
@ -264,7 +264,7 @@ task scf property
library name resolved from: environment
library file name is: <
/home/workspace/jochena/nwchem/loc-bugfix/src/basis/libraries/>
/home/workspace/jochena/nwchem/iboloc-improvements/src/basis/libraries/>
@ -277,7 +277,7 @@ task scf property
library name resolved from: environment
library file name is: <
/home/workspace/jochena/nwchem/loc-bugfix/src/basis/libraries/>
/home/workspace/jochena/nwchem/iboloc-improvements/src/basis/libraries/>
Basis "iao basis" -> "" (spherical)
-----
@ -486,7 +486,7 @@ task scf property
LUMO = -0.055429
Starting SCF solution at 0.2s
Starting SCF solution at 0.1s
@ -504,19 +504,19 @@ task scf property
1 -265.3310324443 1.42D+00 2.92D-01 0.2
2 -265.4360577045 4.13D-01 8.78D-02 0.3
3 -265.4514376314 3.64D-02 9.22D-03 0.5
4 -265.4516512505 1.03D-03 2.34D-04 0.7
5 -265.4516513711 7.80D-06 1.92D-06 0.9
4 -265.4516512505 1.03D-03 2.34D-04 0.8
5 -265.4516513711 7.80D-06 1.92D-06 1.1
Final RHF results
------------------
Total SCF energy = -265.451651371051
Total SCF energy = -265.451651371050
One-electron energy = -682.442839763841
Two-electron energy = 255.473969802116
Two-electron energy = 255.473969802115
Nuclear repulsion energy = 161.517218590675
Time for solution = 0.7s
Time for solution = 1.0s
Final eigenvalues
@ -557,7 +557,7 @@ task scf property
-------------------------------------
Vector 6 Occ=2.000000D+00 E=-1.441125D+00
MO Center= -1.1D+00, 2.6D-02, 7.5D-17, r^2= 1.2D+00
MO Center= -1.1D+00, 2.6D-02, 5.0D-17, r^2= 1.2D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
58 0.413566 5 O s 30 0.293845 3 C s
@ -565,7 +565,7 @@ task scf property
57 0.208468 5 O s 45 0.150994 4 O s
Vector 7 Occ=2.000000D+00 E=-1.338769D+00
MO Center= -9.1D-01, -4.1D-01, -5.3D-17, r^2= 1.4D+00
MO Center= -9.1D-01, -4.1D-01, 1.3D-16, r^2= 1.4D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
44 0.424994 4 O s 58 -0.352816 5 O s
@ -574,7 +574,7 @@ task scf property
57 -0.176450 5 O s
Vector 8 Occ=2.000000D+00 E=-1.070923D+00
MO Center= 1.1D+00, 2.8D-01, 1.6D-17, r^2= 1.5D+00
MO Center= 1.1D+00, 2.8D-01, 7.0D-17, r^2= 1.5D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
16 0.400200 2 C s 2 0.337172 1 C s
@ -582,7 +582,7 @@ task scf property
17 0.160365 2 C s
Vector 9 Occ=2.000000D+00 E=-8.974613D-01
MO Center= 2.3D-01, 2.6D-01, -3.0D-17, r^2= 3.3D+00
MO Center= 2.3D-01, 2.6D-01, -1.1D-18, r^2= 3.3D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
30 -0.305983 3 C s 2 0.303431 1 C s
@ -591,7 +591,7 @@ task scf property
1 -0.152955 1 C s
Vector 10 Occ=2.000000D+00 E=-7.642057D-01
MO Center= 1.6D-01, 3.0D-01, 1.4D-16, r^2= 4.1D+00
MO Center= 1.6D-01, 3.0D-01, 1.1D-16, r^2= 4.1D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
60 0.316925 5 O px 16 -0.241192 2 C s
@ -601,7 +601,7 @@ task scf property
4 0.156757 1 C px 71 0.155748 6 H s
Vector 11 Occ=2.000000D+00 E=-7.114488D-01
MO Center= 2.7D-01, 9.8D-03, -2.5D-16, r^2= 3.1D+00
MO Center= 2.7D-01, 9.8D-03, -1.4D-16, r^2= 3.1D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
19 0.248395 2 C py 81 0.212079 8 H s
@ -611,7 +611,7 @@ task scf property
44 0.168207 4 O s 46 -0.165171 4 O px
Vector 12 Occ=2.000000D+00 E=-6.942998D-01
MO Center= -5.7D-01, -1.8D-01, -7.4D-17, r^2= 3.0D+00
MO Center= -5.7D-01, -1.8D-01, 2.2D-16, r^2= 3.0D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
61 0.332130 5 O py 47 -0.285481 4 O py
@ -621,7 +621,7 @@ task scf property
33 0.150516 3 C py
Vector 13 Occ=2.000000D+00 E=-6.290129D-01
MO Center= -9.9D-01, 1.2D-01, 4.4D-16, r^2= 1.6D+00
MO Center= -9.9D-01, 1.2D-01, -5.1D-16, r^2= 1.6D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
62 0.438625 5 O pz 65 0.308876 5 O pz
@ -629,7 +629,7 @@ task scf property
51 0.167682 4 O pz 37 0.158757 3 C pz
Vector 14 Occ=2.000000D+00 E=-6.234118D-01
MO Center= 8.0D-01, 1.3D-02, -4.6D-16, r^2= 3.8D+00
MO Center= 8.0D-01, 1.3D-02, -3.4D-16, r^2= 3.8D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
4 0.334286 1 C px 76 0.262842 7 H s
@ -638,7 +638,7 @@ task scf property
18 -0.161739 2 C px
Vector 15 Occ=2.000000D+00 E=-5.982438D-01
MO Center= -2.3D-02, 2.4D-01, -8.4D-17, r^2= 3.5D+00
MO Center= -2.3D-02, 2.4D-01, -8.5D-17, r^2= 3.5D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
61 0.305744 5 O py 18 0.273635 2 C px
@ -648,7 +648,7 @@ task scf property
33 -0.180575 3 C py 71 -0.170295 6 H s
Vector 16 Occ=2.000000D+00 E=-5.496397D-01
MO Center= 1.1D+00, 6.0D-02, 5.2D-17, r^2= 3.3D+00
MO Center= 1.1D+00, 6.0D-02, 1.5D-16, r^2= 3.3D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
5 0.298431 1 C py 71 -0.271981 6 H s
@ -657,7 +657,7 @@ task scf property
33 0.163556 3 C py 61 -0.150120 5 O py
Vector 17 Occ=2.000000D+00 E=-4.889073D-01
MO Center= -9.0D-01, -2.5D-01, -2.7D-16, r^2= 2.0D+00
MO Center= -9.0D-01, -2.5D-01, -3.3D-16, r^2= 2.0D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
62 -0.430815 5 O pz 48 0.407766 4 O pz
@ -665,7 +665,7 @@ task scf property
34 0.166236 3 C pz
Vector 18 Occ=2.000000D+00 E=-4.582158D-01
MO Center= -5.2D-01, -7.3D-01, 1.5D-18, r^2= 1.9D+00
MO Center= -5.2D-01, -7.3D-01, 4.7D-17, r^2= 1.9D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
46 0.549426 4 O px 49 0.417524 4 O px
@ -673,7 +673,7 @@ task scf property
64 -0.174821 5 O py 18 0.151160 2 C px
Vector 19 Occ=2.000000D+00 E=-4.009704D-01
MO Center= 1.1D+00, 1.5D-01, 2.8D-16, r^2= 2.0D+00
MO Center= 1.1D+00, 1.5D-01, -3.6D-16, r^2= 2.0D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
20 0.384445 2 C pz 6 0.352495 1 C pz
@ -681,7 +681,7 @@ task scf property
48 -0.214439 4 O pz 51 -0.173233 4 O pz
Vector 20 Occ=0.000000D+00 E= 9.067747D-02
MO Center= 8.9D-01, 1.5D-02, 1.4D-16, r^2= 3.0D+00
MO Center= 8.9D-01, 1.5D-02, 2.9D-16, r^2= 3.0D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
9 0.621145 1 C pz 23 -0.459696 2 C pz
@ -691,7 +691,7 @@ task scf property
65 0.155474 5 O pz
Vector 21 Occ=0.000000D+00 E= 1.933962D-01
MO Center= -2.6D+00, 1.3D-01, -3.8D-16, r^2= 2.6D+00
MO Center= -2.6D+00, 1.3D-01, 3.3D-16, r^2= 2.6D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
87 1.532433 9 H s 17 -0.762684 2 C s
@ -701,7 +701,7 @@ task scf property
60 0.181785 5 O px 3 0.180050 1 C s
Vector 22 Occ=0.000000D+00 E= 1.990748D-01
MO Center= 2.4D+00, 1.2D+00, 7.7D-17, r^2= 4.4D+00
MO Center= 2.4D+00, 1.2D+00, 8.2D-17, r^2= 4.4D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
3 1.857859 1 C s 77 -1.791874 7 H s
@ -711,7 +711,7 @@ task scf property
8 0.218519 1 C py 35 0.169789 3 C px
Vector 23 Occ=0.000000D+00 E= 2.314259D-01
MO Center= 1.7D+00, -2.0D-01, -1.4D-15, r^2= 6.0D+00
MO Center= 1.7D+00, -2.0D-01, 1.2D-15, r^2= 6.0D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
3 1.936960 1 C s 72 -1.805329 6 H s
@ -720,7 +720,7 @@ task scf property
8 -0.489914 1 C py 5 -0.154259 1 C py
Vector 24 Occ=0.000000D+00 E= 2.626515D-01
MO Center= 1.3D-01, -2.5D-02, 3.0D-15, r^2= 2.9D+00
MO Center= 1.3D-01, -2.5D-02, 6.0D-16, r^2= 2.9D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
37 -0.804941 3 C pz 23 0.756689 2 C pz
@ -730,7 +730,7 @@ task scf property
62 0.158924 5 O pz
Vector 25 Occ=0.000000D+00 E= 2.688800D-01
MO Center= 1.9D+00, 3.8D-01, -1.9D-16, r^2= 6.9D+00
MO Center= 1.9D+00, 3.8D-01, -1.1D-15, r^2= 6.9D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
77 -1.706163 7 H s 72 1.689090 6 H s
@ -740,7 +740,7 @@ task scf property
87 -0.319009 9 H s 3 -0.288918 1 C s
Vector 26 Occ=0.000000D+00 E= 3.855495D-01
MO Center= -4.6D-01, -2.3D-01, -1.3D-15, r^2= 3.7D+00
MO Center= -4.6D-01, -2.3D-01, 5.2D-16, r^2= 3.7D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
31 4.026240 3 C s 45 -1.439431 4 O s
@ -750,7 +750,7 @@ task scf property
50 -0.560923 4 O py 82 -0.528079 8 H s
Vector 27 Occ=0.000000D+00 E= 4.475195D-01
MO Center= 5.8D-01, 2.5D-01, 3.0D-16, r^2= 3.9D+00
MO Center= 5.8D-01, 2.5D-01, 1.5D-16, r^2= 3.9D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
21 3.533345 2 C px 3 -2.731556 1 C s
@ -760,7 +760,7 @@ task scf property
7 0.878572 1 C px 30 0.524028 3 C s
Vector 28 Occ=0.000000D+00 E= 4.523376D-01
MO Center= 1.5D+00, -1.4D-01, 5.7D-17, r^2= 4.3D+00
MO Center= 1.5D+00, -1.4D-01, -2.4D-16, r^2= 4.3D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
17 6.048068 2 C s 3 -4.672145 1 C s
@ -770,7 +770,7 @@ task scf property
59 -0.983223 5 O s 36 0.975052 3 C py
Vector 29 Occ=0.000000D+00 E= 4.789847D-01
MO Center= 2.6D-01, 3.3D-01, -2.4D-17, r^2= 3.8D+00
MO Center= 2.6D-01, 3.3D-01, 1.2D-17, r^2= 3.8D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
17 2.858248 2 C s 3 -2.090889 1 C s
@ -780,7 +780,7 @@ task scf property
35 0.814942 3 C px 63 0.614144 5 O px
Vector 30 Occ=0.000000D+00 E= 5.702926D-01
MO Center= 1.4D+00, 5.8D-01, 4.7D-15, r^2= 2.8D+00
MO Center= 1.4D+00, 5.8D-01, 1.7D-15, r^2= 2.8D+00
Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function
----- ------------ --------------- ----- ------------ ---------------
17 2.332617 2 C s 31 -1.303425 3 C s
@ -830,7 +830,7 @@ task scf property
2 1 1 0 0.077897 0.000000 0.000002
2 1 0 1 -0.000000 0.000000 0.000000
2 0 2 0 -24.880694 0.000000 90.697964
2 0 1 1 0.000000 0.000000 0.000000
2 0 1 1 -0.000000 0.000000 0.000000
2 0 0 2 -22.450650 0.000000 0.000000
@ -860,45 +860,40 @@ task scf property
3 2.1535052593 1.5156908043 6.80D-01
4 2.1555044144 1.5083642626 1.99D-01
5 2.1555070455 1.5083594177 8.89D-03
6 2.1555070209 1.5083589529 8.63D-05
7 2.1555070209 1.5083589538 6.36D-06
8 2.1555070209 1.5083589538 9.22D-08
9 2.1555070209 1.5083589538 5.27D-09
6 2.1555070222 1.5083589530 8.63D-05
7 2.1555070222 1.5083589538 6.36D-06
8 2.1555070222 1.5083589538 9.22D-08
9 2.1555070222 1.5083589538 5.27D-09
IBO loc: largest element in C(MO,T) C(MO) -1: 0.00000000
should be zero, for IBOs in the IAO basis
IAO-IBO localized orbitals
IBOs (occ) :
1 -20.408687 2.000 5( 1.00)
2 -20.147892 2.000 4( 1.00)
3 -11.292087 2.000 3( 1.00)
4 -11.136773 2.000 1( 1.00)
5 -11.124537 2.000 2( 1.00)
6 -1.380469 2.000 4( 0.60) 3( 0.40)
7 -1.136467 2.000 5( 0.64) 3( 0.36)
8 -1.090083 2.000 4( 1.00)
9 -1.040643 2.000 5( 0.69) 9( 0.31)
10 -1.025814 2.000 2( 0.50) 1( 0.50)
11 -0.908331 2.000 3( 0.51) 2( 0.48)
12 -0.840377 2.000 5( 0.99)
13 -0.734854 2.000 1( 0.57) 7( 0.42)
14 -0.727325 2.000 1( 0.58) 6( 0.41)
15 -0.726630 2.000 2( 0.57) 8( 0.42)
16 -0.567506 2.000 5( 0.93) 3( 0.06) 4( 0.01)
17 -0.527005 2.000 4( 0.73) 3( 0.26)
18 -0.507592 2.000 4( 0.93) 3( 0.04) 5( 0.01) 2( 0.01)
19 -0.424380 2.000 2( 0.53) 1( 0.43) 3( 0.04)
orbital e(au) occ atom(weight) ...
1 -20.40869 2.000 5( 1.00)
2 -20.14789 2.000 4( 1.00)
3 -11.29209 2.000 3( 1.00)
4 -11.13677 2.000 1( 1.00)
5 -11.12454 2.000 2( 1.00)
6 -1.38047 2.000 4( 0.60) 3( 0.40)
7 -1.13647 2.000 5( 0.64) 3( 0.36)
8 -1.09008 2.000 4( 1.00)
9 -1.04064 2.000 5( 0.69) 9( 0.31)
10 -1.02581 2.000 2( 0.50) 1( 0.50)
11 -0.90833 2.000 3( 0.51) 2( 0.48)
12 -0.84038 2.000 5( 0.99)
13 -0.73485 2.000 1( 0.57) 7( 0.42)
14 -0.72732 2.000 1( 0.58) 6( 0.41)
15 -0.72663 2.000 2( 0.57) 8( 0.42)
16 -0.56751 2.000 5( 0.93) 3( 0.06) 4( 0.01)
17 -0.52700 2.000 4( 0.73) 3( 0.26)
18 -0.50759 2.000 4( 0.93) 3( 0.04) 5( 0.01) 2( 0.01)
19 -0.42438 2.000 2( 0.53) 1( 0.43) 3( 0.04)
IBO localization (occ): IBOs will be stored
in file locorb.movecs, number
1 to 19
IBO loc: largest element in C(iao,T) S C(iao) -1: 0.00000000
Significant deviations from zero may indicate
elevated numerical noise in the IAO generation
in file locorb.movecs, number 1 to 19
non-zero singular values: 10
@ -907,41 +902,60 @@ task scf property
iter Max. delocal Mean delocal Converge
---- ------------ ------------ --------
1 7.4855751970 4.3168336458 0.00D+00
2 2.3398085416 2.0873841008 7.55D-01
3 2.1346570467 1.9908868937 3.58D-01
4 2.1348158454 1.9903813928 2.36D-02
5 2.1348018590 1.9903804763 1.30D-03
6 2.1348017645 1.9903804752 8.92D-05
7 2.1348017626 1.9903804751 5.81D-06
8 2.1348017626 1.9903804751 3.87D-07
9 2.1348017626 1.9903804751 2.53D-08
10 2.1348017626 1.9903804751 0.00D+00
1 6.6031445756 4.4384470629 0.00D+00
2 3.0584618366 2.2466979528 7.65D-01
3 2.1352648694 1.9905418351 6.92D-01
4 2.1347623003 1.9903836321 1.34D-02
5 2.1348015924 1.9903804792 3.23D-03
6 2.1348017600 1.9903804746 2.04D-04
7 2.1348017624 1.9903804750 1.43D-05
8 2.1348017624 1.9903804750 9.45D-07
9 2.1348017624 1.9903804750 6.17D-08
10 2.1348017624 1.9903804750 5.27D-09
IBO loc: largest element in C(MO,T) C(MO) -1: 0.00000000
should be zero, for IBOs in the IAO basis
IAO-IBO localized orbitals
IBOs (vir) :
1 0.209314 0.000 1( 0.55) 2( 0.44)
2 0.251712 0.000 3( 0.64) 4( 0.25) 5( 0.07) 2( 0.03)
3 0.441767 0.000 9( 0.69) 5( 0.30)
4 0.571110 0.000 7( 0.57) 1( 0.42)
5 0.576430 0.000 6( 0.58) 1( 0.41)
6 0.588168 0.000 8( 0.57) 2( 0.42)
7 0.612417 0.000 3( 0.61) 5( 0.34) 4( 0.04)
8 0.678788 0.000 2( 0.50) 3( 0.47) 4( 0.02)
9 0.845663 0.000 3( 0.59) 4( 0.40)
10 0.862369 0.000 1( 0.50) 2( 0.50)
orbital e(au) occ atom(weight) ...
1 0.20931 0.000 1( 0.55) 2( 0.44)
2 0.25171 0.000 3( 0.64) 4( 0.25) 5( 0.07) 2( 0.03)
3 0.44177 0.000 9( 0.69) 5( 0.30)
4 0.57111 0.000 7( 0.57) 1( 0.42)
5 0.57643 0.000 6( 0.58) 1( 0.41)
6 0.58817 0.000 8( 0.57) 2( 0.42)
7 0.61242 0.000 3( 0.61) 5( 0.34) 4( 0.04)
8 0.67879 0.000 2( 0.50) 3( 0.47) 4( 0.02)
9 0.84566 0.000 3( 0.59) 4( 0.40)
10 0.86237 0.000 1( 0.50) 2( 0.50)
IBO localization (vir): IBOs will be stored
in file locorb.movecs, number
20 to 29
in file locorb.movecs, number 20 to 29
IBO transformation (occ.) written to file
./testjob.lmotrans
IAO-based populations
----------------------------
Atom # Charge
--------- ----------------
C 1 -0.184
C 2 -0.209
C 3 0.641
O 4 -0.545
O 5 -0.537
H 6 0.161
H 7 0.148
H 8 0.150
H 9 0.375
----------------------------
sum 0.000
IAOs saved to file iaos.movecs (29 orbitals)
Exiting Localization driver routine
-------------
@ -967,7 +981,7 @@ task scf property
1 a.u. = 2.541766 Debyes
Task times cpu: 0.9s wall: 0.9s
Task times cpu: 1.1s wall: 1.1s
NWChem Input Module
@ -989,7 +1003,7 @@ MA usage statistics:
current number of blocks 0 0
maximum number of blocks 22 14
current total bytes 0 0
maximum total bytes 139408 22511320
maximum total bytes 139376 22511288
maximum total K-bytes 140 22512
maximum total M-bytes 1 23
@ -1047,4 +1061,4 @@ MA usage statistics:
K. Glaesemann, G. Sandrone, M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe,
A. T. Wong, Z. Zhang.
Total times cpu: 1.0s wall: 1.0s
Total times cpu: 1.2s wall: 1.2s

File diff suppressed because it is too large Load diff

View file

@ -64,6 +64,15 @@ c name
continue ! let's hope the file name is OK ...
end if
c ... jochen: nwchem gives an error if the number of MOs in subroutine
c argument nmo, and more importantly the column dimensions of GA vectors
c is smaller than what's in the movecs file from the SCF. The following
c small code block is intended to fix this
if (nmo.lt.nmo_molec(1) .or. nmo.lt.nmo_molec(2)) then
nmo_molec(:) = nmo
end if
c write (luout,*) 'writing localized MOs to file ',trim(movecs)
if (.not. movecs_write(rtdb, basis, filename,

View file

@ -1,6 +1,8 @@
subroutine ibo_localization(rtdb, geom, ltyp, basis, g_movecs,
& nocc, nvir, nmo, nbf, natoms, eval, occ, c, pop, list)
subroutine ibo_localization(rtdb, geom, ltyp, basis,
& g_smat, g_movecs,
& nocc, nvir, nmo, nbf, natoms, eval, occ, c, pop, cpop, list,
& have_iao, g_iao, have_mbs, minbas)
c =================================================================
c IAO construction and generation of occupied or virtual IBOs.
@ -43,18 +45,19 @@ c subroutine arguments:
integer rtdb, geom, basis
character*(3) ltyp
integer g_movecs
integer g_smat, g_movecs, g_iao
integer nocc, nvir, nmo, nbf, natoms
double precision eval(nbf), occ(nbf), c(nbf,2)
double precision pop(natoms)
double precision pop(natoms), cpop(natoms)
integer list(natoms)
logical have_iao, have_mbs
integer minbas
c local GA handles:
integer g_s2, g_s12, g_p12, g_p21
integer g_ctilde, g_iao, g_mo
integer g_ctilde, g_mo
integer g_temp, g_tmp1, g_tmp2, g_cib, g_u, g_vt
integer g_smat
c local variables:
@ -74,8 +77,7 @@ c local variables:
integer
& mnbf, iao_mxprim, iao_mxang, iao_mxcont,
& iao_mxnbf_cn, iao_mxnbf_ce, iao_nshells,
& minbas
& iao_mxnbf_cn, iao_mxnbf_ce, iao_nshells
double precision minval, swap
integer l_val, k_val
@ -86,53 +88,69 @@ c local variables:
integer ga_create_atom_blocked
external ga_create_atom_blocked
character*(16) pname
character*(16) pname, st1, st2
c =================================================================
pname = 'ibo_localization'
dbg = 0
master = ga_nodeid().eq.0
dbg = 0 ! set >0 for code development
master = ga_nodeid().eq.0 ! running on master node?
debug = (dbg>0) .and. master ! .true. during development
if (ltyp.ne.'occ' .and. ltyp.ne.'vir') call errquit
& (pname//': loc. type unknown', 0, BASIS_ERR)
if(debug) then
if (ltyp.eq.'occ') write (luout,*)
& 'entering occupied IBO localization'
if (ltyp.eq.'vir') write (luout,*)
& 'entering virtual IBO localization'
end if
write(luout,*) 'entering IBO localization '//ltyp
if (have_iao) then
write(luout,*) 'IAOs already available. skipping...'
else
write(luout,*) 'IAOs need to be generated.'
end if
if (have_mbs) then
write(luout,*) 'minbas already available. skipping...'
else
write(luout,*) 'minbas needs to be generated.'
end if
end if ! debug
if (.not. geom_num_core(rtdb, geom, 'ddscf', ncore)) ncore = 0
if (debug) write (luout,*) 'ncore = ',ncore
c copy the occupied CMOs to g_mo. Maybe needed later
if (.not. ga_create(MT_DBL, nbf, nocc, 'loc:g_mo',
& nbf, 0, g_mo)) call errquit(pname//': g_mo',0, GA_ERR)
call ga_copy_patch('n',
& g_movecs, 1, nbf, 1, nocc,
& g_mo, 1, nbf, 1, nocc)
if (debug) write (luout,*) 'movecs(occ) -> mo'
c ------------------------------
c construct IAOs in the AO basis
c ------------------------------
c ------------------------------------------
c create or query the minimal basis (minbas)
c ------------------------------------------
c Note:
c Basis 1 is the AO basis used in the SCF calculation
c Basis 2 is the minimal auxiliary basis
c Basis 2 is minbas
c AO Overlap Matrix S1 -> g_smat:
c minbas overlap S2 -> g_s2 basis needs to defined in
c the input as "iao basis"
g_smat = ga_create_atom_blocked(geom, basis, 'loc:smat')
call ga_zero(g_smat)
call int_1e_ga(basis, basis, g_smat, 'overlap', .false.)
if (.not.have_mbs) then
if (.not. bas_create(minbas, 'iao basis'))
& call errquit(pname//': cannot create iao bas', 86, BASIS_ERR)
have_mbs = .true.
if (debug) write(luout,*) 'minbas created: ',minbas
else
if (debug) write(luout,*) 'minbas used is: ',minbas
end if
c auxiliary basis overlap S2 -> g_s2 basis needs to defined in
c the input as "iao basis". we will now create the basis here and
c then calculate the overlap and the mixed ao-iao basis overlap
c S12
if (.not. bas_create(minbas, 'iao basis'))
& call errquit(pname//': cannot create iao bas', 86, BASIS_ERR)
c load information about minbas
if (.not. bas_rtdb_load(rtdb, geom, minbas, 'iao basis'))
& call errquit(pname//': iao basis not present', 86, BASIS_ERR)
@ -168,6 +186,12 @@ c here and exit with an error if nbf < mnbf
if (nbf.lt.mnbf) call errquit
& (pname//': nbf < mnbf. cannot handle!', 66, UNKNOWN_ERR)
c --------------------------------------------------------
c construct IAOs in the AO basis if we don't have them yet
c --------------------------------------------------------
if (have_iao) goto 1000
c create overlap for minbas, and the mixed basis-minbas
c overlap S12.
c Then we calculate the projectors P12 and P21
@ -242,25 +266,14 @@ c P21 is no longer needed
if (.not. ga_destroy(g_p21))
& call errquit(pname//': ga_destroy failed g_p21',61, GA_ERR)
c construct IAOS from occ. MOs:
c copy the relevant CMOs to g_mo
if (.not. ga_create(MT_DBL, nbf, nocc, 'loc:g_mo',
& nbf, 0, g_mo)) call errquit(pname//': g_mo',0, GA_ERR)
call ga_copy_patch('n',
& g_movecs, 1, nbf, 1, nocc,
& g_mo, 1, nbf, 1, nocc)
if (debug) write (luout,*) 'movecs(occ) -> mo'
c construct IAOS from occ. MOs stored in g_mo:
c create C-tilde from Appendix C of Knizia's IBO paper. g_temp
c holds P12 * P21; we won't need it after the next matrix
c multiplication
if (.not. ga_create(MT_DBL, nbf, nocc, 'loc:ctilde',
& nbf, 0, g_ctilde)) call errquit('loc_driver: sc',0, GA_ERR)
& nbf, 0, g_ctilde)) call errquit(pname//': sc',0, GA_ERR)
call ga_dgemm('n', 'n', nbf, nocc, nbf,
& 1.0d0, g_temp, g_mo, 0.0d0, g_ctilde)
@ -391,6 +404,11 @@ c g_p12 no longer needed
if (.not. ga_destroy(g_p12))
& call errquit(pname//': ga_destroy failed g_p12',61, GA_ERR)
have_iao = .true.
c we jump here in case IAOs were already created
1000 continue
c ---------------------------------------------------------------
c IAOs are now in array g_iao. Next, generate occupied or virtual
c IBOs, depending on the input settings (ltyp)
@ -404,10 +422,6 @@ c -----------------------
c note: g_mo already holds the occupied MOs
if (debug) then
write(luout,*) 'movecs(occ) -> mo'
end if
c few more sanity check, just in case
if (nocc.gt.mnbf) call errquit
& (pname//': nocc > mnbf', 66, UNKNOWN_ERR)
@ -446,6 +460,8 @@ c save a copy of the starting MOs for later
c perform localization of the MOs in IAO basis:
if (debug) write(luout,*) 'calling loc. with parameters ',
& minbas, nocc, nbf, mnbf, natoms
call localizeIBO(minbas, c, g_cib, nocc, nbf, mnbf,
& natoms)
@ -493,9 +509,11 @@ c via C(iao,T) S C(MO), store in g_tmp2 (and keep the array)
call ga_dgemm('n', 'n', nbf, nvir, nbf,
& 1.0d0, g_smat, g_mo, 0.0d0, g_tmp1)
if(debug) write (luout,*) 'smat*mo -> tmp1'
call ga_dgemm('t', 'n', mnbf, nvir, nbf,
& 1.0d0, g_iao, g_tmp1, 0.0d0, g_tmp2)
if(debug) write (luout,*) 'iao*tmp1 -> tmp2'
if (.not. ga_destroy(g_tmp1))
& call errquit(pname//': ga_destroy failed g_tmp1',0, GA_ERR)
@ -591,6 +609,8 @@ c dellocate memory used for SVD
c perform localization of the MOs in IAO basis:
if (debug) write(luout,*) 'calling loc. with parameters ',
& minbas, nsing, nbf, mnbf, natoms
call localizeIBO(minbas, c, g_cib, nsing, nbf, mnbf,
& natoms)
@ -602,6 +622,10 @@ c calculate the localization transform. The starting MOs were
c saved in g_tmp2 in the IAO basis
c CMOs(iao,T) * LMOs(iao) = localization transform -> g_tmp1
noff = 0 ! initialize so some compilers stay happy
n1 = 0
n2 = 0
if (ltyp.eq.'occ') then
if (.not. ga_create(MT_DBL, nocc, nocc, 'loc:tmp1',
@ -628,6 +652,8 @@ c CMOs(iao,T) * LMOs(iao) = localization transform -> g_tmp1
call ga_dgemm('t', 'n', nvir, nsing, mnbf,
& 1.0d0, g_tmp2, g_cib, 0.0d0, g_tmp1)
else
call errquit(pname//': ltyp wrong',0, GA_ERR)
end if ! ltyp
if(noff+n1 > nbf) call errquit (pname//
@ -726,11 +752,13 @@ c copy the IBOs into the relevant part of movecs
c Analyze localization of each MO: per LMO, a list of atomic
c populations is printed in decreasing magnitude, with the
c polulations in parentheses. This code is equivalent to the on
c populations in parentheses. This code is equivalent to the one
c found in the Pipek-Mezey localization routine
if (master) then
write(luout,'(/1x,a/)') 'IAO-IBO localized orbitals'
write(luout,'(/1x,a/)') 'IBOs ('//ltyp//') :'
write(luout,*)
& 'orbital e(au) occ atom(weight) ...'
do s = 1, n2
call ga_get(g_cib, 1, mnbf, s, s, c(1,1), 1)
nlist = 0
@ -742,6 +770,12 @@ c found in the Pipek-Mezey localization routine
do u = bflo, bfhi
qas = qas + c(u,1)*c(u,1)
end do
c save cumulative IAO populations for later use:
if(ltyp.eq.'occ') then
cpop(a) = cpop(a) + qas
end if
if (abs(qas) .gt. 0.01d0) then
nlist = nlist + 1
list(nlist) = a
@ -762,31 +796,24 @@ c found in the Pipek-Mezey localization routine
end do
write(luout,9002) s, eval(s+noff),
& occ(s+noff),(list(a), pop(a), a=1,nlist)
9002 format(i5, 1x, f14.6,1x, f5.3, 1x,100(2x,i4,'(',f5.2,')'))
end do
9002 format(i8, 1x, f13.5,1x, f5.3,1x,100(2x,i5,'(',f5.2,')'))
end do ! loop s
write(luout,*)
call util_flush(luout)
end if
end if ! master
if (.not. ga_destroy(g_cib))
& call errquit(pname//': ga_destroy failed g_cib',0, GA_ERR)
c deallocate remaining arrays that are no longer needed
call ga_brdcst(MT_DBL,cpop,natoms,0)
if (.not. ga_destroy(g_iao)) call errquit(
& pname//': error destroying g_iao',0, GA_ERR)
c deallocate remaining arrays that are no longer needed,
c write a summary about the IBOs stored on file, and return
if (.not. ga_destroy(g_mo)) call errquit(
& pname//': error destroying g_mo',0, GA_ERR)
c smat not needed anymore
if (.not. ga_destroy(g_smat)) call errquit(
& pname//': error destroying g_smat',0, GA_ERR)
c destroy minimal basis (iao basis)
if (.not.bas_destroy(minbas))
& call errquit(pname//'iao bas_destroy failed',0,BASIS_ERR)
if (ltyp.eq.'occ') then
n1 = 1
n2 = nocc
@ -795,11 +822,17 @@ c destroy minimal basis (iao basis)
n2 = nocc + nsing
end if
if (master) write(luout,
& '(/1x,a,a,a/1x,a/1x,i10,2x,a,1x,i10/)')
& 'IBO localization (',ltyp,'): IBOs will be stored',
& 'in file locorb.movecs, number ',n1, 'to', n2
write(st1,'(i0)') n1
write(st2,'(i0)') n2
if (master) write(luout,
& '(/1x,a,a,a/1x,a,1x,a,1x,a,1x,a/)')
& 'IBO localization (',ltyp,'): IBOs will be stored',
& 'in file locorb.movecs, number',
& trim(st1), 'to', trim(st2)
call ga_sync()
return
end
@ -946,8 +979,8 @@ c -----------------------------------------------------------------
end if
call ga_sync()
call ga_brdcst(1,values,nsing*8,0)
c call ga_sync()
call ga_brdcst(MT_DBL,values,nsing*8,0)
call ga_sync()
end

View file

@ -46,12 +46,12 @@ c subroutine arguments:
c local GA handles:
integer g_uc(4), g_smat, g_sc, g_t
integer g_movecs(2), g_cmo(2), g_temp, g_tmp1, g_tmp2
integer g_sc0
integer g_sc0, g_iao(2)
c MA variables:
integer l_c, k_c, l_sc, k_sc, l_eval, k_eval, l_occ, k_occ
integer l_dip(3), k_dip(3)
integer l_pop, k_pop, l_list, k_list
integer l_pop, k_pop, l_cpop, k_cpop, l_list, k_list
integer l_iloc, k_iloc
c other local variables:
@ -87,7 +87,10 @@ c other local variables:
external file_write_ga
logical debug, master
logical oprint
logical oprint, have_iao(2), have_mbs
data have_iao(1), have_iao(2)/.false.,.false./
integer minbas
data have_mbs/.false./
integer ga_create_atom_blocked
external ga_create_atom_blocked
@ -98,6 +101,9 @@ c other local variables:
character*(19) pname
character*(3) ltyp
character*(16) tag
double precision atxyz(3), q_nuc, q_mol
c ==================================================================
pname = 'localization_driver'
@ -591,12 +597,23 @@ c allocate memory
if (.not. ma_push_get(mt_dbl, natoms, 'pop', l_pop, k_pop))
& call errquit(pname//': loc:pop', 0, MA_ERR)
if (.not. ma_push_get(mt_dbl, natoms*nspin,'cpop',
& l_cpop,k_cpop))
& call errquit(pname//': loc:cpop', 0, MA_ERR)
if (.not. ma_push_get(mt_int, natoms, 'list', l_list,
& k_list)) call errquit(pname//': loc:list', 0, MA_ERR)
if (.not. ga_create(MT_DBL, nbf, nmo, 'loc:sc0',
& nbf, 0, g_sc0)) call errquit(pname//' ibo: sc0',0, GA_ERR)
c initialize cumulative IAO populations with zeros
do i=1,natoms*nspin
dbl_mb(k_cpop+i-1)=0.0d0
enddo
c begin loop over spins
do ispin = 1,nspin
if (nspin.eq.1) then
@ -626,49 +643,63 @@ c the localization transformation later for this spin
call ga_dgemm('n', 'n', nbf, nmo, nbf,
$ 1.0d0, g_smat, g_movecs(ispin), 0.0d0, g_sc0)
if (loc_opt.eq.0) then
c note: upon first run of the IBO loc., we need to create the
c set of IAOs and the minimal basis (minbas). In a subsequent
c run, this is not required again. the corresponsing variable
c have_iao(ispin) is initialized as .false. in the declarations
c block of this routine. The GA g_iao(ispin) is allocated in
c routine ibo_localization and deallocated here. Likewise,
c minbas is created in ibo_localization but needs to be
c destroyed here.
have_mbs = .false.
c localize occupied MOs:
if (loc_opt.eq.0 .or. loc_opt.eq.2) then
ltyp = 'occ'
call ibo_localization(rtdb, geom, ltyp, basis,
& g_smat,
& g_movecs(ispin),nocc,nvir, nmo, nbf, natoms,
& dbl_mb(k_eval+(ispin-1)*nbf),
& dbl_mb(k_occ+(ispin-1)*nbf),
& dbl_mb(k_c),
& dbl_mb(k_pop), int_mb(k_list))
& dbl_mb(k_pop),
& dbl_mb(k_cpop+(ispin-1)*natoms),
& int_mb(k_list),
& have_iao(ispin), g_iao(ispin), have_mbs, minbas)
else if (loc_opt.eq.1) then
if (debug) write (luout,*)
& pname//': back from ibo_localization (occ)'
end if
c localize virtual MOs:
if(loc_opt.eq.1 .or. loc_opt.eq.2) then
ltyp = 'vir'
call ibo_localization(rtdb, geom, ltyp, basis,
& g_smat,
& g_movecs(ispin),nocc,nvir, nmo, nbf, natoms,
& dbl_mb(k_eval+(ispin-1)*nbf),
& dbl_mb(k_occ+(ispin-1)*nbf),
& dbl_mb(k_c),
& dbl_mb(k_pop), int_mb(k_list))
& dbl_mb(k_pop),
& dbl_mb(k_cpop+(ispin-1)*natoms),
& int_mb(k_list),
& have_iao(ispin), g_iao(ispin), have_mbs, minbas)
else if(loc_opt.eq.2) then
ltyp = 'occ'
call ibo_localization(rtdb, geom, ltyp, basis,
& g_movecs(ispin),nocc,nvir, nmo, nbf, natoms,
& dbl_mb(k_eval+(ispin-1)*nbf),
& dbl_mb(k_occ+(ispin-1)*nbf),
& dbl_mb(k_c),
& dbl_mb(k_pop), int_mb(k_list))
if (debug) write (luout,*)
& pname//': back from ibo_localization (vir)'
ltyp = 'vir'
call ibo_localization(rtdb, geom, ltyp, basis,
& g_movecs(ispin),nocc,nvir, nmo, nbf, natoms,
& dbl_mb(k_eval+(ispin-1)*nbf),
& dbl_mb(k_occ+(ispin-1)*nbf),
& dbl_mb(k_c),
& dbl_mb(k_pop), int_mb(k_list))
end if
else
call errquit(pname//': loc_opt out of range',loc_opt,
& UNKNOWN_ERR)
end if ! loc_opt
if (debug) write (luout,*)
& pname//': back from ibo_localization'
c destroy minimal basis (iao basis), it was created in
c routine ibo_localization
if (.not.bas_destroy(minbas))
& call errquit(pname//'iao bas_destroy failed',0,BASIS_ERR)
c write transformation for this spin to scratch file
c (occ-occ transformation only)
@ -704,12 +735,97 @@ c (occ-occ transformation only)
end if ! save lmotrans for occ MOs
end do ! ispin
end do ! ispin
c Print IAO population-based atomic charges:
if (.not. rtdb_get(rtdb, 'charge', mt_dbl, 1, q_mol))
& q_mol = 0.0d0
if(master .and. loc_opt.ne.1) then
write(luout,'(/10x,a)') " IAO-based populations "
write(luout, '(10x,a)') "----------------------------"
write(luout,'(/10x,a)') "Atom # Charge"
write(luout, '(10x,a)') "--------- ----------------"
do i=1,natoms
c fetch nuclear charge for this atom
if (.not.geom_cent_get(geom, i, tag, atxyz, q_nuc))
& call errquit (
& pname//': cannot get atom info iao chg',1,
& UNKNOWN_ERR)
if (.not. ga_destroy(g_smat)) call errquit(
& pname//' ibo: error destroying g_smat',1, GA_ERR)
if (.not. ga_destroy(g_sc0)) call errquit(
& pname//' ibo: error destroying g_sc0',1, GA_ERR)
c IAO atomic charges:
rtmp = -dbl_mb(k_cpop+i-1)
if (nspin.eq.1) rtmp = rtmp * 2.0d0
rtmp = rtmp + q_nuc
if (nspin.eq.2) rtmp = rtmp - dbl_mb(k_cpop+i-1+natoms)
write(luout, '(t11,a,t14,i6,t23,f10.3)') trim(tag),i, rtmp
dbl_mb(k_pop+i-1) = rtmp
end do ! i=1,natoms
write(luout, '(10x,a)') "----------------------------"
c Now the IAO populations are in k_pop MA array.
c Check if total charge = population; print warning if not.
c Use q_nuc to store the total charge temporarily
q_nuc = 0.0d0
do i=1,natoms
q_nuc = q_nuc + dbl_mb(k_pop+i-1)
end do
write(luout, '(t11, a3, t23, f10.3/)') 'sum', q_nuc
if (dabs(q_mol - q_nuc).gt.1e-8) then
write(luout,'(/1x,a,1x,a/)')
& "WARNING: sum of IAO-population based atomic",
& "charges not equal to total mol. charge in RTDB"
write(luout,*) "mol charge:", q_mol
write(luout,*) "sum of atomic charges", q_nuc
end if
end if ! master
c save IAOs to an 'movecs' file in case we want to
c visualize them
alo(:) = 0
ahi(:) = 0
do ispin = 1,nspin
call ga_inquire (g_iao(ispin), info, alo(ispin), ahi(ispin))
if (debug) write(luout,*)
& 'g_iao dims:', alo(ispin), ahi(ispin)
end do
if (nspin.eq.2 .and. ahi(1).ne.ahi(2)) then
if (master) then
write(luout,'(1x,a/1x,a/1x,a)')
& 'Warning: The IAO sets for the two spins do not have',
& 'the same column dimension. Unable to save iaos.movecs.',
& 'You probably want to check what went wrong !'
end if
else
call hnd_vec_write(rtdb,geom,basis,nbf,nclosed,nopen,
& nvirt,scftyp,g_iao,dbl_mb(k_occ),
& dbl_mb(k_eval),ahi(1), 'iaos.movecs')
write(tag,'(i0)') ahi(1)
if (master) write(luout,'(1x,a,a,a)')
& 'IAOs saved to file iaos.movecs (',trim(tag),' orbitals)'
end if
c clean up arrays. g_iao(ispin) was allocated in routine
c ibo_localization
do ispin = 1,nspin
if (.not. ga_destroy(g_iao(ispin))) call errquit(
& pname//': error destroying g_iao',ispin, GA_ERR)
end do ! ispin
if (.not. ga_destroy(g_smat)) call errquit(
& pname//' ibo: error destroying g_smat',1, GA_ERR)
if (.not. ga_destroy(g_sc0)) call errquit(
& pname//' ibo: error destroying g_sc0',1, GA_ERR)
end if ! loctype