qimpy.dft.electrons.LCAO
- class LCAO(*, comm, checkpoint_in=(None, ''), n_iterations=30, energy_threshold=1e-06, gradient_threshold=1e-08)
Bases:
Minimize
[MatrixArray
]Optimize electronic state in atomic-orbital subspace.
- Parameters:
comm (MPI.Comm)
checkpoint_in (CheckpointPath)
n_iterations (int)
energy_threshold (float)
gradient_threshold (float)
- __init__(*, comm, checkpoint_in=(None, ''), n_iterations=30, energy_threshold=1e-06, gradient_threshold=1e-08)
Set stopping criteria for initial subspace optimization.
- Parameters:
energy_threshold (float) – [Input file] Energy convergence threshold in Hartrees. Stop when energy difference between consecutive LCAO iterations falls below this threshold.
gradient_threshold (float) – [Input file] Subspace-gradient convergence threshold (dimensionless). Stop when gradient of energy with respect to subspace Hamiltonian falls below this threshold.
comm (Comm)
checkpoint_in (CheckpointPath)
n_iterations (int)
- Return type:
None
Methods
Set stopping criteria for initial subspace optimization.
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.
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.
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.
Move the state along direction by amount step_size
Thomas-Fermi kinetic energy density
Set wavefunctions to optimum subspace of atomic orbitals.
Attributes
system
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.
variant_name
Version of children having variants (if any)
- compute(state, energy_only)
Update energy and/or gradients in state. If energy_only is True, only update the energy, else update all entries including extra convergence checks, gradients and preconditioned gradient.
- Parameters:
state (MinimizeState[MatrixArray])
energy_only (bool)
- Return type:
None
- step(direction, step_size)
Move the state along direction by amount step_size
- Parameters:
direction (MatrixArray)
step_size (float)
- Return type:
None
- tau_tf(n_tilde, grid)
Thomas-Fermi kinetic energy density