compute

qcengine.compute(input_data, program, raise_error=False, task_config=None, return_dict=False, return_version=-1)[source]

Executes a single CMS program given a QCSchema input.

The full specification can be found at:

http://molssi-qc-schema.readthedocs.io/en/latest/index.html#

Parameters:
  • input_data (Union[Dict[str, Any], BaseModel]) – A QCSchema input specification in dictionary or model from QCElemental.models

  • program (str) – The CMS program or procedure with which to execute the input. E.g., “psi4”, “rdkit”, “geometric”.

  • raise_error (bool) – If computation doesn’t succeed, should compute raise an error (True) or encode in a FailedOperation (False). See also: return_dict.

  • retries (int, optional) – The number of random tries to retry for.

  • task_config (Optional[Dict[str, Any]]) – A dictionary of local configuration options corresponding to a TaskConfig object. Formerly local_options.

  • return_dict (bool) – Returns a dictionary serialization instead of a Result or FailedOperation model from QCElemental.models. Note that raise_error take precedence.

  • return_version (int) – The schema version to return. If -1, the input schema_version is used.

Return type:

Union[BaseModel, FailedOperation, Dict[str, Any]]

Returns:

  • result – AtomicResult, OptimizationResult, FailedOperation, etc., or Dict representation of any object type A QCSchema representation of the requested output, type depends on return_dict key.

    good_calc

    raise_error

    return_dict

    output

    T

    F (def)

    F (def)

    AtomicResult object

    T

    T

    F (def)

    AtomicResult object

    T

    T

    T

    dict of AtomicResult

    T

    F (def)

    T

    dict of AtomicResult

    F

    F (def)

    F (def)

    FailedOperation object

    F

    T

    F (def)

    raises InputError (type encoded in FailedOp)

    F

    T

    T

    raises InputError (type encoded in FailedOp)

    F

    F (def)

    T

    dict of FailedOperation

    good_calc?

    input_data ver

    return_version

    return_dict

    output

    T

    1

    -1 (def) or 1

    F (def)

    v1.AtomicResult object (not avail. Py 3.14+ ^^)

    T

    1

    2

    F (def)

    v2.AtomicResult object

    T

    1

    -1 (def) or 1

    T

    dict of v1.AtomicResult @@

    T

    1

    2

    T

    dict of v2.AtomicResult

    T

    2

    -1 (def) or 2

    F (def)

    v2.AtomicResult object

    T

    2

    1

    F (def)

    v1.AtomicResult object (not avail. Py 3.14+ ^^)

    T

    2

    -1 (def) or 2

    T

    dict of v2.AtomicResult

    T

    2

    1

    T

    dict of v1.AtomicResult @@

    F

    1

    -1 (def) or 1

    F (def)

    v1.FailedOperation object (not avail. Py 3.14+ ^^) **

    F

    1

    2

    F (def)

    v2.FailedOperation object

    F

    1

    -1 (def) or 1

    T

    dict of v1.FailedOperation @@ **

    F

    1

    2

    T

    dict of v2.FailedOperation

    F

    2

    -1 (def) or 2

    F (def)

    v2.FailedOperation object **

    F

    2

    1

    F (def)

    v1.FailedOperation object (not avail. Py 3.14+ ^^)

    F

    2

    -1 (def) or 2

    T

    dict of v2.FailedOperation **

    F

    2

    1

    T

    dict of v1.FailedOperation @@

    ** F

    ** -1

    for errors before input ver detected, returns v2 if Py 3.14+ else v1

    ^^ 1

    ^^ F

    for Py 3.14+, returns v2.FailedOp for minimal API surprise

    @@ 1

    @@ T

    for Py 3.14+, returns dict of v1 (like all other Py) with brittle

    QCNG_USE_V1V2_SHIM=1, otherwise dict of v2.FailedOp

  • .. versionadded:: 0.50.0 – input_data can newly be QCSchema v2 as well as longstanding v1. Note that the QCSchema v2 layout will not be official until v0.60.0 . The compute_procedure is newly incorporated into compute. The return_version parameter was added.