Skip to content

Commit

Permalink
refined failed test (water example)
Browse files Browse the repository at this point in the history
  • Loading branch information
YAY-C committed Apr 23, 2024
1 parent 84ee0e5 commit 0f4ba39
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions tests/test_SAD.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from qstack.spahm.rho import atom


def test_water():
def test_water_open_shell():
print("Running water-test")
path = os.path.dirname(os.path.realpath(__file__))
mol = compound.xyz_to_mol(path+'/data/H2O.xyz', 'sto3g', charge=0, spin=0)
mol = compound.xyz_to_mol(path+'/data/H2O.xyz', 'sto3g', charge=1, spin=1) ## test breaks when effective open-shell caluclation is needed

Xsad = atom.get_repr(mol, ["H", "O"], 0, 0, dm=None,
xc = 'hf', guess='sad', model='lowdin-long-x', auxbasis='ccpvdzjkfit')
Expand All @@ -18,18 +18,31 @@ def test_water():
return 0


def test_other():
print("Running weird-test")
def test_water_close_shell():
print("Running water-test")
path = os.path.dirname(os.path.realpath(__file__))
mol = compound.xyz_to_mol(path+'/data/645688c7c139c6414b5c0b00.xyz', 'sto3g', charge=-1, spin=2)
mol = compound.xyz_to_mol(path+'/data/H2O.xyz', 'sto3g', charge=0, spin=0) ## test breaks when effective open-shell caluclation is needed

Xsad = atom.get_repr(mol, ["H", "O", "C", "I", "Rh"], -1, 2, dm=None,
xc = 'hf', guess='sad', model='lowdin-long-x', auxbasis='def2tzvpjkfit')
Xsad = atom.get_repr(mol, ["H", "O"], 0, 0, dm=None,
xc = 'hf', guess='sad', model='lowdin-long-x', auxbasis='ccpvdzjkfit')

print(np.array([*Xsad[:,1]]).shape)
return 0

## This is the original failure (spotted) for a xyz-structutre from Reiher-group Monstanto DB
#def test_other():
# print("Running weird-test")
# path = os.path.dirname(os.path.realpath(__file__))
# mol = compound.xyz_to_mol(path+'/data/645688c7c139c6414b5c0b00.xyz', 'sto3g', charge=-1, spin=2)
#
# Xsad = atom.get_repr(mol, ["H", "O", "C", "I", "Rh"], -1, 2, dm=None,
# xc = 'hf', guess='sad', model='lowdin-long-x', auxbasis='def2tzvpjkfit')
#
# print(np.array([*Xsad[:,1]]).shape)
# return 0


if __name__ == '__main__':
test_water()
test_other()
test_water_open_shell()
test_water_close_shell()
#test_other()

0 comments on commit 0f4ba39

Please sign in to comment.