Skip to content

Commit 1e05053

Browse files
authored
Ensure UNK* files are passed to Wannier90 when plotting Wannier functions (#248)
1 parent 69ce4dd commit 1e05053

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/koopmans/workflows/_wannierize.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ def _run(self) -> None:
440440
# 2) standard pw2wannier90 calculation
441441
calc_p2w: calculators.PW2WannierCalculator = self.new_calculator('pw2wannier', spin_component=self.block.spin)
442442
calc_p2w.prefix = 'pw2wannier90'
443+
if calc_w90_pp.parameters.wannier_plot:
444+
# If we want to plot the Wannier functions, we need to write the UNK files
445+
calc_p2w.parameters.write_unk = True
443446
calc_p2w.link(self.pw_outdir, calc_p2w.parameters.outdir, symlink=True)
444447
calc_p2w.link(File(calc_w90_pp, calc_w90_pp.prefix + '.nnkp'), calc_p2w.parameters.seedname + '.nnkp')
445448
status = self.run_steps(calc_p2w)
@@ -451,8 +454,14 @@ def _run(self) -> None:
451454
self.new_calculator(calc_type, init_orbitals=init_orbs,
452455
bands_plot=self.parameters.calculate_bands, **self.block.w90_kwargs)
453456
calc_w90.prefix = 'wannier90'
457+
458+
# Link the pw2wannier90 output files
454459
for ext in ['.eig', '.amn', '.mmn']:
455460
calc_w90.link(File(calc_p2w, calc_p2w.parameters.seedname + ext), calc_w90.prefix + ext, symlink=True)
461+
if calc_w90.parameters.wannier_plot:
462+
for src in File(calc_p2w, '.').glob('UNK*'):
463+
calc_w90.link(src, src.name, symlink=True)
464+
456465
status = self.run_steps(calc_w90)
457466
if status != Status.COMPLETED:
458467
return

0 commit comments

Comments
 (0)