File: test_turbomole_h2o.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (54 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# type: ignore
from ase.calculators.turbomole import Turbomole
from ase.build import molecule

def test_turbomole_h2o():
    mol = molecule('H2O')

    params = {
        'title': 'water',
        'task': 'geometry optimization',
        'use redundant internals': True,
        'basis set name': 'def2-SV(P)',
        'total charge': 0,
        'multiplicity': 1,
        'use dft': True,
        'density functional': 'b3-lyp',
        'use resolution of identity': True,
        'ri memory': 1000,
        'force convergence': 0.001,
        'geometry optimization iterations': 50,
        'scf iterations': 100
    }

    calc = Turbomole(**params)
    mol.calc = calc
    calc.calculate(mol)
    assert calc.converged

    # use the get_property() method
    print(calc.get_property('energy', mol, False))
    print(calc.get_property('forces', mol, False))
    print(calc.get_property('dipole', mol, False))

    # use the get_results() method
    results = calc.get_results()
    print(results['molecular orbitals'])

    # use the __getitem__() method
    print(calc['results']['molecular orbitals'])
    print(calc['results']['geometry optimization history'])

    # perform a normal mode calculation with the optimized structure

    params.update({
        'task': 'normal mode analysis',
        'density convergence': 1.0e-7
    })

    calc = Turbomole(**params)
    mol.calc = calc
    calc.calculate(mol)

    print(calc['results']['vibrational spectrum'])
    print(calc.todict(skip_default=False))