horton_part.algo.diis module

Module of CDIIS algorithm.

diis(x0, func, threshold, maxiter=1000, diis_size=8, version='P', lstsq_solver=None, conv_func=None, verbose=False, logger=None)

DIIS algorithm.

Parameters:
  • x0 (array_like) – 1D array, initial values.

  • func (callable) – Function g which satisfies \(g(x)=x\)

  • threshold (float, optional) – Convergence threshold for the iterative process.

  • threshold – default value : 1e-08 tolerence parameter for convergence test on residual (commutator)

  • maxiter (integer, optional) – default value : 50 maximal number of iterations allowed

  • version (str, optional) – The version of DIIS formalism. [1]_

  • diis_size (integer, optional) – default value : 5 size of the window of stored previous iterates in the FD-CDIIS algorithm this dimension is also used for the adaptative algorithm

  • lstsq_solver (str, optional) – The different method for least-square problem to determine combination coefficients.

  • conv_func (callable, optional) – The convergence func. The default is None.

Returns:

The optimized parameters.

Return type:

np.array

References

[1]: TODO.

lstsq_solver_dyn(propars_list, residues_list)

Solving least-square problem with dynamic subspace size.

Parameters:
  • propars_list (array_like) – A list of pro-atom parameters.

  • residues_list (array_like) – A list of residues.

Returns:

1D array, pro-atom parameters.

Return type:

np.ndarray

lstsq_solver_with_extra_constr(propars_list, residues_list)

Solving least-square problem with non-negative parameters constraints.

Parameters:
  • propars_list (array_like) – A list of pro-atom parameters.

  • residues_list (array_like) – A list of residues.

Returns:

1D array with shape = (N, ) where N is the number pro-atom parameters.

Return type:

np.ndarray

lstsq_spsolver(propars_list, residues_list)

Solving least-square problem using spsolver.

Parameters:
  • propars_list (array_like) – A list of pro-atom parameters.

  • residues_list (array_like) – A list of residues.

Returns:

1D array, pro-atom parameters.

Return type:

np.ndarray