Coverage for gpaw/test/ralda/test_ralda_Ni.py: 100%

12 statements  

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

1import pytest 

2from gpaw.xc.fxc import FXCCorrelation 

3 

4 

5@pytest.fixture 

6def ni_gpw(gpw_files, scalapack): 

7 return gpw_files['ni_pw_kpts333'] 

8 

9 

10@pytest.mark.rpa 

11@pytest.mark.response 

12@pytest.mark.parametrize('params, ref_energy', [ 

13 (dict(xc='RPA'), -7.827), 

14 (dict(xc='rALDA', unit_cells=[2, 1, 1]), -7.501), 

15 (dict(xc='rAPBE', unit_cells=[2, 1, 1]), -7.456), 

16]) 

17def test_Ni(in_tmp_dir, ni_gpw, params, ref_energy): 

18 fxc = FXCCorrelation(ni_gpw, nfrequencies=8, skip_gamma=True, 

19 ecut=[50], **params) 

20 E_fxc = fxc.calculate() 

21 assert E_fxc == pytest.approx(ref_energy, abs=0.01)