Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency fatbandsplot polarized and spin-orbit case #853

Open
rreho opened this issue Oct 25, 2024 · 8 comments
Open

Inconsistency fatbandsplot polarized and spin-orbit case #853

rreho opened this issue Oct 25, 2024 · 8 comments

Comments

@rreho
Copy link

rreho commented Oct 25, 2024

Describe the bug
I tested the FatBandsPlot for polarized and spin-orbit calculation on the same system. The spin-orbit case seems to work correctly, while for polarized calculation it appears as the bands and the projection are shifted by a constant value (which might be the Fermi).

Code to reproduce problem

Emin, Emax = -10,10
fatbands_soc = band_struct_soc.plot.fatbands(bands_style= {'color': 'black', 'opacity': 1, 'width': 1},Erange=[Emin,Emax],fatbands_scale=0.2,fatbands_mode='area_line',backend='matplotlib')
fatbands_soc.update_settings(
    groups = [
    {"species": "O", "color": "red"},
    ]
)
data_soc = fatbands_soc.nodes['bands_data'].get()

Emin, Emax = -10,10
fatbands_pol = band_struct_pol.plot.fatbands(bands_style= {'color': 'black', 'opacity': 1, 'width': 1},Erange=[Emin,Emax],fatbands_scale=0.2,fatbands_mode='area_line',backend='matplotlib')
fatbands_pol.update_settings(
    groups = [
    {"species": "O", "color": "red"},
    ]
)
data_pol = fatbands_pol.nodes['bands_data'].get()

With this code I can produce the following two plots (first one with SOC, second polarized) with internal sisl.viz routines :
STO_soc_bands

STO_collinear_bands

Thanks for your help

Version details
Run the below code and add to bug-report:

[sys]
3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:45:13) [Clang 16.0.6 ]
version                       0.15.0
path                          /Users/Reho0001/opt/anaconda3/envs/aiida-2024/lib/python3.11/site-packages/sisl
CC                            /Library/Developer/CommandLineTools/usr/bin/clang
CFLAGS                        -O3 -DNDEBUG
C version                     12.0.0.12000032
FC                            /usr/local/bin/gfortran
FFLAGS                        -O3
FC version                    11.3.0
cython build version          Cython version 3.0.11
numpy build version           2.1.2
[cmake_args]
CMAKE_BUILD_TYPE              Release
WITH_FORTRAN                  ON
WITH_COVERAGE                 OFF
WITH_LINE_DIRECTIVES          OFF
WITH_ANNOTATE                 OFF
WITH_GDB                      OFF
NO_COMPILATION                
[runtime modules]
numpy                         1.26.4
scipy                         1.14.0
xarray                        2024.7.0
netCDF4                       1.7.1.post2
pandas                        2.2.2
matplotlib                    3.9.2
dill                          0.3.8
pathos                        0.3.2
skimage                       0.24.0
plotly                        5.23.0
ase                           3.23.0
pymatgen                      not found
                              module 'pymatgen' has no attribute '__version__'
[env]
pip                           numpy==1.26.4 scipy==1.14.0 xarray==2024.7.0 netCDF4==1.7.1.post2 pandas==2.2.2 matplotlib==3.9.2 dill==0.3.8 pathos==0.3.2 scikit-image==0.24.0 plotly==5.23.0 ase==3.23.0
conda                         numpy==1.26.4 scipy==1.14.0 xarray==2024.7.0 netCDF4==1.7.1.post2 pandas==2.2.2 matplotlib==3.9.2 dill==0.3.8 pathos==0.3.2 scikit-image==0.24.0 plotly==5.23.0 ase==3.23.0
@zerothi
Copy link
Owner

zerothi commented Oct 25, 2024

Could you try the development version of sisl, this should have been fixed in:
#833

@rreho
Copy link
Author

rreho commented Oct 25, 2024

thanks @zerothi. The problem mentioned has been fixed with the latest development version of the code.
However, I can say that fatbands_mode = "scatter/line" don't produce a plot.
I am aware that this was already a problem in the past, not sure if we plan to fix it in the future or if it has been fixed already.

@zerothi
Copy link
Owner

zerothi commented Oct 25, 2024

So you are saying that the problem in #799 hasn't fully been fixed? @pfebrer can perhaps fill in some details here...

@pfebrer
Copy link
Contributor

pfebrer commented Oct 25, 2024

Hmm indeed it should be solved 😅 Could you provide the files and code needed to reproduce?

@zerothi
Copy link
Owner

zerothi commented Nov 7, 2024

@rreho what's the status here? Can we close?

@rreho
Copy link
Author

rreho commented Nov 7, 2024

The problem with fatbands_mode=scatter/line not producing a plot persists, at least for me. Hence, issue #799 has not been fully fixed.
The code and files to reproduce the error should be downloadable from #799

@zerothi
Copy link
Owner

zerothi commented Nov 7, 2024

@rreho thanks for the extra details! We'll keep it open.

@pfebrer
Copy link
Contributor

pfebrer commented Nov 7, 2024

Ok, I can reproduce that #799 has not been fully fixed for the matplotlib backend. It works in plotly for me though.
I am fixing the matplotlib bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants