Fold2bloch and spin orbit coupling

Dear all,
I am new to Abinit and I would like to use Fold2bloch to unfold the band structures with and without spin-orbit coupling (SOC).

For the non-SOC calculations, everything looks ok, but in the case of SOC, I encounter some problems.

When plotting the ncfile, I get the following error:
“IndexError: index 1 is out of bounds for axis 0 with size 1 abipy”

which points to the following line of the code:
ys = self.uf_eigens[spin, p.ikfound, :] - e0

My question is, can I use Fold2bloch when SOC is applied?
I would appreciate any help regarding this issue.

Here is my input file:

Si Supercell

ndtset 2

#Dataset 2 : the band structure
iscf2 -2
getden2 -1
kptopt2 -2
ndivsm 15
kptbounds
-0.50 0.00 -0.50
0.00 0.00 0.00
0.50 0.00 0.50

tolwfr2 1.0d-12
enunit2 1
nband2 74

######################################################################
#Common input variables

chkprim 0
pp_dirpath “./”
pseudos “si_pbe_v1_abinit.paw”

pawspnorb 1
nspinor 2
kptopt1 4

#Definition of the atoms
natom 16
ntypat 1
typat
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1
znucl 14
xred
0.3750000000 0.3750000000 0.3750000000
0.3750000000 0.3750000000 0.8750000000
0.3750000000 0.8750000000 0.3750000000
0.3750000000 0.8750000000 0.8750000000
0.8750000000 0.3750000000 0.3750000000
0.8750000000 0.3750000000 0.8750000000
0.8750000000 0.8750000000 0.3750000000
0.8750000000 0.8750000000 0.8750000000
0.2500000000 0.2500000000 0.2500000000
0.2500000000 0.2500000000 0.7500000000
0.2500000000 0.7500000000 0.2500000000
0.2500000000 0.7500000000 0.7500000000
0.7500000000 0.2500000000 0.2500000000
0.7500000000 0.2500000000 0.7500000000
0.7500000000 0.7500000000 0.2500000000
0.7500000000 0.7500000000 0.7500000000
acell 1.0 1.0 1.0
rprim
12.6570011470 0.0000000000 7.3075230194
4.2190003823 11.9331351207 7.3075230194
0.0000000000 0.0000000000 14.6150460387

#Numerical parameters of the calculation : planewave basis set and k point grid
ecut 20.0 # Maximum kinetic energy cutoff (Hartree)
pawecutdg 40 # PAW - Energy CUToff for the Double Grid
ngkpt 4 4 4 # 3x2x1 Monkhorst-Pack grid
nshiftk 1 # Use one copy of grid only (default)
shiftk 0.0 0.0 0.0 # Unshifted K-mesh
npband 74
#Parameters for the SCF procedure
diemac 9.0 # Model dielectric preconditioner
nstep 100 # Maximum number of SCF iterations
tolvrs 1.0d-6 # tolerance for potential residual

Thank you,
Moloud

Hi Moloud,

it definitely should work. Looks like there is a bug in abipy, and nss should be 1 for spinorial unpolarized SOC wavefunctions. @gmatteo do you agree?
https://abinit.github.io/abipy/_modules/abipy/electrons/fold2bloch.html
Line

self.nss = max(self.nsppol, self.nspinor)

should be

self.nss = self.nsppol