Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMSA-Builder

Introduction

Wrapper for using MSA-2.0 to generate Fortran code, Python module, and C code.

Author: mizu-bai

Usage

$ python3 -u build.py
Cloning into 'MSA-2.0'...
remote: Enumerating objects: 90, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 90 (delta 41), reused 90 (delta 41), pack-reused 0
Unpacking objects: 100% (90/90), 168.85 KiB | 457.00 KiB/s, done.
--------------------------------------------------------------------------------
Building executable `msa`...
rm -rf *~  *.o  msa 
g++ -O2 -Wall -c msa.cpp -I ./header;
g++ -O2 -Wall -c monomial.cpp -I ./header;
g++ -O2 -Wall -c polynomial.cpp -I ./header;
g++ -O2 -Wall -o msa msa.o monomial.o polynomial.o -I ./header; 
--------------------------------------------------------------------------------
Build Python module? [Y/n] 
Generate C code? [Y/n] 
Build settings:
- Fortran code will be generated by default.
- Python module will be built via `f2py`.
- C code will be generated.
--------------------------------------------------------------------------------
Molecule configuration: 4 1
Max degree of PIP: 4
Range parameter alpha for Morse-like variable (default 2.0): 1.0
PIP settings:
- Molecule configuration: 4 1
- Max degree: 4
- Range parameter alpha: 1.0
--------------------------------------------------------------------------------
Generating PIP basis...
Generating Fortran code...
Building Python module...
To test Python module `msa`, run command:
$ python3 -c "from msa import basis, gradient;print(basis.__doc__); print(gradient.__doc__)"
Please check the output if any error exists!
Generating C code...
--------------------------------------------------------------------------------
Done!

Check out

$ python3 -c "from msa import basis, gradient;print(basis.__doc__); print(gradient.__doc__)"
v = emsav(x,c)

Wrapper for ``emsav``.

Parameters
----------
x : input rank-1 array('d') with bounds (10)
c : input rank-1 array('d') with bounds (83)

Returns
-------
v : float
p = bemsav(x)

Wrapper for ``bemsav``.

Parameters
----------
x : input rank-1 array('d') with bounds (10)

Returns
-------
p : rank-1 array('d') with bounds (83)
m = evmono(x)

Wrapper for ``evmono``.

Parameters
----------
x : input rank-1 array('d') with bounds (10)

Returns
-------
m : rank-1 array('d') with bounds (262)
p = evpoly(m)

Wrapper for ``evpoly``.

Parameters
----------
m : input rank-1 array('d') with bounds (262)

Returns
-------
p : rank-1 array('d') with bounds (83)

grad = demsav(drdx,c,m,p,flag)

Wrapper for ``demsav``.

Parameters
----------
drdx : input rank-2 array('d') with bounds (15,10)
c : input rank-1 array('d') with bounds (83)
m : input rank-1 array('d') with bounds (262)
p : input rank-1 array('d') with bounds (83)
flag : input int

Returns
-------
grad : float
dp = dbemsav(drdx,m,p,flag)

Wrapper for ``dbemsav``.

Parameters
----------
drdx : input rank-2 array('d') with bounds (15,10)
m : input rank-1 array('d') with bounds (262)
p : input rank-1 array('d') with bounds (83)
flag : input int

Returns
-------
dp : rank-1 array('d') with bounds (83)
dm = devmono(drdx,m,flag)

Wrapper for ``devmono``.

Parameters
----------
drdx : input rank-2 array('d') with bounds (15,10)
m : input rank-1 array('d') with bounds (262)
flag : input int

Returns
-------
dm : rank-1 array('d') with bounds (262)
dp = devpoly(dm,p)

Wrapper for ``devpoly``.

Parameters
----------
dm : input rank-1 array('d') with bounds (262)
p : input rank-1 array('d') with bounds (83)

Returns
-------
dp : rank-1 array('d') with bounds (83)

Reference

  1. Xie, Z.; Bowman, J.M. Permutationally Invariant Polynomial Basis for Molecular Energy Surface Fitting via Monomial Symmetrization. J. Chem. Theory Comput. 2010, 6, 26-34.
  2. Nandi, A.; Qu, C.; Bowman, J. M. Using Gradients in Permutationally Invariant Polynomial Potential Fitting: A Demonstration for CH4 Using as Few as 100 Configurations. J. Chem. Theory Comput. 2019, 15 (5), 2826–2835.

About

Wrapper for using MSA-2.0 to generate Fortran code, Python module, and C code.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages