SpongeExt
为MindSponge和CudaSPONGE设计的接口函数。CudaSPONGE部分通过SpongeExt,可以外接如PySAGES等基于Python的增强采样软件。MindSponge部分通过SpongeExt,可以扩展PyTorch后端,在GPU环境运行。
安装教程
从源码安装:
$ git clone https://gitee.com/dechin/sponge-ext.git && cd sponge-ext && python3 setup.py install --user
从pip安装:
$ python3 -m pip install SpongeExt --upgrade -i https://pypi.org/simple
CudaSPONGE使用案例
准备一系列的CudaSPONGE输入文件,例如examples中的nvt.in配置输入文件:
case1 MD simulation
mode = NVT
default_in_file_prefix = ../protein/alad
pbc=0
cutoff=999
dt = 1e-3
step_limit = 2000
write_information_interval = 10
thermostat = middle_langevin
middle_langevin_gamma = 10
rst = nvt_restart
coordinate_in_file = ../protein/alad_coordinate.txt
plugin = /usr/local/python-3.7.5/lib/python3.7/site-packages/prips/_prips.so
py = ../pysages_metad.py
这里使用到了一个使用pysages定义的增强采样方法pysages_metad.py,内容为:
from SpongeExt import enhanced_sponge
import pysages
from pysages.colvars import DihedralAngle
from pysages.methods import Metadynamics
def phi_psi():
from numpy import pi
cvs = [DihedralAngle([4, 6, 8, 14]), DihedralAngle([6, 8, 14, 16])]
height = 5.0 # kJ/mol
sigma = [0.4, 0.4] # radians
stride = 3
ngauss = 500
grid = pysages.Grid(lower=(-pi, -pi), upper=(pi, pi), shape=(50, 50), periodic=True)
method = Metadynamics(cvs, height, sigma, stride, ngauss, grid=grid)
return method
pysages_method = phi_psi()
Calculate_Force, Mdout_Print = enhanced_sponge(pysages_method)
然后使用运行指令运行即可:
$ SPONGE -mdin nvt.in
输出内容大致如下图所示:
------------------------------------------------------------------------------------------------------------
step = 1990, time = 1.990, temperature = 2388.79,
potential = 56.45, CV_0 = -1.500586, CV_1 = -2.550561,
LJ = -0.79, Coulomb = -65.33, nb14_LJ = 7.42,
nb14_EE = 41.19, bond = 6.05, angle = 40.54,
dihedral = 27.37,
------------------------------------------------------------------------------------------------------------
step = 2000, time = 2.000, temperature = 2430.97,
potential = 60.92, CV_0 = -0.989361, CV_1 = -3.084765,
LJ = -0.22, Coulomb = -66.38, nb14_LJ = 4.81,
nb14_EE = 42.10, bond = 9.91, angle = 38.81,
dihedral = 31.90,
------------------------------------------------------------------------------------------------------------
配置深度学习后端
例如配置pytorch后端:
$ export DEEP_LEARNING_BACKEND=pytorch
Metadata
Release files for SpongeExt 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SpongeExt-1.3.tar.gz | 27.2 kB | Without provenance | Details for SpongeExt-1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SpongeExt-1.3-py3-none-any.whl | Python 3 | none | any | Details for SpongeExt-1.3-py3-none-any.whl |
Total release size: 61.9 kB
Release files / SpongeExt-1.3.tar.gz
| Download URL | SpongeExt-1.3.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a050c4b975592e765466924bac4cc567c198c1c9cc8d114eeff126d3e1a2067
|
|
BLAKE2b-256 checksum How to use checksums |
b5bbfcc1e797390e6062a95024653b82d35e43b5f45957ac26d609cd870fd5f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.32.3 requests-toolbelt/0.9.1 tqdm/4.67.1 CPython/3.8.5
|
Release files / SpongeExt-1.3-py3-none-any.whl
| Download URL | SpongeExt-1.3-py3-none-any.whl |
|---|---|
| Size | 34.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40af44ac2d4f77022a226c03b6c1c1f2d1ab2e9ca9ee74be53148f637c2ba928
|
|
BLAKE2b-256 checksum How to use checksums |
3516f97a6b3586b82153d278e60145745554210f8222a90d03c3cc710cb3d8a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.32.3 requests-toolbelt/0.9.1 tqdm/4.67.1 CPython/3.8.5
|
Security for SpongeExt 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.