README.md 2.46 KB
Newer Older
Lauri Himanen's avatar
Lauri Himanen committed
1
This is the main repository of the [NOMAD](https://www.nomad-coe.eu/) parser for
2
[CP2K](https://www.cp2k.org/).
3

Lauri Himanen's avatar
Lauri Himanen committed
4
# Example
5 6
```python
    from cp2kparser import CP2KParser
7
    import matplotlib.pyplot as mpl
8

9
    # 1. Initialize a parser with a set of default units.
10
    default_units = ["eV"]
11
    parser = CP2KParser(default_units=default_units)
12

13 14 15
    # 2. Parse a file
    path = "path/to/main.file"
    results = parser.parse(path)
16

17
    # 3. Query the results with using the id's created specifically for NOMAD.
18 19 20 21
    scf_energies = results["energy_total_scf_iteration"]
    mpl.plot(scf_energies)
    mpl.show()
```
22

Lauri Himanen's avatar
Lauri Himanen committed
23
# Installation
24
The code is python 2 and python 3 compatible. First download and install
Lauri Himanen's avatar
Lauri Himanen committed
25
the nomadcore package:
26 27

```sh
Lauri Himanen's avatar
Lauri Himanen committed
28 29 30 31
git clone https://gitlab.mpcdf.mpg.de/nomad-lab/python-common.git
cd python-common
pip install -r requirements.txt
pip install -e .
32 33
```

34 35 36 37 38 39 40 41
Then download the metainfo definitions to the same folder where the
'python-common' repository was cloned:

```sh
git clone https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-info.git
```

Finally download and install the parser:
42

Lauri Himanen's avatar
Lauri Himanen committed
43 44 45 46 47
```sh
git clone https://gitlab.mpcdf.mpg.de/nomad-lab/parser-cp2k.git
cd parser-cp2k
pip install -e .
```
48

49 50
# Notes
The parser is based on CP2K 2.6.2.
51

Lauri Himanen's avatar
Lauri Himanen committed
52 53 54 55
The CP2K input setting
[PRINT_LEVEL](https://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#PRINT_LEVEL)
controls the amount of details that are outputted during the calculation. The
higher this setting is, the more can be parsed from the upload.
56

Lauri Himanen's avatar
Lauri Himanen committed
57 58 59 60 61
The parser will try to find the paths to all the input and output files, but if
they are located very deep inside some folder structure or outside the folder
where the output file is, the parser will not be able to locate them. For this
reason it is recommended to keep the upload structure as flat as possible.

62 63 64 65
Here is a list of features/fixes that would make the parsing of CP2K results
easier:
 - The pdb trajectory output doesn't seem to conform to the actual standard as
   the different configurations are separated by the END keyword which is
66 67 68
   supposed to be written only once in the file. The [format
   specification](http://www.wwpdb.org/documentation/file-format) states that
   different configurations should start with MODEL and end with ENDMDL tags.
Lauri Himanen's avatar
Lauri Himanen committed
69 70 71 72
 - The output file should contain the paths/filenames of different input and
   output files that are accessed during the program run. This data is already
   available for some files (input file, most files produced by MD), but many
   are not mentioned.