Skip to content

Commit

Permalink
SOF-7417: fix non-colin nspins for bandstructure plot
Browse files Browse the repository at this point in the history
  • Loading branch information
pranabdas committed Aug 5, 2024
1 parent 9c2356a commit 001bdb9
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ class BandStructure(TwoDimensionalPlotProperty):

def __init__(self, name, parser, *args, **kwargs):
super(BandStructure, self).__init__(name, parser, *args, **kwargs)
self.nspins = self.parser.nspins()
# there could be three possibilities for nspins:
# (1) non-magnetic ==> nspins = 1
# (2) collinear magnetic (LSDA) ==> nspins = 2
# (3) non-collinear magnetic ==> nspins = 4
# Prior to Quantum ESPRESSO version 6.4, the XML output contains tag
# NUMBER_OF_SPIN_COMPONENTS, which is set to 4 for non-collinear case,
# and we return the same for versions above 6.4 if noncolin is True.
# However, for non-collinear magnetic case there are one eigenvalue per
# k-pont. Here we override nspins for non-collinear case.
self.nspins = self.parser.nspins() if self.parser.nspins() != 4 else 1

self.eigenvalues_at_kpoints = self.parser.eigenvalues_at_kpoints()
if kwargs.get("remove_non_zero_weight_kpoints", False):
Expand Down

0 comments on commit 001bdb9

Please sign in to comment.