From notebook cell
import veloxchem as vlx
molecule = vlx.Molecule.read_smiles('CCO')
basis = vlx.MolecularBasis.read(molecule, 'def2-svp')
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = 'b3lyp'
results = scf_drv.compute(molecule, basis)
opt_drv = vlx.OptimizationDriver(scf_drv)
opt_results = opt_drv.compute(molecule, basis, results)
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Kohn-Sham
Initial Guess Model : Superposition of Atomic Densities
Convergence Accelerator : Two Level Direct Inversion of Iterative Subspace
Max. Number of Iterations : 50
Max. Number of Error Vectors : 10
Convergence Threshold : 1.0e-06
ERI Screening Threshold : 1.0e-12
Linear Dependence Threshold : 1.0e-06
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
* Info * Using the B3LYP functional.
P. J. Stephens, F. J. Devlin, C. F. Chabalowski, and M. J. Frisch., J. Phys. Chem. 98, 11623 (1994)
* Info * Using the Libxc library (v7.0.0).
S. Lehtola, C. Steigemann, M. J.T. Oliveira, and M. A.L. Marques., SoftwareX 7, 1–5 (2018)
* Info * Using the following algorithm for XC numerical integration.
J. Kussmann, H. Laqua and C. Ochsenfeld, J. Chem. Theory Comput. 2021, 17, 1512-1521
* Info * Starting Reduced Basis SCF calculation...
* Info * ...done. SCF energy in reduced basis set: -153.878486392937 a.u. Time: 0.08 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -154.914064502408 0.0000000000 0.25700154 0.02179011 0.00000000
2 -154.917228200392 -0.0031636980 0.18477397 0.01179506 0.14535754
3 -154.921419464512 -0.0041912641 0.03153015 0.00159927 0.06527732
4 -154.921522198651 -0.0001027341 0.00963180 0.00077432 0.01040150
5 -154.921530557133 -0.0000083585 0.00173197 0.00010436 0.00336227
6 -154.921530851578 -0.0000002944 0.00029569 0.00002451 0.00063152
7 -154.921530862992 -0.0000000114 0.00003877 0.00000229 0.00013434
8 -154.921530863151 -0.0000000002 0.00001670 0.00000085 0.00001563
9 -154.921530863185 -0.0000000000 0.00000165 0.00000009 0.00000567
10 -154.921530863186 -0.0000000000 0.00000015 0.00000001 0.00000083
*** SCF converged in 10 iterations. Time: 1.55 sec.
Spin-Restricted Kohn-Sham:
--------------------------
Total Energy : -154.9215308632 a.u.
Electronic Energy : -236.6490992715 a.u.
Nuclear Repulsion Energy : 81.7275684083 a.u.
------------------------------------
Gradient Norm : 0.0000001479 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
Optimization Driver Setup
===========================
Coordinate System : TRIC
Constraints : No
Max. Number of Steps : 300
Transition State : No
IRC : No
Hessian : never
* Info * Using geomeTRIC for geometry optimization.
L.-P. Wang and C.C. Song, J. Chem. Phys. 2016, 144, 214108
Optimization Step 0
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.648554000000 1.139402000000 1.295920000000
C 0.180717000000 -0.065166000000 0.867911000000
O 0.907537000000 -0.568121000000 1.955549000000
H -1.196687000000 1.546537000000 0.420273000000
H 0.014141000000 1.930694000000 1.706083000000
H -1.383986000000 0.839971000000 2.072410000000
H 0.893504000000 0.247834000000 0.076044000000
H -0.482951000000 -0.852290000000 0.443376000000
H 0.264334000000 -1.075537000000 2.516526000000
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C 0.003214401205 -0.003264944887 0.005993182788
C 0.007072321456 -0.004748980929 0.001456783170
O 0.006880913154 0.020305597692 -0.017097342388
H -0.000181441721 -0.000709573818 -0.005655484476
H 0.004851300840 0.004307551216 0.001239878951
H -0.002529063061 -0.003600381501 0.003174495870
H 0.000869448178 0.004393405219 -0.004131453983
H -0.002534084831 -0.003362503411 0.003044564774
H -0.017670739453 -0.013346320801 0.011996691329
*** Time spent in gradient calculation: 1.04 sec ***
* Info * Energy : -154.9215308632 a.u.
* Info * Gradient : 1.369345e-02 a.u. (RMS)
* Info * 2.742232e-02 a.u. (Max)
* Info * Time : 2.74 sec
Optimization Step 1
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.663660225408 1.150162247330 1.284344041706
C 0.168734845837 -0.070452569003 0.882473241069
O 0.931356631542 -0.607997065506 1.947009581974
H -1.200853908086 1.578631677179 0.420998176890
H -0.011433193625 1.928217500221 1.708223279896
H -1.413312274509 0.878886790325 2.046171288733
H 0.896716401021 0.217408644086 0.105823420569
H -0.490656021983 -0.836683654911 0.425964335850
H 0.333729234458 -1.092358616349 2.531054240577
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C -0.002228982521 0.002889958857 -0.000218989025
C 0.000897561036 -0.001930047499 0.000694540375
O 0.001499050279 0.000115416826 0.001047133313
H -0.000567799989 0.000980298671 0.000002379743
H 0.000050222722 -0.000722827081 -0.000735087737
H 0.000514972612 -0.000362871325 -0.000492973766
H 0.000171907049 -0.000232200274 0.000232943455
H -0.000475652331 0.000429140954 0.000073048482
H 0.000138664336 -0.001180370816 -0.000594501809
*** Time spent in gradient calculation: 1.01 sec ***
* Info * Energy : -154.9234098626 a.u.
* Info * Gradient : 1.733535e-03 a.u. (RMS)
* Info * 3.656252e-03 a.u. (Max)
* Info * Time : 2.63 sec
Optimization Step 2
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.659290944876 1.143812387815 1.287854219009
C 0.168440345482 -0.070582664695 0.875642649038
O 0.927124702052 -0.607443190501 1.941720094621
H -1.194759750384 1.571699182031 0.424762444444
H -0.010346395765 1.922699104911 1.717157614275
H -1.410922724423 0.872050705574 2.048430117767
H 0.895642064591 0.218369152153 0.098857579404
H -0.489955041300 -0.836713409782 0.417787508820
H 0.324794106766 -1.066782762261 2.539017660353
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C -0.000611506844 0.000891579070 0.000219164118
C 0.000351210677 -0.000869461470 -0.000748401867
O -0.000860065640 0.000666375363 0.001570444461
H 0.000244750334 -0.000141447807 0.000228906167
H -0.000081471155 -0.000161929838 -0.000185886705
H 0.000259239069 0.000051769064 -0.000118130769
H -0.000091688440 -0.000313307076 0.000003141319
H -0.000132359183 0.000364788052 0.000186708230
H 0.000921953292 -0.000497241971 -0.001145713701
*** Time spent in gradient calculation: 1.20 sec ***
* Info * Energy : -154.9235340860 a.u.
* Info * Gradient : 1.016085e-03 a.u. (RMS)
* Info * 1.910514e-03 a.u. (Max)
* Info * Time : 2.64 sec
Optimization Step 3
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.655378565844 1.136556510530 1.290486355912
C 0.168509948422 -0.071904587074 0.868281988127
O 0.925850421124 -0.615343689454 1.930936522347
H -1.190422166830 1.569923352205 0.429751254152
H -0.008856649538 1.913591113056 1.728556900806
H -1.409820448460 0.861125614470 2.048126365380
H 0.895526653156 0.219730485662 0.092180811702
H -0.489842710166 -0.836524067203 0.406667940046
H 0.315271432483 -1.027964785080 2.554200246072
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C 0.000942620131 -0.001014819685 0.000093918425
C -0.000346779088 0.000653470821 -0.000780534748
O -0.001323993116 0.001040825749 0.001028100879
H 0.000326880221 -0.000480172289 0.000024700318
H -0.000085252183 0.000228255318 0.000253802421
H -0.000016939766 0.000223498488 0.000201375639
H -0.000155752497 -0.000301948446 -0.000221984267
H 0.000053549764 0.000072285164 0.000233486636
H 0.000603146205 -0.000422706566 -0.000819527907
*** Time spent in gradient calculation: 1.05 sec ***
* Info * Energy : -154.9236332288 a.u.
* Info * Gradient : 9.983879e-04 a.u. (RMS)
* Info * 1.973136e-03 a.u. (Max)
* Info * Time : 2.61 sec
Optimization Step 4
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.652204458755 1.127318524516 1.293430705648
C 0.168114087202 -0.076641956590 0.858343249221
O 0.925297847539 -0.634309731404 1.913198505651
H -1.184930833804 1.573476841752 0.437604752863
H -0.006915782792 1.897996293102 1.745243327484
H -1.411912469061 0.845163128563 2.044303719483
H 0.896643786544 0.220526758327 0.085748584563
H -0.491766152008 -0.835582425522 0.387730010680
H 0.309160789579 -0.966128503828 2.579059319137
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C 0.001690829219 -0.001903665365 -0.000265590209
C -0.000915167245 0.001577340547 -0.000293290302
O -0.000757724173 0.000661726121 0.000236654571
H 0.000169314910 -0.000447453762 -0.000048826446
H -0.000134522309 0.000375846823 0.000487466193
H -0.000247799906 0.000314959040 0.000336136828
H -0.000065101163 -0.000286979122 -0.000210273430
H 0.000150824006 -0.000196504410 0.000052961667
H 0.000112834373 -0.000112822439 -0.000290809826
*** Time spent in gradient calculation: 1.05 sec ***
* Info * Energy : -154.9237270770 a.u.
* Info * Gradient : 1.166182e-03 a.u. (RMS)
* Info * 2.559958e-03 a.u. (Max)
* Info * Time : 2.60 sec
Optimization Step 5
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.652929158169 1.125943293119 1.293718996150
C 0.168143516503 -0.079086521185 0.856032296807
O 0.925487663801 -0.642472058838 1.907966341438
H -1.184256024203 1.577620057106 0.439735205366
H -0.005961956170 1.892935704217 1.748689888740
H -1.413788517323 0.840151608598 2.041769408264
H 0.897283095113 0.221770826190 0.085436396063
H -0.493151597401 -0.834688807153 0.381781826245
H 0.310315099044 -0.947279871450 2.588036563056
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C 0.000874180111 -0.000936525665 -0.000241284350
C -0.000486863494 0.000849553771 -0.000052767792
O -0.000139330603 0.000145837383 0.000055882084
H 0.000005320558 -0.000144208549 -0.000026459024
H -0.000070315399 0.000165667106 0.000245872542
H -0.000158830581 0.000135835423 0.000156091366
H -0.000032056731 -0.000091527788 -0.000142288403
H 0.000058508306 -0.000120438433 -0.000011786272
H -0.000044590505 -0.000025185525 0.000021698489
*** Time spent in gradient calculation: 1.01 sec ***
* Info * Energy : -154.9237519847 a.u.
* Info * Gradient : 5.713608e-04 a.u. (RMS)
* Info * 1.303645e-03 a.u. (Max)
* Info * Time : 2.42 sec
Optimization Step 6
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.654130104120 1.126941396374 1.293499110475
C 0.168228334945 -0.079594037652 0.856230901904
O 0.925894680232 -0.643683326992 1.907458587407
H -1.184990141799 1.579451810107 0.439661249503
H -0.005709427804 1.892888082977 1.747543302718
H -1.414436568599 0.840024008897 2.041237965515
H 0.897666136166 0.222572279912 0.086543472543
H -0.493482935213 -0.834292226257 0.381371703313
H 0.311266368086 -0.946405825372 2.588929896803
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C 0.000121491407 -0.000107908914 -0.000057883999
C -0.000090074080 0.000121043230 0.000006578602
O 0.000051287900 -0.000032992620 0.000027791583
H -0.000017325702 0.000009261134 0.000003754631
H -0.000013269903 0.000009268945 0.000035763710
H -0.000032548272 0.000009655890 0.000007589728
H -0.000004850986 -0.000014010236 -0.000031955318
H 0.000011959232 -0.000021354463 0.000007237351
H -0.000020260546 0.000006133970 0.000005984476
*** Time spent in gradient calculation: 1.00 sec ***
* Info * Energy : -154.9237559247 a.u.
* Info * Gradient : 8.338805e-05 a.u. (RMS)
* Info * 1.724965e-04 a.u. (Max)
* Info * Time : 2.23 sec
Optimization Step 7
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C -0.654413002445 1.127407347629 1.293403873786
C 0.168199131531 -0.079333420243 0.856366871267
O 0.925816272458 -0.643187084044 1.907669354805
H -1.185296612011 1.579542099307 0.439402661766
H -0.005767107690 1.893456362911 1.746880502888
H -1.414418863479 0.840521432660 2.041379295206
H 0.897714736067 0.222993557967 0.086853514386
H -0.493492408224 -0.834004551078 0.381470940896
H 0.311268033908 -0.947284189563 2.588583920858
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C 0.000006318313 -0.000000570856 -0.000005883564
C -0.000010699130 0.000009913633 -0.000011647334
O 0.000028801045 -0.000011297749 0.000013815280
H 0.000000226692 0.000009916211 0.000002406505
H -0.000000185621 -0.000008982316 0.000007059785
H -0.000007576186 -0.000004501654 -0.000007914250
H -0.000005472944 -0.000005320221 -0.000007840618
H -0.000000634952 -0.000005484243 0.000009664382
H -0.000004443691 -0.000004513913 0.000005088504
*** Time spent in gradient calculation: 1.02 sec ***
* Info * Energy : -154.9237559061 a.u.
* Info * Gradient : 1.583223e-05 a.u. (RMS)
* Info * 3.388217e-05 a.u. (Max)
* Info * Time : 2.12 sec
* Info * Geometry optimization completed.
Final Geometry (Angstroms)
============================
Atom Coordinate X Coordinate Y Coordinate Z
C -0.654413002445 1.127407347629 1.293403873786
C 0.168199131531 -0.079333420243 0.856366871267
O 0.925816272458 -0.643187084044 1.907669354805
H -1.185296612011 1.579542099307 0.439402661766
H -0.005767107690 1.893456362911 1.746880502888
H -1.414418863479 0.840521432660 2.041379295206
H 0.897714736067 0.222993557967 0.086853514386
H -0.493492408224 -0.834004551078 0.381470940896
H 0.311268033908 -0.947284189563 2.588583920858
Summary of Geometry Optimization
==================================
Opt.Step Energy (a.u.) Energy Change (a.u.) Displacement (RMS, Max)
-------------------------------------------------------------------------------------
0 -154.921530863186 0.000000000000 0.000e+00 0.000e+00
1 -154.923409862573 -0.001878999387 4.164e-02 7.224e-02
2 -154.923534086007 -0.000124223434 1.224e-02 2.815e-02
3 -154.923633228767 -0.000099142760 1.729e-02 4.265e-02
4 -154.923727077006 -0.000093848239 2.725e-02 6.702e-02
5 -154.923751984717 -0.000024907711 8.688e-03 2.062e-02
6 -154.923755924675 -0.000003939958 1.266e-03 1.738e-03
7 -154.923755906132 0.000000018543 5.288e-04 1.192e-03
Statistical Deviation between
Optimized Geometry and Initial Geometry
=========================================
Internal Coord. RMS deviation Max. deviation
-----------------------------------------------------------
Bonds 0.012 Angstrom 0.027 Angstrom
Angles 1.504 degree 2.869 degree
Dihedrals 7.987 degree 17.596 degree
*** Time spent in Optimization Driver: 20.14 sec
* Info * Optimization results written to file: vlx_20260421_6a25ba09.h5
opt_drv.plot_convergence(opt_results)
From an h5 file
opt_results = vlx.read_results("../output_files/bithio-S0-opt.h5", label="opt")
opt_drv.plot_convergence(opt_results)