fermisurfaces/IFermi

decimation not working as expected.

mdforti opened this issue · 10 comments

I am sorry if this is not the place but I can not create a new account at the support forum:

New registrations are not allowed from your IP address (maximum limit reached). Contact a staff member.

I need to ask something about the surface smoothing and increasing number of faces in the surface. My objective is to smooth the surface at the plot without open3d.
I cant get the surface smooth and decimator_method to work. whatever values I use for thee options the results are allways the same.
at some point I got a warning for 'decimation need open3d' but after installing this requirement I get planar surfaces as shown in the figure 'with open3d', instead of expected result. I would appreciate a clue about to where to start debugging.

whithout open3d:
without open3d

with open3d:
with open3d

utf commented

Hi @mdforti, can I just check what version of IFermi you're using? I fixed some bugs with decimation in versions 0.2.4 and 0.2.5 released earlier this year.

pip says it installed 0.3.0. there is a big chance I am making the mistakes also. also note that to be able to install open3d I had to use python 3.8 which can also be causing issues.

utf commented

Ok. To get smoother surfaces you should try increasing the interpolation factor for Fourier interpolation. Decimation will do the opposite - it will make the surfaces less smooth (fewer faces). The smoothing option isn't well tested. The preferred option is to just increase the interpolation factor.

utf commented

For example, the README example code is:

interpolator = FourierInterpolator(bs)
dense_bs = interpolator.interpolate_bands()

This could be changed to:

interpolator = FourierInterpolator(bs)
dense_bs = interpolator.interpolate_bands(interpolation_factor=50)

You can try increasing the interpolation factor even more than that.

Please let me know if this works for you.

Aaah ok I was getting decimation completely wrong then. I was interpreting the help, which says 'if decimation factor is a float then it si the factor to reduce the number of faces', then tested decimation factors < 1. now I see it.
thank you very much for the clarification !

utf commented

Great! Do you have smooth surfaces now?

yes, its working now !
however to tell you the truth, interpolation factor beyound 10 really puts strain on my laptop which is an i7. what might I be doing wrong ?
just tested: interpolation factor of 15 crashes the execution.

utf commented

Hmm if your band structure has a lot of bands then it may be doing a lot of unnecessary interpolation (only bands near the valence/conduction/Fermi level need to be included). In that case you can use the trim_bandstructure function which will remove excess bands: https://fermisurfaces.github.io/IFermi/ifermi.html#ifermi.interpolate.trim_bandstructure. E.g.,

from ifermi.interpolate import trim_bandstructure

bs_trim = trim_bandstructure(1.5, bs)
interpolator = FourierInterpolator(bs_trim)
dense_bs = interpolator.interpolate_bands(interpolation_factor=15)

That should make the interpolation easier.

Is interpolation_factor=10 still very blocky?

you are partly correct, I have many bands above the cbm and considerable amount below vbm so I guess I can remove them.

utf commented

I'm closing this issue but feel free to re-open if you have more questions.