Optimization

The Record of a geometry optimization.

Attributes

class qcportal.models.OptimizationRecord(*, client: Any = None, cache: Dict[str, Any] = {}, id: qcportal.models.common_models.ObjectId = None, hash_index: str = None, procedure: qcportal.models.records.ConstrainedStrValue = 'optimization', program: str, version: int = 1, protocols: qcelemental.models.procedures.OptimizationProtocols = OptimizationProtocols(trajectory=<TrajectoryProtocolEnum.all: 'all'>), extras: Dict[str, Any] = {}, stdout: qcportal.models.common_models.ObjectId = None, stderr: qcportal.models.common_models.ObjectId = None, error: qcportal.models.common_models.ObjectId = None, manager_name: str = None, status: qcportal.models.records.RecordStatusEnum = <RecordStatusEnum.incomplete: 'INCOMPLETE'>, modified_on: datetime.datetime = None, created_on: datetime.datetime = None, provenance: qcelemental.models.common_models.Provenance = None, schema_version: int = 1, initial_molecule: qcportal.models.common_models.ObjectId, qc_spec: qcportal.models.common_models.QCSpecification, keywords: Dict[str, Any] = {}, energies: List[float] = None, final_molecule: qcportal.models.common_models.ObjectId = None, trajectory: List[qcportal.models.common_models.ObjectId] = None)[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, Default: Ellipsis) – 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.

  • 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, Default: Ellipsis) – The Id of the molecule which was passed in as the reference for this Optimization.

  • qc_spec (QCSpecification, Default: Ellipsis) – 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.

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