Skip to main content

A package for converting CP2K input files into PLAMS-compatible dictionaries.

Project description

https://travis-ci.org/nlesc-nano/CP2K-Parser.svg?branch=master

https://img.shields.io/badge/python-3.5-blue.svg https://img.shields.io/badge/python-3.6-blue.svg https://img.shields.io/badge/python-3.7-blue.svg

CP2K-Parser 1.0.0

A package for converting CP2K input files into PLAMS compatible dictionaries.

Installation

CP2K-Parser can be installed as following:

  • PyPi: pip install CP2K-Parser --upgrade

Usage

>>> import cp2kparser

>>> filename = 'my_cp2k_input.inp'
>>> print(open(filename).read())
&FORCE_EVAL
    &DFT
        BASIS_SET_FILE_NAME  /path/to/basis
        &MGRID
            CUTOFF  400
            NGRIDS  4
        &END
        &POISSON
        &END
        &LOCALIZE T
        &END
        POTENTIAL_FILE_NAME  /path/to/potential
        &QS
            METHOD  GPW
        &END
        &SCF
            EPS_SCF  1e-06
            MAX_SCF  200
        &END
        &XC
            &XC_FUNCTIONAL PBE
            &END
        &END
    &END
    &SUBSYS
        &CELL
            A  16.11886919 0.07814137 -0.697284243
            B  -0.215317662 4.389405268 1.408951791
            C  -0.216126961 1.732808365 9.748961085
            PERIODIC  XYZ
        &END
        &KIND  C
            BASIS_SET  DZVP-MOLOPT-SR-GTH-q4
            POTENTIAL  GTH-PBE-q4
        &END
        &KIND  H
            BASIS_SET  DZVP-MOLOPT-SR-GTH-q1
            POTENTIAL  GTH-PBE-q1
        &END
        &TOPOLOGY
            COORD_FILE_NAME  ./geometry.xyz
            COORDINATE  XYZ
        &END
    &END
&END

&GLOBAL
    PRINT_LEVEL  LOW
    PROJECT  example
    RUN_TYPE  ENERGY_FORCE
&END

>>> cp2k_dict = cp2kparser.read_input(filename)
>>> print(cp2k_dict)
{'force_eval':
    {'dft':
        {'basis_set_file_name': '/path/to/basis',
         'mgrid': {'cutoff': 400, 'ngrids': 4},
         'poisson': {},
         'localize T': {},
         'potential_file_name': '/path/to/potential',
         'qs': {'method': 'GPW'},
         'scf': {'eps_scf': '1e-06', 'max_scf': 200},
         'xc': {'xc_functional PBE': {}}},
    'subsys':
        {'cell': {'a': '16.11886919 0.07814137 -0.697284243', 'b': '-0.215317662 4.389405268 1.408951791', 'c': '-0.216126961 1.732808365 9.748961085', 'periodic': 'XYZ'},
         'kind C': {'basis_set': 'DZVP-MOLOPT-SR-GTH-q4', 'potential': 'GTH-PBE-q4'},
         'kind H': {'basis_set': 'DZVP-MOLOPT-SR-GTH-q1', 'potential': 'GTH-PBE-q1'},
         'topology': {'coord_file_name': './geometry.xyz', 'coordinate': 'XYZ'}}},
'global': {'print_level': 'LOW', 'project': 'example', 'run_type': 'ENERGY_FORCE'}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CP2K-Parser-1.0.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

CP2K_Parser-1.0.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file CP2K-Parser-1.0.0.tar.gz.

File metadata

  • Download URL: CP2K-Parser-1.0.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for CP2K-Parser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dd286415dabdc70e2c956f5a2142ffda912922ab1dc5b20775d8df87f4868d85
MD5 d695b6f97c6495b5ff3e4c37846b3ec5
BLAKE2b-256 c545c1d8227ea6df9f273b8143fe66ae392d57ebec82e201d5bfe913588eb961

See more details on using hashes here.

File details

Details for the file CP2K_Parser-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: CP2K_Parser-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for CP2K_Parser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e99bd259bb191180e83e973cd6e888dc0954c1713f59035e6340411e9f7f4772
MD5 bbfb88b3151bcee81bdb8616637b1e0f
BLAKE2b-256 adb4628bed94395b1e2f5868e578e88d8798b3194b5ca26373f8a84a3fc3dba7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page