gamda


Namegamda JSON
Version 0.5 PyPI version JSON
download
home_page
Summarygamda: GPU-Accelerated Molecular Dynamics Analysis
upload_time2024-01-14 18:02:00
maintainer
docs_urlNone
author
requires_python
license############################################################################## # NOTICE TO LICENSEE: # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ##############################################################################
keywords sponge molecular dynamics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gamda: GPU-Accelerated Molecular Dynamics Analysis

gamda, a python library which utilizes the CUDA-enable GPU to accelerate the analysis of molecular dynamics (MD)

# Dependency

1. cupy

cupy is the backend of the CUDA kernels for analysis

2. MDAnalysis

MDAnalysis is used to handle the reading of MD trajectories and the selection of atoms

# Installation

## from pypi

```
pip install gamda
```

## from gitee

```
git clone https://gitee.com/gao_hyp_xyj_admin/gamda.git
cd gamda
pip install .
```

# Unittest

```
git clone https://gitee.com/gao_hyp_xyj_admin/gamda.git
cd gamda
cd unittest
python -m unittest
```

# Usage

A simple exampe:

```
# Here, we create a xyz file as an example
with open("test.xyz", "w") as f:
    f.write("3\n3\nO 1.11 2.22 3.33\nH 3.33 2.22 1.11\nH 2.22 2.22 2.22")

# Import the package
import gamda
import numpy as np

# Import the desired observable
from gamda.observable import PositionZ

# Import the disired analyzer
from gamda.analyzer import Histogrammer

# gamda.Universe is a subclass of MDAnalysis.Universe
u = gamda.Universe("test.xyz")

# Get your AtomGroup in host (CPU)
ag = u.select_atoms("element H")

# Get your AtomGroup in device (GPU)
dag = u.get_dag("atom", ag)

# Initialize your observable
z = PositionZ("z", dag, gamda.Argument("z", np.float32(0)))

# Initialize your analyzer and add it to the universe
zdf = Histogrammer("zdf", 0, 4, 4, z)
u.add_analyzer(zdf)

# Print the source code
print(u.source_code)

# Run
u.run()

# Free the memory
u.free()
del u

# Normalize the result and save
zdf.normalize()
zdf.save("test_zdf.txt")

```

# Reference

1. cupy
    - https://github.com/cupy/cupy
2. MDAnalysis
    - N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. J. Comput. Chem. 32 (2011), 2319–2327. doi:10.1002/jcc.21787
    - R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. MDAnalysis: A Python package for the rapid analysis of molecular dynamics simulations. In S. Benthall and S. Rostrup, editors, Proceedings of the 15th Python in Science Conference, pages 98-105, Austin, TX, 2016. SciPy. doi:10.25080/Majora-629e541a-00e

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gamda",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "SPONGE,molecular dynamics",
    "author": "",
    "author_email": "Yijie Xia <yijiexia@pku.edu.cn>",
    "download_url": "https://files.pythonhosted.org/packages/71/3f/b5d740d25cb8a32bd85b229b7518e1d2fb3d47a18e7d861ec4694d39be67/gamda-0.5.tar.gz",
    "platform": null,
    "description": "# gamda: GPU-Accelerated Molecular Dynamics Analysis\r\n\r\ngamda, a python library which utilizes the CUDA-enable GPU to accelerate the analysis of molecular dynamics (MD)\r\n\r\n# Dependency\r\n\r\n1. cupy\r\n\r\ncupy is the backend of the CUDA kernels for analysis\r\n\r\n2. MDAnalysis\r\n\r\nMDAnalysis is used to handle the reading of MD trajectories and the selection of atoms\r\n\r\n# Installation\r\n\r\n## from pypi\r\n\r\n```\r\npip install gamda\r\n```\r\n\r\n## from gitee\r\n\r\n```\r\ngit clone https://gitee.com/gao_hyp_xyj_admin/gamda.git\r\ncd gamda\r\npip install .\r\n```\r\n\r\n# Unittest\r\n\r\n```\r\ngit clone https://gitee.com/gao_hyp_xyj_admin/gamda.git\r\ncd gamda\r\ncd unittest\r\npython -m unittest\r\n```\r\n\r\n# Usage\r\n\r\nA simple exampe:\r\n\r\n```\r\n# Here, we create a xyz file as an example\r\nwith open(\"test.xyz\", \"w\") as f:\r\n    f.write(\"3\\n3\\nO 1.11 2.22 3.33\\nH 3.33 2.22 1.11\\nH 2.22 2.22 2.22\")\r\n\r\n# Import the package\r\nimport gamda\r\nimport numpy as np\r\n\r\n# Import the desired observable\r\nfrom gamda.observable import PositionZ\r\n\r\n# Import the disired analyzer\r\nfrom gamda.analyzer import Histogrammer\r\n\r\n# gamda.Universe is a subclass of MDAnalysis.Universe\r\nu = gamda.Universe(\"test.xyz\")\r\n\r\n# Get your AtomGroup in host (CPU)\r\nag = u.select_atoms(\"element H\")\r\n\r\n# Get your AtomGroup in device (GPU)\r\ndag = u.get_dag(\"atom\", ag)\r\n\r\n# Initialize your observable\r\nz = PositionZ(\"z\", dag, gamda.Argument(\"z\", np.float32(0)))\r\n\r\n# Initialize your analyzer and add it to the universe\r\nzdf = Histogrammer(\"zdf\", 0, 4, 4, z)\r\nu.add_analyzer(zdf)\r\n\r\n# Print the source code\r\nprint(u.source_code)\r\n\r\n# Run\r\nu.run()\r\n\r\n# Free the memory\r\nu.free()\r\ndel u\r\n\r\n# Normalize the result and save\r\nzdf.normalize()\r\nzdf.save(\"test_zdf.txt\")\r\n\r\n```\r\n\r\n# Reference\r\n\r\n1. cupy\r\n    - https://github.com/cupy/cupy\r\n2. MDAnalysis\r\n    - N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. J. Comput. Chem. 32 (2011), 2319\u20132327. doi:10.1002/jcc.21787\r\n    - R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. MDAnalysis: A Python package for the rapid analysis of molecular dynamics simulations. In S. Benthall and S. Rostrup, editors, Proceedings of the 15th Python in Science Conference, pages 98-105, Austin, TX, 2016. SciPy. doi:10.25080/Majora-629e541a-00e\r\n",
    "bugtrack_url": null,
    "license": "############################################################################## # NOTICE TO LICENSEE: # # Licensed under the Apache License, Version 2.0 (the \"License\"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an \"AS IS\" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ##############################################################################",
    "summary": "gamda: GPU-Accelerated Molecular Dynamics Analysis",
    "version": "0.5",
    "project_urls": null,
    "split_keywords": [
        "sponge",
        "molecular dynamics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "713fb5d740d25cb8a32bd85b229b7518e1d2fb3d47a18e7d861ec4694d39be67",
                "md5": "cf8e5354e70fe4cd999900d1be3a7dba",
                "sha256": "7191d893b6591de5f4e03d61a21b323a9a419582c0f4aa3a451bae1c1e179aca"
            },
            "downloads": -1,
            "filename": "gamda-0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "cf8e5354e70fe4cd999900d1be3a7dba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11686,
            "upload_time": "2024-01-14T18:02:00",
            "upload_time_iso_8601": "2024-01-14T18:02:00.935494Z",
            "url": "https://files.pythonhosted.org/packages/71/3f/b5d740d25cb8a32bd85b229b7518e1d2fb3d47a18e7d861ec4694d39be67/gamda-0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-14 18:02:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gamda"
}
        
Elapsed time: 0.16251s