For Kohn–Sham DFT, any of the several available functionals is specified as illustrated below, see the exchange-correlation functionals page for a complete list of available functionals.
For input text files, a detailed list of keywords is available.
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.914424308582 a.u. Time: 1.14 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -76.354543788653 0.0000000000 0.17580812 0.02348012 0.00000000
2 -76.356749961810 -0.0022061732 0.07278295 0.00993161 0.04631269
3 -76.357022715953 -0.0002727541 0.04650161 0.00521591 0.02403927
4 -76.357216415458 -0.0001936995 0.00031128 0.00005140 0.01027665
5 -76.357216425698 -0.0000000102 0.00001019 0.00000111 0.00008250
6 -76.357216425711 -0.0000000000 0.00000173 0.00000024 0.00000491
7 -76.357216425711 -0.0000000000 0.00000010 0.00000002 0.00000068
*** SCF converged in 7 iterations. Time: 0.96 sec.
Spin-Restricted Kohn-Sham:
--------------------------
Total Energy : -76.3572164257 a.u.
Electronic Energy : -85.2452779903 a.u.
Nuclear Repulsion Energy : 8.8880615645 a.u.
------------------------------------
Gradient Norm : 0.0000000992 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
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.057502316791 a.u. Time: 0.80 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -129.765364834381 0.0000000000 0.59667617 0.15046484 0.00000000
2 -129.744497234360 0.0208676000 0.85687515 0.21154830 0.21835119
3 -129.783362116624 -0.0388648823 0.10900911 0.02166237 0.14798209
4 -129.783926223218 -0.0005641066 0.01758646 0.00420667 0.02151082
5 -129.783945931672 -0.0000197085 0.00166085 0.00041571 0.00503950
6 -129.783946178851 -0.0000002472 0.00064693 0.00017917 0.00059971
7 -129.783946210550 -0.0000000317 0.00003544 0.00000875 0.00019778
8 -129.783946210698 -0.0000000001 0.00000334 0.00000094 0.00001855
9 -129.783946210698 -0.0000000000 0.00000032 0.00000007 0.00000238
*** SCF converged in 9 iterations. Time: 2.18 sec.
Spin-Restricted Open-Shell Kohn-Sham:
-------------------------------------
Total Energy : -129.7839462107 a.u.
Electronic Energy : -154.6317689015 a.u.
Nuclear Repulsion Energy : 24.8478226908 a.u.
------------------------------------
Gradient Norm : 0.0000003198 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
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.061869257570 a.u. Time: 0.72 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -129.770414431605 0.0000000000 0.39571967 0.04509838 0.00000000
2 -129.759898285392 0.0105161462 0.51326200 0.06157653 0.18204424
3 -129.784884912684 -0.0249866273 0.08171597 0.00828856 0.11897156
4 -129.785485118021 -0.0006002053 0.00995470 0.00148490 0.01972754
5 -129.785497643028 -0.0000125250 0.00103236 0.00016748 0.00501902
6 -129.785498115585 -0.0000004726 0.00039706 0.00008900 0.00082458
7 -129.785498279670 -0.0000001641 0.00019013 0.00004304 0.00060797
8 -129.785498305422 -0.0000000258 0.00005329 0.00000988 0.00031765
9 -129.785498306142 -0.0000000007 0.00001692 0.00000222 0.00004111
10 -129.785498306195 -0.0000000001 0.00000171 0.00000022 0.00000884
11 -129.785498306196 -0.0000000000 0.00000028 0.00000007 0.00000133
*** SCF converged in 11 iterations. Time: 2.18 sec.
Spin-Unrestricted Kohn-Sham:
----------------------------
Total Energy : -129.7854983062 a.u.
Electronic Energy : -154.6333137000 a.u.
Nuclear Repulsion Energy : 24.8478153938 a.u.
------------------------------------
Gradient Norm : 0.0000002799 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
Text file
@jobs
task: uscf
@end
@method settings
basis: def2-svp
xcfun: pbe0
@end
@molecule
charge: 1
multiplicity: 2
xyz:
...
@end