Create helper routines for number of electrons per states and conversion from k-point to spin index
As mentioned by @AlexBuccheri !2325, it would be good to introduce small functions to avoid explicit code for number of electrons per states and conversion from k-point to spin index.