Multiwfn forum

Multiwfn official website: http://sobereva.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn

You are not logged in.

#1 2025-10-26 22:23:19

Alexey
Member
Registered: 2024-06-28
Posts: 24

Ehrenfest force

Hello, i'd like to study Ehrenfest force (both vector field and |F|). Multiwfn has a stress tensor, but is it possible to calculate the Ehrenfest force as its negative divergence? Does Multiwfn have such an option? I couldn't find it in the manual. (I understand that the Ehrenfest force derived from the stress tensor has problems due to the uncertainty of the stress tensor https://doi.org/10.1063/5.0174905 , but I'd still like to see it).

Offline

#2 2025-10-26 22:38:30

sobereva
Tian Lu (Multiwfn developer)
From: Athens, Greece
Registered: 2017-09-11
Posts: 2,132
Website

Re: Ehrenfest force

Hello,

Ehrenfest force has not been explicitly implemented in Multiwfn. But you can easily extend the source code Multiwfn to realize this aim. Stress tensor is calculated by "subroutine stress_tensor" in function.f90. Basic knowledge about modifying source code of Multiwfn can be found in http://sobereva.com/multiwfn/res/Modify … ltiwfn.pdf

Offline

#3 2025-10-27 18:07:43

Alexey
Member
Registered: 2024-06-28
Posts: 24

Re: Ehrenfest force

real*8 function ehr(x,y,z)
use defvar
implicit real*8 (a-h,o-z)
real*8 wfnval(nmo),grad(3,nmo),hess(3,3,nmo),tens3(3,3,3,nmo)
real*8 F(3),phi,g(3),h(3,3),t3(3,3,3)
integer imo,i,j
real*8 occ,term,sumj

call orbderv(5,1,nmo,x,y,z,wfnval,grad,hess,tens3)

F=0D0
do imo=1,nmo
    occ = MOocc(imo)
    if (occ==0D0) cycle
    phi = wfnval(imo)
    g(:) = grad(:,imo)
    h(:,:) = hess(:,:,imo)
    t3(:,:,:) = tens3(:,:,:,imo)

    do i=1,3
        sumj = 0D0
        do j=1,3
           
            sumj = sumj + 2D0*(h(j,i)*g(j) + g(i)*h(j,j) - t3(j,i,j)*phi - h(i,j)*g(j))
        end do
       
        F(i) = F(i) - (-0.25D0*occ*sumj)
    end do
end do

ehr = sqrt(F(1)**2 + F(2)**2 + F(3)**2)
end function

could you please check is it correct?

Offline

#4 2025-10-27 20:11:52

sobereva
Tian Lu (Multiwfn developer)
From: Athens, Greece
Registered: 2017-09-11
Posts: 2,132
Website

Re: Ehrenfest force

I am not sure if the code is fully correct, please compare the result with published values, what I can say is that the format and utilization of variable/arrays look reasonable. If you find the result is correct and in line with with published values, please let me know and I would like to include it into official source code.

Offline

#5 2025-10-28 15:24:30

Alexey
Member
Registered: 2024-06-28
Posts: 24

Re: Ehrenfest force

Dear Tian Lu, i'm currently in the process of verifying the correctness of this code. To do this, I needed to visualize this vector field, but I have into a problem: option 4 only allows to draw scalar fields and their gradients. Is there a way in multiwfn to directly visualize a vector field that is not the gradient of a scalar function? I couldn't find it in the manual

Offline

#6 2025-10-28 19:46:25

sobereva
Tian Lu (Multiwfn developer)
From: Athens, Greece
Registered: 2017-09-11
Posts: 2,132
Website

Re: Ehrenfest force

Multiwfn doesn't provide this feature, please export vector field as .txt file and try to visualize the field via e.g. Origin

Offline

Board footer

Powered by FluxBB