Function for optimizing the geometry of the given configuration. Returns: The optimized configuration. The returned optimized configuration is assigned the self-consistent calculation associated with the final step of the optimization loop.
The configuration to be optimized.
Type: A BulkConfiguration or MoleculeConfiguration or DeviceConfiguration
Default:
None
The maximum forces when the optimization should stop.
Type: A physical quantity with unit eV/Ang
Default:
0.05*eV/Ang
The maximum stress when the optimization should stop.
Type: A physical quantity with unit eV/Ang**3
Default:
0.05*eV/Ang**3
Type: A positive integer.
Default:
1000
The maximum step length the optimizer may take.
Type: A physical quantity with length units.
Default:
0.5*Ang
The maximum step length for running a restart scf calculation for the new geometry.
Type: A physical quantity with length units.
Default:
0.1*Ang
A list of indices of the atom with fixed positions, and Constraints objects.
Type: A list of integers and Constraints objects.
Default:
[]
The filename of the file to be used for storing the trajectory in.
Type: A string.
Default:
None
Disable the stress for device and bulk calculations.
Type: bool
Default:
False for LCAO calculators, True for other calculators.
The optimizer to use for optimizing the structure.
Type: QuasiNewton | FIRE
Default:
An instance of QuasiNewton
Optimize the geometry of a water molecule:
# Define elements
elements = [Oxygen, Hydrogen, Hydrogen]
# Define coordinates
cartesian_coordinates = [[ 0.0, -1.70000000e-05, 1.20198000e-01],
[ 0.0, 7.59572000e-01, -4.86714000e-01],
[ 0.0, -7.59606000e-01, -4.86721000e-01]]*Angstrom
# Set up configuration
molecule_configuration = MoleculeConfiguration(
elements=elements,
cartesian_coordinates=cartesian_coordinates
)
# Define a calculator
molecule_configuration.setCalculator(LCAOCalculator())
# Perform optimization and store the relaxation trajectory
optimized_configuration = OptimizeGeometry(molecule_configuration,
trajectory_filename='opt.nc'
)
# Save the relaxed configuration
nlsave('optimized_configuration.nc', optimized_configuration)
We use the Broyden–Fletcher–Goldfarb–Shanno (BFGS) method for optimization, which is a Quasi-Newton method.
Our implementation uses the ASE code.