Skip to content

Fixing Hubbard formulation - #1224

Merged
t-reents merged 4 commits into
aiidateam:mainfrom
t-reents:fix/1220_hubbard_formulation
Aug 14, 2026
Merged

Fixing Hubbard formulation#1224
t-reents merged 4 commits into
aiidateam:mainfrom
t-reents:fix/1220_hubbard_formulation

Conversation

@t-reents

@t-reents t-reents commented Dec 5, 2025

Copy link
Copy Markdown
Member

Addresses #1220

@bastonero I applied the fix as discussed in the issue. Moreover, I also added "ALPHA" to the supported values. Please have a look whether my understanding/logic for the dudarev formulation was correct.

One additional aspect:

I was wondering, do we actually need this check here:

if hubbard.formulation not in ['dudarev', 'liechtenstein']:
raise ValueError(f'Hubbard formulation {hubbard.formulation} is not implemented.')

Isn't this automatically validated in:

formulation: Literal['dudarev', 'liechtenstein'] = 'dudarev'
"""Hubbard formulation used. Allowed values are: 'dudarev', `liechtenstein`."""

@t-reents
t-reents requested a review from bastonero December 5, 2025 13:59
@t-reents t-reents linked an issue Dec 5, 2025 that may be closed by this pull request

@bastonero bastonero left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot @t-reents. would you be a lamb and add a little test when actually using the liechtenstein "keyword"?

"""Value of the Hubbard parameter, expessed in eV."""

hubbard_type: Literal['Ueff', 'U', 'V', 'J', 'B', 'E2', 'E3']
hubbard_type: Literal['Ueff', 'U', 'V', 'J', 'B', 'E2', 'E3', 'ALPHA']

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also add J0? https://www.quantum-espresso.org/Doc/INPUT_PW.html#id329
this should be the one used in liechtensteain

@bastonero

Copy link
Copy Markdown
Collaborator

re the ValueError: yeah, in principle it can be removed the check. it was put there in case we wanted to have other formulations (don't even know if there are so many others...), so that we didn't need to modify. but agreed it is currently unnecessary

@t-reents

Copy link
Copy Markdown
Member Author

Ciao @bastonero !

Apologies, it obviously took my half a year to look into it again..

I should have addressed all your comments in ea518ed.
Could I kindly ask you for a review?

P.S.: In general, since I'm now trying to take care of the maintenance (since @mbercx left 😢), are you still available for Hubbard related questions/reviews, or are you no longer working on any of these tools? Just to know :)

@bastonero bastonero left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @t-reents ! I think all in good shape. Just a comment, but not nothing really needed. I think we can merge this as is.

Re maintainance/hubbard related things: I now left Bremen and my new position is not particularly devoted to the maintainance of the plugin, although i am very happy to keep it going with some reviews, especially for the Hubbard side. Just ping me, and I'll let you know if in that specific moment i have time or not to do the review.

if hubbard.formulation == 'dudarev':
if param.hubbard_type == 'J':
pre = 'J'
if param.hubbard_type in ['J', 'J0', 'ALPHA']:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure what's more consistent with the Dudarev formulation, since I have never effectively used J (but only Ueff = U-J). I suppose we can leave this "open" to the user, and worst case QE will throw some error. Somehow as with pw.x, we do not want to do input checks on our side (at least, just the basics). So i guess for the time being this is fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I wasn't a 100% myself, as I'm also not a heavy user of the Hubbard part, but converged to this solution with Claude. I will indeed leave it as is and we can always come back. Thanks!

@t-reents

Copy link
Copy Markdown
Member Author

Re maintainance/hubbard related things: I now left Bremen and my new position is not particularly devoted to the maintainance of the plugin, although i am very happy to keep it going with some reviews, especially for the Hubbard side. Just ping me, and I'll let you know if in that specific moment i have time or not to do the review.

OK, great – thank you! Indeed, my main idea was to potentially ping you for the Hubbard related aspects, since you have a lot of expertise there, and potentially ask you for a review. Other than that, I think that the maintenance work should be fine on our side.

Btw, all the best of course for the next chapter!!

@t-reents
t-reents merged commit c84362d into aiidateam:main Aug 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'liechtenstein' Hubbard formulation

2 participants