-
Notifications
You must be signed in to change notification settings - Fork 32
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
Workflows
: harmonic phonons via finite differences
#306
base: master
Are you sure you want to change the base?
Conversation
A workchain to compute phonons using finite differences is introduced, making use of the `aiida-phonopy` plugin.
A minimal working example is provided here: from aiida import orm, load_profile
from aiida.plugins import WorkflowFactory, DbImporterFactory
from aiida.engine import submit
load_profile()
# ========================================================= #
WC = WorkflowFactory("common_workflows.phonons.frozen_phonons")
CodDbImporter = DbImporterFactory('cod')
# ========================================================= #
code = orm.load_code("pw@localhost")
phonopy_code = orm.load_code("phonopy@localhost")
cod = CodDbImporter()
results = cod.query(id='1526655') # Si 1526655
structure = results[0].get_aiida_structure() # it has 8 atoms
inputs = {
'structure': structure,
'supercell_matrix': orm.List([1,1,1]),
'displacement_generator': orm.Dict({'distance':0.01}),
'symmetry': {
'symprec': orm.Float(1e-5),
'distinguish_kinds': orm.Bool(True),
'is_symmetry': orm.Bool(True),
},
'phonopy': {
'code': phonopy_code,
'parameters': orm.Dict({'band':'auto'}),
},
'sub_process_class': 'common_workflows.relax.quantum_espresso',
'generator_inputs': {
'protocol': 'fast',
'engines': {
'relax': {
'code': code,
'options': {
'resources': {
'num_machines': 1
}
}
}
},
'electronic_type': 'metal',
}
}
calc = submit(WC, **inputs) Then you can plot the phonon dispersion with the following:
|
I have some problems with the testing - the sssp fixture doesn't seem to be willing to work. Nevertheless, I was able to run the workflow smoothly with the above reported example (it runs in 30 s / 1 min). Moreover, the dependencies seem rather tricky. It would be great if someone else can give it a try. Of course the input name choices, as well as the entire implementation can (should) be discussed. |
The aiida-phonopy v1.1.2 came with a typo which may crash the future workchain. We update the dependencies to the latest stable version.
Some comments from meeting with @giovannipizzi and @mbercx :
A possible solution that we came up with is: inputs = {
'structure': structure,
'generator_inputs': {
'protocol': 'fast', # ==> qpoints_mesh/supercell_matrix [2,2,2,]
'force_calculator':{
'sub_process_class': 'common_workflows.relax.quantum_espresso', #?
'engines': {
'relax': {
'code': code,
'options': {
'resources': {
'num_machines': 1
}
}
},
},
'electronic_type': 'metal'
},
'phonon_properties': {
'properties': ['bands', 'force_constants', 'dos', 'thermodynamics', ...],
'engine': {
'code': phonopy_code,
'options': {...},
},
},
}
}
builder = FrozenPhononWorkChain.get_builder_from_protocol(**inputs)
builder.supercell_matrix = orm.List([2,2,2,])
... |
Phonons in the harmonic approximations can be obtained with any code able to compute forces using the so-called frozen phonons technique (or small displacements). A workchain is added for common frozen phonons using this methodology.
IMPORTANT NOTE:
In this workchain we don't account for non-analytical corrections, relevant for insulators. This can be added in a modular way via an other workchain dedicated for that purpose (e.g.
CommonDielectricWorkChain
or similar). Eventually, one can devise a master workchain which can compute at glance the needed NAC parameters, to be added to thePhonopyData
/ForceConstantsData
which gathers together all the information. In principle, one could also add separately such parameters, as they are needed only to interpolate the band structure (at the gamma point phonons are ill-defined).