client.py 955 Bytes
Newer Older
1
from nomad import config
2
from nomad.client import ArchiveQuery
3
4
5
from nomad.metainfo import units

# this will not be necessary, once this is the official NOMAD version
6
config.client.url = 'http://labdev-nomad.esc.rzg.mpg.de/fairdi/nomad/testing-major/api'
7

8
query = ArchiveQuery(
9
    query={
10
11
12
13
        'dft.compound_type': 'binary',
        'dft.crystal_system': 'cubic',
        'dft.code_name': 'FHI-aims',
        'atoms': ['O']
14
15
    },
    required={
Markus Scheidgen's avatar
Markus Scheidgen committed
16
17
        'section_run[0]': {
            'section_single_configuration_calculation[-2]': {
18
                'energy_total': '*'
19
            },
Markus Scheidgen's avatar
Markus Scheidgen committed
20
            'section_system[-2]': '*'
21
22
        }
    },
23
24
    per_page=10,
    max=1000)
25

26
print(query)
27

28
for result in query[0:10]:
29
30
31
32
    run = result.section_run[0]
    energy = run.section_single_configuration_calculation[0].energy_total
    formula = run.section_system[0].chemical_composition_reduced
    print('%s: energy %s' % (formula, energy.to(units.hartree)))