Skip to content

Commit

Permalink
LASSIS "fullauto" unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewRHermes committed Oct 31, 2023
1 parent f190381 commit c4fd19b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/lassi/test_22.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_contract_hlas_ci (self):
self.assertAlmostEqual (lib.fp (hket_pq), lib.fp (hket_ref), 8)

def test_lassis (self):
lsis = lassis.LASSIS (las).run (ncharge=1, nspin=1)
lsis = lassis.LASSIS (las).run ()
e_upper = las.e_states[0]
e_lower = lsi.e_roots[0]
self.assertLessEqual (e_lower, lsis.e_roots[0])
Expand Down
15 changes: 14 additions & 1 deletion tests/lassi/test_c2h4n4.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,25 @@ def test_spin_shuffle (self):
self.assertLess (np.amax (np.abs (errvec)), 1e-8)

def test_lassis (self):
# TODO: investigate here if the VRVSolver is actually doing anything
from mrh.my_pyscf.lassi.lassis import LASSIS
las1 = LASSCF (las._scf, (4,4), (4,4), spin_sub=(1,1))
las1.mo_coeff = las.mo_coeff
las1.lasci ()
lsis = LASSIS (las1).run (max_cycle_macro=1)

def test_lassis_slow (self):
from mrh.my_pyscf.lassi.lassis import LASSIS
# TODO: optimize implementation and eventually merge with test_lassis
mol = struct (2.0, 2.0, '6-31g', symmetry=False)
mol.output = '/dev/null'
mol.verbose = 0
mol.spin = 8
mol.build ()
mf = scf.RHF (mol).run ()
las1 = LASSCF (mf, (5,5), ((3,2),(2,3)), spin_sub=(2,2))
mo_coeff = las1.localize_init_guess ((list (range (5)), list (range (5,10))))
las1.kernel (mo_coeff)
lsis = LASSIS (las1).run ()
self.assertLess (lsis.e_roots[0], las1.e_states[0])

if __name__ == "__main__":
Expand Down

0 comments on commit c4fd19b

Please sign in to comment.