dipc-cc / hubbard

Python tools for mean-field Hubbard models
https://dipc-cc.github.io/hubbard/
GNU Lesser General Public License v3.0
21 stars 8 forks source link

enh: added option to smooth LDOS grid with Gaussian smoothing from sisl #123

Closed sofiasanz closed 2 years ago

sofiasanz commented 2 years ago

Added possibility to smooth the real space grid with Gaussian smoothing for LDOS plots.

zerothi commented 2 years ago

Just an idea, you could let smooth be a dict which contains the arguments for the function, then you don't need to think too much about additional parameters?

sofiasanz commented 2 years ago

Just an idea, you could let smooth be a dict which contains the arguments for the function, then you don't need to think too much about additional parameters?

Yes I like it! You can see my implementation in commit cf3d5ec.

sofiasanz commented 2 years ago

I see! Yes that is much better :-)

sofiasanz commented 2 years ago

But if the user doesn't pass any arguments for smooth then it assumes r=0, no? And then it doesn't have the smoothing effect, no?

sofiasanz commented 2 years ago

Otherwise it can just first check if the smooth dictionary is empty or not.

zerothi commented 2 years ago

But if the user doesn't pass any arguments for smooth then it assumes r=0, no? And then it doesn't have the smoothing effect, no?

No, it will use the default values, https://zerothi.github.io/sisl/api/generated/sisl.Grid.html?highlight=smooth#sisl.Grid.smooth

Remember that kwargs for a zero length dict is effectively passing no arguments. I think it is safest to check whether the argument exist (checking the length would not allow users to use default values).

sofiasanz commented 2 years ago

I see. Forgot to check which were the default values of the method. Thanks!

Remember that kwargs for a zero length dict is effectively passing no arguments. I think it is safest to check whether the argument exist (checking the length would not allow users to use default values).

I just saw again what you wrote in https://github.com/dipc-cc/hubbard/pull/123#commitcomment-69471285, didn't see the first line before hehe