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

Bug fix in projwfc calculator #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/koopmans/calculators/_projwfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def generate_dos(self) -> GridDOSCollection:
# The filename does not encode the principal quantum number n. In order to recover this number, we compare
# the reported angular momentum quantum number l against the list of expected orbitals, and infer n
# assuming only that the file corresponding to nl will come before (n+1)l
orbitals = copy.copy(self._expected_orbitals[atom.symbol])
label = atom.symbol + str(atom.tag) if atom.tag > 0 else atom.symbol
orbitals = copy.copy(self._expected_orbitals[label])
for filename in filenames:
# Infer l from the filename
subshell = filename.name[-2]
Expand Down
7 changes: 4 additions & 3 deletions src/koopmans/pseudopotentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,15 @@ def expected_subshells(atoms: Atoms, pseudopotentials: Dict[str, str],

expected_orbitals = {}
for atom in atoms:
if atom.symbol in expected_orbitals:
label = atom.symbol + str(atom.tag) if atom.tag > 0 else atom.symbol
if label in expected_orbitals:
continue
pseudo_file = pseudopotentials[atom.symbol]
pseudo_file = pseudopotentials[label]
z_core = atom.number - valence_from_pseudo(pseudo_file, pseudo_dir)
if z_core in z_core_to_first_orbital:
first_orbital = z_core_to_first_orbital[z_core]
else:
raise ValueError(f'Failed to identify the subshells of the valence of {pseudo_file}')
all_orbitals = list(z_core_to_first_orbital.values()) + ['5d', '6p', '6d']
expected_orbitals[atom.symbol] = sorted(all_orbitals[all_orbitals.index(first_orbital):])
expected_orbitals[label] = sorted(all_orbitals[all_orbitals.index(first_orbital):])
return expected_orbitals
Loading