Mishima-syk / psikit

psi4+RDKit
BSD 3-Clause "New" or "Revised" License
93 stars 19 forks source link

dipolemoment calculation failed for the deprecation of the get_variable() function #43

Closed wangyingxie closed 1 year ago

iwatobipen commented 1 year ago

Hi, Thanks for your issue. I just updated psikit in dev branch. Could you please use the branch to calculate dipolemoment? The version of psi4 should be >= 1.4. Thanks, Taka

wangyingxie commented 1 year ago

Thanks for the correction, I have also updated like this, this also works

@property
def dipolemoment(self, basis_sets= "b3lyp/6-311pg**", return_wfn=True):
    #  The three components of the SCF dipole [Debye]
    x = self.psi4.variable('SCF DIPOLE')[0]
    y = self.psi4.variable('SCF DIPOLE')[1]
    z = self.psi4.variable('SCF DIPOLE')[2]
    total = np.sqrt(x * x + y * y + z * z)
    return (x, y, z, total)