Optimization Routines
Main BE optimization
- class molbe._opt.BEOPT(pot, Fobjs, Nocc, enuc, solver='MP2', ecore=0.0, nproc=1, ompnum=4, only_chem=False, hf_veff=None, hci_pt=False, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, max_space=500, conv_tol=1e-06, relax_density=False, ebe_hf=0.0, scratch_dir=None, **solver_kwargs)
Perform BE optimization.
Implements optimization algorithms for bootstrap optimizations, namely, chemical potential optimization and density matching. The main technique used in the optimization is a Quasi-Newton method. It interface to external (adapted version) module originally written by Hong-Zhou Ye.
- Parameters:
pot (list) – List of initial BE potentials. The last element is for the global chemical potential.
Fobjs (MolBE.fragpart) – Fragment object
Nocc (int) – No. of occupied orbitals for the full system.
enuc (float) – Nuclear component of the energy.
solver (str) – High-level solver in bootstrap embedding. ‘MP2’, ‘CCSD’, ‘FCI’ are supported. Selected CI versions, ‘HCI’, ‘SHCI’, & ‘SCI’ are also supported. Defaults to ‘MP2’
only_chem (bool) – Whether to perform chemical potential optimization only. Refer to bootstrap embedding literatures.
nproc (int) – Total number of processors assigned for the optimization. Defaults to 1. When nproc > 1, Python multithreading is invoked.
ompnum (int) – If nproc > 1, ompnum sets the number of cores for OpenMP parallelization. Defaults to 4
max_space (int) – Maximum number of bootstrap optimizaiton steps, after which the optimization is called converged.
conv_tol (float) – Convergence criteria for optimization. Defaults to 1e-6
ebe_hf (float) – Hartree-Fock energy. Defaults to 0.0
- objfunc(xk)
Computes error vectors, RMS error, and BE energies.
If nproc (set in initialization) > 1, a multithreaded function is called to perform high-level computations.
- Parameters:
xk (list) – Current potentials in the BE optimization.
- Returns:
Error vectors.
- Return type:
list
- optimize(method, J0=None, trust_region=False)
Main kernel to perform BE optimization
- Parameters:
method (str) – High-level quantum chemistry method.
J0 (list of list of float, optional) – Initial Jacobian
trust_region (bool, optional) – Use trust-region based QN optimization, by default False
Quasi-Newton optimization
- class molbe.external.optqn.FrankQN(func, x0, f0, J0, trust=0.5, max_space=500)
Quasi Newton Optimization
Performs quasi newton optimization. Interfaces many functionalities of the frankestein code originaly written by Hong-Zhou Ye