-
Notifications
You must be signed in to change notification settings - Fork 82
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
Hubbard data structure for handling newest QuantumESPRESSO versions (>=7.1
)
#849
Conversation
…esso into feature/data/hubbard
…ndard`-`background`, and others
Thanks a lot @bastonero! A couple of comments off the cuff:
Would these methods also be added to a different class? Some of the methods (e.g.
I think having the input of Cristiano and Iurii (maybe also Eric?) would be valuable here. I'll try to already set up an environment where they can start playing around with this class to give some feedback.
If the order is important, are there any alternatives for the internal data structure?
I guess it would be good to have some basic validation, so nothing breaks when they start to run with the structure. Have to check the specific methods though.
Good question. I'm considering if:
That said, I'm also wondering what you consider to be more "free" ^^
Typically, the questions you want to ask whether thinking database or repository are:
Considering the answer to the first question is probably "no" (or I'm missing a use case?), and the second is: potentially big, I'd lean towards storage in the repository. As for the format: YAML seems fine, but I guess we should consider some other options (how fast is the (de)serialization, is there a native format that QE supports so our storage is consistent, ...).
We'd need these for the project we have in mind, no? (i.e. ML for @muhrin) Format we should indeed discuss. |
Thanks a lot @bastonero .
After a quick look, I definitely feel that all the
Any particular ones that you had doubts about?
The order of the list should be guaranteed when going to and from the database. So that should not be a problem. In principle I don't see a problem with this structure.
I would be really restrictive and have tight checks. It would be really good if you define a very clear "schema" of what data it can the class can store. For starters, it should be very clear exactly what the valid data structure of
I agree with @mbercx , we are more or less stuck with the current interface of class HubbardStructureData(StructureData):
"""Structure data containing code independent info on Hubbard parameters."""
def __init__(
self,
cell: list[list[float]],
pbc: list[bool],
sites: list[list[str, list[float]]]
hubbard_parameters: list = None,
hubbard_projectors: str = "ortho-atomic",
):
self.cell = cell
self.pbc = pbc
self.hubbard_parameters = hubbard_parameters
self.hubbard_projectors = hubbard_projectors
self.sites = sites
@property
def sites(self):
return super().sites
@sites.setter
def sites(self, values):
for kind_name, position in values:
self.append_atom(name=kind_name, position=position) I haven't tested this, but I think you get the gist.
If you don't think a user would ever query for this, yes, probably go with the repo. But I think it might actually have very queryable data no? Also, shouldn't typically be larger than storing all positions of a structure with a medium amount of atoms and those are stored in database. So might just keep it there for now.
Which occupations? |
Thank you @mbercx and @sphuber for the comments.
Thus you mean we should define a
Me and @mbercx discussed yesterday about this. We will make try Iurii and Cristiano to see if the choices seem appropriate with what is used in the DFT community.
I was thinking that having list of list could make queries hard? Better having dictionaries?
To comment and recap again upon this. The issue right now is that the As an example: cell = [[1,0,0],[0,1,0],[0,0,1]]
pbc = [True,True,True]
sites = [
{
'symbol':'Fe',
'position':[0,0,0],
'mass':70,
'spin':1, # to discuss eventually
'hubbard_parameters': {
'manifold':'3d',
'neighbour_index':0,
'neighbour_manifold:'3d',
'value':5.0,
'translation_vector':[0,0,0],
'type':'dudarev',
},
'charge':None,
'extra_property_1':value_1,
'extra_property_2':value_2,
# ...
},
{
'symbol':'Fe',
'position':[0.5,0,0],
'mass':70,
'spin':-1,
'hubbard_parameters': {
'manifold':'3d',
'neighbour_index':1,
'neighbour_manifold:'3d',
'value':5.0,
'translation_vector':[0,0,0],
'type':'dudarev',
},
'charge':+4,
'extra_property_1':value_1,
'extra_property_2':value_2,
# ...
},
# ...
] This structure would also allow for automatic generation of the infamous From here, we can then move to the next question:
Would the proposed structure for the new possible
If this new structure of the data could work, then we could think to go for this completely new |
I pin here @giovannipizzi, @sphuber, @mbercx, @muhrin, @zooks97 for opinions and comments (please, just see the above comment, or the entire discussion - it is rather urgent). I had a look into the implementation of the current StructureData. What I am proposing is essentially the same that is already there, except the fact that symbols and masses are defined now in the infamous I think that, if the above proposal is what is actually desirable and we would agree, then we can momentarily "copy/paste" the entire class from aiida-core, remove the |
c04c5f0
to
d1e2808
Compare
8350849
to
ed2b1d4
Compare
ed2b1d4
to
ae1dbe8
Compare
…iida-quantumespresso into feature/data/hubbard
…ndard`-`background`, and others
|
||
class Hubbard(HubbardProjectors): | ||
"""Class for complete description of Hubbard interactions.""" | ||
hubbard_parameters: List[HubbardParameters] # only `parameters`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here: hubbard_parameters
or just hubbard
? Or something else?
neighbour_index: conint(strict=True) | ||
neighbour_manifold: constr(strip_whitespace=True, to_lower=True, min_length=2, max_length=5) | ||
translation_vector: List[conint(strict=True)] | ||
hubbard_value: float # just `value`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we validate with PositiveFloat
? Or too restrictive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bastonero . Great PR, really clean and understandable code. Just some minor suggestions and questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left two more minor comments that I just came across. But I think this is good to go. @bastonero could you please update the branch, fix the failing docs build and write a final message for the commit (you can just update the original PR description with a description that is up to date). Then just make it a real PR from draft and I will approve and merge
7.1
)
7.1
)7.1
)
Fantastic, thanks a lot @bastonero ! |
QuantumESPRESSO implements a new syntax for Hubbard input starting from
v7.1
onward.The
pw.x
now needs a newCARD
in the input file.We introduce the following new modules:
common.hubbard
: it contains a code, structure agnostic data class describing Hubbard information, such as parameters, projectors, formulation.data.hubbard_structure
: it contains a new code agnostic aiida DataType, theHubbardStructureData
, for handling Hubbard information along with its associated StructureData.utils.hubbard
: a specific, dedicated QuantumESPRESSO utility module for handling and manipulatingHubbardStructureData
.The new data class and aiida data type implement Hubbard information in an agnostic manner, meaning they can be shared among other codes, and they have no constraints for our particular plugin implementation. This is handled through the new
utils.hubbard
module.