qimpy.dft.geometry.Fixed
- class Fixed(*, comm, lattice, checkpoint_in=(None, ''))
Bases:
Relax
Fixed 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:
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_child
Construct child object self.`attr_name` of type cls.
add_child_one_of
Invoke add_child on one of several child options in args.
compute
Update energy and/or gradients in state.
constrain
Override to impose any constraints, restricting to allowed subspace.
finite_difference_test
Check gradient implementation by taking steps along direction.
minimize
Minimize, and return optimized energy of system
report
Override to perform optional reporting / processing every few steps.
run
safe_step_size
Override to return maximum safe step size along direction, if any.
save_checkpoint
Save self and all children in hierarchy to cp_path.
step
Update the geometry along direction by amount step_size
Attributes
latticeK
Preconditioning factor of lattice relative to ions
drag_wavefunctions
Whether to drag atomic components of wavefunctions
history
Utility to save trajectory data
stepper
Interface to move ions/lattice and compute forces/stress
comm
Communicator over which algorithm operates in unison
name
Name of algorithm instance used in reporting eg.
i_iter_start
Starting iteration number (eg.
n_iterations
Maximum number of iterations
energy_threshold
Convergence threshold on energy change
n_consecutive
Number of consecutive iterations threshold must be satisfied
method
CG, L-BFGS or Gradient (i.e steepest descent)
cg_type
Polak-Ribiere, Fletcher-Reeves or Hestenes-Stiefel
line_minimize
Auto, Constant, Quadratic, Wolfe
step_size
Step size options
n_history
Maximum history size (only used for L-BFGS)
wolfe
Wolfe line minimize stopping conditions
converge_on
Converge on 'any', 'all' or a number of thresholds
n_converge
Number of thresholds that converge_on corresponds to
extra_thresholds
Names and thresholds for any additional convergence quantities.
child_names
Names of attributes with child objects.