aiidateam / aiida-quantumespresso-hp

MIT License
3 stars 0 forks source link

Tracking provenance of Hubbard node #21

Closed aim137 closed 1 year ago

aim137 commented 2 years ago

I could not find a way to pass a hubbard node as input to SelfConsistentHubbardWorkChain in a way such that the provenance of those Hubbard parameters was tracked (as one would do with a structure node, for instance).

The use case I have in mind is running one SelfConsistentHubbardWorkChain with a given grid of q-points, and doing a final check with a finer q-grid (another instance of SelfConsistentHubbardWorkChain) to see whether the calculated value of U is well converged with respect to q-sampling. I used the following to pass the Hubbard parameters calculated by the first WC to the second one, however provenance wasn't tracked.

#node 9415 is the hubbard node, output of the first WC, as seen in `Verdi node show <WC_node>`:
Outputs      PK  Type
---------  ----  -------------
hubbard    9415  Dict
structure  9419  StructureData

#Loading the node and doing:
result_hubbard = load_node(9415)   
builder = SelfConsistentHubbardWorkChain.get_builder()
builder.structure = structure
builder.hubbard_u=Dict(dict={
  result_hubbard.get_dict()['sites'][0]['kind']:float(result_hubbard.get_dict()['sites'][0]['value']),
  result_hubbard.get_dict()['sites'][1]['kind']:float(result_hubbard.get_dict()['sites'][1]['value']),
  })

Feel free to close the issue if there is a way to do that and I just didn't find it.

bastonero commented 1 year ago

In the future version #32, which will use QuantumESPRESSO v7.1, this should be automatically addressed.

bastonero commented 1 year ago

Via introducing the HubbardStructureData, the link is automatically performed. Fixed in #32