From a0a3fe8bc44aebf0b73fa9414a59c021e4ee6d09 Mon Sep 17 00:00:00 2001 From: Harper Grimsley Date: Wed, 17 Jul 2024 09:47:43 -0400 Subject: [PATCH] cleaning psi4 quick fix --- tests/test_sa_adapt_vqe.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_sa_adapt_vqe.py b/tests/test_sa_adapt_vqe.py index f113a95f..9626df2e 100644 --- a/tests/test_sa_adapt_vqe.py +++ b/tests/test_sa_adapt_vqe.py @@ -14,6 +14,13 @@ import copy import os import numpy as np +import psi4 + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) + +data_path = os.path.join(THIS_DIR, "lih_cas_dump.json") +if os.path.exists(data_path): + os.remove(data_path) class TestSAADAPTVQE: @@ -235,8 +242,6 @@ def test_LiH_more_adapt_vqe(self): for j in range(len(E_more)): assert dip_dir[i, j] - total_dip[i, j] == approx(0.0, abs=1e-7) - THIS_DIR = os.path.dirname(os.path.abspath(__file__)) - data_path = os.path.join(THIS_DIR, "lih_cas_dump.json") spaces = [[1, 0, 0, 0], [2, 0, 0, 0], [1, 0, 1, 1]] mol = system_factory( system_type="molecule", @@ -339,3 +344,5 @@ def test_LiH_more_adapt_vqe(self): alg.run(pool_type="GSD", adapt_maxiter=3) for i in range(4): assert correct_Es[i] == approx(alg._diag_energies[-1][i]) + + psi4.core.clean_options()