Optimization

The record of a geometry optimization.

Attributes

class qcportal.models.OptimizationRecord(**data)[source]

A OptimizationRecord for all optimization procedure data.

Parameters
  • client (Any, Optional) – The client object which the records are fetched from.

  • cache (Dict[str, Any], Default: {}) – Object cache from expensive queries. It should be very rare that this needs to be set manually by the user.

  • id (ObjectId, Optional) – Id of the object on the database. This is assigned automatically by the database.

  • hash_index (str, Optional) – Hash of this object used to detect duplication and collisions in the database.

  • procedure (ConstrainedStrValue, Default: optimization) – A fixed string indication this is a record for an “Optimization”.

  • program (str) – The quantum chemistry program which carries out the individual quantum chemistry calculations.

  • version (int, Default: 1) – Version of the OptimizationRecord Model which this data was created with.

  • protocols (OptimizationProtocols, Optional)

  • extras (Dict[str, Any], Default: {}) – Extra information to associate with this record.

  • stdout (ObjectId, Optional) – The Id of the stdout data stored in the database which was used to generate this record from the various programs which were called in the process.

  • stderr (ObjectId, Optional) – The Id of the stderr data stored in the database which was used to generate this record from the various programs which were called in the process.

  • error (ObjectId, Optional) – The Id of the error data stored in the database in the event that an error was generated in the process of carrying out the process this record targets. If no errors were raised, this field will be empty.

  • task_id (ObjectId, Optional) – Id of the compute task tracked by Fractal in its TaskTable.

  • manager_name (str, Optional) – Name of the Queue Manager which generated this record.

  • status ({COMPLETE,INCOMPLETE,RUNNING,ERROR}, Default: INCOMPLETE) – The state of a record object. The states which are available are a finite set.

  • modified_on (datetime, Optional) – Last time the data this record points to was modified.

  • created_on (datetime, Optional) – Time the data this record points to was first created.

  • provenance (Provenance, Optional) – Provenance information tied to the creation of this record. This includes things such as every program which was involved in generating the data for this record.

  • schema_version (int, Default: 1) – The version number of QCSchema under which this record conforms to.

  • initial_molecule (ObjectId) – The Id of the molecule which was passed in as the reference for this Optimization.

  • qc_spec (QCSpecification) – The specification of the quantum chemistry calculation to run at each point.

  • keywords (Dict[str, Any], Default: {}) – The keyword options which were passed into the Optimization program. Note: These are a dictionary and not a KeywordSet object.

  • energies (List[float], Optional) – The ordered list of energies at each step of the Optimization.

  • final_molecule (ObjectId, Optional) – The ObjectId of the final, optimized Molecule the Optimization procedure converged to.

  • trajectory (List[ObjectId], Optional) – The list of Molecule Id’s the Optimization procedure generated at each step of the optimization.``initial_molecule`` will be the first index, and final_molecule will be the last index.

build_schema_input(initial_molecule: Molecule, qc_keywords: Optional[KeywordSet] = None, checks: bool = True) → OptimizationInput[source]

Creates a OptimizationInput schema.

get_final_energy() → float[source]

The final energy of the geometry optimization.

Returns

The optimization molecular energy.

Return type

float

get_final_molecule() → Molecule[source]

Returns the optimized molecule

Returns

The optimized molecule

Return type

Molecule

get_initial_molecule() → Molecule[source]

Returns the initial molecule

Returns

The initial molecule

Return type

Molecule

get_molecular_trajectory() → List[Molecule][source]

Returns the Molecule at each gradient evaluation in the trajectory.

Returns

A ordered list of Molecules in the trajectory.

Return type

List[‘Molecule’]

get_trajectory() → List[qcportal.models.records.ResultRecord][source]

Returns the Result records for each gradient evaluation in the trajectory.

Returns

A ordered list of Result record gradient computations.

Return type

List[‘ResultRecord’]

show_history(units: str = 'kcal/mol', digits: int = 3, relative: bool = True, return_figure: Optional[bool] = None) → plotly.Figure[source]

Plots the energy of the trajectory the optimization took.

Parameters
  • units (str, optional) – Units to display the trajectory in.

  • digits (int, optional) – The number of valid digits to show.

  • relative (bool, optional) – If True, all energies are shifted by the lowest energy in the trajectory. Otherwise provides raw energies.

  • return_figure (Optional[bool], optional) – If True, return the raw plotly figure. If False, returns a hosted iPlot. If None, return a iPlot display in Jupyter notebook and a raw plotly figure in all other circumstances.

Returns

The requested figure.

Return type

plotly.Figure