qimpy.dft.geometry.Fixed
- class Fixed(*, comm, lattice, checkpoint_in=(None, ''))
Bases:
RelaxFixed geometry, i.e. only optimize electronic degrees of freedom.
- Parameters:
comm (MPI.Comm)
lattice (Lattice)
checkpoint_in (CheckpointPath)
- __init__(*, comm, lattice, checkpoint_in=(None, ''))
Specify geometry relaxation algorithm and convergence parameters.
- Parameters:
i_iter – Iteration number to start with (used for continuing from checkpoint)
n_iterations – [Input file] Maximum number of iterations.
energy_threshold – [Input file] Convergence threshold on energy change in Eh.
fmax_threshold – [Input file] Convergence threshold on maximum force in Eh/a0.
stress_threshold – [Input file] Convergence threshold on |stress| (stress tensor norm) in Eh/a0^3.
n_consecutive – [Input file] Number of consecutive iterations each threshold must be satisfied.
method – [Input file] Relaxation algorithm: L-BFGS, CG or Gradient. The default L-BFGS (limited-memory Broyden–Fletcher–Goldfarb–Shanno) method is strongly recommended as it requires the least number of force evaluations per line minimize step (with the Wolfe line minimize). Only use CG (conjugate gradients) if L-BFGS fails for some system. The steepest-descent Gradient method is only for special test cases.
cg_type – [Input file] CG variant: Polak-Ribiere, Fletcher-Reeves or Hestenes-Stiefel. Variant of conjugate gradients method (only matters if method is CG).
line_minimize – [Input file] Line minimization scheme: Auto, Constant, Quadratic, Wolfe. Auto matches the line minimization scheme to method (recommended). Constant is a constant step-size usable with the Gradient-descent method. Quadratic is best-suited for conjugate-gradients methods. Wolfe is a cubic line step best suited for L-BFGS.
n_history – [Input file] Maximum history size (only used for L-BFGS).
converge_on – [Input file] Converge on ‘any’, ‘all’ or a specific number of thresholds. If set to any, reaching threshold on any one of energy, force and stress (wherever applicable) will lead to convergence. When set to all, all applicable thresholds must be satisfied. If set to an integer between 1 and the number of applicable thresholds, require that many thresholds to be satisfied simultaneously to achieve convergence.
drag_wavefunctions – [Input file] Whether to drag atomic components of wavefunctions.
save_history – [Input file] Whether to save history along the trajectory. Saved quantities include positions, forces, energies, stress (if available) and lattice (if movable).
comm (Comm)
lattice (Lattice)
checkpoint_in (CheckpointPath)
- Return type:
None
Methods
Specify geometry relaxation algorithm and convergence parameters.
add_childConstruct child object self.`attr_name` of type cls.
add_child_one_ofInvoke add_child on one of several child options in args.
computeUpdate energy and/or gradients in state.
constrainOverride to impose any constraints, restricting to allowed subspace.
finite_difference_testCheck gradient implementation by taking steps along direction.
minimizeMinimize, and return optimized energy of system
reportOverride to perform optional reporting / processing every few steps.
runsafe_step_sizeOverride to return maximum safe step size along direction, if any.
save_checkpointSave self and all children in hierarchy to cp_path.
stepUpdate the geometry along direction by amount step_size
Attributes
latticeKPreconditioning factor of lattice relative to ions
drag_wavefunctionsWhether to drag atomic components of wavefunctions
historyUtility to save trajectory data
stepperInterface to move ions/lattice and compute forces/stress
commCommunicator over which algorithm operates in unison
nameName of algorithm instance used in reporting eg.
i_iter_startStarting iteration number (eg.
n_iterationsMaximum number of iterations
energy_thresholdConvergence threshold on energy change
n_consecutiveNumber of consecutive iterations threshold must be satisfied
methodCG, L-BFGS or Gradient (i.e steepest descent)
cg_typePolak-Ribiere, Fletcher-Reeves or Hestenes-Stiefel
line_minimizeAuto, Constant, Quadratic, Wolfe
step_sizeStep size options
n_historyMaximum history size (only used for L-BFGS)
wolfeWolfe line minimize stopping conditions
converge_onConverge on 'any', 'all' or a number of thresholds
n_convergeNumber of thresholds that converge_on corresponds to
extra_thresholdsNames and thresholds for any additional convergence quantities.
child_namesNames of attributes with child objects.
variant_nameVersion of children having variants (if any)