# Sign convention for dipole moment in Psi4 (expectation value vs finite-field method)

Hi,

As the title suggest, I would like to get some clarification with respect to the convention of dipole moment in Psi4, especially in the context of a dipole moment interacting with an external electric field.

To start with, I would like to make sure that I am understanding the math correctly. The dipole moment is defined as

``````mu = Sum_i q_i r_i (1)
``````

where `q_i` and `r_i` are the point charges and (cartesian) coordinates of `i`. Thus, the dipole moment vector should point from the negative to positive charge, which is the reverse of the “chemistry convention”.

It is also known that the Hamiltonian of a molecule in the presence of an electric field is

``````H = H_0 - mu . eps (2)
``````

where `H_0` is the field-free Hamiltonian and `eps` is the electric field vector (for simplicity, let us assume spatially uniform electric field). Thus, we can compute the dipole moment of a molecule by numerically differentiating the energy with respect to the external electric field

``````mu = -d(H)/d(eps) at eps=0 (3)
``````

Equation (2) also implies that the energy should decrease when `mu` and `eps` are aligned/parallel, and increase when they are antiparallel.

I tested this with the HF molecule at 1.0 Angstrom separation, calculated using RHF/cc-pVDZ in Psi4 1.7 and GAMESS 2022 R2 as reference. Here is the Psi4 input at zero field (I just changed it to +/-0.001 at different inputs).

``````molecule {
0 1
F   0.00  0.00 -0.50
H   0.00  0.00  0.50
no_reorient
nocom
symmetry c1
}

set {
basis cc-pvdz
reference rhf
scf_type pk
e_convergence 1.0e-10
r_convergence 1.0e-10
maxiter 500
perturb_h true
perturb_with dipole
perturb_dipole [0, 0, 0.000]
}

properties('scf', properties=['dipole','mulliken_charges'])
``````

Based on the geometry alone, it is clear from the definition in Eq. (1) that the dipole moment vector should point in the direction of positive z axis (i.e., pointing from F to H). Here is the summary of results of Psi4 and GAMESS:

``````=======================================
Field (a.u.)    E(GMS)        E(PSI4)
---------------------------------------
-0.001    -100.009040    -100.010705
0.000    -100.009870    -100.009870
0.001    -100.010705    -100.009040
---------------------------------------
Dipole (FFM)   +0.832034      -0.832034
Dipole (<mu>)  +0.832043      +0.832037
=======================================
``````

The expectation value dipole points in the correct direction, but the FFM is not. This implies that either the sign of the dipole moment in Psi4 uses the chemistry convention (but printed out in the way consistent with the definition), or that Psi4 uses the Hamiltonian of the form `H = H_0 + mu . eps`.

Could someone please clarify this issue?

Yes, when you request `perturb_with dipole`, Psi4 is adding the scaled dipole operator rather than subtracting it. The code does not assume that the user wants to add an electric-dipole field and leaves it to you to keep up with the sign. (I note that the GAMESS documentation that handles such perturbations explicitly refers to their `EVEC` option as adding an electric field.)
I also did a little bit of a digging and found that GAMESS also uses `H = H_0 + mu . eps`, but the dipole integrals in AO basis has the reverse sign compared to Psi4 (at least within the integral preparation if external field is toggled on - I have not checked extensively). Thus, effectively the equation should be `H = H_0 - mu . eps` in GAMESS, I assume, leading to the discrepancy between the two codes.