From 335e9dd73fce00d9112f1a8e46ef69fad77049b9 Mon Sep 17 00:00:00 2001 From: Alex Izvorski Date: Fri, 26 Jul 2024 08:58:01 -0700 Subject: [PATCH] pass lattice vectors if pyscf object has them --- python/dftd3/pyscf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/dftd3/pyscf.py b/python/dftd3/pyscf.py index 1d851fe7..6259482d 100644 --- a/python/dftd3/pyscf.py +++ b/python/dftd3/pyscf.py @@ -220,9 +220,17 @@ def kernel(self) -> Tuple[float, np.ndarray]: """ mol = self.mol + lattice = None + periodic = None + if callable(getattr(mol, 'lattice_vectors')): + lattice = mol.lattice_vectors() + periodic = np.array([True,True,True], dtype=bool) + disp = DispersionModel( np.array([gto.charge(mol.atom_symbol(ia)) for ia in range(mol.natm)]), mol.atom_coords(), + lattice=lattice, + periodic=periodic, ) if self.param is not None: