VeloxChem supports robust restart capabilities via binary HDF5 (.h5) files that capture the essential electronic‑structure state needed to resume or reuse calculations reproducibly and efficiently.
What is stored in the restart file?¶
The restart file is designed to be portable, compact, and self‑describing. It typically contains:
System definition
Cartesian geometry (atomic numbers, positions)
Charge and spin multiplicity
Basis and integral metadata
Basis‑set and ECP identifiers per atom
Integral conventions
XC grid settings
SCF/DFT electronic state
Total energies
Molecular‑orbital (MO) coefficients and orbital energies
Occupations (including fractional, if used)
Density matrix (α/β for unrestricted cases)
SCF convergence thresholds and last achieved residuals
Functional specification
Additional model context (when active)
Implicit solvation model and parameters (e.g., CPCM/SMD)
Explicit solvation model and parameters (polarizable embedding)
External fields (if present) and unit specifications
Provenance and versioning
VeloxChem version, build info, and I/O schema version
Host and timestamp metadata to aid reproducibility
What can be restarted?¶
SCF/DFT single‑point energy
Resume from a converged density and MO set for instant re‑evaluation (e.g., with tighter thresholds or different print options).Geometry optimization & PES scans
Reuse the last converged density/MOs at a new geometry as a high‑quality initial guess to accelerate SCF convergence along a path or during restarts after wall‑time limits.Vibrational analysis (IR/Raman)
Start the property step from a converged electronic state at the optimized geometry.Spectroscopies (UV/vis, optical activity)
Provide a clean ground‑state reference (MOs, occupations, density) for TDDFT and CPP runs to reduce set‑up time and ensure consistency of state definitions.
Writing restart files¶
VeloxChem can write a restart file at the end of an SCF/DFT calculation (and at checkpoints for longer runs).
import veloxchem as vlx
molecule = vlx.Molecule.read_name("water")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "b3lyp"
# specify name of HDF5 file
scf_drv.filename = "my_vlx_calc"
scf_results = scf_drv.compute(molecule, basis)Reading water from PubChem...
Reference: S. Kim, J. Chen, T. Cheng, A. Gindulyte, J. He, S. He, Q. Li, B. A. Shoemaker, P. A. Thiessen, B. Yu, L. Zaslavsky, J. Zhang, E. E. Bolton, Nucleic Acids Res., 2025, 53, D1516-D1525.
Please double-check the compound since names may refer to more than one record.
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Kohn-Sham
Initial Guess Model : Restart from Checkpoint
Convergence Accelerator : 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 * Restarting from checkpoint file: my_vlx_calc_scf.h5
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -76.357217270774 0.0000000000 0.00000049 0.00000007 0.00000000
* Info * Checkpoint written to file: my_vlx_calc_scf.h5
* Info * SCF results written to file: my_vlx_calc.h5
*** SCF converged in 1 iterations. Time: 0.02 sec.
Spin-Restricted Kohn-Sham:
--------------------------
Total Energy : -76.3572172708 a.u.
Electronic Energy : -85.2452833708 a.u.
Nuclear Repulsion Energy : 8.8880661000 a.u.
------------------------------------
Gradient Norm : 0.0000004940 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
File content¶
Depending on the details of calculations, restart files contain different information. A quick overview of the information is readily available.
import h5py
with h5py.File(f"{scf_drv.filename}_scf.h5", "r") as f:
for key in f.keys():
print(key)alpha_energies
alpha_occupations
alpha_orbitals
atom_basis_labels_flattened
atom_coordinates
basis_set
dft_func_label
method_settings
molecular_charge
nuclear_charges
nuclear_repulsion
number_of_alpha_electrons
number_of_atoms
number_of_beta_electrons
potfile_text
scf_settings
scf_type
spin_multiplicity
Restarting calculations¶
VeloxChem can read a restart file in the beginning of the calculation.
import veloxchem as vlx
fname = "../output_files/c2h4"
molecule, basis = vlx.read_molecule_and_basis(f"{fname}_scf.h5")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.filename = fname
scf_results = scf_drv.compute(molecule, basis)
rsp_drv = vlx.LinearResponseEigenSolver()
rsp_drv.nstates = 5
rsp_drv.filename = fname
rsp_results = rsp_drv.compute(molecule, basis, scf_results)
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Hartree-Fock
Initial Guess Model : Restart from Checkpoint
Convergence Accelerator : 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
* Info * Restarting from checkpoint file: ../output_files/c2h4_scf.h5
Iter. | Hartree-Fock Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -77.977992711737 0.0000000000 0.00000030 0.00000005 0.00000000
* Info * Checkpoint written to file: ../output_files/c2h4_scf.h5
* Info * SCF results written to file: ../output_files/c2h4.h5
*** SCF converged in 1 iterations. Time: 0.02 sec.
Spin-Restricted Hartree-Fock:
-----------------------------
Total Energy : -77.9779927117 a.u.
Electronic Energy : -111.5154198613 a.u.
Nuclear Repulsion Energy : 33.5374271495 a.u.
------------------------------------
Gradient Norm : 0.0000002992 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
Linear Response EigenSolver Setup
===================================
Number of States : 5
Max. Number of Iterations : 150
Convergence Threshold : 1.0e-04
ERI Screening Threshold : 1.0e-12
* Info * Restarting from checkpoint file: ../output_files/c2h4_rsp.h5
* Info * 39 gerade trial vectors in reduced space
* Info * 39 ungerade trial vectors in reduced space
*** Iteration: 1 * Residuals (Max,Min): 5.78e-05 and 1.42e-05
* Info * Checkpoint written to file: ../output_files/c2h4_rsp.h5
* Info * Time spent in writing checkpoint file: 0.01 sec
*** Linear response converged in 1 iterations. Time: 0.02 sec
* Info * Response solution vectors written to file: ../output_files/c2h4.h5
Electric Transition Dipole Moments (dipole length, a.u.)
--------------------------------------------------------
X Y Z
Excited State S1: 0.000000 0.000000 1.543748
Excited State S2: 0.000259 0.000000 -0.000000
Excited State S3: -0.181646 0.000000 0.000000
Excited State S4: -0.000047 -0.000000 0.000000
Excited State S5: 0.000000 0.000000 -0.000000
Electric Transition Dipole Moments (dipole velocity, a.u.)
----------------------------------------------------------
X Y Z
Excited State S1: 0.000000 0.000000 1.482777
Excited State S2: 0.000310 0.000000 -0.000000
Excited State S3: -0.216326 -0.000000 0.000000
Excited State S4: -0.000062 0.000000 0.000000
Excited State S5: 0.000000 -0.000000 -0.000000
Magnetic Transition Dipole Moments (a.u.)
-----------------------------------------
X Y Z
Excited State S1: -0.000013 -0.000000 -0.000000
Excited State S2: 0.000000 -0.000000 -0.648453
Excited State S3: 0.000000 0.000000 -0.000984
Excited State S4: -0.000000 0.000000 0.317172
Excited State S5: 0.000000 -0.822871 0.000000
One-Photon Absorption
---------------------
Excited State S1: 0.29746770 a.u. 8.09451 eV Osc.Str. 0.4726
Excited State S2: 0.34384575 a.u. 9.35652 eV Osc.Str. 0.0000
Excited State S3: 0.34559331 a.u. 9.40407 eV Osc.Str. 0.0076
Excited State S4: 0.35523709 a.u. 9.66649 eV Osc.Str. 0.0000
Excited State S5: 0.38056386 a.u. 10.35567 eV Osc.Str. 0.0000
Electronic Circular Dichroism
-----------------------------
Excited State S1: Rot.Str. -0.000000 a.u. -0.0000 [10**(-40) cgs]
Excited State S2: Rot.Str. 0.000000 a.u. 0.0000 [10**(-40) cgs]
Excited State S3: Rot.Str. -0.000000 a.u. -0.0000 [10**(-40) cgs]
Excited State S4: Rot.Str. 0.000000 a.u. 0.0000 [10**(-40) cgs]
Excited State S5: Rot.Str. 0.000000 a.u. 0.0000 [10**(-40) cgs]
Character of excitations:
Excited state 1
---------------
HOMO -> LUMO 0.9876
Excited state 2
---------------
HOMO-1 -> LUMO 0.8156
HOMO -> LUMO+2 0.5633
Excited state 3
---------------
HOMO -> LUMO+1 -0.9942
Excited state 4
---------------
HOMO -> LUMO+2 0.8112
HOMO-1 -> LUMO -0.5690
Excited state 5
---------------
HOMO-2 -> LUMO 0.8573
HOMO -> LUMO+3 -0.4837
import veloxchem as vlx
fname = "../output_files/c2h4"
molecule, basis = vlx.read_molecule_and_basis(f"{fname}_scf.h5")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.filename = fname
opt_drv = vlx.OptimizationDriver(scf_drv)
opt_drv.filename = fname
opt_results = opt_drv.compute(molecule, basis)
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
* Info * Reading molecular geometry from checkpoint file...
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.000000000000 -0.000016659650 -0.660075820396
C 0.000000000000 -0.000016659648 0.660075820383
H -0.000000000000 0.921866596976 -1.229859357051
H 0.000000000000 -0.921849937327 -1.229941659419
H -0.000000000000 0.921866596977 1.229859357042
H 0.000000000000 -0.921849937324 1.229941659406
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C -0.000000000000 -0.000001731062 -0.000000955479
C 0.000000000000 -0.000001731060 0.000000955478
H 0.000000000000 0.000002730748 0.000004333318
H -0.000000000000 -0.000000999687 -0.000000778847
H -0.000000000000 0.000002730748 -0.000004333317
H 0.000000000000 -0.000000999687 0.000000778847
*** Time spent in gradient calculation: 0.10 sec ***
* Info * Energy : -77.9779927117 a.u.
* Info * Gradient : 3.253209e-06 a.u. (RMS)
* Info * 5.121975e-06 a.u. (Max)
* Info * Time : 0.14 sec
Optimization Step 1
=====================
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
C 0.000000000000 0.000020848750 -0.660076931436
C -0.000000000000 0.000020848746 0.660076931425
H -0.000000000000 0.921828342437 -1.229982922598
H 0.000000000000 -0.921849191182 -1.229879735592
H -0.000000000000 0.921828342437 1.229982922579
H 0.000000000000 -0.921849191185 1.229879735583
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
C -0.000000000000 0.000002114079 0.000001058229
C -0.000000000000 0.000002114076 -0.000001058229
H 0.000000000000 -0.000003532522 -0.000006049740
H 0.000000000000 0.000001418444 0.000000374504
H 0.000000000000 -0.000003532521 0.000006049739
H 0.000000000000 0.000001418444 -0.000000374503
*** Time spent in gradient calculation: 0.09 sec ***
* Info * Energy : -77.9779927113 a.u.
* Info * Gradient : 4.351991e-06 a.u. (RMS)
* Info * 7.005574e-06 a.u. (Max)
* Info * Time : 0.21 sec
* Info * Geometry optimization completed.
Final Geometry (Angstroms)
============================
Atom Coordinate X Coordinate Y Coordinate Z
C 0.000000000000 0.000020848750 -0.660076931436
C -0.000000000000 0.000020848746 0.660076931425
H -0.000000000000 0.921828342437 -1.229982922598
H 0.000000000000 -0.921849191182 -1.229879735592
H -0.000000000000 0.921828342437 1.229982922579
H 0.000000000000 -0.921849191185 1.229879735583
Summary of Geometry Optimization
==================================
Opt.Step Energy (a.u.) Energy Change (a.u.) Displacement (RMS, Max)
-------------------------------------------------------------------------------------
0 -77.977992711737 0.000000000000 0.000e+00 0.000e+00
1 -77.977992711297 0.000000000440 8.559e-05 1.294e-04
Statistical Deviation between
Optimized Geometry and Initial Geometry
=========================================
Internal Coord. RMS deviation Max. deviation
-----------------------------------------------------------
Bonds 0.000 Angstrom 0.000 Angstrom
Angles 0.004 degree 0.004 degree
Dihedrals 0.000 degree 0.000 degree
*** Time spent in Optimization Driver: 0.36 sec
* Info * Optimization results written to file: ../output_files/c2h4.h5