Fleur dos/band workflows

Warning

These workchains do not work with AiiDA >1.0 version yet. They need to be updated.

These are two seperate workflows which are pretty similar so we treat them here together

  • Class: fleur_dos_wc and FleurBandDosWorkChain
  • String to pass to the WorkflowFactory(): fleur.dos, fleur.banddos
  • Workflow type: Workflow (lv 1)
  • Aim: Calculate a density of states. Calculate a Band structure.
  • Compuational demand: 1 Fleur Job calculation
  • Database footprint: Outputnode with information, full provenance, ~ 10 nodes
  • File repository footprint: The JobCalculation run, plus the DOS or Bandstructure files
  • Additional Info: Use alone.

Import Example:

from aiida_fleur.workflows.dos import fleur_dos_wc
#or
WorkflowFactory('fleur.dos')

from aiida_fleur.workflows.banddos import FleurBandDosWorkChain
#or
WorkflowFactory('fleur.banddos')

Description/Purpose

DOS:

Calculates an Density of states (DOS) ontop of a given Fleur calculation (converged or not).

BandDos:

Calculates an electronic band structure ontop of a given Fleur calculation (converged or not).

In the future we plan to add the possibility to converge a calculation before, and choose the kpaths automatic. This version should be able start simply from a crystal structure.

Each of these workflows prepares/chances the Fleur input and manages one Fleur calculation.

Input nodes:

  • fleur (Code): Fleur code using the fleur.fleur plugin
  • wf_parameters (Dict, optional): Some settings of the workflow behavior (e.g. number of kpoints, path, energy sampling and smearing, …)
  • fleurinp (FleurinpData, path 2): Fleur input data object representing the fleur input files.
  • remote_data (RemoteData, optional): The remote folder of the (converged) calculation whose output density is used as input for the DOS, or band structure run.
  • options (Dict, optional): All options available in AiiDA, i.e resource specification, queue name, extras scheduler commands, …
  • settings (Dict, optional): special settings for Fleur calculations, will be given like it is through to calculationss.

Returns nodes

  • output_dos_wc_para (Dict): Information of the dos workflow results like success, last result node, list with convergence behavior
  • output_band_wc_para (Dict): Information node from the band workflow
  • last_fleur_calc_output (Dict) Output node of last Fleur calculation is returned.

Database Node graph

from aiida_fleur.tools.graph_fleur import draw_graph

draw_graph(76867)
../../_images/dos_76867.pdf

Plot_fleur visualization

Single node

from aiida_fleur.tools.plot import plot_fleur

# DOS calc
plot_fleur(76867)
../../_images/dos_plot.png

For the bandstructure visualization it depends on the File produced. Old bandstructure file:

../../_images/bandstructure.png

Bandstructure `band_dos.hdf` file with l-like charge information: Band resolved bandstructure and fat-bands for the different channels. Spin and combinded DOS plus band structure visualizations are in progress…

../../_images/Bands_colored.png
../../_images/band_s_like.png
../../_images/band_p_like.png
../../_images/band_d_like.png
../../_images/band_f_like.png

Multi node just does a bunch of single plots for now.

from aiida_fleur.tools.plot import plot_fleur

plot_fleur(dos_pk_list)

Example usage

# -*- coding: utf-8 -*-
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany.         #
#                All rights reserved.                                         #
# This file is part of the AiiDA-FLEUR package.                               #
#                                                                             #
# The code is hosted on GitHub at https://github.com/broeder-j/aiida-fleur    #
# For further information on the license, see the LICENSE.txt file            #
# For further information please visit http://www.flapw.de or                 #
# http://aiida-fleur.readthedocs.io/en/develop/                               #
###############################################################################
"""
Here we run the fleur_dos_wc for a Fleur calculation which has been converged before
Layout:

1. Database env load, Import, create base classes
2. Creation of  input nodes
3. Lauch workchain
"""

#######################
# 1. Load the database environment. Imports and base class creation

from __future__ import absolute_import
from aiida import load_dbenv, is_dbenv_loaded
if not is_dbenv_loaded():
    load_dbenv()

from aiida.plugins import DataFactory
from aiida.orm import Code, load_node
from aiida.engine.launch import submit, run
from aiida_fleur.workflows.dos import fleur_dos_wc

ParameterData = DataFactory('parameter')
StructureData = DataFactory('structure')

#######################
# 2. Creation/loding of input nodes

# Load the codes, thwy have to be setup in your database.
fleur_label = 'fleur@localhost'
fleur_code = Code.get_from_string(fleur_label)

### Create wf_parameters (optional) and options
wf_para = Dict(dict={'fleur_runmax': 4, 'density_criterion': 0.000001, 'serial': False})

options = Dict(dict={'resources': {'num_machines': 1}, 'queue_name': '', 'max_wallclock_seconds': 60 * 60})

# load a fleurino data object from a scf_wc before
################################
# 3. submit the workchain with its inputs.

inputs = {}
inputs['wf_parameters'] = wf_para
inputs['fleurinp'] = fleurinp
inputs['fleur'] = fleur_code
inputs['description'] = 'test fleur_dos_wc run on W'
inputs['label'] = 'dos test '
inputs['options'] = options

# submit workchain to the daemon
# Noice that the nodes we created before are not yet stored in the database,
# but AiiDA will do so automaticly when we launch the workchain.
# To reuse nodes it might be a good idea, to save them before by hand and then load them
res = submit(fleur_dos_wc, **inputs)

# You can also run the workflow in the python interpreter as blocking
#res = run(fleur_dos_wc, **inputs)

Error handling

Still has to be documented

Warning if parent calculation was not converged.