Exemple #1
0
    def test_parse_gaussian_load_basis(self):
        with tempfile.NamedTemporaryFile(mode='w+') as f:
            f.write('''
****
H 0
S 1 1.0
1.0 1.0
****
''')
            f.flush()
            self.assertEqual(parse_gaussian.load(f.name, 'H'), [[0, [1., 1.]]])

        with tempfile.NamedTemporaryFile(mode='w+') as f:
            f.write('''
H 0
S 1 1.0
1.0 1.0
****
''')
            f.flush()
            self.assertEqual(parse_gaussian.load(f.name, 'H'), [[0, [1., 1.]]])

        with tempfile.NamedTemporaryFile(mode='w+') as f:
            f.write('''
****
H 0
S 1 1.0
1.0 1.0
''')
            f.flush()
            self.assertEqual(parse_gaussian.load(f.name, 'H'), [[0, [1., 1.]]])

        with tempfile.NamedTemporaryFile(mode='w+') as f:
            f.write('''
H 0
S 1 1.0
1.0 1.0
''')
            f.flush()
            self.assertEqual(parse_gaussian.load(f.name, 'H'), [[0, [1., 1.]]])
Exemple #2
0
def get_dfo_basis(ase_sym, basis='dfo.gbs'):
    # ase_sym	...	string of atoms/chemical symbols (e.g. 'LiH', 'H2')
    # output	...	dict/basis format of pyscf
    #
    # convert string to list object
    #
    ase_sym = string2symbols(ase_sym)
    dfo = {}
    p_home = os.path.dirname(os.path.realpath(__file__))
    for s in ase_sym:
        b_tmp = load(p_home + '/basis/' + basis, s)
        dfo_tmp = {s: b_tmp}
        dfo.update(dfo_tmp)
    return dfo