Skip to content

Further work on #925 and #1050

Terence Tsang requested to merge TTsangSC/gpaw:issue-1050-rng into master

Closes #1050 (closed), which is a continuation of #925 (closed).

End-user-API changes

  • Direct minimization in LCAO mode (GPAW(eigensolver=LCAOETDM(...))):
    Orbital randomization can now be controlled via passing an RNG object to gpaw.directmin.etdm_lcao.LCAOETDM(randomizeorbitals=...)
  • Non-self-consistent calculation of Perdew–Zunger self-interaction corrections (NSCFSIC(GPAW(...), ...); legacy code (?)):
    (Seems superseded by the ETDM methods in gpaw.directmin)
    Initialization parameters (notably rng=<RNG object>) for the underlying gpaw.xc.sic.SIC[Spin] objects can now be passed to the gpaw.utilities.sic.NSCFSIC helper object

Details

gpaw.directmin.Derivatives(random_amat=...)
Now permitting passing an RNG so that the randomization of the matrix A can be controlled

gpaw.test.directopt.test_{directmin_lcao|grad_numerically_{lcao|pw}}
Now testing if the results are consistent between randomized and non-randomized cases; when random numbers are used, an explicit RNG is always provided

gpaw.test.fd_ops.test_non_periodic.test_fd_ops_non_periodic()
gpaw.test.radial.test_integral4.test_radial_integral4()
gpaw.test.sic.test_nscfsic.test_sic_nscfsic()
gpaw.test.xc.test_gga_atom.test_xc_gga_atom()
gpaw.test.xc.test_lxc_xcatom.test_xc_lxc_xcatom()
gpaw.test.xc.test_xcatom.test_xc_xcatom()
Now using explicit RNGs or np.random.RandomState instances instead of the numpy global random state

gpaw.utilities.sic.NSCFSIC
Now accepting extra initialization arguments (e.g. rng=...), passing them to gpaw.xc.sic.SIC

Edited by Terence Tsang

Merge request reports