Coder Social home page Coder Social logo

mmunibas / kmdcm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ericboittier/kmdcm

1.0 0.0 0.0 1.64 GB

Shell 0.01% JavaScript 0.04% C++ 0.10% Python 94.91% C 0.78% Lua 0.01% Fortran 0.17% PowerShell 0.01% Forth 0.01% XSLT 0.01% CSS 0.01% Makefile 0.01% HTML 0.02% Smarty 0.01% DIGITAL Command Language 0.01% Jupyter Notebook 0.02% Cython 3.92% Roff 0.01%

kmdcm's Introduction

Kernel-based Minimal Distributed Charge Models (kMDCM)

Installation

After cloning the repository, you can install the package by running the following commands:

python3 -m venv kmdcm-env
source kmdcm-env/bin/activate
pip install -r requirements.txt
pip install -e .

PyDCM requires the Fortran code to be compiled. To do so, run the following commands:

export CFLAGS="-std=c99"
cd kmdcm/pydcm
bash compile_f2py.sh

Usage

First, create the input json file. An example is given in "create_json_input.py". To create the json file, run the following command:

python kmdcm/pydcm/create_json.py

To optimize the charges and fit the kernels, run the following command in the "tests" directory:

Example 1: Water

 python test_dcm.py --alpha 0.000001 --n_factor 8 --n_atoms 3  --l2 0.0 --json water_pbe0.json --fname water_pbe0 --do_opt

Example 2: Methanol

python test_dcm.py --alpha 0.000001 --n_factor 16 --n_atoms 6  --l2 40.0 --json shaked-methanol.json --fname shaked-methanol --do_opt

Keyword arguments

  • --alpha is the regularization parameter
  • --n_factor is the ratio between the test and training set
  • --n_atoms is the number of atoms in the molecule
  • --l2 is the l2 penalty for moving the charges from their initial positions
  • --json is the json file containing the filenames for fitting
  • --fname is the name of the job

Exporting kernel matrices to CHARMM

To export the kernel matrices to CHARMM, run the following command:

python kmdcm/utils/save_charmm_input.py --kernel 4af4d6a1-a66c-4339-bafa-82db5e7529fc

This creates a directory in the tests/coeffs which stores the kernel coefficients ("coefs0.txt", etc.) and the reference distances ("x_fit.txt").

156 10 3 6
acec8c45-bfe5-4acc-8574-925372ecb40d/x_fit.txt
acec8c45-bfe5-4acc-8574-925372ecb40d/coefs0.txt
...
acec8c45-bfe5-4acc-8574-925372ecb40d/coefs29.txt

Running kMDCM in CHARMM

! 
open unit 12 card read name @input/methanol.kern
! regular MDCM input file
open unit 10 card read name @input/10charges.dcm
DCM KERN 12 IUDCM 10 TSHIFT 
'''

kmdcm's People

Contributors

ericboittier avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.