Skip to content
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

Bandstructure wf #45

Merged
merged 15 commits into from
Dec 18, 2020
Merged

Bandstructure wf #45

merged 15 commits into from
Dec 18, 2020

Conversation

RubelMozumder
Copy link
Contributor

Add bandstructure workflow

@PhilippRue PhilippRue self-requested a review December 3, 2020 17:11
Copy link
Member

@PhilippRue PhilippRue left a comment

Choose a reason for hiding this comment

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

Thank you @RubelMozumder. I left a few comments for improvements.

What is still needed in addition:

  • you started from the stale branch develop_workflow_conventions. Please merge the develop into Bandstructure_wf to get the latest changes (use git merge --no-ff develop on your Bandstructure_wf branch to do so)
  • add an entry point in the setup.json
  • add a test for the bandstructure functionality see here for an example
  • add documentation
  • add/replace plotting functionality in plot_kkr tool to work with you workflow
  • make you workflow importable: from aiida_kkr.workflows import kkr_BS_wc

Comment on lines 17 to 20
__copyright__ = u"This is the Copyright"
__license__ = "Here is the license"
__version__ = "Here is the version"
__contributors__ = "using technique from Philpp RÜssmann's DOS wf"
Copy link
Member

Choose a reason for hiding this comment

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

This should contain the actual information and not just a placeholder

  • copyright: FZJ
  • license: MIT license
  • version: start with 0.1.0
  • contributors: your name

Comment on lines 26 to 38
Workchain for BandStructure calculation, starting from RemoteFolderData the previous converged KKR calculation remote folder data

inputs:
:param wf_parameters: (Dict), (optional); Workchain Specifications, contains npt2, tempr, emin(ev), emax(ev), kmesh
keys. The Energy emin and emax are the energy difference from the fermi energy.

:param options: (Dict), (optional); Computer Specifications, Schedualer command, parallel or serial
:param kpoints: (KpointsData),(optional); Kpoints data type from thestructure,
but not mendatory as it can be extrruct from structure internaly from the remote data
:param remote_data: (RemoteData)(mendaory); From the previous kkr-converged calcualtion.
:param kkr: (Code)(mendaory); KKR code specifiaction
:param label: (Str):
:param description: (Str):
Copy link
Member

Choose a reason for hiding this comment

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

fix types and complete missing information


returns:
:out BS_Data : (ArrayData) ; Consist of (Dos_intensity matrix), k_points (list), Energy_levels (list), special_kpoints(dict)
:out result_wf: (Dict); work_chain_specifications node, BS_data node, remote_folder node
Copy link
Member

Choose a reason for hiding this comment

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

why do you want to return the remote folder node? It is not needed to continue a calculation from the output of the bandstructure calculation. So we should not expose this.



returns:
:out BS_Data : (ArrayData) ; Consist of (Dos_intensity matrix), k_points (list), Energy_levels (list), special_kpoints(dict)
Copy link
Member

Choose a reason for hiding this comment

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

rename:

  • Dos_intensity matrix -> BlochSpectralFunction
  • Energy_levels -> energy_points

'EMAX': 5, # Energy over the fermi surface for energy contour in ev unit
"NPT2": 200, # Energy points in the energy contour
"kmesh": [30, 30, 30],
'TEMPR': 50. # temperature
Copy link
Member

Choose a reason for hiding this comment

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

we should add the possibility to overwrite the cluster radius (RCLUSTZ) as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do the RCLUSTZ will have any impact on the on the DOS calc? Because, it is already converged.

Copy link
Member

Choose a reason for hiding this comment

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

for a qdos calculation you run at much lower values of the imaginary part of the energies (given by NPOL=0 and a small value of the temperature). This puts higher demands on the numerics which in the end require larger screening clusters. Otherwise you will see negative densities.

loaded_file = np.loadtxt(f)
total_dos[:,5:] += loaded_file[:,5:]

ef = fermi_level.value # in eV unit
Copy link
Member

Choose a reason for hiding this comment

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

this is in Ry, the conversion to eV units is only done in the next line!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In [5]: ef = out['fermi_energy']

In [6]: ef
Out[6]: 0.6360325445

In [12]: ef = out['fermi_energy']

In [13]: eng_unit = out['energy_unit']

In [14]: eng_unit
Out[14]: 'eV'

This is from output_parameter of the parent cal. This make me a bit confused as I extract the value in the same way.

Copy link
Member

Choose a reason for hiding this comment

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

the energy_unit refers to the energy value and the fermi_energy_unit gives you the unit of the fermi_energy which is in Ry and not in eV

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, sorry. Thanks.

total_dos[:,5:] += loaded_file[:,5:]

ef = fermi_level.value # in eV unit
total_dos[:,0] = total_dos[:,0]*eVscale - ef*np.ones(np.shape(total_dos[:,0]))
Copy link
Member

Choose a reason for hiding this comment

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

you could also write total_dos[:,0] = (total_dos[:,0]-ef)*eVscale


dos_intensity = dos_intensity.T # setting eng-kpts corresponds to x-y asix
q_vec = np.asarray(q_vec) # converting q_vec into array
eng_points = np.asarray(list(eng_points)) # converting eng_popints into array
Copy link
Member

Choose a reason for hiding this comment

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

since eng_points is a set before, you should make sure to sort the array afterwards

Comment on lines 437 to 439
array.set_array('BS_Matrix', dos_intensity)
array.set_array('Kpts', q_vec)
array.set_array('Eng_levels',eng_points)
Copy link
Member

Choose a reason for hiding this comment

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

rename as commented above




class kkr_BS_wf(WorkChain):
Copy link
Member

Choose a reason for hiding this comment

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

rename to kkr_bs_wc to be consistent with the other workflow names

…ing explanation and datatype, the removal of the 'remote_folder' from the output of the WC, using the conventional name 'Dos_intensity matrix -> BlochSpectralFunction', 'Energy_levels -> energy_points', To 'RCLUSTZ' to the bs_param, removal the k-mesh from the bs_param, changing the 'wf_option_default' to the normal specifications from the CLAIX18, to set the 'exit_codes' instead of the 'if_' condition, return exit_code instead of raising and Error in case the parent_workflow is not the WorkChainNode, fixning the error for the units of energy (eV, Ry), removing the unnecessary keyword 'BZDIVIDE', sending a report informing the structure of the unitcell, return the exit_codes fro the 'dos_run=Flase', fixining the energy units, removing the unneccessary function 'ev_To_Ry', renaming 'total_dos# to 'total_qdos'and 'num_dos_files' to the 'num_qdos_files', adding 'total_dos[:,0] = (total_dos[:,0]-ef)*eVscale' instead of 'total_dos[:,0] = total_dos[:,0]*eVscale - ef*np.ones(np.shape(total_dos[:,0]))', to make the 'eng_points' array immediately after the set of 'eng_points', to transform 'Dos_intensity matrix -> BlochSpectralFunction', 'Energy_levels -> energy_points' as convention, to rewrite the 'kkr_BS_wf' to 'kkr_bs_wc'.
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.

2 participants