ZMP

class n2v.ZMP[source]

Bases: object

Methods Summary

generate_s_functional(lam, zmp_functional, …)

Generates S_n Functional as described in: https://doi.org/10.1002/qua.26400

zmp([opt_max_iter, opt_tol, lambda_list, …])

Performs ZMP optimization according to:

zmp_scf(lambda_list, zmp_functional, …)

Performs scf cycle Parameters: zmp_functional: options the penalty term. But others are not currently working except for Hartree penalty (original ZMP). ———-.

Methods Documentation

generate_s_functional(lam, zmp_functional, Cocca, Coccb, Da, Db)[source]

Generates S_n Functional as described in: https://doi.org/10.1002/qua.26400

zmp(opt_max_iter=100, opt_tol=1e-06, lambda_list=[70], zmp_mixing=1, print_scf=False)[source]

Performs ZMP optimization according to:

1) ‘From electron densities to Kohn-Sham kinetic energies, orbital energies, exchange-correlation potentials, and exchange-correlation energies’ by Zhao + Morrison + Parr. https://doi.org/10.1103/PhysRevA.50.2138

Additional DIIS algorithms obtained from: 2) ‘Psi4NumPy: An interactive quantum chemistry programming environment for reference implementations and rapid development.’ by Daniel G.A. Smith and others. https://doi.org/10.1021/acs.jctc.8b00286

Functionals that drive the SCF procedure are obtained from: https://doi.org/10.1002/qua.26400

lambda_list: list

List of Lamda parameters used as a coefficient for Hartree difference in SCF cycle.

zmp_mixing: float, optional

mixing in [0,1]. How much of the new potential is added in. For example, zmp_mixing = 0 means the traditional ZMP, i.e. all the potentials from previous smaller lambda are ignored. Zmp_mixing = 1 means that all the potentials of previous lambdas are accumulated, the larger lambda potential are meant to fix the wrong/inaccurate region of the potential of the sum of the previous potentials instead of providing an entire new potentials. default: 1

opt_max_iter: float

Maximum number of iterations for scf cycle

opt_tol: float

Convergence criteria set for Density Difference and DIIS error.

return:

The result will be stored in self.proto_density_a and self.proto_density_b For zmp_mixing==1, restricted (ref==1):

self.proto_density_a = sum_i lambda_i * (Da_i - Dt[0]) - 1/N * (Dt[0]) self.proto_density_b = sum_i lambda_i * (Db_i - Dt[1]) - 1/N * (Dt[1]);

unrestricted (ref==1):

self.proto_density_a = sum_i lambda_i * (Da_i - Dt[0]) - 1/N * (Dt[0] + Dt[1]) self.proto_density_b = sum_i lambda_i * (Db_i - Dt[1]) - 1/N * (Dt[0] + Dt[1]);

For restricted (ref==1):

vxc = int dr’

rac{self.proto_density_a + self.proto_density_b}{|r-r'|}

= 2 * int dr’

rac{self.proto_density_a}{|r-r'|};
for unrestricted (ref==2):

vxc_up = int dr’

rac{self.proto_density_a}{|r-r'|}

vxc_down = int dr’

rac{self.proto_density_b}{|r-r'|}.
To get potential on grid, one needs to do

vxc = self.on_grid_esp(Da=self.proto_density_a, Db=self.proto_density_b, grid=grid) for restricted; vxc_up = self.on_grid_esp(Da=self.proto_density_a, Db=np.zeros_like(self.proto_density_a),

grid=grid) for unrestricted;

zmp_scf(lambda_list, zmp_functional, maxiter, print_scf, D_conv)[source]

Performs scf cycle Parameters:

zmp_functional: options the penalty term. But others are not currently working except for Hartree penalty (original ZMP).