Skip to main content

ChemCloud python client. Scalable compute, easy to learn, fast to code.

Project description

chemcloud - A Python Client for ChemCloud

chemcloud is a python client that makes performing computational chemistry calculations easy, fast, and fun. All input and output data structures are based on the QCSchema specification designed by The Molecular Sciences Software Institute. The client provides a simple, yet powerful interface to perform computational chemistry calculation using nothing but modern python and an internet connection. Compute is generously provided free of charge by the ChemCloud project.

Check out the documentation.

Requirements

  • Python 3.6+
  • chemcloud stands on the shoulders of giants. It internally depends upon QCElemental, httpx, and toml.
  • The AtomicInput, Molecule, Model, and AtomicResult models used throughout the package come directly from QCElemental. They are included in chemcloud.models for your convenience.

Installation

pip install chemcloud

Example

The Absolute Minimum

>>> from chemcloud import CCClient

>>> client = CCClient()
>>> client.configure() # only run the very first time you use CCClient
# See supported compute engines
>>> client.supported_engines
['psi4', 'terachem_fe', ...]
# Test connection to ChemCloud
>>> client.hello_world("Colton")
'Welcome to ChemCloud, Colton'
  • Create a Molecule
  • More details about the Molecule object can be found here and here.
  • Molecules can be created from pubchem, local files, or using pure python.
>>> from chemcloud.models import Molecule
>>> water = Molecule.from_data("pubchem:water")
  • Specify your compute job using an AtomicInput object
  • More details about the AtomicInput object can be found here.
>>> from chemcloud.models import AtomicInput
>>> atomic_input = AtomicInput(molecule=water, model={"method": "B3LYP", "basis": "6-31g"}, driver="energy")
  • Submit a computation, specify a target quantum chemistry engine, and get back an AtomicResult
>>> future_result = client.compute(atomic_input, engine="terachem_fe")
>>> future_result.status
'STARTED'

# Get result
>>> result = future_result.get()
# Successful computation
>>> result.success
True
>>> result
AtomicResult(driver='energy', model={'method': 'B3LYP', 'basis': '6-31g'}, molecule_hash='b6ec4fa')
>>> result.return_result
-76.38545794119997

# Failed computation
>>> result.success
False
# View result
>>> result
FailedOperation(error=ComputeError(error_type='input_error', error_message='QCEngine Input Error: Traceback (most recent call last):...'))
>>> from pprint import pprint
>>> pprint(result.error.error_message)
  • Putting it all together
>>> from chemcloud import CCClient
>>> from chemcloud.models import AtomicInput, Molecule

>>> client = CCClient()
>>> water = Molecule.from_data("pubchem:water")
>>> atomic_input = AtomicInput(molecule=water, model={"method": "B3LYP", "basis": "6-31g"}, driver="energy")
>>> future_result = client.compute(atomic_input, engine="terachem_fe")
>>> result = future_result.get()
>>> result
AtomicResult(driver='energy', model={'method': 'B3LYP', 'basis': '6-31g'}, molecule_hash='b6ec4fa')
>>> result.return_result
-76.38545794119997

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.6.0.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chemcloud-0.6.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file chemcloud-0.6.0.tar.gz.

File metadata

  • Download URL: chemcloud-0.6.0.tar.gz
  • Upload date:
  • Size: 39.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for chemcloud-0.6.0.tar.gz
Algorithm Hash digest
SHA256 3b085cc09180edf7ee7a2c5a042fb4ac8256663a37f55311bca0fb9d27e2859e
MD5 ec64ae4edcf8b609d830e05590794e1a
BLAKE2b-256 cff92b2b70f9554f62537b2e8ac224734d15c8772f66293c159a51c5d3a9b021

See more details on using hashes here.

File details

Details for the file chemcloud-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: chemcloud-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for chemcloud-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62dab138529f28ac20cb8c69ff620c4ea5cef5dc1cffd3bb9f89a0b1df359db9
MD5 4320a996773c032e2acca6efc1b1fcbd
BLAKE2b-256 7c5be6b96f90807134889c80609283a4666c40b8bfe1e1b9d9952c236b9661ea

See more details on using hashes here.

Supported by

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