aiidateam / aiida-quantumespresso-hp

MIT License
3 stars 0 forks source link

Allow relaxations with 'ortho-atomic' projection of orbitals #8

Closed MackeEric closed 3 years ago

MackeEric commented 3 years ago

Just a minor thing: Since as of v6.6 pw.x is able to calculate forces and stresses for ortho-atomic projectors too, relaxations can be performed with the flag U_projection_type set to 'ortho-atomic'.

Therefore, in the hubbard.py workchain we should stop enforcing the 'atomic' default as it is done right now (see code below). For example, we could change the defaults.u_projection_type_relax attribute to become a list of allowed projection types and move the

parameters['SYSTEM']['u_projection_type'] = self.defaults.u_projection_type_relax inputs.base.pw.parameters = orm.Dict(dict=parameters)

block behind the if-condition.

        u_projection_type_relax = parameters['SYSTEM'].get('u_projection_type', self.defaults.u_projection_type_relax)

        parameters['SYSTEM']['u_projection_type'] = self.defaults.u_projection_type_relax
        inputs.base.pw.parameters = orm.Dict(dict=parameters)
        inputs.metadata.call_link_label = 'iteration_{:02d}_relax'.format(self.ctx.iteration)

        if u_projection_type_relax != self.defaults.u_projection_type_relax:
            self.report(
                f'warning: you specified `u_projection_type = {u_projection_type_relax}` in the input parameters, but '
                r'this will crash pw.x, changing it to `{self.defaults.u_projection_type_relax}`'
            )
MackeEric commented 3 years ago

This issue has been explained again in #12 . Sorry for the double-posting