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

adding nbands_factor logic into PdosWorkChain #1044

Merged
Prev Previous commit
Next Next commit
including logic if scf is present
AndresOrtegaGuerrero committed Nov 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 88214e6395cae27c56d2f2baebc168fa2877301e
20 changes: 11 additions & 9 deletions src/aiida_quantumespresso/workflows/pdos.py
Original file line number Diff line number Diff line change
@@ -431,20 +431,22 @@ def run_nscf(self):
inputs = AttributeDict(self.exposed_inputs(PwBaseWorkChain, 'nscf'))
if 'scf' in self.inputs:
inputs.pw.parent_folder = self.ctx.scf_parent_folder

if 'nbands_factor' in self.inputs:
factor = self.inputs.nbands_factor.value
parameters = self.ctx.workchain_scf.outputs.output_parameters.get_dict()
nbands = int(parameters['number_of_bands'])
nelectron = int(parameters['number_of_electrons'])
nbnd = max(int(0.5 * nelectron * factor), int(0.5 * nelectron) + 4, nbands)
inputs.pw.parameters['SYSTEM']['nbnd'] = nbnd

else:
inputs.pw.parameters['SYSTEM']['nbnd'] = self.ctx.workchain_scf.outputs.output_parameters['number_of_bands']
inputs.pw.structure = self.inputs.structure

inputs.metadata.call_link_label = 'nscf'

if 'nbands_factor' in self.inputs:
factor = self.inputs.nbands_factor.value
parameters = self.ctx.workchain_scf.outputs.output_parameters.get_dict()
nbands = int(parameters['number_of_bands'])
nelectron = int(parameters['number_of_electrons'])
nbnd = max(int(0.5 * nelectron * factor), int(0.5 * nelectron) + 4, nbands)
inputs.pw.parameters['SYSTEM']['nbnd'] = nbnd

else:
inputs.pw.parameters['SYSTEM']['nbnd'] = self.ctx.workchain_scf.outputs.output_parameters['number_of_bands']

inputs = prepare_process_inputs(PwBaseWorkChain, inputs)


Unchanged files with check annotations Beta

hubbard_structure = HubbardStructureData.from_structure(structure)
if is_intersite_hubbard(orig_structure.hubbard):
raise NotImplementedError('Intersite Hubbard parameters are not yet supported.')

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

GitHub Actions / tests (3.8)

Intersite Hubbard parameters are not yet supported.

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

GitHub Actions / tests (3.9)

Intersite Hubbard parameters are not yet supported.

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

GitHub Actions / tests (3.10)

Intersite Hubbard parameters are not yet supported.

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

GitHub Actions / tests (3.11)

Intersite Hubbard parameters are not yet supported.
for parameter in orig_structure.hubbard.parameters:
hubbard_structure.initialize_onsites_hubbard(