From 2c09ff40e5be45d665b04c59cc572fbd6334570f Mon Sep 17 00:00:00 2001 From: Colton Hicks Date: Fri, 23 Feb 2024 16:27:48 -0800 Subject: [PATCH] Deployed 204558a with MkDocs version: 1.5.3 --- search/search_index.json | 2 +- sitemap.xml | 28 +++--- sitemap.xml.gz | Bin 370 -> 370 bytes tutorial/bigchem-algorithms/index.html | 134 +++++++++++++++---------- 4 files changed, 97 insertions(+), 67 deletions(-) diff --git a/search/search_index.json b/search/search_index.json index aa668ed..5a7ba1e 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"chemcloud","text":""},{"location":"#chemcloud-a-python-client-for-chemcloud","title":"chemcloud - A Python Client for ChemCloud","text":"

chemcloud is a python client for the ChemCloud Server. The client provides a simple yet powerful interface to perform computational chemistry calculations using nothing but modern Python and an internet connection.

Documentation: https://mtzgroup.github.io/chemcloud-client

chemcloud works in harmony with a suite of other quantum chemistry tools for fast, structured, and interoperable quantum chemistry.

"},{"location":"#the-qc-suite-of-programs","title":"The QC Suite of Programs","text":""},{"location":"#installation","title":"Installation","text":"
pip install chemcloud\n
"},{"location":"#quickstart","title":"Quickstart","text":"
from chemcloud import CCClient\n\nclient = CCClient()\nclient.configure() # only run this the very first time you use CCClient\n# See supported compute engines on the ChemCloud Server\nclient.supported_engines\n['psi4', 'terachem', ...]\n# Test connection to ChemCloud\nclient.hello_world(\"Colton\")\n'Welcome to ChemCloud, Colton'\n
from qcio import Molecule, ProgramInput\nfrom chemcloud import CCClient\n\nclient = CCClient()\n\n# Create the molecule\nh2o = Molecule.open(\"h2o.xyz\")\n\n# Define the program input\nprog_input = ProgramInput(\n    molecule=h2o,\n    calctype=\"energy\",\n    model={\"method\": \"hf\", \"basis\": \"sto-3g\"},\n    keywords={\"purify\": \"no\", \"restricted\": False},\n)\n\n# Submit the calculation to the server\nfuture_output = client.compute(\"terachem\", prog_input, collect_files=True)\n# Status can be checked at any time\nfuture_result.status\n# Get the output (blocking)\noutput = future_output.get()\n\n# Inspect the output\noutput.input_data # Input data used by the QC program\noutput.success # Whether the calculation succeeded\noutput.results # All structured results from the calculation\noutput.stdout # Stdout log from the calculation\noutput.pstdout # Shortcut to print out the stdout in human readable format\noutput.files # Any files returned by the calculation\noutput.provenance # Provenance information about the calculation\noutput.extras # Any extra information not in the schema\noutput.traceback # Stack trace if calculation failed\noutput.ptraceback # Shortcut to print out the traceback in human readable format\n
"},{"location":"#examples","title":"Examples","text":"

Examples of various computations can be found in the examples directory.

"},{"location":"#support","title":"Support","text":"

If you have any issues with chemcloud or would like to request a feature, please open an issue.

"},{"location":"CHANGELOG/","title":"Changelog","text":"

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

"},{"location":"CHANGELOG/#unreleased","title":"unreleased","text":""},{"location":"CHANGELOG/#083-2023-10-20","title":"0.8.3 - 2023-10-20","text":""},{"location":"CHANGELOG/#changed","title":"Changed","text":""},{"location":"CHANGELOG/#082-2023-09-25","title":"0.8.2 - 2023-09-25","text":""},{"location":"CHANGELOG/#changed_1","title":"Changed","text":""},{"location":"CHANGELOG/#081-2023-09-20","title":"0.8.1 - 2023-09-20","text":""},{"location":"CHANGELOG/#changed_2","title":"Changed","text":""},{"location":"CHANGELOG/#080-2023-09-19","title":"0.8.0 - 2023-09-19","text":""},{"location":"CHANGELOG/#changed_3","title":"Changed","text":""},{"location":"CHANGELOG/#070-2023-09-08","title":"0.7.0 - 2023-09-08","text":""},{"location":"CHANGELOG/#changed_4","title":"Changed","text":""},{"location":"CHANGELOG/#added","title":"Added","text":""},{"location":"CHANGELOG/#062-2022-12-27","title":"0.6.2 - 2022-12-27","text":""},{"location":"CHANGELOG/#changed_5","title":"Changed","text":""},{"location":"CHANGELOG/#061-2022-07-19","title":"0.6.1 - 2022-07-19","text":""},{"location":"CHANGELOG/#changed_6","title":"Changed","text":""},{"location":"CHANGELOG/#060-2022-07-19","title":"0.6.0 - 2022-07-19","text":""},{"location":"CHANGELOG/#changed_7","title":"Changed","text":""},{"location":"CHANGELOG/#050-2022-07-15","title":"0.5.0 - 2022-07-15","text":""},{"location":"CHANGELOG/#changed_8","title":"Changed","text":""},{"location":"CHANGELOG/#041-2022-05-07","title":"0.4.1 - 2022-05-07","text":""},{"location":"CHANGELOG/#changed_9","title":"Changed","text":""},{"location":"CHANGELOG/#040-2022-4-02","title":"0.4.0 - 2022-4-02","text":""},{"location":"CHANGELOG/#added_1","title":"Added","text":""},{"location":"CHANGELOG/#changed_10","title":"Changed","text":""},{"location":"CHANGELOG/#removed","title":"Removed","text":""},{"location":"CHANGELOG/#031-2022-03-27","title":"0.3.1 - 2022-03-27","text":""},{"location":"CHANGELOG/#added_2","title":"Added","text":""},{"location":"CHANGELOG/#changed_11","title":"Changed","text":""},{"location":"CHANGELOG/#030-2022-03-26","title":"0.3.0 - 2022-03-26","text":""},{"location":"CHANGELOG/#added_3","title":"Added","text":""},{"location":"CHANGELOG/#024-2021-06-07","title":"0.2.4 - 2021-06-07","text":""},{"location":"CHANGELOG/#added_4","title":"Added","text":""},{"location":"CHANGELOG/#023-2021-06-04","title":"0.2.3 - 2021-06-04","text":""},{"location":"CHANGELOG/#added_5","title":"Added","text":""},{"location":"CHANGELOG/#changed_12","title":"Changed","text":""},{"location":"CHANGELOG/#022-2021-05-21","title":"0.2.2 - 2021-05-21","text":""},{"location":"CHANGELOG/#added_6","title":"Added","text":""},{"location":"CHANGELOG/#021-2021-03-05","title":"0.2.1 - 2021-03-05","text":""},{"location":"CHANGELOG/#added_7","title":"Added","text":""},{"location":"CHANGELOG/#020-2021-02-26","title":"0.2.0 - 2021-02-26","text":""},{"location":"CHANGELOG/#added_8","title":"Added","text":""},{"location":"CHANGELOG/#changed_13","title":"Changed","text":""},{"location":"CHANGELOG/#011-2021-01-22","title":"0.1.1 - 2021-01-22","text":""},{"location":"CHANGELOG/#added_9","title":"Added","text":""},{"location":"dev-decisions/","title":"Core Development Decisions","text":""},{"location":"dev-decisions/#_requestsclient-class","title":"_RequestsClient Class","text":"

I'm starting to have second thoughts about this ^^ decision. It feels like the _RequestsClient is starting to take on too much responsibility. It accepts python data types as parameters, and returns python data types as it if were an end-user class. It isn't. It's meant to be a utility class used by end-user objects such as CCClient and FutureOutput objects. I think it should return data more directly from the ChemCloud API and let the other classes handle this data. This becomes more apparent as I add pydantic to my data models and realize I'd rather have them pass rawer data types to the _RequestsClient and then handle the results of an API call inside their own class. Maybe the compute() method on the _RequestsClient should go away and these should live exclusively on the CCClient object which then utilizes request and authenticated_request to access ChemCloud.

"},{"location":"code-reference/CCClient/","title":"CCClient","text":"

Main client object to perform computations using ChemCloud.

Source code in chemcloud/client.py
class CCClient:\n\"\"\"Main client object to perform computations using ChemCloud.\"\"\"\n\n    def __init__(\n        self,\n        *,\n        chemcloud_username: Optional[str] = None,\n        chemcloud_password: Optional[str] = None,\n        profile: Optional[str] = None,\n        chemcloud_domain: Optional[str] = None,\n    ):\n\"\"\"\n        Initialize a CCClient object.\n\n        Parameters:\n            chemcloud_username: ChemCloud username\n            chemcloud_password: ChemCloud password\n            profile: Authentication profile name\n            chemcloud_domain: Domain of ChemCloud instance to connect to\n\n        !!! Danger\n            It is not recommended to pass your ChemCloud username and\n            password directly to a `CCClient`. Instead instantiate a client with no\n            credentials `client = CCClient()` and then run `client.configure()` to\n            securely set up your authentication credentials for ChemCloud.\n        \"\"\"\n        self._client = _RequestsClient(\n            chemcloud_username=chemcloud_username,\n            chemcloud_password=chemcloud_password,\n            profile=profile,\n            chemcloud_domain=chemcloud_domain,\n        )\n        self._openapi_spec: Optional[Dict] = None\n\n    def __repr__(self) -> str:\n        return (\n            f\"{type(self).__name__}({self._client._chemcloud_domain}, \"\n            f\"profile={self.profile})\"\n        )\n\n    def _set_openapi_specification(self):\n\"\"\"Gets OpenAPI specification from ChemCloud Server\"\"\"\n        self._openapi_spec = self._client._request(\n            \"get\", \"/openapi.json\", api_call=False\n        )\n\n    @property\n    def version(self) -> str:\n\"\"\"Returns chemcloud client version\"\"\"\n        return __version__\n\n    @property\n    def profile(self) -> str:\n\"\"\"Profile being used for authentication with ChemCloud.\n\n        Returns:\n            The name of the credentials profile being used with the current client.\n        \"\"\"\n        return self._client._profile\n\n    @property\n    def supported_programs(self) -> List[str]:\n\"\"\"Compute programs currently supported by ChemCloud.\n\n        Returns:\n            List of programs currently supported by ChemCloud.\"\"\"\n        if not self._openapi_spec:\n            self._set_openapi_specification()\n        try:\n            assert self._openapi_spec is not None\n            programs = self._openapi_spec[\"components\"][\"schemas\"][\"SupportedPrograms\"][\n                \"enum\"\n            ]\n        except IndexError:\n            print(\"Cannot locate currently supported programs.\")\n            programs = [\"\"]\n        return programs\n\n    def hello_world(self, name: Optional[str] = None) -> str:\n\"\"\"A simple endpoint to check connectivity to ChemCloud.\n\n        Parameters:\n            name: Your name\n\n        Returns:\n            A message from ChemCloud if the client was able to successfully\n            connect.\n        \"\"\"\n        return self._client.hello_world(name)\n\n    def compute(\n        self,\n        program: str,\n        inp_obj: QCIOInputsOrList,\n        *,\n        collect_stdout: bool = True,\n        collect_files: bool = False,\n        collect_wavefunction: bool = False,\n        rm_scratch_dir: bool = True,\n        propagate_wfn: bool = False,\n        queue: Optional[str] = None,\n    ) -> Union[FutureOutput, FutureOutputGroup]:\n\"\"\"Submit a computation to ChemCloud.\n\n        Parameters:\n            program: A program name matching one of the `self.supported_programs`\n            inp_obj: The input object to be used for the computation. This can be a\n                single input object or a list of input objects.\n            collect_stdout: Whether to collect stdout/stderr from the program as output.\n                Failed computations will always collect stdout/stderr.\n            collect_files: Collect all files generated by the QC program as output.\n            collect_wavefunction: Collect the wavefunction file(s) from the calculation.\n                Not every program will support this. Use collect_files to collect\n                all files including the wavefunction.\n            rm_scratch_dir: Delete the scratch directory after the program exits. Should\n                only be set to False for debugging purposes.\n            propagate_wfn: For any adapter performing a sequential task, such\n                as a geometry optimization, propagate the wavefunction from the previous\n                step to the next step. This is useful for accelerating convergence by\n                using a previously computed wavefunction as a starting guess. This will\n                be ignored if the adapter for a given qc program does not support it.\n            queue: The name of a private compute queue. If None, default queue is used\n\n        Returns:\n            Object providing access to a computation's eventual result. You can check a\n            computation's status by running `.status` on the `FutureOutput` object or\n            `.get()` to block and retrieve the computation's final result.\n        \"\"\"\n        if self.supported_programs is not None:\n            assert (\n                program in self.supported_programs\n            ), f\"Please use one of the following programs: {self.supported_programs}\"\n\n        compute_params = dict(\n            program=program,\n            collect_stdout=collect_stdout,\n            collect_files=collect_files,\n            collect_wavefunction=collect_wavefunction,\n            rm_scratch_dir=rm_scratch_dir,\n            propagate_wfn=propagate_wfn,\n            queue=queue,\n        )\n        return self._client.compute(inp_obj, compute_params)\n\n    def configure(self, profile: str = settings.chemcloud_credentials_profile) -> None:\n\"\"\"Configure profiles for authentication with ChemCloud.\n\n        Parameters:\n            profile: Optional value to create a named profile for use with QC\n                Cloud. No value needs to be passed and most users will only have one\n                login with ChemCloud. CCClient will access the profile by\n                default without a specific name being passed. Pass a value if you have\n                multiple logins to ChemCloud.\n        Note:\n            Configures `chemcloud` to use the passed credentials automatically in the\n            future. You will not need to run `.configure()` the next time you use the\n            `chemcloud`.\n\n        \"\"\"\n        print(\n            \"\u2705 If you don't get have an account please signup at: \"\n            f\"{self._client._chemcloud_domain}/signup\"\n        )\n        access_token, refresh_token = self._client._set_tokens_from_user_input()\n        self._client.write_tokens_to_credentials_file(\n            access_token, refresh_token, profile=profile\n        )\n        print(\n            f\"'{profile}' profile configured! Username/password not required for \"\n            \"future use of CCClient\"\n        )\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.profile","title":"profile: str property","text":"

Profile being used for authentication with ChemCloud.

Returns:

Type Description str

The name of the credentials profile being used with the current client.

"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.supported_programs","title":"supported_programs: List[str] property","text":"

Compute programs currently supported by ChemCloud.

Returns:

Type Description List[str]

List of programs currently supported by ChemCloud.

"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.version","title":"version: str property","text":"

Returns chemcloud client version

"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.__init__","title":"__init__(*, chemcloud_username=None, chemcloud_password=None, profile=None, chemcloud_domain=None)","text":"

Initialize a CCClient object.

Parameters:

Name Type Description Default chemcloud_username Optional[str]

ChemCloud username

None chemcloud_password Optional[str]

ChemCloud password

None profile Optional[str]

Authentication profile name

None chemcloud_domain Optional[str]

Domain of ChemCloud instance to connect to

None

Danger

It is not recommended to pass your ChemCloud username and password directly to a CCClient. Instead instantiate a client with no credentials client = CCClient() and then run client.configure() to securely set up your authentication credentials for ChemCloud.

Source code in chemcloud/client.py
def __init__(\n    self,\n    *,\n    chemcloud_username: Optional[str] = None,\n    chemcloud_password: Optional[str] = None,\n    profile: Optional[str] = None,\n    chemcloud_domain: Optional[str] = None,\n):\n\"\"\"\n    Initialize a CCClient object.\n\n    Parameters:\n        chemcloud_username: ChemCloud username\n        chemcloud_password: ChemCloud password\n        profile: Authentication profile name\n        chemcloud_domain: Domain of ChemCloud instance to connect to\n\n    !!! Danger\n        It is not recommended to pass your ChemCloud username and\n        password directly to a `CCClient`. Instead instantiate a client with no\n        credentials `client = CCClient()` and then run `client.configure()` to\n        securely set up your authentication credentials for ChemCloud.\n    \"\"\"\n    self._client = _RequestsClient(\n        chemcloud_username=chemcloud_username,\n        chemcloud_password=chemcloud_password,\n        profile=profile,\n        chemcloud_domain=chemcloud_domain,\n    )\n    self._openapi_spec: Optional[Dict] = None\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.compute","title":"compute(program, inp_obj, *, collect_stdout=True, collect_files=False, collect_wavefunction=False, rm_scratch_dir=True, propagate_wfn=False, queue=None)","text":"

Submit a computation to ChemCloud.

Parameters:

Name Type Description Default program str

A program name matching one of the self.supported_programs

required inp_obj QCIOInputsOrList

The input object to be used for the computation. This can be a single input object or a list of input objects.

required collect_stdout bool

Whether to collect stdout/stderr from the program as output. Failed computations will always collect stdout/stderr.

True collect_files bool

Collect all files generated by the QC program as output.

False collect_wavefunction bool

Collect the wavefunction file(s) from the calculation. Not every program will support this. Use collect_files to collect all files including the wavefunction.

False rm_scratch_dir bool

Delete the scratch directory after the program exits. Should only be set to False for debugging purposes.

True propagate_wfn bool

For any adapter performing a sequential task, such as a geometry optimization, propagate the wavefunction from the previous step to the next step. This is useful for accelerating convergence by using a previously computed wavefunction as a starting guess. This will be ignored if the adapter for a given qc program does not support it.

False queue Optional[str]

The name of a private compute queue. If None, default queue is used

None

Returns:

Type Description Union[FutureOutput, FutureOutputGroup]

Object providing access to a computation's eventual result. You can check a

Union[FutureOutput, FutureOutputGroup]

computation's status by running .status on the FutureOutput object or

Union[FutureOutput, FutureOutputGroup]

.get() to block and retrieve the computation's final result.

Source code in chemcloud/client.py
def compute(\n    self,\n    program: str,\n    inp_obj: QCIOInputsOrList,\n    *,\n    collect_stdout: bool = True,\n    collect_files: bool = False,\n    collect_wavefunction: bool = False,\n    rm_scratch_dir: bool = True,\n    propagate_wfn: bool = False,\n    queue: Optional[str] = None,\n) -> Union[FutureOutput, FutureOutputGroup]:\n\"\"\"Submit a computation to ChemCloud.\n\n    Parameters:\n        program: A program name matching one of the `self.supported_programs`\n        inp_obj: The input object to be used for the computation. This can be a\n            single input object or a list of input objects.\n        collect_stdout: Whether to collect stdout/stderr from the program as output.\n            Failed computations will always collect stdout/stderr.\n        collect_files: Collect all files generated by the QC program as output.\n        collect_wavefunction: Collect the wavefunction file(s) from the calculation.\n            Not every program will support this. Use collect_files to collect\n            all files including the wavefunction.\n        rm_scratch_dir: Delete the scratch directory after the program exits. Should\n            only be set to False for debugging purposes.\n        propagate_wfn: For any adapter performing a sequential task, such\n            as a geometry optimization, propagate the wavefunction from the previous\n            step to the next step. This is useful for accelerating convergence by\n            using a previously computed wavefunction as a starting guess. This will\n            be ignored if the adapter for a given qc program does not support it.\n        queue: The name of a private compute queue. If None, default queue is used\n\n    Returns:\n        Object providing access to a computation's eventual result. You can check a\n        computation's status by running `.status` on the `FutureOutput` object or\n        `.get()` to block and retrieve the computation's final result.\n    \"\"\"\n    if self.supported_programs is not None:\n        assert (\n            program in self.supported_programs\n        ), f\"Please use one of the following programs: {self.supported_programs}\"\n\n    compute_params = dict(\n        program=program,\n        collect_stdout=collect_stdout,\n        collect_files=collect_files,\n        collect_wavefunction=collect_wavefunction,\n        rm_scratch_dir=rm_scratch_dir,\n        propagate_wfn=propagate_wfn,\n        queue=queue,\n    )\n    return self._client.compute(inp_obj, compute_params)\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.configure","title":"configure(profile=settings.chemcloud_credentials_profile)","text":"

Configure profiles for authentication with ChemCloud.

Parameters:

Name Type Description Default profile str

Optional value to create a named profile for use with QC Cloud. No value needs to be passed and most users will only have one login with ChemCloud. CCClient will access the profile by default without a specific name being passed. Pass a value if you have multiple logins to ChemCloud.

chemcloud_credentials_profile

Note: Configures chemcloud to use the passed credentials automatically in the future. You will not need to run .configure() the next time you use the chemcloud.

Source code in chemcloud/client.py
def configure(self, profile: str = settings.chemcloud_credentials_profile) -> None:\n\"\"\"Configure profiles for authentication with ChemCloud.\n\n    Parameters:\n        profile: Optional value to create a named profile for use with QC\n            Cloud. No value needs to be passed and most users will only have one\n            login with ChemCloud. CCClient will access the profile by\n            default without a specific name being passed. Pass a value if you have\n            multiple logins to ChemCloud.\n    Note:\n        Configures `chemcloud` to use the passed credentials automatically in the\n        future. You will not need to run `.configure()` the next time you use the\n        `chemcloud`.\n\n    \"\"\"\n    print(\n        \"\u2705 If you don't get have an account please signup at: \"\n        f\"{self._client._chemcloud_domain}/signup\"\n    )\n    access_token, refresh_token = self._client._set_tokens_from_user_input()\n    self._client.write_tokens_to_credentials_file(\n        access_token, refresh_token, profile=profile\n    )\n    print(\n        f\"'{profile}' profile configured! Username/password not required for \"\n        \"future use of CCClient\"\n    )\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.hello_world","title":"hello_world(name=None)","text":"

A simple endpoint to check connectivity to ChemCloud.

Parameters:

Name Type Description Default name Optional[str]

Your name

None

Returns:

Type Description str

A message from ChemCloud if the client was able to successfully

str

connect.

Source code in chemcloud/client.py
def hello_world(self, name: Optional[str] = None) -> str:\n\"\"\"A simple endpoint to check connectivity to ChemCloud.\n\n    Parameters:\n        name: Your name\n\n    Returns:\n        A message from ChemCloud if the client was able to successfully\n        connect.\n    \"\"\"\n    return self._client.hello_world(name)\n
"},{"location":"code-reference/exceptions/","title":"Exceptions","text":""},{"location":"code-reference/exceptions/#chemcloud.exceptions.BaseError","title":"BaseError","text":"

Bases: Exception

Exception Base for client.

Source code in chemcloud/exceptions.py
class BaseError(Exception):\n\"\"\"Exception Base for client.\"\"\"\n
"},{"location":"code-reference/exceptions/#chemcloud.exceptions.TimeoutError","title":"TimeoutError","text":"

Bases: BaseError

A timeout parameter was exceeded

Source code in chemcloud/exceptions.py
class TimeoutError(BaseError):\n\"\"\"A timeout parameter was exceeded\"\"\"\n
"},{"location":"code-reference/future-outputs/","title":"Future outputs","text":""},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutput","title":"FutureOutput","text":"

Bases: FutureOutputBase

Single computation result

Source code in chemcloud/models.py
class FutureOutput(FutureOutputBase):\n\"\"\"Single computation result\"\"\"\n\n    result: Optional[QCIOOutputs] = None\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputBase","title":"FutureOutputBase","text":"

Bases: BaseModel, ABC

Base class for FutureOutputs

Attributes:

Name Type Description task_id str

The task_id for primary task submitted to ChemCloud. May correspond to a single task or group of tasks.

client Any

The _RequestsClient to use for http requests to ChemCloud.

result Optional[QCIOOutputsOrList]

Primary return value resulting from computation.

Caution

A FutureOutput should never be instantiated directly. CCClient.compute(...) will return one when you submit a computation.

Source code in chemcloud/models.py
class FutureOutputBase(BaseModel, ABC):\n\"\"\"Base class for FutureOutputs\n\n    Attributes:\n        task_id: The task_id for primary task submitted to ChemCloud. May correspond to\n            a single task or group of tasks.\n        client: The _RequestsClient to use for http requests to ChemCloud.\n        result: Primary return value resulting from computation.\n\n    Caution:\n        A FutureOutput should never be instantiated directly.\n        `CCClient.compute(...)` will return one when you submit a computation.\n    \"\"\"\n\n    task_id: str\n    result: Optional[QCIOOutputsOrList] = None\n    client: Any\n    _state: TaskStatus = TaskStatus.PENDING\n\n    model_config = {\"validate_assignment\": True}\n\n    def get(\n        self,\n        timeout: Optional[float] = None,  # in seconds\n        interval: float = 1.0,\n    ) -> QCIOOutputsOrList:\n\"\"\"Block until a calculation is complete and return the result.\n\n        Parameters:\n            timeout: The number of seconds to wait for a computation before raising a\n                TimeOutError.\n            interval: The amount of time to wait between calls to ChemCloud to\n                check a computation's status.\n\n        Returns:\n            Resultant values from a computation.\n\n        Exceptions:\n            TimeoutError: Raised if timeout interval exceeded.\n        \"\"\"\n        if self.result:\n            return self.result\n\n        start_time = time()\n\n        while not self.result:\n            # Calling self.status returns status and sets self.result if task complete\n            self.status\n            if timeout:\n                if (time() - start_time) > timeout:\n                    raise TimeoutError(\n                        f\"Your timeout limit of {timeout} seconds was exceeded\"\n                    )\n            sleep(interval)\n\n        return self.result\n\n    def _output(self):\n\"\"\"Return output from server\"\"\"\n        return self.client.output(self.task_id)\n\n    @property\n    def status(self) -> str:\n\"\"\"Check status of compute task.\n\n        Returns:\n            Status of computation.\n\n        Note:\n            Sets self.result if task is complete.\n        \"\"\"\n        if self.result:\n            return self._state\n        self._state, self.result = self._output()\n        return self._state\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputBase.status","title":"status: str property","text":"

Check status of compute task.

Returns:

Type Description str

Status of computation.

Note

Sets self.result if task is complete.

"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputBase.get","title":"get(timeout=None, interval=1.0)","text":"

Block until a calculation is complete and return the result.

Parameters:

Name Type Description Default timeout Optional[float]

The number of seconds to wait for a computation before raising a TimeOutError.

None interval float

The amount of time to wait between calls to ChemCloud to check a computation's status.

1.0

Returns:

Type Description QCIOOutputsOrList

Resultant values from a computation.

Raises:

Type Description TimeoutError

Raised if timeout interval exceeded.

Source code in chemcloud/models.py
def get(\n    self,\n    timeout: Optional[float] = None,  # in seconds\n    interval: float = 1.0,\n) -> QCIOOutputsOrList:\n\"\"\"Block until a calculation is complete and return the result.\n\n    Parameters:\n        timeout: The number of seconds to wait for a computation before raising a\n            TimeOutError.\n        interval: The amount of time to wait between calls to ChemCloud to\n            check a computation's status.\n\n    Returns:\n        Resultant values from a computation.\n\n    Exceptions:\n        TimeoutError: Raised if timeout interval exceeded.\n    \"\"\"\n    if self.result:\n        return self.result\n\n    start_time = time()\n\n    while not self.result:\n        # Calling self.status returns status and sets self.result if task complete\n        self.status\n        if timeout:\n            if (time() - start_time) > timeout:\n                raise TimeoutError(\n                    f\"Your timeout limit of {timeout} seconds was exceeded\"\n                )\n        sleep(interval)\n\n    return self.result\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputGroup","title":"FutureOutputGroup","text":"

Bases: FutureOutputBase

Group computation result

Source code in chemcloud/models.py
class FutureOutputGroup(FutureOutputBase):\n\"\"\"Group computation result\"\"\"\n\n    result: Optional[List[QCIOOutputs]] = None\n\n    def _output(self):\n\"\"\"Return result from server. Remove GROUP_ID_PREFIX from id.\"\"\"\n        return self.client.output(self.task_id.replace(GROUP_ID_PREFIX, \"\"))\n\n    @field_validator(\"task_id\")\n    @classmethod\n    def validate_id(cls, val):\n\"\"\"Prepend id with GROUP_ID_PREFIX.\n\n        NOTE:\n            This makes instantiating FutureOutputGroups from saved ids easier because\n            they are differentiated from FutureOutput ids.\n        \"\"\"\n        if not val.startswith(GROUP_ID_PREFIX):\n            val = GROUP_ID_PREFIX + val\n        return val\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputGroup.validate_id","title":"validate_id(val) classmethod","text":"

Prepend id with GROUP_ID_PREFIX.

NOTE

This makes instantiating FutureOutputGroups from saved ids easier because they are differentiated from FutureOutput ids.

Source code in chemcloud/models.py
@field_validator(\"task_id\")\n@classmethod\ndef validate_id(cls, val):\n\"\"\"Prepend id with GROUP_ID_PREFIX.\n\n    NOTE:\n        This makes instantiating FutureOutputGroups from saved ids easier because\n        they are differentiated from FutureOutput ids.\n    \"\"\"\n    if not val.startswith(GROUP_ID_PREFIX):\n        val = GROUP_ID_PREFIX + val\n    return val\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.TaskStatus","title":"TaskStatus","text":"

Bases: str, Enum

Tasks status for a submitted compute job.

Source code in chemcloud/models.py
class TaskStatus(str, Enum):\n\"\"\"Tasks status for a submitted compute job.\"\"\"\n\n    #: Task state is unknown (assumed pending since you know the id).\n    PENDING = \"PENDING\"\n    COMPLETE = \"COMPLETE\"\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.from_file","title":"from_file(path, client)","text":"

Instantiate FutureOutputs or FutureOutputGroups from file of result ids

Parameters:

Name Type Description Default path Union[str, Path]

Path to file containing the ids

required client Any

Instantiated CCClient object

required Source code in chemcloud/models.py
def from_file(\n    path: Union[str, Path],\n    client: Any,\n) -> List[Union[FutureOutput, FutureOutputGroup]]:\n\"\"\"Instantiate FutureOutputs or FutureOutputGroups from file of result ids\n\n    Params:\n        path: Path to file containing the ids\n        client: Instantiated CCClient object\n    \"\"\"\n    frs: List[Union[FutureOutput, FutureOutputGroup]] = []\n    with open(path) as f:\n        for id in f.readlines():\n            id = id.strip()\n            model: Union[Type[FutureOutput], Type[FutureOutputGroup]]\n            if id.startswith(GROUP_ID_PREFIX):\n                model = FutureOutputGroup\n            else:\n                model = FutureOutput\n            frs.append(model(task_id=id, client=client._client))\n\n    assert len(frs) > 0, \"No ids found in file!\"\n    return frs\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.to_file","title":"to_file(future_results, path, *, append=False)","text":"

Write FutureOutputs to disk for later retrieval

Parameters:

Name Type Description Default future_results Union[FutureOutputBase, List[FutureOutputBase]]

List of or single FutureOutput or FutureOutputGroup

required path Union[str, Path]

File path to results file

required append bool

Append results to an existing file if True, else create new file

False Source code in chemcloud/models.py
def to_file(\n    future_results: Union[FutureOutputBase, List[FutureOutputBase]],\n    path: Union[str, Path],\n    *,\n    append: bool = False,\n) -> None:\n\"\"\"Write FutureOutputs to disk for later retrieval\n\n    Params:\n        future_results: List of or single FutureOutput or FutureOutputGroup\n        path: File path to results file\n        append: Append results to an existing file if True, else create new file\n    \"\"\"\n    if not isinstance(future_results, list):\n        future_results = [future_results]\n\n    with open(path, f\"{'a' if append else 'w'}\") as f:\n        f.writelines([f\"{fr.task_id}\\n\" for fr in future_results])\n
"},{"location":"code-reference/inputs/","title":"Inputs","text":"

End user input models for qcio

"},{"location":"code-reference/inputs/#qcio.models.inputs.DualProgramInput","title":"DualProgramInput","text":"

Bases: StructuredInputBase, SubProgramArgs

Input for a two program calculation.

Attributes:

Name Type Description calctype

The type of calculation to be performed.

keywords

Dict of keywords to be passed to the program. Defaults to empty dict.

molecule

The molecule to be used in the calculation.

files

A dict mapping filename to str or bytes data.

subprogram

The name of the subprogram to be used.

subprogram_args

The input arguments for the subprogram.

extras

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
class DualProgramInput(StructuredInputBase, SubProgramArgs):\n\"\"\"Input for a two program calculation.\n\n    Attributes:\n        calctype: The type of calculation to be performed.\n        keywords: Dict of keywords to be passed to the program. Defaults to empty dict.\n        molecule: The molecule to be used in the calculation.\n        files: A dict mapping filename to str or bytes data.\n        subprogram: The name of the subprogram to be used.\n        subprogram_args: The input arguments for the subprogram.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n
"},{"location":"code-reference/inputs/#qcio.models.inputs.FileInput","title":"FileInput","text":"

Bases: InputBase

File and command line argument inputs for a calculation.

Attributes:

Name Type Description files

A dict mapping filename to str or bytes data.

cmdline_args List[str]

A list of command line arguments to be passed to the program.

extras List[str]

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
class FileInput(InputBase):\n\"\"\"File and command line argument inputs for a calculation.\n\n    Attributes:\n        files: A dict mapping filename to str or bytes data.\n        cmdline_args: A list of command line arguments to be passed to the program.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n\n    cmdline_args: List[str] = []\n\n    @classmethod\n    def from_directory(cls, directory: Union[Path, str], **kwargs) -> Self:\n\"\"\"Collect all files from directory and instantiate an object.\"\"\"\n        obj = cls(**kwargs)\n        directory = Path(directory)\n        obj.open_files(directory)\n        return obj\n
"},{"location":"code-reference/inputs/#qcio.models.inputs.FileInput.from_directory","title":"from_directory(directory, **kwargs) classmethod","text":"

Collect all files from directory and instantiate an object.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
@classmethod\ndef from_directory(cls, directory: Union[Path, str], **kwargs) -> Self:\n\"\"\"Collect all files from directory and instantiate an object.\"\"\"\n    obj = cls(**kwargs)\n    directory = Path(directory)\n    obj.open_files(directory)\n    return obj\n
"},{"location":"code-reference/inputs/#qcio.models.inputs.ProgramInput","title":"ProgramInput","text":"

Bases: StructuredInputBase, QCProgramArgs

Input for a single point calculation.

Attributes:

Name Type Description calctype

The type of calculation to perform.

model

The model for the quantum chemistry calculation.

keywords

A dict of keywords to be passed to the program excluding model and calctype. Defaults to an empty dict.

molecule

The molecule to be used in the calculation.

files

Files to be passed to the QC program.

extras

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
class ProgramInput(StructuredInputBase, QCProgramArgs):\n\"\"\"Input for a single point calculation.\n\n    Attributes:\n        calctype: The type of calculation to perform.\n        model: The model for the quantum chemistry calculation.\n        keywords: A dict of keywords to be passed to the program excluding model and\n            calctype. Defaults to an empty dict.\n        molecule: The molecule to be used in the calculation.\n        files: Files to be passed to the QC program.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n
"},{"location":"code-reference/outputs/","title":"Outputs","text":"

End user output and results objects from a calculation.

"},{"location":"code-reference/outputs/#qcio.models.outputs.FileOutput","title":"FileOutput","text":"

Bases: SuccessfulOutputBase

Generic output class for pure file based I/O.

Attributes:

Name Type Description input_data FileInput

The FileInput object used for the computation.

files FileInput

A dict mapping filename to str or bytes data.

success FileInput

A boolean indicator that the operation succeeded (always True)

stdout FileInput

The primary logging output of the program. Contains a union of stdout and stderr.

provenance FileInput

An object containing the provenance information for the results.

extras FileInput

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class FileOutput(SuccessfulOutputBase):\n\"\"\"Generic output class for pure file based I/O.\n\n    Attributes:\n        input_data: The FileInput object used for the computation.\n        files: A dict mapping filename to str or bytes data.\n        success: A boolean indicator that the operation succeeded (always True)\n        stdout: The primary logging output of the program. Contains a union of stdout\n            and stderr.\n        provenance: An object containing the provenance information for the results.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n\n    \"\"\"\n\n    input_data: FileInput\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationOutput","title":"OptimizationOutput","text":"

Bases: SuccessfulOutputBase

Output from a successful optimization.

Attributes:

Name Type Description input_data Union[DualProgramInput, ProgramInput]

The OptimizationInput object for the computation.

results OptimizationResults

The results computed by the program.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class OptimizationOutput(SuccessfulOutputBase):\n\"\"\"Output from a successful optimization.\n\n    Attributes:\n        input_data: The OptimizationInput object for the computation.\n        results: The results computed by the program.\n    \"\"\"\n\n    input_data: Union[DualProgramInput, ProgramInput]\n    results: OptimizationResults\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults","title":"OptimizationResults","text":"

Bases: ResultsBase

Computed properties for an optimization.

Attributes:

Name Type Description energies List[float]

The energies for each step of the optimization.

molecules List[Molecule]

The Molecule objects for each step of the optimization.

final_molecule Optional[Molecule]

The final, optimized molecule.

trajectory List[SinglePointOutput]

The SinglePointOutput objects for each step of the optimization.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class OptimizationResults(ResultsBase):\n\"\"\"Computed properties for an optimization.\n\n    Attributes:\n        energies: The energies for each step of the optimization.\n        molecules: The Molecule objects for each step of the optimization.\n        final_molecule: The final, optimized molecule.\n        trajectory: The SinglePointOutput objects for each step of the optimization.\n    \"\"\"\n\n    trajectory: List[SinglePointOutput] = []\n\n    @property\n    def final_molecule(self) -> Optional[Molecule]:\n\"\"\"The final molecule in the optimization.\"\"\"\n        try:\n            return self.trajectory[-1].input_data.molecule\n        except IndexError:  # Empty trajectory\n            return None\n\n    @property\n    def energies(self) -> List[float]:\n\"\"\"The energies for each step of the optimization.\"\"\"\n        # or 0.0 covers null case for mypy\n        return [output.results.energy or 0.0 for output in self.trajectory]\n\n    @property\n    def molecules(self) -> List[Molecule]:\n\"\"\"The Molecule objects for each step of the optimization.\"\"\"\n        return [output.input_data.molecule for output in self.trajectory]\n\n    def __repr_args__(self):\n\"\"\"Custom repr to avoid printing the entire collection objects.\"\"\"\n        return [\n            (\"final_molecule\", f\"{self.final_molecule}\"),\n            (\"trajectory\", \"[...]\"),\n            (\"energies\", \"[...]\"),\n            (\"molecules\", \"[...]\"),\n        ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.energies","title":"energies: List[float] property","text":"

The energies for each step of the optimization.

"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.final_molecule","title":"final_molecule: Optional[Molecule] property","text":"

The final molecule in the optimization.

"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.molecules","title":"molecules: List[Molecule] property","text":"

The Molecule objects for each step of the optimization.

"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.__repr_args__","title":"__repr_args__()","text":"

Custom repr to avoid printing the entire collection objects.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
def __repr_args__(self):\n\"\"\"Custom repr to avoid printing the entire collection objects.\"\"\"\n    return [\n        (\"final_molecule\", f\"{self.final_molecule}\"),\n        (\"trajectory\", \"[...]\"),\n        (\"energies\", \"[...]\"),\n        (\"molecules\", \"[...]\"),\n    ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.ProgramFailure","title":"ProgramFailure","text":"

Bases: OutputBase

A object containing details about a failed calculation.

Attributes:

Name Type Description input_data Union[DualProgramInput, ProgramInput, FileInput]

The input object for the computation.

success Literal[False]

Always False for a Failed output.

traceback Optional[str]

String representation of the traceback of the exception that caused the failure.

results Optional[str]

Any compted data that was able to be extracted before program failed.

stdout Optional[str]

The primary logging output of the program. Contains a union of stdout and stderr.

provenance Optional[str]

An object containing the provenance information for the output.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class ProgramFailure(OutputBase):\n\"\"\"A object containing details about a failed calculation.\n\n    Attributes:\n        input_data: The input object for the computation.\n        success: Always False for a Failed output.\n        traceback: String representation of the traceback of the exception that caused\n            the failure.\n        results: Any compted data that was able to be extracted before program failed.\n        stdout: The primary logging output of the program. Contains a union of stdout\n            and stderr.\n        provenance: An object containing the provenance information for the output.\n    \"\"\"\n\n    input_data: Union[DualProgramInput, ProgramInput, FileInput]\n    success: Literal[False] = False\n    traceback: Optional[str] = None\n\n    @property\n    def ptraceback(self) -> None:\n\"\"\"Print the traceback text\"\"\"\n        print(self.traceback)\n\n    def __repr_args__(self) -> \"ReprArgs\":\n\"\"\"Exclude traceback from the repr\"\"\"\n        return [\n            (key, value if key != \"traceback\" else \"<...>\")\n            for key, value in super().__repr_args__()\n        ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.ProgramFailure.ptraceback","title":"ptraceback: None property","text":"

Print the traceback text

"},{"location":"code-reference/outputs/#qcio.models.outputs.ProgramFailure.__repr_args__","title":"__repr_args__()","text":"

Exclude traceback from the repr

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
def __repr_args__(self) -> \"ReprArgs\":\n\"\"\"Exclude traceback from the repr\"\"\"\n    return [\n        (key, value if key != \"traceback\" else \"<...>\")\n        for key, value in super().__repr_args__()\n    ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointOutput","title":"SinglePointOutput","text":"

Bases: SuccessfulOutputBase

Output from a successful single point calculation.

Attributes:

Name Type Description input_data ProgramInput

The SinglePointInput object for the computation.

success ProgramInput

Always True for a successful computation.

results SinglePointResults

The results computed by the program.

files SinglePointResults

A dict mapping filename to str or bytes data.

stdout SinglePointResults

The primary logging output of the program. Contains a union of stdout and stderr.

provenance SinglePointResults

An object containing the provenance information for the results.

extras SinglePointResults

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class SinglePointOutput(SuccessfulOutputBase):\n\"\"\"Output from a successful single point calculation.\n\n    Attributes:\n        input_data: The SinglePointInput object for the computation.\n        success: Always True for a successful computation.\n        results: The results computed by the program.\n        files: A dict mapping filename to str or bytes data.\n        stdout: The primary logging output of the program. Contains a union of stdout\n            and stderr.\n        provenance: An object containing the provenance information for the results.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n\n    input_data: ProgramInput\n    results: SinglePointResults\n\n    @property\n    def return_result(self) -> Union[float, ArrayLike2D]:\n\"\"\"Return the result of the calculation.\n\n        Returns:\n            The explicitly requested result of the calculation, i.e., the energy,\n                gradient, or hessian.\n        \"\"\"\n        return getattr(self.results, self.input_data.calctype.value)\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointOutput.return_result","title":"return_result: Union[float, ArrayLike2D] property","text":"

Return the result of the calculation.

Returns:

Type Description Union[float, ArrayLike2D]

The explicitly requested result of the calculation, i.e., the energy, gradient, or hessian.

"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointResults","title":"SinglePointResults","text":"

Bases: ResultsBase

The computed results from a single point calculation.

Attributes:

Name Type Description calcinfo_natoms Optional[int]

The number of atoms as computed by the program.

calcinfo_nalpha Optional[int]

The number of alpha electrons as computed by the program.

calcinfo_nbeta Optional[int]

The number of beta electrons as computed by the program.

calcinfo_nbasis Optional[int]

The number of basis functions in the calculation.

calcinfo_nmo Optional[int]

The number of molecular orbitals in the calculation

energy Optional[float]

The electronic energy of the molecule in Hartrees.

gradient Optional[ArrayLike2D]

The gradient of the molecule in Hartrees/Bohr.

hessian Optional[ArrayLike2D]

The hessian of the molecule in Hartrees/Bohr^2.

nuclear_repulsion_energy Optional[float]

The nuclear repulsion energy of the molecule in Hartrees.

wavefunction Optional[Wavefunction]

Wavefunction data from the calculation.

freqs_wavenumber List[float]

The frequencies of the molecule in wavenumbers.

normal_modes_cartesian Optional[ArrayLike3D]

3D n_vibmodes x n_atoms x 3 array containing un-mass-weighted Cartesian displacements of each normal mode.

gibbs_free_energy Optional[float]

Gibbs free energy (i.e. thermochemical analysis) in Hartrees of a system where translation / rotation / vibration degrees of freedom are approximated using ideal gas / rigid rotor / harmonic oscillator respectively.

scf_dipole_moment Optional[List[float]]

The x, y, z component of the dipole moment of the molecule in units of e a0 (NOT Debye!).

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class SinglePointResults(ResultsBase):\n\"\"\"The computed results from a single point calculation.\n\n    Attributes:\n        calcinfo_natoms: The number of atoms as computed by the program.\n        calcinfo_nalpha: The number of alpha electrons as computed by the program.\n        calcinfo_nbeta: The number of beta electrons as computed by the program.\n        calcinfo_nbasis: The number of basis functions in the calculation.\n        calcinfo_nmo: The number of molecular orbitals in the calculation\n\n        energy: The electronic energy of the molecule in Hartrees.\n        gradient: The gradient of the molecule in Hartrees/Bohr.\n        hessian: The hessian of the molecule in Hartrees/Bohr^2.\n        nuclear_repulsion_energy: The nuclear repulsion energy of the molecule in\n            Hartrees.\n\n        wavefunction: Wavefunction data from the calculation.\n\n        freqs_wavenumber: The frequencies of the molecule in wavenumbers.\n        normal_modes_cartesian: 3D n_vibmodes x n_atoms x 3 array containing\n            un-mass-weighted Cartesian displacements of each normal mode.\n        gibbs_free_energy: Gibbs free energy (i.e. thermochemical analysis) in Hartrees\n            of a system where translation / rotation / vibration degrees of freedom are\n            approximated using ideal gas / rigid rotor / harmonic oscillator\n            respectively.\n        scf_dipole_moment: The x, y, z component of the dipole moment of the molecule\n            in units of e a0 (NOT Debye!).\n\n    \"\"\"\n\n    # calcinfo contains general information about the calculation\n    calcinfo_natoms: Optional[int] = None\n    calcinfo_nbasis: Optional[int] = None\n    calcinfo_nmo: Optional[int] = None\n    calcinfo_nalpha: Optional[int] = None\n    calcinfo_nbeta: Optional[int] = None\n\n    # Core properties\n    energy: Optional[float] = None\n    gradient: Optional[ArrayLike2D] = None\n    hessian: Optional[ArrayLike2D] = None\n    nuclear_repulsion_energy: Optional[float] = None\n\n    # Wavefunction data\n    wavefunction: Optional[Wavefunction] = None\n\n    # Frequency data\n    freqs_wavenumber: List[float] = []\n    normal_modes_cartesian: Optional[ArrayLike3D] = None\n    gibbs_free_energy: Optional[float] = None\n\n    # SCF results\n    scf_dipole_moment: Optional[List[float]] = None\n\n    @field_validator(\"normal_modes_cartesian\")\n    @classmethod\n    def validate_normal_modes_cartesian_shape(cls, v: ArrayLike3D):\n        if v is not None:\n            # Assume array has length of the number of normal modes\n            n_normal_modes = len(v)\n            return np.asarray(v).reshape(n_normal_modes, -1, 3)\n\n    @field_validator(\"gradient\")\n    @classmethod\n    def validate_gradient_shape(cls, v: ArrayLike2D):\n\"\"\"Validate gradient is n x 3\"\"\"\n        if v is not None:\n            return np.asarray(v).reshape(-1, 3)\n\n    @field_validator(\"hessian\")\n    @classmethod\n    def validate_hessian_shape(cls, v: ArrayLike2D):\n\"\"\"Validate hessian is square\"\"\"\n        if v is not None:\n            v = np.asarray(v)\n            n = int(np.sqrt(v.size))\n            return v.reshape((n, n))\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointResults.validate_gradient_shape","title":"validate_gradient_shape(v) classmethod","text":"

Validate gradient is n x 3

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
@field_validator(\"gradient\")\n@classmethod\ndef validate_gradient_shape(cls, v: ArrayLike2D):\n\"\"\"Validate gradient is n x 3\"\"\"\n    if v is not None:\n        return np.asarray(v).reshape(-1, 3)\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointResults.validate_hessian_shape","title":"validate_hessian_shape(v) classmethod","text":"

Validate hessian is square

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
@field_validator(\"hessian\")\n@classmethod\ndef validate_hessian_shape(cls, v: ArrayLike2D):\n\"\"\"Validate hessian is square\"\"\"\n    if v is not None:\n        v = np.asarray(v)\n        n = int(np.sqrt(v.size))\n        return v.reshape((n, n))\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.Wavefunction","title":"Wavefunction","text":"

Bases: QCIOModelBase

The wavefunction for a single point calculation.

Attributes:

Name Type Description scf_eigenvalues_a Optional[ArrayLike2D]

The SCF alpha-spin orbital eigenvalues.

scf_eigenvalues_b Optional[ArrayLike2D]

The SCF beta-spin orbital eigenvalues.

scf_occupations_a Optional[ArrayLike2D]

The SCF alpha-spin orbital occupations.

scf_occupations_b Optional[ArrayLike2D]

The SCF beta-spin orbital occupations.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class Wavefunction(QCIOModelBase):\n\"\"\"The wavefunction for a single point calculation.\n\n    Attributes:\n        scf_eigenvalues_a: The SCF alpha-spin orbital eigenvalues.\n        scf_eigenvalues_b: The SCF beta-spin orbital eigenvalues.\n        scf_occupations_a: The SCF alpha-spin orbital occupations.\n        scf_occupations_b: The SCF beta-spin orbital occupations.\n    \"\"\"\n\n    scf_eigenvalues_a: Optional[ArrayLike2D] = None\n    scf_eigenvalues_b: Optional[ArrayLike2D] = None\n    scf_occupations_a: Optional[ArrayLike2D] = None\n    scf_occupations_b: Optional[ArrayLike2D] = None\n\n    @field_validator(\n        \"scf_eigenvalues_a\",\n        \"scf_eigenvalues_b\",\n        \"scf_occupations_a\",\n        \"scf_occupations_b\",\n    )\n    @classmethod\n    def to_numpy(cls, val, _info) -> Optional[np.ndarray]:\n        return np.asarray(val) if val is not None else None\n
"},{"location":"tutorial/authentication/","title":"Authentication","text":"

Authentication is the process of supplying your credentials (usually a username and password) to chemcloud so that you can perform computations. chemcloud provides a few easy ways for you to authenticate. If you do not have a ChemCloud account you can get one for free here or at the address of the ChemCloud server you want to interact with: https://chemcloud.mtzlab.com/signup

"},{"location":"tutorial/authentication/#clientconfigure-recommended-for-most-cases","title":"client.configure() (recommended for most cases)","text":"
from chemcloud import CCClient\nclient = CCClient()\nclient.configure()\n\u2705 If you dont get have an account please signup at: https://chemcloud.mtzlab.com/signup\nPlease enter your ChemCloud username: your_username@email.com\nPlease enter your ChemCloud password:\nAuthenticating...\n'default' profile configured! Username/password not required for future use of CCClient\n

Performing this action will configure your local client by writing authentication tokens to ~/.chemcloud/credentials. You will not need to execute configure() ever again. Under the hood CCClient will access your tokens, refresh them when necessary, and keep you logged in to ChemCloud. Note that this will write a file to your home directory with sensitive access tokens, so if you are on a shared computer or using a device where you would not want to write this information to disk do not use this option. If you would like to write the credentials file to a different directory than ~/.chemcloud, set the CHEMCLOUD_BASE_DIRECTORY environment variable to the path of interest.

You can configure multiple profiles in case you have multiple logins to ChemCloud by passing a profile name to configure():

client.configure('mtz_lab')\n\u2705 If you dont get have an account please signup at: https://chemcloud.mtzlab.com/signup\nPlease enter your ChemCloud username: your_username@email.om\nPlease enter your ChemCloud password:\nAuthenticating...\n'mtz_lab' profile configured! Username/password not required for future use of CCClient\n

To use one of these profiles pass the profile option to your client instance. The \"default\" profile is used when no profile name is passed:

from chemcloud import CCClient\n# Use default profile\nclient = CCClient()\n\n# Use named profile\nclient = CCClient(profile=\"mtz_lab\")\n
"},{"location":"tutorial/authentication/#environment-variables","title":"Environment Variables","text":"

You can set your ChemCloud username and password in your environment and the client will find them automatically. Set CHEMCLOUD_USERNAME and CHEMCLOUD_PASSWORD. When you create a client it will find these values and maintain all access tokens in memory only.

"},{"location":"tutorial/authentication/#usernamepassword-when-prompted-after-calling-clientcompute","title":"Username/Password when prompted after calling client.compute(...)","text":"

If you have not run client.configure() or set environment variables you will be requested for your username and password when you submit a computation to ChemCloud using client.compute(...). The client will use your username and password to get access tokens and will maintain access tokens for you in memory only. Your login session will be valid for the duration of your Python session.

"},{"location":"tutorial/authentication/#pass-usernamepassword-to-client-not-recommended","title":"Pass Username/Password to Client (not recommended)","text":"

You can directly pass a username and password to the client object. This is not recommended as it opens up the possibility of your credentials accidentally being committed to your code repo. However, it can be used in rare circumstances when necessary.

from chemcloud import CCClient\nclient = CCClient(\n    chemcloud_username=\"your_username@email.com\", chemcloud_password=\"super_secret_password\"  # pragma: allowlist secret\n    )\n
"},{"location":"tutorial/batch-computations/","title":"Batch Computations","text":"

Calculations can be submitted in bulk by passing a list of Input objects to client.compute() rather than a single object.

from qcio import Molecule, ProgramInput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = ProgramInput(\n    molecule=water,\n    model={\"method\": \"b3lyp\", \"basis\": \"6-31g\"},\n    calctype=\"energy\",\n    keywords={},\n)\nfuture_result = client.compute(\"psi4\", [prog_inp] * 2)\noutput = future_result.get()\n# Array of SinglePointOutput objects containing all returned data\nprint(output)\n
"},{"location":"tutorial/bigchem-algorithms/","title":"BigChem Algorithms","text":"

BigChem implements some of its own concurrent algorithms that leverage its horizontally scalable backend infrastructure. These include a parallel hessian algorithm and parallel frequency analysis algorithm. To use them submit a hessian calculation to ChemCloud using bigchem as the engine. See examples the parallel_hessian.py and parallel_frequency_analysis.py scripts in the examples directory.

"},{"location":"tutorial/bigchem-algorithms/#hessian","title":"Hessian","text":"

from qcio import DualProgramInput, Molecule, SinglePointOutput

from chemcloud import CCClient

water = Molecule( symbols=[\"O\", \"H\", \"H\"], geometry=[ [0.0000, 0.00000, 0.0000], [0.2774, 0.89290, 0.2544], [0.6067, -0.23830, -0.7169], ], )

client = CCClient()

prog_inp = DualProgramInput( molecule=water, calctype=\"hessian\", subprogram=\"psi4\", subprogram_args={\"model\": {\"method\": \"b3lyp\", \"basis\": \"6-31g\"}}, )

"},{"location":"tutorial/bigchem-algorithms/#submit-calculation","title":"Submit calculation","text":"

future_result = client.compute(\"bigchem\", prog_inp) output: SinglePointOutput = future_result.get()

"},{"location":"tutorial/bigchem-algorithms/#singlepointoutput-object-containing-all-returned-data","title":"SinglePointOutput object containing all returned data","text":"

print(output) print(output.results.hessian)

"},{"location":"tutorial/bigchem-algorithms/#frequency-data-always-included-too","title":"Frequency data always included too","text":"

print(f\"Wavenumbers: {output.results.freqs_wavenumber}\") print(output.results.normal_modes_cartesian) print(output.results.gibbs_free_energy)

"},{"location":"tutorial/bigchem-algorithms/#frequency-analysis","title":"Frequency Analysis","text":"

from qcio import DualProgramInput, Molecule, SinglePointOutput

from chemcloud import CCClient

water = Molecule( symbols=[\"O\", \"H\", \"H\"], geometry=[ [0.0000, 0.00000, 0.0000], [0.2774, 0.89290, 0.2544], [0.6067, -0.23830, -0.7169], ], )

client = CCClient()

prog_inp = DualProgramInput( molecule=water, calctype=\"hessian\", subprogram=\"psi4\", subprogram_args={\"model\": {\"method\": \"b3lyp\", \"basis\": \"6-31g\"}}, )

"},{"location":"tutorial/bigchem-algorithms/#submit-calculation_1","title":"Submit calculation","text":"

future_result = client.compute(\"bigchem\", prog_inp) output: SinglePointOutput = future_result.get()

"},{"location":"tutorial/bigchem-algorithms/#singlepointoutput-object-containing-all-returned-data_1","title":"SinglePointOutput object containing all returned data","text":"

print(output) print(f\"Wavenumbers: {output.results.freqs_wavenumber}\") print(output.results.normal_modes_cartesian) print(output.results.gibbs_free_energy)

Keywords for the BigChem algorithms:

Keyword Type Description Default Value dh float Displacement for gradient geometries for finite difference 5.0e-3 temperature float Temperature passed to the harmonic free energy module 300.0 pressure float Pressure passed to the harmonic free energy module 1.0"},{"location":"tutorial/compute/","title":"Compute","text":"

Computations are physically executed by a BigChem instance fronted by a ChemCloud server. The chemcloud python client submits jobs to and retrieves work from the ChemCloud server. Computations are submitted using the CCClient object.

Computations require a QC proram and ProgramInput or DualProgramInput object. The ProgramInput object contains all the information necessary to run a single calculation. The DualProgramInput object is used when two QC programs are used in tandem, such as when performing a geometry optimization with one program that uses a subprogram for the energy and gradient calculations.

"},{"location":"tutorial/compute/#basic-single-point-calculation","title":"Basic Single Point Calculation","text":"
from qcio import Molecule, ProgramInput, SinglePointOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = ProgramInput(\n    molecule=water,\n    model={\"method\": \"b3lyp\", \"basis\": \"6-31g\"},\n    calctype=\"energy\",  # Or \"gradient\" or \"hessian\"\n    keywords={},\n)\nfuture_result = client.compute(\"psi4\", prog_inp, collect_files=True)\noutput: SinglePointOutput = future_result.get()\n# SinglePointOutput object containing all returned data\nprint(output.stdout)\nprint(output)\n# The energy value requested\nprint(output.return_result)\nprint(output.files.keys())\n
"},{"location":"tutorial/compute/#including-files-in-the-input","title":"Including Files in the Input","text":"
from qcio import Molecule, ProgramInput, SinglePointOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = ProgramInput(\n    molecule=water,\n    model={\"method\": \"b3lyp\", \"basis\": \"6-31g\"},\n    calctype=\"energy\",\n    keywords={\"guess\": \"c0\"},\n    files={\n        \"c0\": b'\\xdf4R\\xdea\\xd7\\xef?\\xc1-\\xbdg2\\xd0\\xca?\\x8e\\xc4\\x94\\x02\\xe5\\xcd\\xae\\xbe\\xd9kP\\xd8R2\\xb7\\xbfhV\\xc1\\x136\\xe5\\xbe\\xbe\\xad\\x0b#2\\xabp\\xb6?\\xe9\\x91\\x99\\xbf\\xd7\\xe9e>LQ\\x05\\xa4F\\xaa\\xa6>>k\\xab\\xa4\\xd4j\\xa1\\xbf\\xd1#\\xbf\\x14\\t\\xdf\\xd8>\\x99Qq\\x1b\\x07\\x0b\\xb4?$*\\x0ed\\x95\\x91\\x97\\xbe\\r\\xc8\\xfb\\xca\\xbb\\x82\\xab?\\'d\\x0c-Y\\x8e\\x9c?\\x8c\\x10\\xf1\\xd9I\\xb5\\xdd\\xbf\\xf7\\xea%X\\xd0\\x02\\xbf>==urA\\xc8\\xc9?\\xe0f\\xbb#^\\t\\xc8>\\xe3\\xfb\\x8b\\xc2C\\x94\\xc3\\xbf\\xd0]m\\x85\\xd1\\xd7\\xb5>\\xa2\\x1c\\x03Un0\\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    },\n)\nfuture_result = client.compute(\"terachem\", prog_inp)\noutput: SinglePointOutput = future_result.get()\n# SinglePointOutput object containing all returned data\nprint(output.stdout)\nprint(output)\n# The energy value requested\nprint(output.return_result)\nprint(output.files.keys())\n

Files can also be added to an input objects using the open_file method.

prog_input.open_file(\"some_file.dat\")\n
"},{"location":"tutorial/geometry-optimization/","title":"Geometry optimization","text":""},{"location":"tutorial/geometry-optimization/#basic-working-example","title":"Basic Working Example","text":"
from qcio import DualProgramInput, Molecule, OptimizationOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [-0.11904094, -0.36695321, -0.21996706],\n        [1.24615604, -0.14134141, 0.99915579],\n        [-0.24300973, 1.16287522, -1.24168873],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = DualProgramInput(\n    molecule=water,\n    calctype=\"optimization\",\n    keywords={\"maxiter\": 25},\n    subprogram=\"psi4\",\n    subprogram_args={\"model\": {\"method\": \"b3lyp\", \"basis\": \"6-31g\"}},\n)\n\n\n# Submit calculation\nfuture_result = client.compute(\"geometric\", prog_inp)\noutput: OptimizationOutput = future_result.get()\n\nif output.success:\n    print(\"Optimization succeeded!\")\n    # Will be OptimizationResult object\n    print(output)\n    # The final molecule of the geometry optimization\n    print(output.results.final_molecule)\n    # Initial molecule\n    print(output.input_data.molecule)\n    # A list of ordered AtomicResult objects for each step in the optimization\n    print(output.results.trajectory)\n    # A list of ordered energies for each step in the optimization\n    print(output.results.energies)\nelse:\n    print(\"Optimization failed!\")\n    # Will be FailedOperation object\n    print(output)\n    # Error information\n    print(output.traceback)\n
"},{"location":"tutorial/geometry-optimization/#using-force-fields","title":"Using Force Fields","text":"

rdkit can be specified as a compute backend to perform optimizations using force field methods instead of quantum chemistry backends. To use rdkit force field methods simply modify the model specification and subprogram specification as shown below. Also note that rdkit requires the molecular connectivity to be defined.

water = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n    # Add bond connectivity to water (from_atom, to_atom, bond_order)\n    connectivity=[(0, 1, 1.0), (0, 2, 1.0)],\n)\n\nopt_input = DualProgramInput(\n    ...\n    subprogram=\"rdkit\",\n    subprogram_args={\"model\": {\"method\": \"UFF\"}} # or any other force field\n)\n\nfuture_output = client.compute(\"geometric\", opt_input)\n
"},{"location":"tutorial/geometry-optimization/#berny-specifics","title":"Berny Specifics","text":"

The berny procedure uses the pyberny package to perform a geometry optimization. berny specific keywords are subject to change as the berny package evolves, but for simplicity a short list is included here with default values noted:

Keyword Description Default Value maxsteps Maximum number of steps in the optimization 100 gradientmax Convergence criteria (AU) 0.45e-3 gradientrms Convergence criteria (AU) 0.15e-3 stepmax Step in internal coordinates, assuming radian units for angles (AU) 1.8e-3 steprms Step in internal coordinates, assuming radian units for angles (AU) 0.45e-3 trust Initial trust radius in AU. It is the maximum RMS of the quadratic step 0.3 dihedral Form dihedral angles True superweakdih Form dihedral angles containing two or more noncovalent bonds False"},{"location":"tutorial/geometry-optimization/#geometric-specifics","title":"geomeTRIC Specifics","text":"

The geometric procedure uses the geomeTRIC package to perform a geometry optimization. geomeTRIC specific keywords are subject to change as the geomeTRIC package evolves. Since geomeTRIC has considerably more keywords, here's the source code that defines various parameters for an optimization. Keywords noted below can be included in the OptimizationInput keywords dictionary. If these options are overwhelming, keep in mind you can run both the berny and geometric optimizers without any keywords and the optimizers will use sensible defaults.

class OptParams(object):\n\"\"\"\n    Container for optimization parameters.\n    The parameters used to be contained in the command-line \"args\",\n    but this was dropped in order to call Optimize() from another script.\n    \"\"\"\n    def __init__(self, **kwargs):\n        # Whether we are optimizing for a transition state. This changes a number of default parameters.\n        self.transition = kwargs.get('transition', False)\n        # CI optimizations sometimes require tiny steps\n        self.meci = kwargs.get('meci', False)\n        # Handle convergence criteria; this edits the kwargs\n        self.convergence_criteria(**kwargs)\n        # Threshold (in a.u. / rad) for activating alternative algorithm that enforces precise constraint satisfaction\n        self.enforce = kwargs.get('enforce', 0.0)\n        # Small eigenvalue threshold\n        self.epsilon = kwargs.get('epsilon', 1e-5)\n        # Interval for checking the coordinate system for changes\n        self.check = kwargs.get('check', 0)\n        # More verbose printout\n        self.verbose = kwargs.get('verbose', False)\n        # Starting value of the trust radius\n        # Because TS optimization is experimental, use conservative trust radii\n        self.trust = kwargs.get('trust', 0.01 if self.transition else 0.1)\n        # Maximum value of trust radius\n        self.tmax = kwargs.get('tmax', 0.03 if self.transition else 0.3)\n        # Minimum value of the trust radius\n        self.tmin = kwargs.get('tmin', 0.0 if (self.transition or self.meci) else min(1.2e-3, self.Convergence_drms))\n        # Minimum size of a step that can be rejected\n        self.thre_rj = kwargs.get('thre_rj', 1e-4 if (self.transition or self.meci) else 1e-2)\n        # Sanity checks on trust radius\n        if self.tmax < self.tmin:\n            raise ParamError(\"Max trust radius must be larger than min\")\n        # The trust radius should not be outside (tmin, tmax)\n        self.trust = min(self.tmax, self.trust)\n        self.trust = max(self.tmin, self.trust)\n        # Maximum number of optimization cycles\n        self.maxiter = kwargs.get('maxiter', 300)\n        # Use updated constraint algorithm implemented 2019-03-20\n        self.conmethod = kwargs.get('conmethod', 0)\n        # Write Hessian matrix at optimized structure to text file\n        self.write_cart_hess = kwargs.get('write_cart_hess', None)\n        # Output .xyz file name may be set separately in\n        # run_optimizer() prior to calling Optimize().\n        self.xyzout = kwargs.get('xyzout', None)\n        # Name of the qdata.txt file to be written.\n        # The CLI is designed so the user passes true/false instead of the file name.\n        self.qdata = 'qdata.txt' if kwargs.get('qdata', False) else None\n        # Whether to calculate or read a Hessian matrix.\n        self.hessian = kwargs.get('hessian', None)\n        if self.hessian is None:\n            # Default is to calculate Hessian in the first step if searching for a transition state.\n            # Otherwise the default is to never calculate the Hessian.\n            if self.transition: self.hessian = 'first'\n            else: self.hessian = 'never'\n        if self.hessian.startswith('file:'):\n            if os.path.exists(self.hessian[5:]):\n                # If a path is provided for reading a Hessian file, read it now.\n                self.hess_data = np.loadtxt(self.hessian[5:])\n            else:\n                raise IOError(\"No Hessian data file found at %s\" % self.hessian)\n        elif self.hessian.lower() in ['never', 'first', 'each', 'stop', 'last', 'first+last']:\n            self.hessian = self.hessian.lower()\n        else:\n            raise RuntimeError(\"Hessian command line argument can only be never, first, last, first+last, each, stop, or file:<path>\")\n        # Perform a frequency analysis whenever a cartesian Hessian is computed\n        self.frequency = kwargs.get('frequency', None)\n        if self.frequency is None: self.frequency = True\n        # Temperature and pressure for harmonic free energy\n        self.temperature, self.pressure = kwargs.get('thermo', [300.0, 1.0])\n        # Number of desired samples from Wigner distribution\n        self.wigner = kwargs.get('wigner', 0)\n        if self.wigner and not self.frequency:\n            raise ParamError('Wigner sampling requires frequency analysis')\n        # Reset Hessian to guess whenever eigenvalues drop below epsilon\n        self.reset = kwargs.get('reset', None)\n        if self.reset is None: self.reset = not (self.transition or self.meci or self.hessian == 'each')\n

And convergence criteria:

def convergence_criteria(self, **kwargs):\n        criteria = kwargs.get('converge', [])\n        if len(criteria)%2 != 0:\n            raise RuntimeError('Please pass an even number of options to --converge')\n        for i in range(int(len(criteria)/2)):\n            key = 'convergence_' + criteria[2*i].lower()\n            try:\n                val = float(criteria[2*i+1])\n                logger.info('Using convergence criteria: %s %.2e\\n' % (key, val))\n            except ValueError:\n                # This must be a set\n                val = str(criteria[2*i+1])\n                logger.info('Using convergence criteria set: %s %s\\n' % (key, val))\n            kwargs[key] = val\n        # convergence dictionary to store criteria stored in order of energy, grms, gmax, drms, dmax\n        # 'GAU' contains the default convergence criteria that are used when nothing is passed.\n        convergence_sets = {'GAU': [1e-6, 3e-4, 4.5e-4, 1.2e-3, 1.8e-3],\n                            'NWCHEM_LOOSE': [1e-6, 3e-3, 4.5e-3, 3.6e-3, 5.4e-3],\n                            'GAU_LOOSE': [1e-6, 1.7e-3, 2.5e-3, 6.7e-3, 1e-2],\n                            'TURBOMOLE': [1e-6, 5e-4, 1e-3, 5.0e-4, 1e-3],\n                            'INTERFRAG_TIGHT': [1e-6, 1e-5, 1.5e-5, 4.0e-4, 6.0e-4],\n                            'GAU_TIGHT': [1e-6, 1e-5, 1.5e-5, 4e-5, 6e-5],\n                            'GAU_VERYTIGHT': [1e-6, 1e-6, 2e-6, 4e-6, 6e-6]}\n        # Q-Chem style convergence criteria (i.e. gradient and either energy or displacement)\n        self.qccnv = kwargs.get('qccnv', False)\n        # Molpro style convergence criteria (i.e. gradient and either energy or displacement, with different defaults)\n        self.molcnv = kwargs.get('molcnv', False)\n        # Check if there is a convergence set passed else use the default\n        set_name = kwargs.get('convergence_set', 'GAU').upper()\n        # If we have extra keywords apply them here else use the set\n        # Convergence criteria in a.u. and Angstrom\n        self.Convergence_energy = kwargs.get('convergence_energy', convergence_sets[set_name][0])\n        self.Convergence_grms = kwargs.get('convergence_grms', convergence_sets[set_name][1])\n        self.Convergence_gmax = kwargs.get('convergence_gmax', convergence_sets[set_name][2])\n        self.Convergence_drms = kwargs.get('convergence_drms', convergence_sets[set_name][3])\n        self.Convergence_dmax = kwargs.get('convergence_dmax', convergence_sets[set_name][4])\n        # Convergence criteria that are only used if molconv is set to True\n        self.Convergence_molpro_gmax = kwargs.get('convergence_molpro_gmax', 3e-4)\n        self.Convergence_molpro_dmax = kwargs.get('convergence_molpro_dmax', 1.2e-3)\n
"},{"location":"tutorial/supported-programs/","title":"Supported programs","text":"

Supported compute engines in chemcloud can be checked as follows:

from chemcloud import CCClient\n\nclient = CCClient()\nclient.supported_engines\n[\"psi4\", \"terachem_fe\", \"rdkit\", ...]\n

Please see BigChem Algorithms for details on parallel execution algorithms unique to the BigChem compute engine.

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"chemcloud","text":""},{"location":"#chemcloud-a-python-client-for-chemcloud","title":"chemcloud - A Python Client for ChemCloud","text":"

chemcloud is a python client for the ChemCloud Server. The client provides a simple yet powerful interface to perform computational chemistry calculations using nothing but modern Python and an internet connection.

Documentation: https://mtzgroup.github.io/chemcloud-client

chemcloud works in harmony with a suite of other quantum chemistry tools for fast, structured, and interoperable quantum chemistry.

"},{"location":"#the-qc-suite-of-programs","title":"The QC Suite of Programs","text":""},{"location":"#installation","title":"Installation","text":"
pip install chemcloud\n
"},{"location":"#quickstart","title":"Quickstart","text":"
from chemcloud import CCClient\n\nclient = CCClient()\nclient.configure() # only run this the very first time you use CCClient\n# See supported compute engines on the ChemCloud Server\nclient.supported_engines\n['psi4', 'terachem', ...]\n# Test connection to ChemCloud\nclient.hello_world(\"Colton\")\n'Welcome to ChemCloud, Colton'\n
from qcio import Molecule, ProgramInput\nfrom chemcloud import CCClient\n\nclient = CCClient()\n\n# Create the molecule\nh2o = Molecule.open(\"h2o.xyz\")\n\n# Define the program input\nprog_input = ProgramInput(\n    molecule=h2o,\n    calctype=\"energy\",\n    model={\"method\": \"hf\", \"basis\": \"sto-3g\"},\n    keywords={\"purify\": \"no\", \"restricted\": False},\n)\n\n# Submit the calculation to the server\nfuture_output = client.compute(\"terachem\", prog_input, collect_files=True)\n# Status can be checked at any time\nfuture_result.status\n# Get the output (blocking)\noutput = future_output.get()\n\n# Inspect the output\noutput.input_data # Input data used by the QC program\noutput.success # Whether the calculation succeeded\noutput.results # All structured results from the calculation\noutput.stdout # Stdout log from the calculation\noutput.pstdout # Shortcut to print out the stdout in human readable format\noutput.files # Any files returned by the calculation\noutput.provenance # Provenance information about the calculation\noutput.extras # Any extra information not in the schema\noutput.traceback # Stack trace if calculation failed\noutput.ptraceback # Shortcut to print out the traceback in human readable format\n
"},{"location":"#examples","title":"Examples","text":"

Examples of various computations can be found in the examples directory.

"},{"location":"#support","title":"Support","text":"

If you have any issues with chemcloud or would like to request a feature, please open an issue.

"},{"location":"CHANGELOG/","title":"Changelog","text":"

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

"},{"location":"CHANGELOG/#unreleased","title":"unreleased","text":""},{"location":"CHANGELOG/#083-2023-10-20","title":"0.8.3 - 2023-10-20","text":""},{"location":"CHANGELOG/#changed","title":"Changed","text":""},{"location":"CHANGELOG/#082-2023-09-25","title":"0.8.2 - 2023-09-25","text":""},{"location":"CHANGELOG/#changed_1","title":"Changed","text":""},{"location":"CHANGELOG/#081-2023-09-20","title":"0.8.1 - 2023-09-20","text":""},{"location":"CHANGELOG/#changed_2","title":"Changed","text":""},{"location":"CHANGELOG/#080-2023-09-19","title":"0.8.0 - 2023-09-19","text":""},{"location":"CHANGELOG/#changed_3","title":"Changed","text":""},{"location":"CHANGELOG/#070-2023-09-08","title":"0.7.0 - 2023-09-08","text":""},{"location":"CHANGELOG/#changed_4","title":"Changed","text":""},{"location":"CHANGELOG/#added","title":"Added","text":""},{"location":"CHANGELOG/#062-2022-12-27","title":"0.6.2 - 2022-12-27","text":""},{"location":"CHANGELOG/#changed_5","title":"Changed","text":""},{"location":"CHANGELOG/#061-2022-07-19","title":"0.6.1 - 2022-07-19","text":""},{"location":"CHANGELOG/#changed_6","title":"Changed","text":""},{"location":"CHANGELOG/#060-2022-07-19","title":"0.6.0 - 2022-07-19","text":""},{"location":"CHANGELOG/#changed_7","title":"Changed","text":""},{"location":"CHANGELOG/#050-2022-07-15","title":"0.5.0 - 2022-07-15","text":""},{"location":"CHANGELOG/#changed_8","title":"Changed","text":""},{"location":"CHANGELOG/#041-2022-05-07","title":"0.4.1 - 2022-05-07","text":""},{"location":"CHANGELOG/#changed_9","title":"Changed","text":""},{"location":"CHANGELOG/#040-2022-4-02","title":"0.4.0 - 2022-4-02","text":""},{"location":"CHANGELOG/#added_1","title":"Added","text":""},{"location":"CHANGELOG/#changed_10","title":"Changed","text":""},{"location":"CHANGELOG/#removed","title":"Removed","text":""},{"location":"CHANGELOG/#031-2022-03-27","title":"0.3.1 - 2022-03-27","text":""},{"location":"CHANGELOG/#added_2","title":"Added","text":""},{"location":"CHANGELOG/#changed_11","title":"Changed","text":""},{"location":"CHANGELOG/#030-2022-03-26","title":"0.3.0 - 2022-03-26","text":""},{"location":"CHANGELOG/#added_3","title":"Added","text":""},{"location":"CHANGELOG/#024-2021-06-07","title":"0.2.4 - 2021-06-07","text":""},{"location":"CHANGELOG/#added_4","title":"Added","text":""},{"location":"CHANGELOG/#023-2021-06-04","title":"0.2.3 - 2021-06-04","text":""},{"location":"CHANGELOG/#added_5","title":"Added","text":""},{"location":"CHANGELOG/#changed_12","title":"Changed","text":""},{"location":"CHANGELOG/#022-2021-05-21","title":"0.2.2 - 2021-05-21","text":""},{"location":"CHANGELOG/#added_6","title":"Added","text":""},{"location":"CHANGELOG/#021-2021-03-05","title":"0.2.1 - 2021-03-05","text":""},{"location":"CHANGELOG/#added_7","title":"Added","text":""},{"location":"CHANGELOG/#020-2021-02-26","title":"0.2.0 - 2021-02-26","text":""},{"location":"CHANGELOG/#added_8","title":"Added","text":""},{"location":"CHANGELOG/#changed_13","title":"Changed","text":""},{"location":"CHANGELOG/#011-2021-01-22","title":"0.1.1 - 2021-01-22","text":""},{"location":"CHANGELOG/#added_9","title":"Added","text":""},{"location":"dev-decisions/","title":"Core Development Decisions","text":""},{"location":"dev-decisions/#_requestsclient-class","title":"_RequestsClient Class","text":"

I'm starting to have second thoughts about this ^^ decision. It feels like the _RequestsClient is starting to take on too much responsibility. It accepts python data types as parameters, and returns python data types as it if were an end-user class. It isn't. It's meant to be a utility class used by end-user objects such as CCClient and FutureOutput objects. I think it should return data more directly from the ChemCloud API and let the other classes handle this data. This becomes more apparent as I add pydantic to my data models and realize I'd rather have them pass rawer data types to the _RequestsClient and then handle the results of an API call inside their own class. Maybe the compute() method on the _RequestsClient should go away and these should live exclusively on the CCClient object which then utilizes request and authenticated_request to access ChemCloud.

"},{"location":"code-reference/CCClient/","title":"CCClient","text":"

Main client object to perform computations using ChemCloud.

Source code in chemcloud/client.py
class CCClient:\n\"\"\"Main client object to perform computations using ChemCloud.\"\"\"\n\n    def __init__(\n        self,\n        *,\n        chemcloud_username: Optional[str] = None,\n        chemcloud_password: Optional[str] = None,\n        profile: Optional[str] = None,\n        chemcloud_domain: Optional[str] = None,\n    ):\n\"\"\"\n        Initialize a CCClient object.\n\n        Parameters:\n            chemcloud_username: ChemCloud username\n            chemcloud_password: ChemCloud password\n            profile: Authentication profile name\n            chemcloud_domain: Domain of ChemCloud instance to connect to\n\n        !!! Danger\n            It is not recommended to pass your ChemCloud username and\n            password directly to a `CCClient`. Instead instantiate a client with no\n            credentials `client = CCClient()` and then run `client.configure()` to\n            securely set up your authentication credentials for ChemCloud.\n        \"\"\"\n        self._client = _RequestsClient(\n            chemcloud_username=chemcloud_username,\n            chemcloud_password=chemcloud_password,\n            profile=profile,\n            chemcloud_domain=chemcloud_domain,\n        )\n        self._openapi_spec: Optional[Dict] = None\n\n    def __repr__(self) -> str:\n        return (\n            f\"{type(self).__name__}({self._client._chemcloud_domain}, \"\n            f\"profile={self.profile})\"\n        )\n\n    def _set_openapi_specification(self):\n\"\"\"Gets OpenAPI specification from ChemCloud Server\"\"\"\n        self._openapi_spec = self._client._request(\n            \"get\", \"/openapi.json\", api_call=False\n        )\n\n    @property\n    def version(self) -> str:\n\"\"\"Returns chemcloud client version\"\"\"\n        return __version__\n\n    @property\n    def profile(self) -> str:\n\"\"\"Profile being used for authentication with ChemCloud.\n\n        Returns:\n            The name of the credentials profile being used with the current client.\n        \"\"\"\n        return self._client._profile\n\n    @property\n    def supported_programs(self) -> List[str]:\n\"\"\"Compute programs currently supported by ChemCloud.\n\n        Returns:\n            List of programs currently supported by ChemCloud.\"\"\"\n        if not self._openapi_spec:\n            self._set_openapi_specification()\n        try:\n            assert self._openapi_spec is not None\n            programs = self._openapi_spec[\"components\"][\"schemas\"][\"SupportedPrograms\"][\n                \"enum\"\n            ]\n        except IndexError:\n            print(\"Cannot locate currently supported programs.\")\n            programs = [\"\"]\n        return programs\n\n    def hello_world(self, name: Optional[str] = None) -> str:\n\"\"\"A simple endpoint to check connectivity to ChemCloud.\n\n        Parameters:\n            name: Your name\n\n        Returns:\n            A message from ChemCloud if the client was able to successfully\n            connect.\n        \"\"\"\n        return self._client.hello_world(name)\n\n    def compute(\n        self,\n        program: str,\n        inp_obj: QCIOInputsOrList,\n        *,\n        collect_stdout: bool = True,\n        collect_files: bool = False,\n        collect_wavefunction: bool = False,\n        rm_scratch_dir: bool = True,\n        propagate_wfn: bool = False,\n        queue: Optional[str] = None,\n    ) -> Union[FutureOutput, FutureOutputGroup]:\n\"\"\"Submit a computation to ChemCloud.\n\n        Parameters:\n            program: A program name matching one of the `self.supported_programs`\n            inp_obj: The input object to be used for the computation. This can be a\n                single input object or a list of input objects.\n            collect_stdout: Whether to collect stdout/stderr from the program as output.\n                Failed computations will always collect stdout/stderr.\n            collect_files: Collect all files generated by the QC program as output.\n            collect_wavefunction: Collect the wavefunction file(s) from the calculation.\n                Not every program will support this. Use collect_files to collect\n                all files including the wavefunction.\n            rm_scratch_dir: Delete the scratch directory after the program exits. Should\n                only be set to False for debugging purposes.\n            propagate_wfn: For any adapter performing a sequential task, such\n                as a geometry optimization, propagate the wavefunction from the previous\n                step to the next step. This is useful for accelerating convergence by\n                using a previously computed wavefunction as a starting guess. This will\n                be ignored if the adapter for a given qc program does not support it.\n            queue: The name of a private compute queue. If None, default queue is used\n\n        Returns:\n            Object providing access to a computation's eventual result. You can check a\n            computation's status by running `.status` on the `FutureOutput` object or\n            `.get()` to block and retrieve the computation's final result.\n        \"\"\"\n        if self.supported_programs is not None:\n            assert (\n                program in self.supported_programs\n            ), f\"Please use one of the following programs: {self.supported_programs}\"\n\n        compute_params = dict(\n            program=program,\n            collect_stdout=collect_stdout,\n            collect_files=collect_files,\n            collect_wavefunction=collect_wavefunction,\n            rm_scratch_dir=rm_scratch_dir,\n            propagate_wfn=propagate_wfn,\n            queue=queue,\n        )\n        return self._client.compute(inp_obj, compute_params)\n\n    def configure(self, profile: str = settings.chemcloud_credentials_profile) -> None:\n\"\"\"Configure profiles for authentication with ChemCloud.\n\n        Parameters:\n            profile: Optional value to create a named profile for use with QC\n                Cloud. No value needs to be passed and most users will only have one\n                login with ChemCloud. CCClient will access the profile by\n                default without a specific name being passed. Pass a value if you have\n                multiple logins to ChemCloud.\n        Note:\n            Configures `chemcloud` to use the passed credentials automatically in the\n            future. You will not need to run `.configure()` the next time you use the\n            `chemcloud`.\n\n        \"\"\"\n        print(\n            \"\u2705 If you don't get have an account please signup at: \"\n            f\"{self._client._chemcloud_domain}/signup\"\n        )\n        access_token, refresh_token = self._client._set_tokens_from_user_input()\n        self._client.write_tokens_to_credentials_file(\n            access_token, refresh_token, profile=profile\n        )\n        print(\n            f\"'{profile}' profile configured! Username/password not required for \"\n            \"future use of CCClient\"\n        )\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.profile","title":"profile: str property","text":"

Profile being used for authentication with ChemCloud.

Returns:

Type Description str

The name of the credentials profile being used with the current client.

"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.supported_programs","title":"supported_programs: List[str] property","text":"

Compute programs currently supported by ChemCloud.

Returns:

Type Description List[str]

List of programs currently supported by ChemCloud.

"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.version","title":"version: str property","text":"

Returns chemcloud client version

"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.__init__","title":"__init__(*, chemcloud_username=None, chemcloud_password=None, profile=None, chemcloud_domain=None)","text":"

Initialize a CCClient object.

Parameters:

Name Type Description Default chemcloud_username Optional[str]

ChemCloud username

None chemcloud_password Optional[str]

ChemCloud password

None profile Optional[str]

Authentication profile name

None chemcloud_domain Optional[str]

Domain of ChemCloud instance to connect to

None

Danger

It is not recommended to pass your ChemCloud username and password directly to a CCClient. Instead instantiate a client with no credentials client = CCClient() and then run client.configure() to securely set up your authentication credentials for ChemCloud.

Source code in chemcloud/client.py
def __init__(\n    self,\n    *,\n    chemcloud_username: Optional[str] = None,\n    chemcloud_password: Optional[str] = None,\n    profile: Optional[str] = None,\n    chemcloud_domain: Optional[str] = None,\n):\n\"\"\"\n    Initialize a CCClient object.\n\n    Parameters:\n        chemcloud_username: ChemCloud username\n        chemcloud_password: ChemCloud password\n        profile: Authentication profile name\n        chemcloud_domain: Domain of ChemCloud instance to connect to\n\n    !!! Danger\n        It is not recommended to pass your ChemCloud username and\n        password directly to a `CCClient`. Instead instantiate a client with no\n        credentials `client = CCClient()` and then run `client.configure()` to\n        securely set up your authentication credentials for ChemCloud.\n    \"\"\"\n    self._client = _RequestsClient(\n        chemcloud_username=chemcloud_username,\n        chemcloud_password=chemcloud_password,\n        profile=profile,\n        chemcloud_domain=chemcloud_domain,\n    )\n    self._openapi_spec: Optional[Dict] = None\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.compute","title":"compute(program, inp_obj, *, collect_stdout=True, collect_files=False, collect_wavefunction=False, rm_scratch_dir=True, propagate_wfn=False, queue=None)","text":"

Submit a computation to ChemCloud.

Parameters:

Name Type Description Default program str

A program name matching one of the self.supported_programs

required inp_obj QCIOInputsOrList

The input object to be used for the computation. This can be a single input object or a list of input objects.

required collect_stdout bool

Whether to collect stdout/stderr from the program as output. Failed computations will always collect stdout/stderr.

True collect_files bool

Collect all files generated by the QC program as output.

False collect_wavefunction bool

Collect the wavefunction file(s) from the calculation. Not every program will support this. Use collect_files to collect all files including the wavefunction.

False rm_scratch_dir bool

Delete the scratch directory after the program exits. Should only be set to False for debugging purposes.

True propagate_wfn bool

For any adapter performing a sequential task, such as a geometry optimization, propagate the wavefunction from the previous step to the next step. This is useful for accelerating convergence by using a previously computed wavefunction as a starting guess. This will be ignored if the adapter for a given qc program does not support it.

False queue Optional[str]

The name of a private compute queue. If None, default queue is used

None

Returns:

Type Description Union[FutureOutput, FutureOutputGroup]

Object providing access to a computation's eventual result. You can check a

Union[FutureOutput, FutureOutputGroup]

computation's status by running .status on the FutureOutput object or

Union[FutureOutput, FutureOutputGroup]

.get() to block and retrieve the computation's final result.

Source code in chemcloud/client.py
def compute(\n    self,\n    program: str,\n    inp_obj: QCIOInputsOrList,\n    *,\n    collect_stdout: bool = True,\n    collect_files: bool = False,\n    collect_wavefunction: bool = False,\n    rm_scratch_dir: bool = True,\n    propagate_wfn: bool = False,\n    queue: Optional[str] = None,\n) -> Union[FutureOutput, FutureOutputGroup]:\n\"\"\"Submit a computation to ChemCloud.\n\n    Parameters:\n        program: A program name matching one of the `self.supported_programs`\n        inp_obj: The input object to be used for the computation. This can be a\n            single input object or a list of input objects.\n        collect_stdout: Whether to collect stdout/stderr from the program as output.\n            Failed computations will always collect stdout/stderr.\n        collect_files: Collect all files generated by the QC program as output.\n        collect_wavefunction: Collect the wavefunction file(s) from the calculation.\n            Not every program will support this. Use collect_files to collect\n            all files including the wavefunction.\n        rm_scratch_dir: Delete the scratch directory after the program exits. Should\n            only be set to False for debugging purposes.\n        propagate_wfn: For any adapter performing a sequential task, such\n            as a geometry optimization, propagate the wavefunction from the previous\n            step to the next step. This is useful for accelerating convergence by\n            using a previously computed wavefunction as a starting guess. This will\n            be ignored if the adapter for a given qc program does not support it.\n        queue: The name of a private compute queue. If None, default queue is used\n\n    Returns:\n        Object providing access to a computation's eventual result. You can check a\n        computation's status by running `.status` on the `FutureOutput` object or\n        `.get()` to block and retrieve the computation's final result.\n    \"\"\"\n    if self.supported_programs is not None:\n        assert (\n            program in self.supported_programs\n        ), f\"Please use one of the following programs: {self.supported_programs}\"\n\n    compute_params = dict(\n        program=program,\n        collect_stdout=collect_stdout,\n        collect_files=collect_files,\n        collect_wavefunction=collect_wavefunction,\n        rm_scratch_dir=rm_scratch_dir,\n        propagate_wfn=propagate_wfn,\n        queue=queue,\n    )\n    return self._client.compute(inp_obj, compute_params)\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.configure","title":"configure(profile=settings.chemcloud_credentials_profile)","text":"

Configure profiles for authentication with ChemCloud.

Parameters:

Name Type Description Default profile str

Optional value to create a named profile for use with QC Cloud. No value needs to be passed and most users will only have one login with ChemCloud. CCClient will access the profile by default without a specific name being passed. Pass a value if you have multiple logins to ChemCloud.

chemcloud_credentials_profile

Note: Configures chemcloud to use the passed credentials automatically in the future. You will not need to run .configure() the next time you use the chemcloud.

Source code in chemcloud/client.py
def configure(self, profile: str = settings.chemcloud_credentials_profile) -> None:\n\"\"\"Configure profiles for authentication with ChemCloud.\n\n    Parameters:\n        profile: Optional value to create a named profile for use with QC\n            Cloud. No value needs to be passed and most users will only have one\n            login with ChemCloud. CCClient will access the profile by\n            default without a specific name being passed. Pass a value if you have\n            multiple logins to ChemCloud.\n    Note:\n        Configures `chemcloud` to use the passed credentials automatically in the\n        future. You will not need to run `.configure()` the next time you use the\n        `chemcloud`.\n\n    \"\"\"\n    print(\n        \"\u2705 If you don't get have an account please signup at: \"\n        f\"{self._client._chemcloud_domain}/signup\"\n    )\n    access_token, refresh_token = self._client._set_tokens_from_user_input()\n    self._client.write_tokens_to_credentials_file(\n        access_token, refresh_token, profile=profile\n    )\n    print(\n        f\"'{profile}' profile configured! Username/password not required for \"\n        \"future use of CCClient\"\n    )\n
"},{"location":"code-reference/CCClient/#chemcloud.client.CCClient.hello_world","title":"hello_world(name=None)","text":"

A simple endpoint to check connectivity to ChemCloud.

Parameters:

Name Type Description Default name Optional[str]

Your name

None

Returns:

Type Description str

A message from ChemCloud if the client was able to successfully

str

connect.

Source code in chemcloud/client.py
def hello_world(self, name: Optional[str] = None) -> str:\n\"\"\"A simple endpoint to check connectivity to ChemCloud.\n\n    Parameters:\n        name: Your name\n\n    Returns:\n        A message from ChemCloud if the client was able to successfully\n        connect.\n    \"\"\"\n    return self._client.hello_world(name)\n
"},{"location":"code-reference/exceptions/","title":"Exceptions","text":""},{"location":"code-reference/exceptions/#chemcloud.exceptions.BaseError","title":"BaseError","text":"

Bases: Exception

Exception Base for client.

Source code in chemcloud/exceptions.py
class BaseError(Exception):\n\"\"\"Exception Base for client.\"\"\"\n
"},{"location":"code-reference/exceptions/#chemcloud.exceptions.TimeoutError","title":"TimeoutError","text":"

Bases: BaseError

A timeout parameter was exceeded

Source code in chemcloud/exceptions.py
class TimeoutError(BaseError):\n\"\"\"A timeout parameter was exceeded\"\"\"\n
"},{"location":"code-reference/future-outputs/","title":"Future outputs","text":""},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutput","title":"FutureOutput","text":"

Bases: FutureOutputBase

Single computation result

Source code in chemcloud/models.py
class FutureOutput(FutureOutputBase):\n\"\"\"Single computation result\"\"\"\n\n    result: Optional[QCIOOutputs] = None\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputBase","title":"FutureOutputBase","text":"

Bases: BaseModel, ABC

Base class for FutureOutputs

Attributes:

Name Type Description task_id str

The task_id for primary task submitted to ChemCloud. May correspond to a single task or group of tasks.

client Any

The _RequestsClient to use for http requests to ChemCloud.

result Optional[QCIOOutputsOrList]

Primary return value resulting from computation.

Caution

A FutureOutput should never be instantiated directly. CCClient.compute(...) will return one when you submit a computation.

Source code in chemcloud/models.py
class FutureOutputBase(BaseModel, ABC):\n\"\"\"Base class for FutureOutputs\n\n    Attributes:\n        task_id: The task_id for primary task submitted to ChemCloud. May correspond to\n            a single task or group of tasks.\n        client: The _RequestsClient to use for http requests to ChemCloud.\n        result: Primary return value resulting from computation.\n\n    Caution:\n        A FutureOutput should never be instantiated directly.\n        `CCClient.compute(...)` will return one when you submit a computation.\n    \"\"\"\n\n    task_id: str\n    result: Optional[QCIOOutputsOrList] = None\n    client: Any\n    _state: TaskStatus = TaskStatus.PENDING\n\n    model_config = {\"validate_assignment\": True}\n\n    def get(\n        self,\n        timeout: Optional[float] = None,  # in seconds\n        interval: float = 1.0,\n    ) -> QCIOOutputsOrList:\n\"\"\"Block until a calculation is complete and return the result.\n\n        Parameters:\n            timeout: The number of seconds to wait for a computation before raising a\n                TimeOutError.\n            interval: The amount of time to wait between calls to ChemCloud to\n                check a computation's status.\n\n        Returns:\n            Resultant values from a computation.\n\n        Exceptions:\n            TimeoutError: Raised if timeout interval exceeded.\n        \"\"\"\n        if self.result:\n            return self.result\n\n        start_time = time()\n\n        while not self.result:\n            # Calling self.status returns status and sets self.result if task complete\n            self.status\n            if timeout:\n                if (time() - start_time) > timeout:\n                    raise TimeoutError(\n                        f\"Your timeout limit of {timeout} seconds was exceeded\"\n                    )\n            sleep(interval)\n\n        return self.result\n\n    def _output(self):\n\"\"\"Return output from server\"\"\"\n        return self.client.output(self.task_id)\n\n    @property\n    def status(self) -> str:\n\"\"\"Check status of compute task.\n\n        Returns:\n            Status of computation.\n\n        Note:\n            Sets self.result if task is complete.\n        \"\"\"\n        if self.result:\n            return self._state\n        self._state, self.result = self._output()\n        return self._state\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputBase.status","title":"status: str property","text":"

Check status of compute task.

Returns:

Type Description str

Status of computation.

Note

Sets self.result if task is complete.

"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputBase.get","title":"get(timeout=None, interval=1.0)","text":"

Block until a calculation is complete and return the result.

Parameters:

Name Type Description Default timeout Optional[float]

The number of seconds to wait for a computation before raising a TimeOutError.

None interval float

The amount of time to wait between calls to ChemCloud to check a computation's status.

1.0

Returns:

Type Description QCIOOutputsOrList

Resultant values from a computation.

Raises:

Type Description TimeoutError

Raised if timeout interval exceeded.

Source code in chemcloud/models.py
def get(\n    self,\n    timeout: Optional[float] = None,  # in seconds\n    interval: float = 1.0,\n) -> QCIOOutputsOrList:\n\"\"\"Block until a calculation is complete and return the result.\n\n    Parameters:\n        timeout: The number of seconds to wait for a computation before raising a\n            TimeOutError.\n        interval: The amount of time to wait between calls to ChemCloud to\n            check a computation's status.\n\n    Returns:\n        Resultant values from a computation.\n\n    Exceptions:\n        TimeoutError: Raised if timeout interval exceeded.\n    \"\"\"\n    if self.result:\n        return self.result\n\n    start_time = time()\n\n    while not self.result:\n        # Calling self.status returns status and sets self.result if task complete\n        self.status\n        if timeout:\n            if (time() - start_time) > timeout:\n                raise TimeoutError(\n                    f\"Your timeout limit of {timeout} seconds was exceeded\"\n                )\n        sleep(interval)\n\n    return self.result\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputGroup","title":"FutureOutputGroup","text":"

Bases: FutureOutputBase

Group computation result

Source code in chemcloud/models.py
class FutureOutputGroup(FutureOutputBase):\n\"\"\"Group computation result\"\"\"\n\n    result: Optional[List[QCIOOutputs]] = None\n\n    def _output(self):\n\"\"\"Return result from server. Remove GROUP_ID_PREFIX from id.\"\"\"\n        return self.client.output(self.task_id.replace(GROUP_ID_PREFIX, \"\"))\n\n    @field_validator(\"task_id\")\n    @classmethod\n    def validate_id(cls, val):\n\"\"\"Prepend id with GROUP_ID_PREFIX.\n\n        NOTE:\n            This makes instantiating FutureOutputGroups from saved ids easier because\n            they are differentiated from FutureOutput ids.\n        \"\"\"\n        if not val.startswith(GROUP_ID_PREFIX):\n            val = GROUP_ID_PREFIX + val\n        return val\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.FutureOutputGroup.validate_id","title":"validate_id(val) classmethod","text":"

Prepend id with GROUP_ID_PREFIX.

NOTE

This makes instantiating FutureOutputGroups from saved ids easier because they are differentiated from FutureOutput ids.

Source code in chemcloud/models.py
@field_validator(\"task_id\")\n@classmethod\ndef validate_id(cls, val):\n\"\"\"Prepend id with GROUP_ID_PREFIX.\n\n    NOTE:\n        This makes instantiating FutureOutputGroups from saved ids easier because\n        they are differentiated from FutureOutput ids.\n    \"\"\"\n    if not val.startswith(GROUP_ID_PREFIX):\n        val = GROUP_ID_PREFIX + val\n    return val\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.TaskStatus","title":"TaskStatus","text":"

Bases: str, Enum

Tasks status for a submitted compute job.

Source code in chemcloud/models.py
class TaskStatus(str, Enum):\n\"\"\"Tasks status for a submitted compute job.\"\"\"\n\n    #: Task state is unknown (assumed pending since you know the id).\n    PENDING = \"PENDING\"\n    COMPLETE = \"COMPLETE\"\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.from_file","title":"from_file(path, client)","text":"

Instantiate FutureOutputs or FutureOutputGroups from file of result ids

Parameters:

Name Type Description Default path Union[str, Path]

Path to file containing the ids

required client Any

Instantiated CCClient object

required Source code in chemcloud/models.py
def from_file(\n    path: Union[str, Path],\n    client: Any,\n) -> List[Union[FutureOutput, FutureOutputGroup]]:\n\"\"\"Instantiate FutureOutputs or FutureOutputGroups from file of result ids\n\n    Params:\n        path: Path to file containing the ids\n        client: Instantiated CCClient object\n    \"\"\"\n    frs: List[Union[FutureOutput, FutureOutputGroup]] = []\n    with open(path) as f:\n        for id in f.readlines():\n            id = id.strip()\n            model: Union[Type[FutureOutput], Type[FutureOutputGroup]]\n            if id.startswith(GROUP_ID_PREFIX):\n                model = FutureOutputGroup\n            else:\n                model = FutureOutput\n            frs.append(model(task_id=id, client=client._client))\n\n    assert len(frs) > 0, \"No ids found in file!\"\n    return frs\n
"},{"location":"code-reference/future-outputs/#chemcloud.models.to_file","title":"to_file(future_results, path, *, append=False)","text":"

Write FutureOutputs to disk for later retrieval

Parameters:

Name Type Description Default future_results Union[FutureOutputBase, List[FutureOutputBase]]

List of or single FutureOutput or FutureOutputGroup

required path Union[str, Path]

File path to results file

required append bool

Append results to an existing file if True, else create new file

False Source code in chemcloud/models.py
def to_file(\n    future_results: Union[FutureOutputBase, List[FutureOutputBase]],\n    path: Union[str, Path],\n    *,\n    append: bool = False,\n) -> None:\n\"\"\"Write FutureOutputs to disk for later retrieval\n\n    Params:\n        future_results: List of or single FutureOutput or FutureOutputGroup\n        path: File path to results file\n        append: Append results to an existing file if True, else create new file\n    \"\"\"\n    if not isinstance(future_results, list):\n        future_results = [future_results]\n\n    with open(path, f\"{'a' if append else 'w'}\") as f:\n        f.writelines([f\"{fr.task_id}\\n\" for fr in future_results])\n
"},{"location":"code-reference/inputs/","title":"Inputs","text":"

End user input models for qcio

"},{"location":"code-reference/inputs/#qcio.models.inputs.DualProgramInput","title":"DualProgramInput","text":"

Bases: StructuredInputBase, SubProgramArgs

Input for a two program calculation.

Attributes:

Name Type Description calctype

The type of calculation to be performed.

keywords

Dict of keywords to be passed to the program. Defaults to empty dict.

molecule

The molecule to be used in the calculation.

files

A dict mapping filename to str or bytes data.

subprogram

The name of the subprogram to be used.

subprogram_args

The input arguments for the subprogram.

extras

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
class DualProgramInput(StructuredInputBase, SubProgramArgs):\n\"\"\"Input for a two program calculation.\n\n    Attributes:\n        calctype: The type of calculation to be performed.\n        keywords: Dict of keywords to be passed to the program. Defaults to empty dict.\n        molecule: The molecule to be used in the calculation.\n        files: A dict mapping filename to str or bytes data.\n        subprogram: The name of the subprogram to be used.\n        subprogram_args: The input arguments for the subprogram.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n
"},{"location":"code-reference/inputs/#qcio.models.inputs.FileInput","title":"FileInput","text":"

Bases: InputBase

File and command line argument inputs for a calculation.

Attributes:

Name Type Description files

A dict mapping filename to str or bytes data.

cmdline_args List[str]

A list of command line arguments to be passed to the program.

extras List[str]

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
class FileInput(InputBase):\n\"\"\"File and command line argument inputs for a calculation.\n\n    Attributes:\n        files: A dict mapping filename to str or bytes data.\n        cmdline_args: A list of command line arguments to be passed to the program.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n\n    cmdline_args: List[str] = []\n\n    @classmethod\n    def from_directory(cls, directory: Union[Path, str], **kwargs) -> Self:\n\"\"\"Collect all files from directory and instantiate an object.\"\"\"\n        obj = cls(**kwargs)\n        directory = Path(directory)\n        obj.open_files(directory)\n        return obj\n
"},{"location":"code-reference/inputs/#qcio.models.inputs.FileInput.from_directory","title":"from_directory(directory, **kwargs) classmethod","text":"

Collect all files from directory and instantiate an object.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
@classmethod\ndef from_directory(cls, directory: Union[Path, str], **kwargs) -> Self:\n\"\"\"Collect all files from directory and instantiate an object.\"\"\"\n    obj = cls(**kwargs)\n    directory = Path(directory)\n    obj.open_files(directory)\n    return obj\n
"},{"location":"code-reference/inputs/#qcio.models.inputs.ProgramInput","title":"ProgramInput","text":"

Bases: StructuredInputBase, QCProgramArgs

Input for a single point calculation.

Attributes:

Name Type Description calctype

The type of calculation to perform.

model

The model for the quantum chemistry calculation.

keywords

A dict of keywords to be passed to the program excluding model and calctype. Defaults to an empty dict.

molecule

The molecule to be used in the calculation.

files

Files to be passed to the QC program.

extras

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/inputs.py
class ProgramInput(StructuredInputBase, QCProgramArgs):\n\"\"\"Input for a single point calculation.\n\n    Attributes:\n        calctype: The type of calculation to perform.\n        model: The model for the quantum chemistry calculation.\n        keywords: A dict of keywords to be passed to the program excluding model and\n            calctype. Defaults to an empty dict.\n        molecule: The molecule to be used in the calculation.\n        files: Files to be passed to the QC program.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n
"},{"location":"code-reference/outputs/","title":"Outputs","text":"

End user output and results objects from a calculation.

"},{"location":"code-reference/outputs/#qcio.models.outputs.FileOutput","title":"FileOutput","text":"

Bases: SuccessfulOutputBase

Generic output class for pure file based I/O.

Attributes:

Name Type Description input_data FileInput

The FileInput object used for the computation.

files FileInput

A dict mapping filename to str or bytes data.

success FileInput

A boolean indicator that the operation succeeded (always True)

stdout FileInput

The primary logging output of the program. Contains a union of stdout and stderr.

provenance FileInput

An object containing the provenance information for the results.

extras FileInput

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class FileOutput(SuccessfulOutputBase):\n\"\"\"Generic output class for pure file based I/O.\n\n    Attributes:\n        input_data: The FileInput object used for the computation.\n        files: A dict mapping filename to str or bytes data.\n        success: A boolean indicator that the operation succeeded (always True)\n        stdout: The primary logging output of the program. Contains a union of stdout\n            and stderr.\n        provenance: An object containing the provenance information for the results.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n\n    \"\"\"\n\n    input_data: FileInput\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationOutput","title":"OptimizationOutput","text":"

Bases: SuccessfulOutputBase

Output from a successful optimization.

Attributes:

Name Type Description input_data Union[DualProgramInput, ProgramInput]

The OptimizationInput object for the computation.

results OptimizationResults

The results computed by the program.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class OptimizationOutput(SuccessfulOutputBase):\n\"\"\"Output from a successful optimization.\n\n    Attributes:\n        input_data: The OptimizationInput object for the computation.\n        results: The results computed by the program.\n    \"\"\"\n\n    input_data: Union[DualProgramInput, ProgramInput]\n    results: OptimizationResults\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults","title":"OptimizationResults","text":"

Bases: ResultsBase

Computed properties for an optimization.

Attributes:

Name Type Description energies List[float]

The energies for each step of the optimization.

molecules List[Molecule]

The Molecule objects for each step of the optimization.

final_molecule Optional[Molecule]

The final, optimized molecule.

trajectory List[SinglePointOutput]

The SinglePointOutput objects for each step of the optimization.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class OptimizationResults(ResultsBase):\n\"\"\"Computed properties for an optimization.\n\n    Attributes:\n        energies: The energies for each step of the optimization.\n        molecules: The Molecule objects for each step of the optimization.\n        final_molecule: The final, optimized molecule.\n        trajectory: The SinglePointOutput objects for each step of the optimization.\n    \"\"\"\n\n    trajectory: List[SinglePointOutput] = []\n\n    @property\n    def final_molecule(self) -> Optional[Molecule]:\n\"\"\"The final molecule in the optimization.\"\"\"\n        try:\n            return self.trajectory[-1].input_data.molecule\n        except IndexError:  # Empty trajectory\n            return None\n\n    @property\n    def energies(self) -> List[float]:\n\"\"\"The energies for each step of the optimization.\"\"\"\n        # or 0.0 covers null case for mypy\n        return [output.results.energy or 0.0 for output in self.trajectory]\n\n    @property\n    def molecules(self) -> List[Molecule]:\n\"\"\"The Molecule objects for each step of the optimization.\"\"\"\n        return [output.input_data.molecule for output in self.trajectory]\n\n    def __repr_args__(self):\n\"\"\"Custom repr to avoid printing the entire collection objects.\"\"\"\n        return [\n            (\"final_molecule\", f\"{self.final_molecule}\"),\n            (\"trajectory\", \"[...]\"),\n            (\"energies\", \"[...]\"),\n            (\"molecules\", \"[...]\"),\n        ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.energies","title":"energies: List[float] property","text":"

The energies for each step of the optimization.

"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.final_molecule","title":"final_molecule: Optional[Molecule] property","text":"

The final molecule in the optimization.

"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.molecules","title":"molecules: List[Molecule] property","text":"

The Molecule objects for each step of the optimization.

"},{"location":"code-reference/outputs/#qcio.models.outputs.OptimizationResults.__repr_args__","title":"__repr_args__()","text":"

Custom repr to avoid printing the entire collection objects.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
def __repr_args__(self):\n\"\"\"Custom repr to avoid printing the entire collection objects.\"\"\"\n    return [\n        (\"final_molecule\", f\"{self.final_molecule}\"),\n        (\"trajectory\", \"[...]\"),\n        (\"energies\", \"[...]\"),\n        (\"molecules\", \"[...]\"),\n    ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.ProgramFailure","title":"ProgramFailure","text":"

Bases: OutputBase

A object containing details about a failed calculation.

Attributes:

Name Type Description input_data Union[DualProgramInput, ProgramInput, FileInput]

The input object for the computation.

success Literal[False]

Always False for a Failed output.

traceback Optional[str]

String representation of the traceback of the exception that caused the failure.

results Optional[str]

Any compted data that was able to be extracted before program failed.

stdout Optional[str]

The primary logging output of the program. Contains a union of stdout and stderr.

provenance Optional[str]

An object containing the provenance information for the output.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class ProgramFailure(OutputBase):\n\"\"\"A object containing details about a failed calculation.\n\n    Attributes:\n        input_data: The input object for the computation.\n        success: Always False for a Failed output.\n        traceback: String representation of the traceback of the exception that caused\n            the failure.\n        results: Any compted data that was able to be extracted before program failed.\n        stdout: The primary logging output of the program. Contains a union of stdout\n            and stderr.\n        provenance: An object containing the provenance information for the output.\n    \"\"\"\n\n    input_data: Union[DualProgramInput, ProgramInput, FileInput]\n    success: Literal[False] = False\n    traceback: Optional[str] = None\n\n    @property\n    def ptraceback(self) -> None:\n\"\"\"Print the traceback text\"\"\"\n        print(self.traceback)\n\n    def __repr_args__(self) -> \"ReprArgs\":\n\"\"\"Exclude traceback from the repr\"\"\"\n        return [\n            (key, value if key != \"traceback\" else \"<...>\")\n            for key, value in super().__repr_args__()\n        ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.ProgramFailure.ptraceback","title":"ptraceback: None property","text":"

Print the traceback text

"},{"location":"code-reference/outputs/#qcio.models.outputs.ProgramFailure.__repr_args__","title":"__repr_args__()","text":"

Exclude traceback from the repr

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
def __repr_args__(self) -> \"ReprArgs\":\n\"\"\"Exclude traceback from the repr\"\"\"\n    return [\n        (key, value if key != \"traceback\" else \"<...>\")\n        for key, value in super().__repr_args__()\n    ]\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointOutput","title":"SinglePointOutput","text":"

Bases: SuccessfulOutputBase

Output from a successful single point calculation.

Attributes:

Name Type Description input_data ProgramInput

The SinglePointInput object for the computation.

success ProgramInput

Always True for a successful computation.

results SinglePointResults

The results computed by the program.

files SinglePointResults

A dict mapping filename to str or bytes data.

stdout SinglePointResults

The primary logging output of the program. Contains a union of stdout and stderr.

provenance SinglePointResults

An object containing the provenance information for the results.

extras SinglePointResults

Additional information to bundle with the object. Use for schema development and scratch space.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class SinglePointOutput(SuccessfulOutputBase):\n\"\"\"Output from a successful single point calculation.\n\n    Attributes:\n        input_data: The SinglePointInput object for the computation.\n        success: Always True for a successful computation.\n        results: The results computed by the program.\n        files: A dict mapping filename to str or bytes data.\n        stdout: The primary logging output of the program. Contains a union of stdout\n            and stderr.\n        provenance: An object containing the provenance information for the results.\n        extras: Additional information to bundle with the object. Use for schema\n            development and scratch space.\n    \"\"\"\n\n    input_data: ProgramInput\n    results: SinglePointResults\n\n    @property\n    def return_result(self) -> Union[float, ArrayLike2D]:\n\"\"\"Return the result of the calculation.\n\n        Returns:\n            The explicitly requested result of the calculation, i.e., the energy,\n                gradient, or hessian.\n        \"\"\"\n        return getattr(self.results, self.input_data.calctype.value)\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointOutput.return_result","title":"return_result: Union[float, ArrayLike2D] property","text":"

Return the result of the calculation.

Returns:

Type Description Union[float, ArrayLike2D]

The explicitly requested result of the calculation, i.e., the energy, gradient, or hessian.

"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointResults","title":"SinglePointResults","text":"

Bases: ResultsBase

The computed results from a single point calculation.

Attributes:

Name Type Description calcinfo_natoms Optional[int]

The number of atoms as computed by the program.

calcinfo_nalpha Optional[int]

The number of alpha electrons as computed by the program.

calcinfo_nbeta Optional[int]

The number of beta electrons as computed by the program.

calcinfo_nbasis Optional[int]

The number of basis functions in the calculation.

calcinfo_nmo Optional[int]

The number of molecular orbitals in the calculation

energy Optional[float]

The electronic energy of the molecule in Hartrees.

gradient Optional[ArrayLike2D]

The gradient of the molecule in Hartrees/Bohr.

hessian Optional[ArrayLike2D]

The hessian of the molecule in Hartrees/Bohr^2.

nuclear_repulsion_energy Optional[float]

The nuclear repulsion energy of the molecule in Hartrees.

wavefunction Optional[Wavefunction]

Wavefunction data from the calculation.

freqs_wavenumber List[float]

The frequencies of the molecule in wavenumbers.

normal_modes_cartesian Optional[ArrayLike3D]

3D n_vibmodes x n_atoms x 3 array containing un-mass-weighted Cartesian displacements of each normal mode.

gibbs_free_energy Optional[float]

Gibbs free energy (i.e. thermochemical analysis) in Hartrees of a system where translation / rotation / vibration degrees of freedom are approximated using ideal gas / rigid rotor / harmonic oscillator respectively.

scf_dipole_moment Optional[List[float]]

The x, y, z component of the dipole moment of the molecule in units of e a0 (NOT Debye!).

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class SinglePointResults(ResultsBase):\n\"\"\"The computed results from a single point calculation.\n\n    Attributes:\n        calcinfo_natoms: The number of atoms as computed by the program.\n        calcinfo_nalpha: The number of alpha electrons as computed by the program.\n        calcinfo_nbeta: The number of beta electrons as computed by the program.\n        calcinfo_nbasis: The number of basis functions in the calculation.\n        calcinfo_nmo: The number of molecular orbitals in the calculation\n\n        energy: The electronic energy of the molecule in Hartrees.\n        gradient: The gradient of the molecule in Hartrees/Bohr.\n        hessian: The hessian of the molecule in Hartrees/Bohr^2.\n        nuclear_repulsion_energy: The nuclear repulsion energy of the molecule in\n            Hartrees.\n\n        wavefunction: Wavefunction data from the calculation.\n\n        freqs_wavenumber: The frequencies of the molecule in wavenumbers.\n        normal_modes_cartesian: 3D n_vibmodes x n_atoms x 3 array containing\n            un-mass-weighted Cartesian displacements of each normal mode.\n        gibbs_free_energy: Gibbs free energy (i.e. thermochemical analysis) in Hartrees\n            of a system where translation / rotation / vibration degrees of freedom are\n            approximated using ideal gas / rigid rotor / harmonic oscillator\n            respectively.\n        scf_dipole_moment: The x, y, z component of the dipole moment of the molecule\n            in units of e a0 (NOT Debye!).\n\n    \"\"\"\n\n    # calcinfo contains general information about the calculation\n    calcinfo_natoms: Optional[int] = None\n    calcinfo_nbasis: Optional[int] = None\n    calcinfo_nmo: Optional[int] = None\n    calcinfo_nalpha: Optional[int] = None\n    calcinfo_nbeta: Optional[int] = None\n\n    # Core properties\n    energy: Optional[float] = None\n    gradient: Optional[ArrayLike2D] = None\n    hessian: Optional[ArrayLike2D] = None\n    nuclear_repulsion_energy: Optional[float] = None\n\n    # Wavefunction data\n    wavefunction: Optional[Wavefunction] = None\n\n    # Frequency data\n    freqs_wavenumber: List[float] = []\n    normal_modes_cartesian: Optional[ArrayLike3D] = None\n    gibbs_free_energy: Optional[float] = None\n\n    # SCF results\n    scf_dipole_moment: Optional[List[float]] = None\n\n    @field_validator(\"normal_modes_cartesian\")\n    @classmethod\n    def validate_normal_modes_cartesian_shape(cls, v: ArrayLike3D):\n        if v is not None:\n            # Assume array has length of the number of normal modes\n            n_normal_modes = len(v)\n            return np.asarray(v).reshape(n_normal_modes, -1, 3)\n\n    @field_validator(\"gradient\")\n    @classmethod\n    def validate_gradient_shape(cls, v: ArrayLike2D):\n\"\"\"Validate gradient is n x 3\"\"\"\n        if v is not None:\n            return np.asarray(v).reshape(-1, 3)\n\n    @field_validator(\"hessian\")\n    @classmethod\n    def validate_hessian_shape(cls, v: ArrayLike2D):\n\"\"\"Validate hessian is square\"\"\"\n        if v is not None:\n            v = np.asarray(v)\n            n = int(np.sqrt(v.size))\n            return v.reshape((n, n))\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointResults.validate_gradient_shape","title":"validate_gradient_shape(v) classmethod","text":"

Validate gradient is n x 3

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
@field_validator(\"gradient\")\n@classmethod\ndef validate_gradient_shape(cls, v: ArrayLike2D):\n\"\"\"Validate gradient is n x 3\"\"\"\n    if v is not None:\n        return np.asarray(v).reshape(-1, 3)\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.SinglePointResults.validate_hessian_shape","title":"validate_hessian_shape(v) classmethod","text":"

Validate hessian is square

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
@field_validator(\"hessian\")\n@classmethod\ndef validate_hessian_shape(cls, v: ArrayLike2D):\n\"\"\"Validate hessian is square\"\"\"\n    if v is not None:\n        v = np.asarray(v)\n        n = int(np.sqrt(v.size))\n        return v.reshape((n, n))\n
"},{"location":"code-reference/outputs/#qcio.models.outputs.Wavefunction","title":"Wavefunction","text":"

Bases: QCIOModelBase

The wavefunction for a single point calculation.

Attributes:

Name Type Description scf_eigenvalues_a Optional[ArrayLike2D]

The SCF alpha-spin orbital eigenvalues.

scf_eigenvalues_b Optional[ArrayLike2D]

The SCF beta-spin orbital eigenvalues.

scf_occupations_a Optional[ArrayLike2D]

The SCF alpha-spin orbital occupations.

scf_occupations_b Optional[ArrayLike2D]

The SCF beta-spin orbital occupations.

Source code in /home/cbh/.cache/pypoetry/virtualenvs/chemcloud-cIGgXbph-py3.8/lib/python3.8/site-packages/qcio/models/outputs.py
class Wavefunction(QCIOModelBase):\n\"\"\"The wavefunction for a single point calculation.\n\n    Attributes:\n        scf_eigenvalues_a: The SCF alpha-spin orbital eigenvalues.\n        scf_eigenvalues_b: The SCF beta-spin orbital eigenvalues.\n        scf_occupations_a: The SCF alpha-spin orbital occupations.\n        scf_occupations_b: The SCF beta-spin orbital occupations.\n    \"\"\"\n\n    scf_eigenvalues_a: Optional[ArrayLike2D] = None\n    scf_eigenvalues_b: Optional[ArrayLike2D] = None\n    scf_occupations_a: Optional[ArrayLike2D] = None\n    scf_occupations_b: Optional[ArrayLike2D] = None\n\n    @field_validator(\n        \"scf_eigenvalues_a\",\n        \"scf_eigenvalues_b\",\n        \"scf_occupations_a\",\n        \"scf_occupations_b\",\n    )\n    @classmethod\n    def to_numpy(cls, val, _info) -> Optional[np.ndarray]:\n        return np.asarray(val) if val is not None else None\n
"},{"location":"tutorial/authentication/","title":"Authentication","text":"

Authentication is the process of supplying your credentials (usually a username and password) to chemcloud so that you can perform computations. chemcloud provides a few easy ways for you to authenticate. If you do not have a ChemCloud account you can get one for free here or at the address of the ChemCloud server you want to interact with: https://chemcloud.mtzlab.com/signup

"},{"location":"tutorial/authentication/#clientconfigure-recommended-for-most-cases","title":"client.configure() (recommended for most cases)","text":"
from chemcloud import CCClient\nclient = CCClient()\nclient.configure()\n\u2705 If you dont get have an account please signup at: https://chemcloud.mtzlab.com/signup\nPlease enter your ChemCloud username: your_username@email.com\nPlease enter your ChemCloud password:\nAuthenticating...\n'default' profile configured! Username/password not required for future use of CCClient\n

Performing this action will configure your local client by writing authentication tokens to ~/.chemcloud/credentials. You will not need to execute configure() ever again. Under the hood CCClient will access your tokens, refresh them when necessary, and keep you logged in to ChemCloud. Note that this will write a file to your home directory with sensitive access tokens, so if you are on a shared computer or using a device where you would not want to write this information to disk do not use this option. If you would like to write the credentials file to a different directory than ~/.chemcloud, set the CHEMCLOUD_BASE_DIRECTORY environment variable to the path of interest.

You can configure multiple profiles in case you have multiple logins to ChemCloud by passing a profile name to configure():

client.configure('mtz_lab')\n\u2705 If you dont get have an account please signup at: https://chemcloud.mtzlab.com/signup\nPlease enter your ChemCloud username: your_username@email.om\nPlease enter your ChemCloud password:\nAuthenticating...\n'mtz_lab' profile configured! Username/password not required for future use of CCClient\n

To use one of these profiles pass the profile option to your client instance. The \"default\" profile is used when no profile name is passed:

from chemcloud import CCClient\n# Use default profile\nclient = CCClient()\n\n# Use named profile\nclient = CCClient(profile=\"mtz_lab\")\n
"},{"location":"tutorial/authentication/#environment-variables","title":"Environment Variables","text":"

You can set your ChemCloud username and password in your environment and the client will find them automatically. Set CHEMCLOUD_USERNAME and CHEMCLOUD_PASSWORD. When you create a client it will find these values and maintain all access tokens in memory only.

"},{"location":"tutorial/authentication/#usernamepassword-when-prompted-after-calling-clientcompute","title":"Username/Password when prompted after calling client.compute(...)","text":"

If you have not run client.configure() or set environment variables you will be requested for your username and password when you submit a computation to ChemCloud using client.compute(...). The client will use your username and password to get access tokens and will maintain access tokens for you in memory only. Your login session will be valid for the duration of your Python session.

"},{"location":"tutorial/authentication/#pass-usernamepassword-to-client-not-recommended","title":"Pass Username/Password to Client (not recommended)","text":"

You can directly pass a username and password to the client object. This is not recommended as it opens up the possibility of your credentials accidentally being committed to your code repo. However, it can be used in rare circumstances when necessary.

from chemcloud import CCClient\nclient = CCClient(\n    chemcloud_username=\"your_username@email.com\", chemcloud_password=\"super_secret_password\"  # pragma: allowlist secret\n    )\n
"},{"location":"tutorial/batch-computations/","title":"Batch Computations","text":"

Calculations can be submitted in bulk by passing a list of Input objects to client.compute() rather than a single object.

from qcio import Molecule, ProgramInput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = ProgramInput(\n    molecule=water,\n    model={\"method\": \"b3lyp\", \"basis\": \"6-31g\"},\n    calctype=\"energy\",\n    keywords={},\n)\nfuture_result = client.compute(\"psi4\", [prog_inp] * 2)\noutput = future_result.get()\n# Array of SinglePointOutput objects containing all returned data\nprint(output)\n
"},{"location":"tutorial/bigchem-algorithms/","title":"BigChem Algorithms","text":"

BigChem implements some of its own concurrent algorithms that leverage its horizontally scalable backend infrastructure. These include a parallel hessian algorithm and parallel frequency analysis algorithm. To use them submit a hessian calculation to ChemCloud using bigchem as the engine. See examples the parallel_hessian.py and parallel_frequency_analysis.py scripts in the examples directory.

"},{"location":"tutorial/bigchem-algorithms/#hessian","title":"Hessian","text":"
from qcio import DualProgramInput, Molecule, SinglePointOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = DualProgramInput(\n    molecule=water,\n    calctype=\"hessian\",\n    subprogram=\"psi4\",\n    subprogram_args={\"model\": {\"method\": \"b3lyp\", \"basis\": \"6-31g\"}},\n)\n\n\n# Submit calculation\nfuture_result = client.compute(\"bigchem\", prog_inp)\noutput: SinglePointOutput = future_result.get()\n\n# SinglePointOutput object containing all returned data\nprint(output)\nprint(output.results.hessian)\n# Frequency data always included too\nprint(f\"Wavenumbers: {output.results.freqs_wavenumber}\")\nprint(output.results.normal_modes_cartesian)\nprint(output.results.gibbs_free_energy)\n
"},{"location":"tutorial/bigchem-algorithms/#frequency-analysis","title":"Frequency Analysis","text":"
from qcio import DualProgramInput, Molecule, SinglePointOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = DualProgramInput(\n    molecule=water,\n    calctype=\"hessian\",\n    subprogram=\"psi4\",\n    subprogram_args={\"model\": {\"method\": \"b3lyp\", \"basis\": \"6-31g\"}},\n)\n\n\n# Submit calculation\nfuture_result = client.compute(\"bigchem\", prog_inp)\noutput: SinglePointOutput = future_result.get()\n\n# SinglePointOutput object containing all returned data\nprint(output)\nprint(f\"Wavenumbers: {output.results.freqs_wavenumber}\")\nprint(output.results.normal_modes_cartesian)\nprint(output.results.gibbs_free_energy)\n

Keywords for the BigChem algorithms:

Keyword Type Description Default Value dh float Displacement for gradient geometries for finite difference 5.0e-3 temperature float Temperature passed to the harmonic free energy module 300.0 pressure float Pressure passed to the harmonic free energy module 1.0"},{"location":"tutorial/compute/","title":"Compute","text":"

Computations are physically executed by a BigChem instance fronted by a ChemCloud server. The chemcloud python client submits jobs to and retrieves work from the ChemCloud server. Computations are submitted using the CCClient object.

Computations require a QC proram and ProgramInput or DualProgramInput object. The ProgramInput object contains all the information necessary to run a single calculation. The DualProgramInput object is used when two QC programs are used in tandem, such as when performing a geometry optimization with one program that uses a subprogram for the energy and gradient calculations.

"},{"location":"tutorial/compute/#basic-single-point-calculation","title":"Basic Single Point Calculation","text":"
from qcio import Molecule, ProgramInput, SinglePointOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = ProgramInput(\n    molecule=water,\n    model={\"method\": \"b3lyp\", \"basis\": \"6-31g\"},\n    calctype=\"energy\",  # Or \"gradient\" or \"hessian\"\n    keywords={},\n)\nfuture_result = client.compute(\"psi4\", prog_inp, collect_files=True)\noutput: SinglePointOutput = future_result.get()\n# SinglePointOutput object containing all returned data\nprint(output.stdout)\nprint(output)\n# The energy value requested\nprint(output.return_result)\nprint(output.files.keys())\n
"},{"location":"tutorial/compute/#including-files-in-the-input","title":"Including Files in the Input","text":"
from qcio import Molecule, ProgramInput, SinglePointOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = ProgramInput(\n    molecule=water,\n    model={\"method\": \"b3lyp\", \"basis\": \"6-31g\"},\n    calctype=\"energy\",\n    keywords={\"guess\": \"c0\"},\n    files={\n        \"c0\": b'\\xdf4R\\xdea\\xd7\\xef?\\xc1-\\xbdg2\\xd0\\xca?\\x8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\x15\\xd7?\\x9fo\\xed~OG\\xd0\\xbft9\\xe6\\xcd\\xa9\\xcd\\xd9\\xbfa\\xa6>\"\\xeb\\xa7\\xe3\\xbfj?\\xea\\xd6\\x11\\xb3\\xf3\\xbf\\xf2=JS\\xf6\\xc6\\xde?9BT]PGQ?\\xe9\\x80\\xd0\\x08\\xfe\\xea\\x9b?\\xf5G\\xb1\\x83\\xa0O\\xc3?\\xef\\x96y[9\\x92\\xc2?\\xc7\\xb6\\xd7\\x87\\xce\\x8c\\xd5\\xbf\\xd1Q\\x02l\\x958\\xc6?C\\xd8\\x13\\x1c\\xdb\\x89\\xde\\xbf2\\x02y\\'\\xa4\\xd2\\xd3?^\\xef\\x1f\\xd70\\x03\\xc7?\\xacm2\\x05s3\\xe6?\\xc0\\xde\\x00pP\\xc6\\xdb?\\x0fx\\x8c\\xdfP\\xea\\xf0\\xbf\\xa7\\xd4\\x80E\\xc9\\xbe\\xd5\\xbf'  # noqa: E501\n    },\n)\nfuture_result = client.compute(\"terachem\", prog_inp)\noutput: SinglePointOutput = future_result.get()\n# SinglePointOutput object containing all returned data\nprint(output.stdout)\nprint(output)\n# The energy value requested\nprint(output.return_result)\nprint(output.files.keys())\n

Files can also be added to an input objects using the open_file method.

prog_input.open_file(\"some_file.dat\")\n
"},{"location":"tutorial/geometry-optimization/","title":"Geometry optimization","text":""},{"location":"tutorial/geometry-optimization/#basic-working-example","title":"Basic Working Example","text":"
from qcio import DualProgramInput, Molecule, OptimizationOutput\n\nfrom chemcloud import CCClient\n\nwater = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [-0.11904094, -0.36695321, -0.21996706],\n        [1.24615604, -0.14134141, 0.99915579],\n        [-0.24300973, 1.16287522, -1.24168873],\n    ],\n)\n\nclient = CCClient()\n\nprog_inp = DualProgramInput(\n    molecule=water,\n    calctype=\"optimization\",\n    keywords={\"maxiter\": 25},\n    subprogram=\"psi4\",\n    subprogram_args={\"model\": {\"method\": \"b3lyp\", \"basis\": \"6-31g\"}},\n)\n\n\n# Submit calculation\nfuture_result = client.compute(\"geometric\", prog_inp)\noutput: OptimizationOutput = future_result.get()\n\nif output.success:\n    print(\"Optimization succeeded!\")\n    # Will be OptimizationResult object\n    print(output)\n    # The final molecule of the geometry optimization\n    print(output.results.final_molecule)\n    # Initial molecule\n    print(output.input_data.molecule)\n    # A list of ordered AtomicResult objects for each step in the optimization\n    print(output.results.trajectory)\n    # A list of ordered energies for each step in the optimization\n    print(output.results.energies)\nelse:\n    print(\"Optimization failed!\")\n    # Will be FailedOperation object\n    print(output)\n    # Error information\n    print(output.traceback)\n
"},{"location":"tutorial/geometry-optimization/#using-force-fields","title":"Using Force Fields","text":"

rdkit can be specified as a compute backend to perform optimizations using force field methods instead of quantum chemistry backends. To use rdkit force field methods simply modify the model specification and subprogram specification as shown below. Also note that rdkit requires the molecular connectivity to be defined.

water = Molecule(\n    symbols=[\"O\", \"H\", \"H\"],\n    geometry=[\n        [0.0000, 0.00000, 0.0000],\n        [0.2774, 0.89290, 0.2544],\n        [0.6067, -0.23830, -0.7169],\n    ],\n    # Add bond connectivity to water (from_atom, to_atom, bond_order)\n    connectivity=[(0, 1, 1.0), (0, 2, 1.0)],\n)\n\nopt_input = DualProgramInput(\n    ...\n    subprogram=\"rdkit\",\n    subprogram_args={\"model\": {\"method\": \"UFF\"}} # or any other force field\n)\n\nfuture_output = client.compute(\"geometric\", opt_input)\n
"},{"location":"tutorial/geometry-optimization/#berny-specifics","title":"Berny Specifics","text":"

The berny procedure uses the pyberny package to perform a geometry optimization. berny specific keywords are subject to change as the berny package evolves, but for simplicity a short list is included here with default values noted:

Keyword Description Default Value maxsteps Maximum number of steps in the optimization 100 gradientmax Convergence criteria (AU) 0.45e-3 gradientrms Convergence criteria (AU) 0.15e-3 stepmax Step in internal coordinates, assuming radian units for angles (AU) 1.8e-3 steprms Step in internal coordinates, assuming radian units for angles (AU) 0.45e-3 trust Initial trust radius in AU. It is the maximum RMS of the quadratic step 0.3 dihedral Form dihedral angles True superweakdih Form dihedral angles containing two or more noncovalent bonds False"},{"location":"tutorial/geometry-optimization/#geometric-specifics","title":"geomeTRIC Specifics","text":"

The geometric procedure uses the geomeTRIC package to perform a geometry optimization. geomeTRIC specific keywords are subject to change as the geomeTRIC package evolves. Since geomeTRIC has considerably more keywords, here's the source code that defines various parameters for an optimization. Keywords noted below can be included in the OptimizationInput keywords dictionary. If these options are overwhelming, keep in mind you can run both the berny and geometric optimizers without any keywords and the optimizers will use sensible defaults.

class OptParams(object):\n\"\"\"\n    Container for optimization parameters.\n    The parameters used to be contained in the command-line \"args\",\n    but this was dropped in order to call Optimize() from another script.\n    \"\"\"\n    def __init__(self, **kwargs):\n        # Whether we are optimizing for a transition state. This changes a number of default parameters.\n        self.transition = kwargs.get('transition', False)\n        # CI optimizations sometimes require tiny steps\n        self.meci = kwargs.get('meci', False)\n        # Handle convergence criteria; this edits the kwargs\n        self.convergence_criteria(**kwargs)\n        # Threshold (in a.u. / rad) for activating alternative algorithm that enforces precise constraint satisfaction\n        self.enforce = kwargs.get('enforce', 0.0)\n        # Small eigenvalue threshold\n        self.epsilon = kwargs.get('epsilon', 1e-5)\n        # Interval for checking the coordinate system for changes\n        self.check = kwargs.get('check', 0)\n        # More verbose printout\n        self.verbose = kwargs.get('verbose', False)\n        # Starting value of the trust radius\n        # Because TS optimization is experimental, use conservative trust radii\n        self.trust = kwargs.get('trust', 0.01 if self.transition else 0.1)\n        # Maximum value of trust radius\n        self.tmax = kwargs.get('tmax', 0.03 if self.transition else 0.3)\n        # Minimum value of the trust radius\n        self.tmin = kwargs.get('tmin', 0.0 if (self.transition or self.meci) else min(1.2e-3, self.Convergence_drms))\n        # Minimum size of a step that can be rejected\n        self.thre_rj = kwargs.get('thre_rj', 1e-4 if (self.transition or self.meci) else 1e-2)\n        # Sanity checks on trust radius\n        if self.tmax < self.tmin:\n            raise ParamError(\"Max trust radius must be larger than min\")\n        # The trust radius should not be outside (tmin, tmax)\n        self.trust = min(self.tmax, self.trust)\n        self.trust = max(self.tmin, self.trust)\n        # Maximum number of optimization cycles\n        self.maxiter = kwargs.get('maxiter', 300)\n        # Use updated constraint algorithm implemented 2019-03-20\n        self.conmethod = kwargs.get('conmethod', 0)\n        # Write Hessian matrix at optimized structure to text file\n        self.write_cart_hess = kwargs.get('write_cart_hess', None)\n        # Output .xyz file name may be set separately in\n        # run_optimizer() prior to calling Optimize().\n        self.xyzout = kwargs.get('xyzout', None)\n        # Name of the qdata.txt file to be written.\n        # The CLI is designed so the user passes true/false instead of the file name.\n        self.qdata = 'qdata.txt' if kwargs.get('qdata', False) else None\n        # Whether to calculate or read a Hessian matrix.\n        self.hessian = kwargs.get('hessian', None)\n        if self.hessian is None:\n            # Default is to calculate Hessian in the first step if searching for a transition state.\n            # Otherwise the default is to never calculate the Hessian.\n            if self.transition: self.hessian = 'first'\n            else: self.hessian = 'never'\n        if self.hessian.startswith('file:'):\n            if os.path.exists(self.hessian[5:]):\n                # If a path is provided for reading a Hessian file, read it now.\n                self.hess_data = np.loadtxt(self.hessian[5:])\n            else:\n                raise IOError(\"No Hessian data file found at %s\" % self.hessian)\n        elif self.hessian.lower() in ['never', 'first', 'each', 'stop', 'last', 'first+last']:\n            self.hessian = self.hessian.lower()\n        else:\n            raise RuntimeError(\"Hessian command line argument can only be never, first, last, first+last, each, stop, or file:<path>\")\n        # Perform a frequency analysis whenever a cartesian Hessian is computed\n        self.frequency = kwargs.get('frequency', None)\n        if self.frequency is None: self.frequency = True\n        # Temperature and pressure for harmonic free energy\n        self.temperature, self.pressure = kwargs.get('thermo', [300.0, 1.0])\n        # Number of desired samples from Wigner distribution\n        self.wigner = kwargs.get('wigner', 0)\n        if self.wigner and not self.frequency:\n            raise ParamError('Wigner sampling requires frequency analysis')\n        # Reset Hessian to guess whenever eigenvalues drop below epsilon\n        self.reset = kwargs.get('reset', None)\n        if self.reset is None: self.reset = not (self.transition or self.meci or self.hessian == 'each')\n

And convergence criteria:

def convergence_criteria(self, **kwargs):\n        criteria = kwargs.get('converge', [])\n        if len(criteria)%2 != 0:\n            raise RuntimeError('Please pass an even number of options to --converge')\n        for i in range(int(len(criteria)/2)):\n            key = 'convergence_' + criteria[2*i].lower()\n            try:\n                val = float(criteria[2*i+1])\n                logger.info('Using convergence criteria: %s %.2e\\n' % (key, val))\n            except ValueError:\n                # This must be a set\n                val = str(criteria[2*i+1])\n                logger.info('Using convergence criteria set: %s %s\\n' % (key, val))\n            kwargs[key] = val\n        # convergence dictionary to store criteria stored in order of energy, grms, gmax, drms, dmax\n        # 'GAU' contains the default convergence criteria that are used when nothing is passed.\n        convergence_sets = {'GAU': [1e-6, 3e-4, 4.5e-4, 1.2e-3, 1.8e-3],\n                            'NWCHEM_LOOSE': [1e-6, 3e-3, 4.5e-3, 3.6e-3, 5.4e-3],\n                            'GAU_LOOSE': [1e-6, 1.7e-3, 2.5e-3, 6.7e-3, 1e-2],\n                            'TURBOMOLE': [1e-6, 5e-4, 1e-3, 5.0e-4, 1e-3],\n                            'INTERFRAG_TIGHT': [1e-6, 1e-5, 1.5e-5, 4.0e-4, 6.0e-4],\n                            'GAU_TIGHT': [1e-6, 1e-5, 1.5e-5, 4e-5, 6e-5],\n                            'GAU_VERYTIGHT': [1e-6, 1e-6, 2e-6, 4e-6, 6e-6]}\n        # Q-Chem style convergence criteria (i.e. gradient and either energy or displacement)\n        self.qccnv = kwargs.get('qccnv', False)\n        # Molpro style convergence criteria (i.e. gradient and either energy or displacement, with different defaults)\n        self.molcnv = kwargs.get('molcnv', False)\n        # Check if there is a convergence set passed else use the default\n        set_name = kwargs.get('convergence_set', 'GAU').upper()\n        # If we have extra keywords apply them here else use the set\n        # Convergence criteria in a.u. and Angstrom\n        self.Convergence_energy = kwargs.get('convergence_energy', convergence_sets[set_name][0])\n        self.Convergence_grms = kwargs.get('convergence_grms', convergence_sets[set_name][1])\n        self.Convergence_gmax = kwargs.get('convergence_gmax', convergence_sets[set_name][2])\n        self.Convergence_drms = kwargs.get('convergence_drms', convergence_sets[set_name][3])\n        self.Convergence_dmax = kwargs.get('convergence_dmax', convergence_sets[set_name][4])\n        # Convergence criteria that are only used if molconv is set to True\n        self.Convergence_molpro_gmax = kwargs.get('convergence_molpro_gmax', 3e-4)\n        self.Convergence_molpro_dmax = kwargs.get('convergence_molpro_dmax', 1.2e-3)\n
"},{"location":"tutorial/supported-programs/","title":"Supported programs","text":"

Supported compute engines in chemcloud can be checked as follows:

from chemcloud import CCClient\n\nclient = CCClient()\nclient.supported_engines\n[\"psi4\", \"terachem_fe\", \"rdkit\", ...]\n

Please see BigChem Algorithms for details on parallel execution algorithms unique to the BigChem compute engine.

"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 51e4416..d069dbb 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,72 +2,72 @@ https://mtzgroup.github.io/chemcloud-client/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/CHANGELOG/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/dev-decisions/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/code-reference/CCClient/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/code-reference/exceptions/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/code-reference/future-outputs/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/code-reference/inputs/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/code-reference/outputs/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/tutorial/authentication/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/tutorial/batch-computations/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/tutorial/bigchem-algorithms/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/tutorial/compute/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/tutorial/geometry-optimization/ - 2023-11-30 + 2024-02-24 daily https://mtzgroup.github.io/chemcloud-client/tutorial/supported-programs/ - 2023-11-30 + 2024-02-24 daily \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 4cfe569c576c61afe89522292c323086b5497e10..aca91d81a6ee2e5377f64292274d1e853bb46558 100644 GIT binary patch literal 370 zcmV-&0ge72iwFn=IN4r8D+c5Li%|4xt7R#34;Lb5kWUdB(~OkSe2%e~RX7JN{4T$DFeT^2BMJE&1C z%8&Oaa$7FDSsT3$fJG`E!=jXk?w-=!ZdV0`V3-S)^@0X2(?y^ck=E5++0BZyCWG_Y zX|>w&ZgL69#^6zS8(k$7%DAqSrIQcWHV%Yq1tZdyPCKp*SU_WkuBn?jsTXEk<=XuV>ZvWPMXinA&AnZd6aa!I%~ zY49wg_x7g&C8nE%X^{k!CbtI8vxm&61y}><55%Ugy-~*;vmc^!)*}qWc`H2okLa8Z Q>8G>%0_tv zRVI5eDA;)TY&xOMq2^c0nT&s<{S~r(et2CyzPzpS!0lkmI*@vN^dS%A6ii?qHsDi8 zfwyg&Q9ORZ!(M`;Y-hiT6g@DEuz17DYvmc^!=m|RJJSs2#BRZ!; Q`sr-G00l-8yrc>M0M^O1@c;k- diff --git a/tutorial/bigchem-algorithms/index.html b/tutorial/bigchem-algorithms/index.html index b100f74..ea11404 100644 --- a/tutorial/bigchem-algorithms/index.html +++ b/tutorial/bigchem-algorithms/index.html @@ -453,6 +453,13 @@ Hessian + + +
  • + + Frequency Analysis + +
  • @@ -666,6 +673,13 @@ Hessian + + +
  • + + Frequency Analysis + +
  • @@ -689,59 +703,75 @@

    BigChem Algorithms🔗

    BigChem implements some of its own concurrent algorithms that leverage its horizontally scalable backend infrastructure. These include a parallel hessian algorithm and parallel frequency analysis algorithm. To use them submit a hessian calculation to ChemCloud using bigchem as the engine. See examples the parallel_hessian.py and parallel_frequency_analysis.py scripts in the examples directory.

    Hessian🔗

    -

    from qcio import DualProgramInput, Molecule, SinglePointOutput

    -

    from chemcloud import CCClient

    -

    water = Molecule( - symbols=["O", "H", "H"], - geometry=[ - [0.0000, 0.00000, 0.0000], - [0.2774, 0.89290, 0.2544], - [0.6067, -0.23830, -0.7169], - ], -)

    -

    client = CCClient()

    -

    prog_inp = DualProgramInput( - molecule=water, - calctype="hessian", - subprogram="psi4", - subprogram_args={"model": {"method": "b3lyp", "basis": "6-31g"}}, -)

    -

    Submit calculation🔗

    -

    future_result = client.compute("bigchem", prog_inp) -output: SinglePointOutput = future_result.get()

    -

    SinglePointOutput object containing all returned data🔗

    -

    print(output) -print(output.results.hessian)

    -

    Frequency data always included too🔗

    -

    print(f"Wavenumbers: {output.results.freqs_wavenumber}") -print(output.results.normal_modes_cartesian) -print(output.results.gibbs_free_energy)

    +
    from qcio import DualProgramInput, Molecule, SinglePointOutput
    +
    +from chemcloud import CCClient
    +
    +water = Molecule(
    +    symbols=["O", "H", "H"],
    +    geometry=[
    +        [0.0000, 0.00000, 0.0000],
    +        [0.2774, 0.89290, 0.2544],
    +        [0.6067, -0.23830, -0.7169],
    +    ],
    +)
    +
    +client = CCClient()
    +
    +prog_inp = DualProgramInput(
    +    molecule=water,
    +    calctype="hessian",
    +    subprogram="psi4",
    +    subprogram_args={"model": {"method": "b3lyp", "basis": "6-31g"}},
    +)
    +
    +
    +# Submit calculation
    +future_result = client.compute("bigchem", prog_inp)
    +output: SinglePointOutput = future_result.get()
    +
    +# SinglePointOutput object containing all returned data
    +print(output)
    +print(output.results.hessian)
    +# Frequency data always included too
    +print(f"Wavenumbers: {output.results.freqs_wavenumber}")
    +print(output.results.normal_modes_cartesian)
    +print(output.results.gibbs_free_energy)
    +

    Frequency Analysis🔗

    -

    from qcio import DualProgramInput, Molecule, SinglePointOutput

    -

    from chemcloud import CCClient

    -

    water = Molecule( - symbols=["O", "H", "H"], - geometry=[ - [0.0000, 0.00000, 0.0000], - [0.2774, 0.89290, 0.2544], - [0.6067, -0.23830, -0.7169], - ], -)

    -

    client = CCClient()

    -

    prog_inp = DualProgramInput( - molecule=water, - calctype="hessian", - subprogram="psi4", - subprogram_args={"model": {"method": "b3lyp", "basis": "6-31g"}}, -)

    -

    Submit calculation🔗

    -

    future_result = client.compute("bigchem", prog_inp) -output: SinglePointOutput = future_result.get()

    -

    SinglePointOutput object containing all returned data🔗

    -

    print(output) -print(f"Wavenumbers: {output.results.freqs_wavenumber}") -print(output.results.normal_modes_cartesian) -print(output.results.gibbs_free_energy)

    +
    from qcio import DualProgramInput, Molecule, SinglePointOutput
    +
    +from chemcloud import CCClient
    +
    +water = Molecule(
    +    symbols=["O", "H", "H"],
    +    geometry=[
    +        [0.0000, 0.00000, 0.0000],
    +        [0.2774, 0.89290, 0.2544],
    +        [0.6067, -0.23830, -0.7169],
    +    ],
    +)
    +
    +client = CCClient()
    +
    +prog_inp = DualProgramInput(
    +    molecule=water,
    +    calctype="hessian",
    +    subprogram="psi4",
    +    subprogram_args={"model": {"method": "b3lyp", "basis": "6-31g"}},
    +)
    +
    +
    +# Submit calculation
    +future_result = client.compute("bigchem", prog_inp)
    +output: SinglePointOutput = future_result.get()
    +
    +# SinglePointOutput object containing all returned data
    +print(output)
    +print(f"Wavenumbers: {output.results.freqs_wavenumber}")
    +print(output.results.normal_modes_cartesian)
    +print(output.results.gibbs_free_energy)
    +

    Keywords for the BigChem algorithms: