First-order properties quantify expectation values of one-electron operators in individual electronic states. For the electronic ground state, quantities such as the permanent electric dipole moment are evaluated directly from the converged Kohn–Sham density, requiring no response treatment. In contrast, expectation values for electronically excited states—most notably excited-state dipole moments—are obtained from the double residue of the quadratic response function, which provides the transition-specific way to construct expectation values in the excited-state manifold. Together, these formulations provide a consistent route to state-specific first-order properties across both ground and excited electronic states. See Norman et al. (2018) for further details.
Electric dipole moment¶
The electric dipole moment consists of separate nuclear and electronic contributions, arising from the distribution of nuclear charges and the electronic density, respectively. VeloxChem evaluates the total dipole moment as the sum of these two components. For charge-neutral systems, the total dipole moment is independent of the choice of gauge origin. In contrast, for ionic systems the dipole moment depends on the origin of the coordinate system. In such cases, VeloxChem reports dipole moments computed with respect to the center of nuclear charge, providing a well-defined and physically meaningful reference point.
The standard unit for electric dipole moments is Debye (D) after Peter Debye. The conversion factor between atomic units and Debye is
Ground state¶
Python script
import veloxchem as vlx
molecule = vlx.Molecule.read_name("para-nitroaniline")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "b3lyp"
scf_results = scf_drv.compute(molecule, basis)
prop_drv = vlx.FirstOrderPropertyDriver()
prop_drv.property = "electric dipole moment"
prop_results = prop_drv.compute(molecule, basis, scf_results)Reading para-nitroaniline 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: -488.569243954976 a.u. Time: 5.60 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -491.681781588963 0.0000000000 0.63469707 0.04175984 0.00000000
2 -491.650182173240 0.0315994157 0.85120210 0.05488615 0.44187448
3 -491.717824975010 -0.0676428018 0.27219268 0.02210981 0.28412068
4 -491.723106243863 -0.0052812689 0.15543147 0.01309760 0.11615297
5 -491.725521322750 -0.0024150789 0.02520258 0.00153080 0.04830475
6 -491.725578086193 -0.0000567634 0.00956606 0.00070402 0.01091130
7 -491.725588966431 -0.0000108802 0.00359213 0.00029798 0.00483022
8 -491.725590579638 -0.0000016132 0.00130110 0.00006833 0.00180918
9 -491.725590775000 -0.0000001954 0.00025254 0.00001664 0.00042546
10 -491.725590780110 -0.0000000051 0.00012765 0.00000898 0.00010428
11 -491.725590782137 -0.0000000020 0.00001709 0.00000078 0.00004806
12 -491.725590782171 -0.0000000000 0.00000267 0.00000017 0.00000725
13 -491.725590782172 -0.0000000000 0.00000128 0.00000007 0.00000136
14 -491.725590782171 0.0000000000 0.00000064 0.00000004 0.00000067
*** SCF converged in 14 iterations. Time: 86.49 sec.
Spin-Restricted Kohn-Sham:
--------------------------
Total Energy : -491.7255907822 a.u.
Electronic Energy : -977.7263727468 a.u.
Nuclear Repulsion Energy : 486.0007819646 a.u.
------------------------------------
Gradient Norm : 0.0000006417 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
import numpy as np
results = prop_results["electric dipole moment"]
dipmom = np.linalg.norm(results["total"])
au2debye = 2.541746
print(f"Electric dipole moment: {dipmom * au2debye: .4f} Debye")
print(f"Components (a.u.):\n{"x":>6s} {"y":>8s} {"z":>8s}")
print(
f"{results["total"][0]:>8.4f} {results["total"][1]:>8.4f} {results["total"][2]:>8.4f}"
)Electric dipole moment: 8.2621 Debye
Components (a.u.):
x y z
-1.0103 2.7091 -1.4852
molecule.show()Excited state¶
Python script
import veloxchem as vlx
molecule = vlx.Molecule.read_name("para-nitroaniline")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "cam-b3lyp"
scf_results = scf_drv.compute(molecule, basis)from veloxchem.doubleresbeta import DoubleResBetaDriverexcmom_drv = DoubleResBetaDriver()
excmom_drv.initial_state = 3
excmom_drv.final_state = 3
excmom_results = excmom_drv.compute(molecule, basis, scf_results)
Quadratic Response Driver Setup
=================================
ERI Screening Threshold : 1.0e-12
Convergance Threshold : 1.0e-04
Max. Number of Iterations : 150
Max. Number of Iterations : 150
Linear Response EigenSolver Setup
===================================
Number of States : 3
Max. Number of Iterations : 150
Convergence Threshold : 1.0e-04
ERI Screening Threshold : 1.0e-12
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 * 9 gerade trial vectors in reduced space
* Info * 9 ungerade trial vectors in reduced space
*** Iteration: 1 * Residuals (Max,Min): 3.27e-01 and 7.48e-02
* Info * 12 gerade trial vectors in reduced space
* Info * 12 ungerade trial vectors in reduced space
*** Iteration: 2 * Residuals (Max,Min): 9.08e-02 and 1.35e-02
* Info * 15 gerade trial vectors in reduced space
* Info * 15 ungerade trial vectors in reduced space
*** Iteration: 3 * Residuals (Max,Min): 3.58e-02 and 3.19e-03
* Info * 18 gerade trial vectors in reduced space
* Info * 18 ungerade trial vectors in reduced space
*** Iteration: 4 * Residuals (Max,Min): 1.37e-02 and 3.36e-04
* Info * 21 gerade trial vectors in reduced space
* Info * 21 ungerade trial vectors in reduced space
*** Iteration: 5 * Residuals (Max,Min): 4.42e-03 and 6.25e-05
* Info * 23 gerade trial vectors in reduced space
* Info * 23 ungerade trial vectors in reduced space
*** Iteration: 6 * Residuals (Max,Min): 1.88e-03 and 5.07e-05
* Info * 24 gerade trial vectors in reduced space
* Info * 24 ungerade trial vectors in reduced space
*** Iteration: 7 * Residuals (Max,Min): 6.32e-04 and 5.06e-05
* Info * 25 gerade trial vectors in reduced space
* Info * 25 ungerade trial vectors in reduced space
*** Iteration: 8 * Residuals (Max,Min): 2.00e-04 and 5.06e-05
* Info * 26 gerade trial vectors in reduced space
* Info * 26 ungerade trial vectors in reduced space
*** Iteration: 9 * Residuals (Max,Min): 5.60e-05 and 4.83e-05
*** Linear response converged in 9 iterations. Time: 166.51 sec
Complex Response Solver Setup
===============================
Number of Frequencies : 1
Max. Number of Iterations : 150
Convergence Threshold : 1.0e-04
ERI Screening Threshold : 1.0e-12
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 * 0 gerade trial vectors in reduced space
* Info * 3 ungerade trial vectors in reduced space
*** Iteration: 1 * Residuals (Max,Min): 1.33e+00 and 7.59e-01
* Info * 0 gerade trial vectors in reduced space
* Info * 6 ungerade trial vectors in reduced space
*** Iteration: 2 * Residuals (Max,Min): 3.22e-01 and 1.44e-01
* Info * 0 gerade trial vectors in reduced space
* Info * 9 ungerade trial vectors in reduced space
*** Iteration: 3 * Residuals (Max,Min): 1.08e-01 and 5.24e-02
* Info * 0 gerade trial vectors in reduced space
* Info * 12 ungerade trial vectors in reduced space
*** Iteration: 4 * Residuals (Max,Min): 2.22e-02 and 1.81e-02
* Info * 0 gerade trial vectors in reduced space
* Info * 15 ungerade trial vectors in reduced space
*** Iteration: 5 * Residuals (Max,Min): 7.30e-03 and 5.18e-03
* Info * 0 gerade trial vectors in reduced space
* Info * 18 ungerade trial vectors in reduced space
*** Iteration: 6 * Residuals (Max,Min): 1.76e-03 and 1.35e-03
* Info * 0 gerade trial vectors in reduced space
* Info * 21 ungerade trial vectors in reduced space
*** Iteration: 7 * Residuals (Max,Min): 5.41e-04 and 3.56e-04
* Info * 0 gerade trial vectors in reduced space
* Info * 24 ungerade trial vectors in reduced space
*** Iteration: 8 * Residuals (Max,Min): 1.46e-04 and 1.02e-04
* Info * 0 gerade trial vectors in reduced space
* Info * 27 ungerade trial vectors in reduced space
*** Iteration: 9 * Residuals (Max,Min): 2.95e-05 and 2.14e-05
*** Complex response converged in 9 iterations. Time: 156.78 sec
Fock Matrix Computation
=========================
* Info * Processing 2 Fock builds...
* Info * Time spent in Fock matrices: 12.91 sec
Summary of Double residue of Quadratic Response Function
==========================================================
Excited state dipole moments
----------------------------
X Y Z
<3|mu|3> : -0.423354 -1.009679 -1.020739
*** Time spent in double residue of quadratic response calculation: 342.00 sec ***
mu_g = np.array(excmom_results['ground_state_dipole_moments'])
mu = []
for key, value in excmom_results['excited_state_dipole_moments'].items():
mu.append(value)
mu = np.array(mu)
mu_e = -(mu - 2 * mu_g)
print(f"\nElectric dipole moment: {np.linalg.norm(mu_e) * au2debye: .4f} Debye")
Dipole moment: 12.7337 Debye
Text file
jobs
task: response
@end
@method settings
xcfun: cam-b3lyp
basis: def2-svpd
@end
@response
property: transition dipole moment
initial_state: 1
final_state: 1
@end
@molecule
charge: 0
multiplicity: 1
xyz:
...
@end- Norman, P., Ruud, K., & Saue, T. (2018). Principles and practices of molecular properties. John Wiley & Sons, Ltd.