OptimizeGeometryParameters

class OptimizeGeometryParameters(max_forces=None, max_stress=None, max_steps=None, max_step_length=None, constraints=None, trajectory_filename=None, trajectory_object_id=None, disable_stress=None, optimize_cell=None, optimizer_method=None, target_stress=None, pre_step_hook=None, post_step_hook=None, constrain_bravais_lattice=None, trajectory_interval=None, restart_strategy=None, enable_optimization_stop_file=None, write_raw_stress=None, write_raw_forces=None)

Class for parameters used in optimizing the geometry of a configuration.

Parameters:
  • max_forces (PhysicalQuantity of type force) – The maximum forces determining that the optimization should stop.
    Default: 0.05*eV/Ang

  • max_stress (PhysicalQuantity of type pressure) – The maximum stress determining that the optimization should stop.
    Default: 0.1*GPa

  • max_steps (A positive integer.) – The maximum number of steps.
    Default: 200

  • max_step_length (PhysicalQuantity of type length) – The maximum step length the optimizer may take.
    Default: 0.2*Ang

  • constraints (A list of integers and Constraints objects.) – A list of indices of the atom with fixed positions, and Constraints objects.
    Default: []

  • trajectory_filename (str.) – The filename of the file to be used for storing the trajectory in.

  • trajectory_object_id (str | None) – The object id to use when saving to HDF5.
    Default: None

  • disable_stress
    Deprecated: from v2022.03, use optimize_cell parameter instead.

  • optimize_cell (bool) – will be change during the optimization. Enabling the stress calculation for bulk configurations.
    Default: True for BulkConfigurations otherwise False

  • optimizer_method (FIRE | LBFGS.) – The optimizer to use for optimizing the structure.
    Default: LBFGS

  • target_stress – The target stress under which the cell should be optimized. Must be given as a single pressure value, or a stress vector in Voigt or matrix notation.
    Default: 0*GPa

  • pre_step_hook (A callable function or method) – An optional user-defined function which will be called just before each optimization step. The signature of the function requires the arguments (step, configuration). The return status is ignored. Unhandled exceptions will terminate the optimization.
    Default: No hook.

  • post_step_hook (A callable function or method) – An optional user-defined function which will be called just after each optimization step. The signature of the function requires the arguments (step, configuration). The return status is ignored. Unhandled exceptions will terminate the optimization.
    Default: No hook.

  • constrain_bravais_lattice (bool) – Enable preserving the Bravais lattice symmetry of the configuration.
    Default: True if the target_stress is commensurate with the lattice symmetries

  • trajectory_interval (int | PhysicalQuantity of type time) – The resolution used in saving steps to a trajectory file. This can either be given as an integer (a value of 1 results in all steps being saved; a value of 2 results in every second step being saved; etc.) or as a time interval.
    Default: 1

  • restart_strategy (NoRestart | RestartFromTrajectory) – The restart mechanism based on trajectory data saved in a given file.
    Default: RestartFromTrajectory()

  • enable_optimization_stop_file (bool) – Determines whether to enable a file for stopping the geometry optimization. If True, creation of the stop file will stop the optimization at the next step. The name of the stop file will be shown in the log output; it will be stop-geometry-optimization-uniqueID, where uniqueID is a randomly generated identifier for this optimization. The file must be created in the current working directory.
    Default: True

  • write_raw_stress (bool) – Determines whether the stress will be written in the trajectory before any constraint is applied to the system. If it is True, then in the trajectory, the stress values before applying any constraint will be saved. However, if it is false, then the stress values after applying the constraint will be saved in the trajectory.
    Default: None

  • write_raw_forces (bool) – Determines whether the forces will be written in the trajectory before any constraint is applied to the system. If it is True, then in the trajectory, the forces on the atoms before applying any constraint will be saved. However, if it is false, then the forces after applying the constraint will be saved in the trajectory.
    Default: None

constrainBravaisLattice()

Query method for the constrain_bravais_lattice parameter.

constraints()

Query method for the constraints.

classmethod defaultEnabledStress(configuration_type, is_neb, neb_variable_cell=None)

The default “enable stress” depend on the configuration type.

Parameters:
  • configuration_type (type) – The configuration type.

  • is_neb (bool) – True, if neb configuration.

  • neb_variable_cell (bool) – Whether this is a variable cell NEB Configuration.

Returns:

True, for Bulk configurations, otherwise False.

Return type:

bool

disableStress()

Query method for the disable stress.

enableOptimizationStopFile()

Query method for the enable_optimization_stop_file parameter.

maxForces()

Query method for the max forces.

maxStepLength()

Query method for the max step length.

maxSteps()

Query method for the max steps.

maxStress()

Query method for the max stress.

optimizeCell()

Query method for the optimize cell.

optimizerMethod()

Query method for the optimizer method.

postStepHook()

Query method for the post-step hook.

preStepHook()

Query method for the pre-step hook.

restartStrategy()

Query method for the restart_strategy parameter.

setConstrainBravaisLattice(constrain_bravais_lattice)

Method for setting the constrain_bravais_lattice parameter.

setConstraints(constraints)

Method for setting the constraints.

setDisableStress(disable_stress)

Method for setting the disable_stress.

setEnableOptimizationStopFile(enable_optimization_stop_file, default_enable_optimization_stop_file)

Method for setting the enable optimization stop file parameter.

setMaxForces(max_forces)

Method for setting the max forces.

setMaxStepLength(max_step_length)

Method for setting the max step length.

setMaxSteps(max_steps)

Method for setting the max steps.

setMaxStress(max_stress)

Method for setting the max stress.

setOptimizeCell(optimize_cell)

Method for setting the disable_stress and optimize cell.

setOptimizerMethod(optimizer_method)

Method for setting the optimizer method.

setPostStepHook(post_step_hook)

Method for setting the post-step hook.

setPreStepHook(pre_step_hook)

Method for setting the pre-step hook.

setRestartStrategy(restart_strategy, default_restart_strategy)

Method for setting the restart_strategy parameter.

setTargetStress(target_stress)

Method for setting the target stress tensor.

setTrajectoryFilename(trajectory_filename)

Method for setting the trajectory filename.

setTrajectoryInterval(trajectory_interval, default_trajectory_interval)

Method for setting the trajectory_interval parameter.

setTrajectoryObjectId(trajectory_object_id)

Method for setting the trajectory object ID.

setWriteRawStress(write_raw_stress)

Method for setting the write_raw_stress.

targetStress()

Query method for the target stress tensor.

trajectoryFilename()

Query method for the trajectory filename.

trajectoryInterval()

Query method for the trajectory_interval parameter.

trajectoryObjectId()

Query method for the trajectory object ID.

uniqueString()

Return a unique string representing the state of the object.

writeRawForces()

Query method to check if raw force will be written on the trajectory.

writeRawStress()

Query method to check if raw stress will be written on the trajectory.