Skip to main content

Fast, secure, scalable quantum chemistry. A Python client for the the ChemCloud server.

Project description

image image image Actions status Actions status Ruff

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")
>>> 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chemcloud-0.7.0.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

chemcloud-0.7.0-py3-none-any.whl (12.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page