lxvm / AutoBZ.jl

Automatic and adaptive BZ integration for electronic properties
https://lxvm.github.io/AutoBZ.jl/
MIT License
3 stars 1 forks source link

[BREAKING] V0.4 #24

Closed lxvm closed 9 months ago

lxvm commented 9 months ago

This pr is breaking because it makes all parameters into keyword arguments. The usage is reflected in tests and the docs, and the main advantage is that all parameters are treated in the same way, whereas before there was a distinction between positional and keyword parameters. They can be optionally provided to the integrand constructor and handled consistently with clear precedence relations, which ends up simplifying lots of code.

I did this so that the self energy could be a parameter instead of a positional argument, which clarified how canonical initialization parameters have lower precedence than constructor parameters, which are already lower precedence than the solve-time parameters.

The previous behavior could not cope with mixed canonical parameters and constructor parameters, which made the implementation less robust to different types of user input and less flexible since the order of parameters was fixed.

However, users now have to call their solvers with keyword arguments all of the time. This includes calls to batchsolve for which the keyword parameter vectors can be constructed with paramzip and paramproduct.

This pr also allows the user to pass in an auxiliary function to the auxiliary integrand constructor to control the behavior.

Also, the step size for AutoPTR is now computed more rigorously by estimating the strip of analyticity as 2pi*eta/v/T where v is the L2 norm of the gradient of H and T is the period of the Hamiltonian. The estimate is always performed for the scattering, eta determined from self energy at the Fermi energy