Coverage for gpaw/test/lrtddft/conftest.py: 100%

15 statements  

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

1import pytest 

2from ase import Atom, Atoms 

3from gpaw import GPAW 

4 

5 

6@pytest.fixture 

7def H2struct(): 

8 R = 0.7 # approx. experimental bond length 

9 a = 3.0 

10 c = 4.0 

11 return Atoms([Atom('H', (a / 2, a / 2, (c - R) / 2)), 

12 Atom('H', (a / 2, a / 2, (c + R) / 2))], 

13 cell=(a, a, c)) 

14 

15 

16@pytest.fixture 

17def H2(H2struct): 

18 H2 = H2struct.copy() 

19 H2.calc = GPAW(mode='fd', 

20 xc='PBE', 

21 poissonsolver={'name': 'fd'}, 

22 nbands=3, 

23 spinpol=False) 

24 H2.get_potential_energy() 

25 return H2