You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's add an option --smear-function or something that can be either a word (e.g. "gaussian", "lorentzian", etc.) or a function in the case of the Python API.
To implement the arbitrary function:
Check that the user is imputing the function from the Python API only (morphpy.py). This should be fairly easy since the CLI input will be a string, while the Python function will be an actual function. Check for edge chases (e.g. if a user somehow can input a non-string in the CLI as input.)
Check if the input is a string or function. If it is a string, then run the code as usual. If it is a function, set the smearing function to be the user-passed function.
Check that the user-provided function is normalizable. E.g. the L1 or L2 norm is bounded. This is important as we normalize by the L1 norm of the function. I'm actually not too sure this is necessary as we normalize by the sum of the function over the xmin to xmax range the user provides, meaning divergences at infinity are not a concern, but it is still something to think about. We ABSOLUTELY need to ensure the function is well-defined in all points between xmin and xmax though.
Ensure self-consistency. If the program returns +/-sigma, make sure reading in +/-sigma do the same thing. (E.g. for the Lorentzian, +/-sigma/((r-r_0)2+sigma2) are not the same.
@sbillinge I'm writing the one for Lorentzian since I would like to use it. The second part (letting the user pass an arbitrary function to be smeared) I will probably not work on, so a new person can feel free to take a crack at it.
Edit: I put some notes on how this arbitrary function should be implemented.
Activity
Sparks29032 commentedon Sep 30, 2025
Moved to 0.4.0 release.
sbillinge commentedon Sep 30, 2025
I moved to backburner. Let's wait for a request.
Sparks29032 commentedon Jul 8, 2026
I am requesting this for comparing DOS curves at different temperatures (Lorentzian broadening).
sbillinge commentedon Jul 9, 2026
I moved it back to 0.5.0 release. Do you want to do it @Sparks29032 or shall we give it to one of the new people?
Sparks29032 commentedon Jul 9, 2026
@sbillinge I'm writing the one for Lorentzian since I would like to use it. The second part (letting the user pass an arbitrary function to be smeared) I will probably not work on, so a new person can feel free to take a crack at it.
Edit: I put some notes on how this arbitrary function should be implemented.