Coverage for gpaw/test/vdw/test_quick.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-07-12 00:18 +0000

1import pytest 

2from ase import Atoms 

3from gpaw import GPAW 

4from gpaw.xc.vdw import VDWFunctional 

5 

6 

7@pytest.mark.libxc 

8def test_vdw_quick(): 

9 vdw = VDWFunctional('vdW-DF', verbose=1) 

10 L = 2.5 

11 a = Atoms( 

12 'H', 

13 cell=(L, L, L), 

14 pbc=True, 

15 calculator=GPAW(mode='fd', nbands=1)) 

16 e = a.get_potential_energy() 

17 e2 = a.calc.get_xc_difference(vdw) 

18 print(e, e2) 

19 assert (vdw.shape == (24, 24, 24)).all()