Fast, secure, scalable quantum chemistry. A Python client for the the ChemCloud server.
Project description
Beautiful and user friendly data structures for quantum chemistry.
chemcloud - A Python Client for ChemCloud
chemcloud
is a python client for the ChemCloud Server that makes performing computational chemistry calculations easy, fast, and fun. All input and output data structures come from qcio for consistency and easy of use and the way calculations are run follows the qcop API. The client provides a simple, yet powerful interface to perform computational chemistry calculation using nothing but modern python and an internet connection.
Documentation: https://mtzgroup.github.io/chemcloud-client
Source Code: https://github.com/mtzgroup/chemcloud-client
Requirements
- Python 3.8++
Installation
pip install chemcloud
Usage
- Create a ChemCloud account at https://chemcloud.mtzlab.com/signup (or the address of the ChemCloud Server you want to communicate with).
- Instantiate a client
- Configure client (only required the very first time you use
CCClient
)
>>> from chemcloud import CCClient
>>> client = CCClient()
>>> client.configure() # only run this the very first time you use CCClient
# See supported compute engines on the ChemCloud Server
>>> client.supported_engines
['psi4', 'terachem', ...]
# Test connection to ChemCloud
>>> client.hello_world("Colton")
'Welcome to ChemCloud, Colton'
- Create a Molecule.
Molecules
can be created opened from.xyz
files or created in pure python.
>>> from qcio import Molecule
>>> water = Molecule.open("mygeom.xyz")
- Specify your compute job using an ProgramInput
>>> from qcio import ProgramInput
>>> prog_inp = ProgramInput(calctype="energy", molecule=water, model={"method": "B3LYP", "basis": "6-31g"}, keywords={})
- Submit a computation, specify a target quantum chemistry program, and get back an SinglePointOutput object.
>>> future_result = client.compute("psi4", prog_inp, collect_files=True)
>>> future_result.status
'STARTED'
# Get output
>>> output = future_result.get()
# Successful output
>>> output.success
True
>>> output
SinglePointOutput(...)
# All computed results are stored here
>>> output.results
SinglePointResults(...)
# Failed result
>>> output.success
False
# View output
>>> output
>>> ProgramFailure(...)
# To see error
>>> output.ptraceback
- Putting it all together
>>> from chemcloud import CCClient
>>> from qcio import Molecule, ProgramInput
>>> client = CCClient()
>>> water = Molecule.open("mygeom.xyz")
>>> prog_inp = ProgramInput(calctype="energy", molecule=water, model={"method": "B3LYP", "basis": "6-31g"}, keywords={})
>>> future_result = client.compute("psi4", prog_inp)
>>> output = future_result.get()
>>> output
SinglePointOutput(...)
# All computed results are stored here
>>> output.results
SinglePointResults(...)
>>> output.results.return_result
-76.38545794119997
Examples
Examples of various computations can be found in the documentation and in the GiHub repo's examples directory.
Development
Install poetry
curl -sSL https://install.python-poetry.org | python3 -
Install the ChemCloud package
poetry install
sh scripts/tests.sh
Licence
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chemcloud-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 457efca4151a1963483940248aedfedc09f31d77d545af9c655d504ae9b8e32f |
|
MD5 | 322749bbc2ee99b480ba769174851a19 |
|
BLAKE2b-256 | ffd1328ade8f11a7ddfd9fa4856879a5d62d24e648d0d89f52a4e479b8e79be2 |