qimpy.dft.geometry.Fixed
- class Fixed(*, comm, lattice, checkpoint_in=CheckpointPath(checkpoint=None, path=''))
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=CheckpointPath(checkpoint=None, path=''))
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_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
- drag_wavefunctions: bool
Whether to drag atomic components of wavefunctions
- history: Optional[History]
Utility to save trajectory data
- latticeK: float
Preconditioning factor of lattice relative to ions
- stepper: Stepper
Interface to move ions/lattice and compute forces/stress