Skip to content

Instantly share code, notes, and snippets.

@bast
Created June 1, 2021 08:52
Show Gist options
  • Save bast/5789e5aab087e21b815e65c6279cb989 to your computer and use it in GitHub Desktop.
Save bast/5789e5aab087e21b815e65c6279cb989 to your computer and use it in GitHub Desktop.
Test script example.
#!/usr/bin/env python
# srdft_lda_molhes
# ----------------
# Molecule: Ethane
# Wave Function: srDFT (LDA) / STO-3G
# Test Purpose: Test analytical molecular hessian and dipole gradient
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest import version_info, get_filter, cli, run
from runtest_config import configure
assert version_info.major == 2
f = [
# energy
get_filter(from_re='Final .* energy',
num_lines=1,
rel_tolerance=1.0e-8),
# molecular gradient
get_filter(from_string='Molecular gradient (au)',
num_lines=5,
abs_tolerance=1.0e-6),
# molecular hessian
get_filter(from_string='Molecular Hessian (au)',
num_lines=94,
abs_tolerance=1.0e-5),
]
options = cli()
ierr = 0
for inp in ['lda_molhes_nosym.dal',
'lda_molhes_nosym_nodifc.dal',
'hf_molhes_nosym.dal',
'hf_molhes_nosym_nodifc.dal',
'srlda_molhes_nosym.dal',
'srlda_molhes_nosym_nodifc.dal',
'srhf_molhes_nosym.dal',
'srhf_molhes_nosym_nodifc.dal',
'srlda04_molhes_nosym.dal',
'srlda04_molhes_nosym_nodifc.dal',
'srlda04_molhes_nosym.dal',
'srlda04_molhes_nosym_nodifc.dal']:
for mol in ['H2.mol']:
ierr += run(options,
configure,
input_files=[inp, mol],
filters={'out': f})
sys.exit(ierr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment