Fleur equation of states (eos) workflows

  • Class: FleurEosWorkChain
  • String to pass to the WorkflowFactory(): fleur.eos
  • Workflow type: Basic (lvl 1)
  • Aim: Vary the cell volume, to fit an equation of states, (Bulk modulus, …)
  • Computational demand: 5-10 Fleur SCF workchains in parallel
  • Database footprint: Outputnode with information, full provenance, ~ (10+10*FLEUR Jobs)*points nodes
  • File repository footprint: no addition to the JobCalculations run

Import Example:

from aiida_fleur.workflows.eos import fleur_eos_wc
#or
WorkflowFactory('fleur.eos')

Description/Purpose

Calculates an equation of state for a given crystal structure.

First, an input structure is scaled and a list of scaled structures is constructed. Then, total energies of all the scaled structures are calculated via FleurScfWorkChain. Finally, resulting total energies are fitted via the Birch–Murnaghan equation of state and the cell volume corresponding to the lowest energy is evaluated. Other fit options are also available.

  • fleur: Code - Fleur code using the fleur.fleur plugin
  • inpgen: Code, optional - Inpgen code using the fleur.inpgen plugin
  • wf_parameters: Dict, optional - Settings of the workflow behavior
  • structure: StructureData, optional: Crystal structure data node.
  • calc_parameters: Dict, optional - FLAPW parameters, used by inpgen
  • fleurinp: FleurinpData, optional: Fleur input data object representing the FLEUR input files
  • remote_data: RemoteData, optional - The remote folder of the previous calculation
  • options: Dict, optional - AiiDA options (queues, cpus)
  • settings: Dict, optional - special settings for Fleur calculations.

Returns nodes

  • output_eos_wc_para: Dict - Information of workflow results like success, list with convergence behavior
  • output_eos_wc_structure: StructureData - Crystal structure with the volume of the lowest total energy.

Database Node graph

from aiida_fleur.tools.graph_fleur import draw_graph

draw_graph(49670)
../../_images/eos_49670.pdf

Plot_fleur visualization

Single node

from aiida_fleur.tools.plot import plot_fleur

plot_fleur(49670)
../../_images/plot_fleur_eos_sn.png

Multi node

from aiida_fleur.tools.plot import plot_fleur

plot_fleur(eos_pk_list)
../../_images/plot_fleur_eos_mn.png

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_eos_wc for @ or some other material

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.eos import FleurEosWorkChain

ParameterData = DataFactory('parameter')
FleurinpData = DataFactory('fleur.fleurinp')
StructureData = DataFactory('structure')


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

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

### Create wf_parameters (optional) and options
wf_para = Dict(dict={'fleur_runmax' : 4, 
                              'points' : 4,
                              'guess' : 1.0})

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

# Create W bcc crystal structure 
bohr_a_0= 0.52917721092 # A
a = 3.013812049196*bohr_a_0
cell = [[-a,a,a],[a,-a,a],[a,a,-a]]
structure = StructureData(cell=cell)
structure.append_atom(position=(0.,0.,0.), symbols='W')

# (optional) We specifi some FLAPW parameters for W
parameters = Dict(dict={
                  'atom':{
                        'element' : 'W',
                        'jri' : 833,
                        'rmt' : 2.3,
                        'dx' : 0.015,
                        'lmax' : 8,
                        'lo' : '5p',
                        'econfig': '[Kr] 5s2 4d10 4f14| 5p6 5d4 6s2',
                        },
                  'comp': {
                        'kmax': 3.0,
                        },
                  'kpt': {
                        'nkpt': 100,
                        }})


################################
# 3. submit the workchain with its inputs.

inputs = {}
inputs['wf_parameters'] = wf_para
inputs['structure'] = structure
inputs['calc_parameters'] = parameters
inputs['fleur'] = fleur_code
inputs['inpgen'] = inpgen_code
inputs['description'] = 'test fleur_eos_wc run on W'
inputs['label'] = 'eos test on W'
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(FleurEosWorkChain, **inputs)

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

Output node example

{
  "bulk_deriv": -612.513884563477, 
  "bulk_modulus": 29201.4098068761, 
  "bulk_modulus_units": "GPa", 
  "calculations": [], 
  "distance_charge": [
    4.4141e-06, 
    4.8132e-06, 
    1.02898e-05, 
    1.85615e-05
  ], 
  "distance_charge_units": "me/bohr^3", 
  "errors": [], 
  "guess": 1.0, 
  "info": [
    "Consider refining your basis set."
  ], 
  "initial_structure": "d6985712-7eca-4730-991f-1d924cbd1062", 
  "natoms": 1, 
  "nsteps": 4, 
  "residuals": [], 
  "scaling": [
    0.998, 
    1.0, 
    1.002, 
    1.004
  ], 
  "scaling_gs": 1.00286268683922, 
  "scf_wfs": [], 
  "stepsize": 0.002, 
  "structures": [
    "f7fddbb5-51af-4dac-a4ba-021d1bf5795b", 
    "28e9ed28-837c-447e-aae7-371b70454dc4", 
    "fc340850-1a54-4be4-abed-576621b3015f", 
    "77fd128b-e88c-4d7d-9aea-d909166926cb"
  ], 
  "successful": true, 
  "total_energy": [
    -439902.565469453, 
    -439902.560450163, 
    -439902.564547518, 
    -439902.563105211
  ], 
  "total_energy_units": "Htr", 
  "volume_gs": 16.2724654374658, 
  "volume_units": "A^3", 
  "volumes": [
    16.1935634057491, 
    16.2260154366224, 
    16.2584674674955, 
    16.290919498369
  ], 
  "warnings": [
    "Abnormality in Total energy list detected. Check entr(ies) [1]."
  ], 
  "workflow_name": "fleur_eos_wc", 
  "workflow_version": "0.3.3"
}

Error handling

Still has to be documented…

Total energy check:

The workflow quickly checks the behavior of the total energy for outliers. Which might occur, because the chosen FLAPW parameters might not be good for all volumes. Also local Orbital setup and so on might matter.

  • Not enough points for fit
  • Some calculations did not converge
  • Volume ground state does not lie in the calculated interval, interval refinement