WuYang

class n2v.WuYang[source]

Bases: object

Performs Optimization as in: 10.1063/1.1535422 - Qin Wu + Weitao Yang

lambda_rgl: {None, float}. If float, lambda-regularization is added with lambda=lambda_rgl.

Attributes Summary

lambda_reg

regul_norm

Methods Summary

find_regularization_constant_wy(opt_max_iter)

Finding regularization constant lambda.

gradient_wy(v)

Calculates gradient wrt target density Equation (11) of main reference

hessian_wy(v)

Calculates gradient wrt target density Equation (13) of main reference

lagrangian_wy(v)

Lagrangian to be minimized wrt external potential Equation (5) of main reference

wuyang(opt_max_iter[, reg, tol, gtol, …])

Calls scipy minimizer to minimize lagrangian.

Attributes Documentation

lambda_reg = None
regul_norm = None

Methods Documentation

find_regularization_constant_wy(opt_max_iter, opt_method='trust-krylov', gtol=0.001, tol=None, opt=None, lambda_list=None)[source]

Finding regularization constant lambda.

Note: it is recommend to set a specific convergence criteria by opt or tol,

in order to control the same convergence for different lambda value.

After the calculation is done, one can plot the returns to select a good lambda.

opt_max_iter: int

maximum iteration

opt_method: string default: “trust-krylov”

opt_methods available in scipy.optimize.minimize

tol: float

Tolerance for termination. See scipy.optimize.minimize for details.

gtol: float

gtol for scipy.optimize.minimize: the gradient norm for convergence

opt: dictionary, optional
if given:

scipy.optimize.minimize(method=opt_method, options=opt).

Notice that opt has lower priorities than opt_max_iter and gtol.

lambda_list: np.ndarray, optional

A array of lambda to search; otherwise, it will be 10 ** np.linspace(-1, -7, 7).

lambda_list: np.ndarray

A array of lambda searched.

P_list: np.ndarray

The value defined by [Bulat, Heaton-Burgess, Cohen, Yang 2007] eqn (21). Corresponding to lambda in lambda_list.

Ts_list: np.ndarray

The Ts value for each lambda.

gradient_wy(v)[source]

Calculates gradient wrt target density Equation (11) of main reference

hessian_wy(v)[source]

Calculates gradient wrt target density Equation (13) of main reference

lagrangian_wy(v)[source]

Lagrangian to be minimized wrt external potential Equation (5) of main reference

wuyang(opt_max_iter, reg=None, tol=1e-07, gtol=0.001, opt_method='trust-krylov', opt=None)[source]

Calls scipy minimizer to minimize lagrangian.