cp2k_to_prm

FOX.io.cp2k_to_prm

A TypedMapping subclass converting CP2K settings to .prm-compatible values.

Index

PRMMapping(name, key, columns, key_path, …) A TypedMapping providing tools for converting CP2K settings to .prm-compatible values.
CP2K_TO_PRM

API

class FOX.io.cp2k_to_prm.PRMMapping(name, key, columns, key_path, unit, default_unit, post_process)[source]

A TypedMapping providing tools for converting CP2K settings to .prm-compatible values.

Parameters:
name

The name of the PRMContainer attribute.

Type:str
columns

The names relevant PRMContainer DataFrame columns.

Type:tuple [int]
key_path

The path of CP2K Settings keys leading to the property of interest.

Type:tuple [str]
key

The key(s) within PRMMapping.key_path containg the actual properties of interest, e.g. "epsilon" and "sigma".

Type:tuple [str]
unit

The desired output unit.

Type:tuple [str]
default_unit

The default unit as utilized by CP2K.

Type:tuple [str, optional]
post_process

Callables for post-processing the value of interest. Set a particular callable to None to disable post-processing.

Type:tuple [Callable, optional]
FOX.io.cp2k_to_prm.CP2K_TO_PRM : MappingProxyType[str, PRMMapping]

A Mapping containing PRMMapping instances.

MappingProxyType({
    'nonbonded':
        PRMMapping(name='nbfix', columns=[2, 3],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'nonbonded', 'lennard-jones'),
                   key=('epsilon', 'sigma'),
                   unit=('kcal/mol', 'angstrom'),
                   default_unit=('kcal/mol', 'kelvin'),
                   post_process=(None, sigma_to_r2)),

    'nonbonded14':
        PRMMapping(name='nbfix', columns=[4, 5],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'nonbonded14', 'lennard-jones'),
                   key=('epsilon', 'sigma'),
                   unit=('kcal/mol', 'angstrom'),
                   default_unit=('kcal/mol', 'kelvin'),
                   post_process=(None, sigma_to_r2)),

    'bonds':
        PRMMapping(name='bonds', columns=[2, 3],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'bond'),
                   key=('k', 'r0'),
                   unit=('kcal/mol/A**2', 'angstrom'),
                   default_unit=('internal_cp2k', 'bohr'),  # TODO: internal_cp2k ?????????
                   post_process=(None, None)),

    'angles':
        PRMMapping(name='angles', columns=[3, 4],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'bend'),
                   key=('k', 'theta0'),
                   unit=('kcal/mol', 'degree'),
                   default_unit=('hartree', 'radian'),
                   post_process=(None, None)),

    'urrey-bradley':
        PRMMapping(name='angles', columns=[5, 6],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'bend', 'ub'),
                   key=('k', 'r0'),
                   unit=('kcal/mol/A**2', 'angstrom'),
                   default_unit=('internal_cp2k', 'bohr'),  # TODO: internal_cp2k ?????????
                   post_process=(None, None)),

    'dihedrals':
        PRMMapping(name='dihedrals', columns=[4, 5, 6],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'torsion'),
                   key=('k', 'm', 'phi0'),
                   unit=('kcal/mol', 'hartree', 'degree'),
                   default_unit=('hartree', 'hartree', 'radian'),
                   post_process=(None, None, None)),

    'improper':
        PRMMapping(name='improper', columns=[4, 5, 6],
                   key_path=('input', 'force_eval', 'mm', 'forcefield', 'improper'),
                   key=('k', 'k', 'phi0'),
                   unit=('kcal/mol', 'hartree', 'degree'),
                   default_unit=('hartree', 'hartree', 'radian'),
                   post_process=(None, return_zero, None)),
})