VeloxChem supports several types of SCF reference states for DFT calculations, allowing users to select the electronic description best suited to the system’s spin and symmetry: restricted closed‑shell DFT for singlet ground states with paired electrons, RODFT (restricted open‑shell DFT) for high‑spin systems that preserve a common spatial orbital set for paired electrons, and UDFT (unrestricted DFT) for general open‑shell situations where the α and β electrons occupy independently optimized orbitals.
Restricted closed-shell¶
Python script
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"
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 : 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: -75.914424315018 a.u. Time: 1.73 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -76.354542525191 0.0000000000 0.17587538 0.02347379 0.00000000
2 -76.356801440016 -0.0022589148 0.06858414 0.00926569 0.04528504
3 -76.357073849613 -0.0002724096 0.04004835 0.00452441 0.02196601
4 -76.357217261001 -0.0001434114 0.00030308 0.00005160 0.00889620
5 -76.357217270760 -0.0000000098 0.00001042 0.00000113 0.00008244
6 -76.357217270774 -0.0000000000 0.00000179 0.00000024 0.00000504
7 -76.357217270774 -0.0000000000 0.00000010 0.00000002 0.00000071
*** SCF converged in 7 iterations. Time: 2.21 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.0000000999 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
print(f"Orbital occupation α,β-spin: {scf_results["occ_alpha"][:10]}")
print("Orbital energies α,β-spin (a.u.):\n", scf_results["E_alpha"][:10])Orbital occupation α,β-spin: [1. 1. 1. 1. 1. 0. 0. 0. 0. 0.]
Orbital energies α,β-spin (a.u.):
[-19.12219351 -0.96878733 -0.50551377 -0.36345166 -0.2895069
0.0397504 0.11770565 0.54491518 0.59493537 0.91642722]
Text file
@jobs
task: scf
@end
@method settings
basis: def2-svp
xcfun: b3lyp
@end
@molecule
charge: 0
multiplicity: 1
xyz:
...
@endRestricted open-shell¶
Python script
import veloxchem as vlx
molecule = vlx.Molecule.read_smiles("[N]=O")
molecule.set_multiplicity(2)
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedOpenDriver()
scf_drv.xcfun = "b3lyp"
scf_results = scf_drv.compute(molecule, basis)
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Open-Shell 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: -129.057485382474 a.u. Time: 0.49 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -129.764933337196 0.0000000000 0.60341253 0.16108719 0.00000000
2 -129.749613734065 0.0153196031 0.80143242 0.20926533 0.21030391
3 -129.783271711297 -0.0336579772 0.11737274 0.02429155 0.14112499
4 -129.783928542679 -0.0006568314 0.01685570 0.00388005 0.02082569
5 -129.783946065793 -0.0000175231 0.00137346 0.00039266 0.00447877
6 -129.783946219730 -0.0000001539 0.00054777 0.00016866 0.00043915
7 -129.783946241609 -0.0000000219 0.00002392 0.00000704 0.00014744
8 -129.783946241821 -0.0000000002 0.00000411 0.00000136 0.00002560
9 -129.783946241822 -0.0000000000 0.00000029 0.00000009 0.00000243
*** SCF converged in 9 iterations. Time: 1.39 sec.
Spin-Restricted Open-Shell Kohn-Sham:
-------------------------------------
Total Energy : -129.7839462418 a.u.
Electronic Energy : -154.6317689326 a.u.
Nuclear Repulsion Energy : 24.8478226908 a.u.
------------------------------------
Gradient Norm : 0.0000002864 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 2
Magnetic Quantum Number (M_S) : 0.5
Expectation value of S**2 : 0.7500
print(f"Orbital occupation α-spin: {scf_results["occ_alpha"][:10]}")
print(f"Orbital occupation β-spin: {scf_results["occ_beta"][:10]}")
print("Orbital energies α,β-spin (a.u.):\n", scf_results["E_alpha"][:10])Orbital occupation α-spin: [1. 1. 1. 1. 1. 1. 1. 1. 0. 0.]
Orbital occupation β-spin: [1. 1. 1. 1. 1. 1. 1. 0. 0. 0.]
Orbital energies α,β-spin (a.u.):
[-19.27368892 -14.47080255 -1.20607409 -0.68041446 -0.52387878
-0.49584857 -0.48049371 -0.23231923 -0.12129919 0.30145246]
Text file
@jobs
task: roscf
@end
@method settings
basis: 6-31+G*
xcfun: b3lyp
@end
@molecule
charge: 1
multiplicity: 2
xyz:
...
@endUnrestricted open-shell¶
Python script
import veloxchem as vlx
molecule = vlx.Molecule.read_smiles("[N]=O")
molecule.set_multiplicity(2)
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scfdrv = vlx.ScfUnrestrictedDriver()
scfdrv.xcfun = "b3lyp"
scf_results = scfdrv.compute(molecule, basis)
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Unrestricted 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: -129.061853345103 a.u. Time: 0.43 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -129.770422524819 0.0000000000 0.39565404 0.04935156 0.00000000
2 -129.763736394160 0.0066861307 0.47391916 0.06296619 0.17373740
3 -129.784738390037 -0.0210019959 0.09126061 0.00941422 0.11369978
4 -129.785485927104 -0.0007475371 0.00979565 0.00141024 0.01997809
5 -129.785497733075 -0.0000118060 0.00087409 0.00015867 0.00468732
6 -129.785497980386 -0.0000002473 0.00029738 0.00007196 0.00069731
7 -129.785498015414 -0.0000000350 0.00008710 0.00002017 0.00026126
8 -129.785498022243 -0.0000000068 0.00003803 0.00000794 0.00010231
9 -129.785498023843 -0.0000000016 0.00001421 0.00000363 0.00005999
10 -129.785498024012 -0.0000000002 0.00000223 0.00000037 0.00002558
11 -129.785498024013 -0.0000000000 0.00000013 0.00000002 0.00000201
*** SCF converged in 11 iterations. Time: 1.70 sec.
Spin-Unrestricted Kohn-Sham:
----------------------------
Total Energy : -129.7854980240 a.u.
Electronic Energy : -154.6333134178 a.u.
Nuclear Repulsion Energy : 24.8478153938 a.u.
------------------------------------
Gradient Norm : 0.0000001252 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 2
Magnetic Quantum Number (M_S) : 0.5
Expectation value of S**2 : 0.7528
print(f"Orbital occupation α-spin: {scf_results["occ_alpha"][:10]}")
print(f"Orbital occupation β-spin: {scf_results["occ_beta"][:10]}")
print("Orbital energies α-spin (a.u.):\n", scf_results["E_alpha"][:10])
print("Orbital energies β-spin (a.u.):\n", scf_results["E_beta"][:10])Orbital occupation α-spin: [1. 1. 1. 1. 1. 1. 1. 1. 0. 0.]
Orbital occupation β-spin: [1. 1. 1. 1. 1. 1. 1. 0. 0. 0.]
Orbital energies α-spin (a.u.):
[-19.27368892 -14.47080255 -1.20607409 -0.68041446 -0.52387878
-0.49584857 -0.48049371 -0.23231923 -0.12129919 0.30145246]
Orbital energies β-spin (a.u.):
[-19.26364681 -14.45472904 -1.18448121 -0.64354186 -0.48583559
-0.45693795 -0.44908194 -0.1046368 -0.06134444 0.3185291 ]
Text file
@jobs
task: uscf
@end
@method settings
basis: def2-svp
xcfun: pbe0
@end
@molecule
charge: 1
multiplicity: 2
xyz:
...
@end