Skip to content

Periodic systems calculated as non-periodic in PySCF #73

@aizvorski

Description

@aizvorski

It seems that, when using simple-dftd3's PySCF interface, periodic systems are calculated as though they were non-periodic.

Minimal example:

import dftd3.pyscf as disp

xc = 'PBE'
basis =  'def2-TZVP'
atom = '''
O  -1.6256  -0.0413   0.3705
H  -0.7061  -0.0938   0.0934
H  -2.0618  -0.7328  -0.1359
'''

from pyscf import gto
from pyscf.pbc import gto as pbc_gto

mol = gto.M(atom=atom, basis = basis)
e_disp = float(disp.DFTD3Dispersion(mol, xc=xc, version="d3bj").kernel()[0])
print('non-periodic result', e_disp)

cell = pbc_gto.M(atom=atom, basis = basis, a=[[3,0,0], [0,3,0], [0,0,3]])
e_disp_periodic = float(disp.DFTD3Dispersion(cell, xc=xc, version="d3bj").kernel()[0])
print('periodic result', e_disp_periodic)
print('difference', abs(e_disp_periodic - e_disp))

Output:

non-periodic result -0.0003594806949831674
periodic result -0.0003594806949831674
difference 0.0

Expected: the two results should be different ;)

dftd3.interface.Dispersionmodel seems to support lattice=... and periodic=... arguments. However the PySCF interface code doesn't copy these parameters from the PySCF cell to the DispersionModel. It looks like if that did happen, it should happen when the other parameters (atom nuclear charges and coordinates) are copied, at pyscf.py line 223.

Could you please let me know if this is a missing feature or deliberate? If missing, how hard would it be to add it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions