Skip to content

Setting Hubbard projectors #1219

@liborvojacek

Description

@liborvojacek

When setting the Hubbard projectors for HubbardStructureData instance, one needs to first create a copy of the HubbardStructureData.Hubbard() object, set the projectors in this copy, then set the value of the HubbardStructureData.Hubbard to the modified object, which works correctly and is described in the tutorial:

hubbard = hubbard_structure.hubbard
hubbard.projectors = 'atomic' # default is 'ortho-atomic'
hubbard.formulation = 'dudarev' # already the default
hubbard_structure.hubbard = hubbard
print(HubbardUtils(hubbard_structure).get_hubbard_card())

However, quite unintuitively, it does not work to set the projectors directly like

hubbard_structure.hubbard.projectors = 'atomic'

after which the hubbard_structure.hubbard.projectors stay 'ortho-atomic', they haven't changed to 'atomic'.

This can cause confusion and bugs when the user believes he has set the projectors to the new value, while they didn't change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions