GithubHelp home page GithubHelp logo

judftteam / aiida-fleur Goto Github PK

View Code? Open in Web Editor NEW
14.0 7.0 7.0 463.03 MB

AiiDA plugin of the high-performance density functional theory code FLEUR (www.judft.de) for high-throughput electronic structure calculations.

Home Page: https://aiida-fleur.readthedocs.io

License: Other

Python 99.85% Shell 0.15%
high-throughput workflow all-electron electronic-structure judft ab-initio aiida band-structure computational-materials-science condensed-matter-physics

aiida-fleur's Introduction

FLEUR with AiiDA

MIT license GitHub release PyPI version Conda Version PyPI pyversions Fleur Compatibility Build status Documentation Status codecov DOI

This software contains a plugin that enables the usage of the all-electron DFT FLEUR code with the AiiDA framework.

Developed at Forschungszentrum Jülich GmbH

Compatibility matrix

FLEUR Plugin AiiDA CORE Python FLEUR/XML file version
v2.0.0 < v3.0.0 Compatibility for v2.0 PyPI pyversions Fleur Compatibility/<=0.37
v1.2.0 < v2.0.0 Compatibility for v1.2 PyPI pyversions Fleur Compatibility/<=0.35
v1.0.0 < v1.2.0 Compatibility for v1.0 PyPI pyversions Fleur Compatibility/<=0.33
< v0.6.3 Compatibility for v0.6.3 PyPI pyversions Fleur Compatibility/<=0.31

Documentation and User Support

Hosted at http://aiida-fleur.readthedocs.io/en/develop/index.html. For other information see the AiiDA-core docs or http://www.flapw.de.

Users can post any questions in the Fleur user forum

For bugs, feature requests and further issues please use the issue tracker on github of the aiida-fleur repository.

License:

MIT license. See the license file.

How to cite:

If you use this package please consider citing:

J. Broeder, D. Wortmann, and S. Blügel,
Using the AiiDA-FLEUR package for all-electron ab initio electronic structure
data generation and processing in materials science,
In Extreme Data Workshop 2018 Proceedings, 2019, vol 40, p 43-48

Comments/Disclaimer:

The plug-in and the workflows will only work with a Fleur version using xml files as I/O, i.e >v0.27.

Contents

  1. Introduction
  2. Installation Instructions
  3. Code Dependencies
  4. Further Information

Introduction

This is a python package (AiiDA plugin, workflows and utility) allowing to use the FLEUR-code in the AiiDA Framework. The FLEUR-code is an all-electron DFT code using the FLAPW method, that is widely applied in the material science and physics community.

The plugin :

The Fleur plugin consists of:

1. A data-structure representing input files and called FleurinpData.
2. inpgen calculation
3. FLEUR calculation
4. Workchains
5. utility

Workchains in this package:

workflow entry point name Description
fleur.scf SCF-cycle of Fleur. Converge the charge density and the Total energy with multiple FLEUR runs
fleur.eos Calculate and Equation of States with FLEUR (currently cubic systems only)
fleur.dos Calculate a Density of States (DOS) with FLEUR
fleur.band Calculate a Band structure with FLEUR
fleur.relax Relaxation of the atomic positions of a crystal structure with FLEUR
fleur.init_cls Calculate initial corelevel shifts and formation energies with FLEUR
fleur.corehole Workflow for corehole calculations, calculation of Binding energies with FLEUR
fleur.dmi Calculates Dzyaloshinskii–Moriya Interaction energy dispersion of a spin spiral
fleur.ssdisp Calculates exchange interaction energy dispersion of a spin spiral
fleur.mae Calculates Magnetic Anisotropy Energy

See the AiiDA documentation for general info about the AiiDA workflow system or how to write workflows.

Utility/tools:

filename Description
Structure_util.py Constains some methods to handle AiiDA structures (some of them might now be methods of the AiiDA structureData, if so use them from there!)
merge_parameter.py Methods to handle parameterData nodes, i.e merge them. Which is very useful for all-electron codes, because instead of pseudo potentialsfamilies you can create now families of parameter nodes for the periodic table.
read_cif.py This can be used as stand-alone to create StructureData nodes from .cif files from an directory tree.

Utility and tools, which are independend of AiiDA are moved to the masci-tools (material science tools) repository, which is a dependency of aiida-fleur.

Command line interface (CLI)

Besides the python API, aiida-fleur comes with a builtin CLI: aiida-fleur. This interface is built using the click library and supports tab-completion.

To enable tab-completion, add the following to your shell loading script, e.g. the .bashrc or virtual environment activate script:

eval "$(_AIIDA_FLEUR_COMPLETE=source aiida-fleur)"

the main subcommands include:

data: Commands to create and inspect data nodes
    fleurinp   Commands to handle `FleurinpData` nodes.
    parameter  Commands to create and inspect `Dict` nodes containing FLAPW parameters
    structure  Commands to create and inspect `StructureData` nodes.
launch: Commands to launch workflows and calcjobs of aiida-fleur

    banddos          Launch a banddos workchain
    corehole         Launch a corehole workchain
    create_magnetic  Launch a create_magnetic workchain
    dmi              Launch a dmi workchain
    eos              Launch a eos workchain
    fleur            Launch a base_fleur workchain.
    init_cls         Launch an init_cls workchain
    inpgen           Launch an inpgen calcjob on given input If no    code is...
    mae              Launch a mae workchain
    relax            Launch a base relax workchain # TODO final scf    input
    scf              Launch a scf workchain
    ssdisp           Launch a ssdisp workchain

plot: Invoke the plot_fleur command on given nodes

workflow: Commands to inspect aiida-fleur workchains and prepare inputs

for example to launch an scf workchain on a given structure execute:

$ aiida-fleur launch scf -i <inpgenpk> -f <fleurpk> -S <structurepk>

the command can also process structures in any format ase can handle, this includes Cif, xsf and poscar files. In such a case simply parse the path to the file:

$ aiida-fleur launch scf -i <inpgenpk> -f <fleurpk> -S ./structure/Cu.cif

Installation Instructions

From the aiida-fleur folder (after downloading the code, recommended) use:

$ pip install .
# or which is very useful to keep track of the changes (developers)
$ pip install -e .

To uninstall use:

$ pip uninstall aiida-fleur

Or install latest release version from pypi:

$ pip install aiida-fleur

Test Installation

To test rather the installation was successful use:

$ verdi plugins list aiida.calculations
   # example output:

   ## Pass as a further parameter one (or more) plugin names
   ## to get more details on a given plugin.
   ...
   * fleur.fleur
   * fleur.inpgen

You should see 'fleur.*' in the list

The other entry points can be checked with the AiiDA Factories (Data, Workflow, Calculation, Parser). (this is done in test_entry_points.py)

We suggest to run all the (unit)tests in the aiida-fleur/aiida_fleur/tests/ folder.

$ bash run_all_cov.sh

Code Dependencies

Requirements are listed in pyproject.toml

most important are:

  • aiida_core >= 2.0
  • lxml
  • ase
  • masci-tools

Mainly AiiDA:

  1. Download from www.aiida.net -> Download
  2. install and setup -> aiida's documentation

Easy plotting and other useful routines that do not depend on aiida_core are part of the masci-tools (material science tools) repository.

For easy plotting we recommend using 'plot_methods' from masci-tools, which are also deployed by the 'plot_fleur(<node(s)>)' function.

Further Information

The plug-in source code documentation is here. also some documentation of the plug-in, further things can be found at www.flapw.de. Usage examples are shown in 'examples'.

Acknowledgements

Besides the Forschungszentrum Juelich, this work is supported by the European MaX Centre of Excellence 'Materials design at the Exascale' MaX funded by the Horizon 2020 EINFRA-5 program, Grant No. 676598 and under grant agreement No. 824143. This work is further supported by the Joint Lab Virtual Materials Design (JLVMD) of the Forschungszentrum Jülich.

For this work essential is AiiDA, which itself is supported by the MARVEL National Centre for Competency in Research funded by the Swiss National Science Foundation.

MaX

JLVMD

aiida-fleur's People

Contributors

anoopkcn avatar broeder-j avatar d-wortmann avatar dependabot[bot] avatar janssenhenning avatar philipprue avatar pre-commit-ci[bot] avatar robinhilg avatar sphuber avatar tseplyaev avatar yakutovicha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiida-fleur's Issues

Changing floats in inp,xml

Fleur is not capable of dealing with floats like 1e-5. (Change on the fleur side?)

Therefore, fleurinpmodifier has to prevent to write the floats in that form.

A workaround so far is to give the modifier methods a string instead of a float.

queue limits are a problem try to deal on workflow level

as long AiiDA does not have this feature.
Idea: write workflows in a style that you can count/know the numbers of subworkflows currently running. Then maybe do not submit any sub workflow as long as the number did not decrease.

output node of fleur_scf_wc content

currently the content is:
{
"distance_charge": 7.994e-07,
"distance_charge_all": [
1.5084338969,
1.4243665042,
0.1836076641,
0.0446805799,
0.0346745327,
0.0057244928,
0.0024850833,
0.0009573742,
3.56938e-05,
2.84684e-05,
7.994e-07
],
"distance_charge_units": "me/bohr^3",
"iterations_total": 11,
"last_calc_uuid": "80ba2838-1607-40c8-b74c-7ce6b29c8577",
"loop_count": 1,
"material": "Kr",
"successful": true,
"total_cpu_time": "",
"total_cpu_time_units": "hours",
"total_energy": -2790.4780331553,
"total_energy_all": [
-2790.4763685438,
-2790.4764415277,
-2790.4777323388,
-2790.4779329712,
-2790.4779668154,
-2790.478013726,
-2790.4780279666,
-2790.4780279116,
-2790.4780325126,
-2790.4780331659,
-2790.4780331553
],
"total_energy_units": "Htr",
"warnings": [],
"workflow_name": "fleur_scf_wc",
"workflow_version": "0.1.0"
}

What is missing?

Implement scf workchain failure handling

Scf workchian should probably use RestartBaseWorkChain to handle some failures.

Examples:

  1. Retry: try to converge restarting from this calculation, i.e. if scf is ended and did not lead to convergence, resubmit it.
  2. ggf handle bad convergence behavior, delete broyd (do not copy), i.e. try to change mixing scheme, factors...

PYTHONPATH not there

if PYTHONPATH is not defined in the os.env the plugin does not work.

this should not be
-> make a try and catch error

Return node producing workfunctions should produce the result node

the right way would be to produce the output node in the workfunction not duplicate the output nodes to get the links in the aiida graph right. (and without extra additional helper nodes) The problem is that currently the output node is produced from the context of the workchains. and that a workfunction can only have aiida objects as input, meaning we cannot make it simply a method of workchain class.

An other solution (maybe better) might be to make this function a method of the workchain classes and produce the connecting links and 'workfunction node' by hand. This might be less work and more robust of the workchain.

maybe it is also worth to wait a bit and see if the aiida workfunction policy changes.

Kpoints data usage of inpgen

Inpgen should be able to use an AiiDa kpoints node. This should be done with care.

There are several cases.
Kpoints given as a list - > override kpoint list in inp.xml at the end. at parse time before creating new fleurinp.
kpoints given as mesh (3,3,3) -> set div1,2,3
kpoints given as path -> ?

fleur parser fails in certain magnetic cases with soc

this might only happen if calculation was failed. i.e there are some checks missing.

the parser fails with

'''
charge_density1 = get_xml_attribute(charge_densitys[0], distance_name)
| IndexError: list index out of range
'''
So charge density is prob empty, because it was not in the out.xml file....

Output node of Fleur calculations

What is missing in the output node of a Fleur calculations.
the output node should be standalone enough to provide the follow information:

  1. What was calculated and how?
  2. Basic run information, was everything fine, or what went wrong
  3. Important output (results, but also sanity check values)

Things to add:

  1. More units fields should be added.
  2. Warnings, Hints and Errors should be parsed.
  3. Other physical quantities?
  • total magnetic moment cell last iteration
  • total spinDependentCharges last iteration
  • cell_volume because one often likes to give something per volume
  • reciprocal cell_volume ?
  • structure information, add Formula, Elements, spacegroup, dimensions, .... which is redundant but helpful information....
  • parse atom types information
  • fleur mode since in case of other fleur modes, output is different,
  • 'number_valence_electrons' : X, 'number_core_electrons' : X

Current content:

{
    "bandgap": 0.0005412425,
    "bandgap_units": "eV",
    "charge_den_xc_den_integral": -111.8771323535,
    "charge_density1": 1.871e-07,
    "charge_density2": 1.803e-07,
    "creator_name": "fleur 31",
    "creator_target_architecture": "GEN",
    "creator_target_structure": " ",
    "density_convergence_units": "me/bohr^3",
    "end_date": {
        "date": "2020/11/30",
        "time": "12:19:18"
    },
    "energy": -69269.59001367,
    "energy_core_electrons": -1444.2206331035,
    "energy_hartree": -2545.6104803879,
    "energy_hartree_units": "Htr",
    "energy_units": "eV",
    "energy_valence_electrons": -25.3255485869,
    "fermi_energy": 0.3702091804,
    "fermi_energy_units": "Htr",
    "force_largest": 0.0,
    "kmax": 5.0,
    "magnetic_moment_units": "muBohr",
    "magnetic_moments": [
        2.3339400372,
        2.3339362223
    ],
    "magnetic_spin_down_charges": [
        6.2618479986,
        6.2618511289
    ],
    "magnetic_spin_up_charges": [
        8.5957880358,
        8.5957873512
    ],
    "number_of_atom_types": 2,
    "number_of_atoms": 2,
    "number_of_iterations": 20,
    "number_of_iterations_total": 20,
    "number_of_kpoints": 286,
    "number_of_species": 1,
    "number_of_spin_components": 2,
    "number_of_symmetries": 48,
    "orbital_magnetic_moment_units": "muBohr",
    "orbital_magnetic_moments": [],
    "orbital_magnetic_spin_down_charges": [],
    "orbital_magnetic_spin_up_charges": [],
    "output_file_version": "0.27",
    "overall_charge_density": 7.73e-08,
    "parser_info": "AiiDA Fleur Parser v0.3.0",
    "parser_warnings": [],
    "spin_density": 3.593e-07,
    "start_date": {
        "date": "2020/11/30",
        "time": "12:10:16"
    },
    "sum_of_eigenvalues": -1469.5461816904,
    "title": "A Fleur input generator calculation with aiida",
    "unparsed": [],
    "walltime": 542,
    "walltime_units": "seconds",
    "warnings": {
        "debug": {},
        "error": {},
        "info": {},
        "warning": {}
    }

Fleurinp get_structure data

There is a bug in the get_structure data methods from fleurinpdata. for compounds...
s.get_formula() gives wrong result. Be2W4 -W4 therefore Be is missing...

General finding the schema file

So far we look in the current dir, and walk the PYTHONPATH, or hack it.

One should still think about a more general solution. Especially after the plugin is made pip install able, because then it should be clear where the schemas are.

inpgen returns data type instead of fleurinp data

There seems to be a bug sometimes in creating fleurinp data sometimes. Through it might or might not have todo with the small changes of me in aiida_core, escape_for_bash and so on. Investigate.

Implement Fleur failure handling in FleurBaseWorkChain

All the text below is extracted from scf workchain:

  • handle out of walltime (not one interation run) abort, tell user to specifi mor resources, or different cutoffs

  • handle fleur error fermi level convergence
    restart fleur with more tempertature broad or other smearing type (gauss = T)

  • qfix needed, restart fleur with Qfix

  • differ errors, solving dirac equation
    abort, or restart with different parameters

  • muffin tin radii overlap, restart with smaller MT

  • wrong command line switches
    hdf, -h , ... restart with the right one, or abort

  • something about kpt grid
    abort, or restart with increased number /different number of kpoints

  • wrong parallelisation
    abort or restart with right parallelisation

ALL FLEUR current (07.2017) ERROR hints:

    • nsh greater than dimensioned | increase nmax in jcoff2'
    • Fermi-level determination did not converge| change temperature or set input = F
    • Too low eigenvalue detected | If the lowest eigenvalue is more than 1Htr below the lowest energy parameter, you probably have picked up a ghoststate
    • e >= vz0 | Vacuum energy-parameter too high
    • kidx /= stars | something wrong with kmxxc_fft or nxc3_fft
    • Wrong size of matrix | Your basis might be too large or the parallelization fail or ??
      If no LO's are set skiplo must be 0 in enpara
    • You compiled without support for HDF5. Please use another mode
    • Your HDF5 library does not support parallel IO
    • Use -mpi or -hdf instead
    • Consider setting 'autocomp = false' in apwefl.
    • Film setup not centered" | The z = 0 plane is the center of the film
      setcore_bystr |
      expnadconfig |
    • File not readable:"//filename | FLEUR wants to read a file that is not present
    • Both inp & inp.xml given | Please delete one of the input files or specify -xml to use inp.xml
      inp.xml not found | You gave the -xml option but provided no inp.xml file
    • No input file found | To use FLEUR, you have to provide either an 'inp' or an 'inp.xml' file in the working directory
    • Use a supercell or a different functional
    • MPI parallelization failed | ou have to either compile FLEUR with a parallel diagonalization library (ELPA,SCALAPACK...) or you have to run such that the No of kpoints can be distributed on the PEs

AiiDA related:

    • Submissionfailed:
      SSHException: SSH session not active -> wait and relaunch

Scheduler/HPC related:

    • scf scheduler needs other things than torque, try to provide both as default
      that they both work
    • ran out of walltime with out a single interation done. (killed by scheduler)
      -> terminate, because the user should specify more recources or in the
      calculation something is fishy
    • bumped by scheduler joblimit. reached
      -> think about something here and retry
    • no space/files left on remote machine.
      -> also terminate, tell user to delete stuff
    • not eneough memory, (killed by scheduler, or some fleur error)
      -> can we do something here

NOTE:

  • If some wc parameters were adjusted, they have to be passed to higher-level workchain somehow. Otherwise we end up in a situation when SCF workchain submits not correct parameters for the second iteration again.

find schema

the plugin finds the schema file, but does not reconize that the version is right.

reduce size of pypi install

As of today, after installing aiida-fleur 0.6.2 via pip, the package takes up 38MB on disk space, 36MB of which is in tests/files (e.g. local_exe (??) ).

Can this be improved?

A few other packages for comparison

1.4M	paramiko
1.5M	setuptools
3.5M	tornado
5.8M	IPython
8.2M	sqlalchemy
38M  	aiida-fleur

please fix dependencies

  • aiida-core >= 0.12.0[atomic_tools] results in always selecting aiida-core 0.12.2 (even though 0.12.3 is out). I believe the correct syntax should be: aiida-core[atomic_tools] >=0.12.0,<1.0
  • please don't fix the numpy version as it is fixed by aiida-core

Maintenance of xpaths (and therefore whole plugin) should be easier

So far all xpaths are hardcodes somewhere in the plugin, therefore the plugin needs a bit of maintenance.

A solution to extracted all these paths from the schema file, which should not take so much time (or be done only once and installation and stored in a file or so) should replace this.

fleur_corehole to many unnecessary nodes

In the current design the workflow creates a list of pairs with atom types and coresetup stuff and then creates calculations out of that list. Which results into the moved of the supercell x times for an atom type, where x is the number of core levels to calculate.

A better design would avoid these double nodes. But since the workfunction for the parameter creating has to be called anyway the nodes saved is only x-1. per atom type.

Work Flow for relaxation

Dear Jens,

I am wondering if anyone is working on the structural relaxation workflow, if not I would like to make one. There seems to be a WF with old workflows but none in the new ones. Let me know so that I can start to work on it.

Regards
Vamshi

fleurinp methods buggy

The methods get_structure_data and get_kpoints_data_nwf currently fail with

XMLSyntaxError: Element 'fleurInput', attribute 'fleurInputVersion': [facet 'enumeration'] The value '' is not an element of the set {'0.28', '0.27'}.

this is after the change to the new xml schema management. And should be fixed. Also the work functions of these should be working again.

pypi package broken

pip install aiida-fleur
   Downloading https://files.pythonhosted.org/packages/f7/c7/4824f9f3a391f59658a258a0ba01265d81f54bca574f8af645e956bfe9c4/aiida-fleur-0.6.0.tar.gz (155kB)
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-FIzeJI/aiida-fleur/setup.py", line 9, in <module>
            with open('setup.json', 'r') as info:
        IOError: [Errno 2] No such file or directory: 'setup.json'

In order to fix this, please add a MANIFEST.in with content

include setup.json

see e.g. https://github.com/cp2k/aiida-cp2k/blob/master/MANIFEST.in

test for all workchains, options interface change

Since the interface how options are provided to the base scf workchain was changed, all workchains where adapted, but there are still some issues left. u.a there are errors if the 'custom_scheduler_commands' option is not provided....

corehole wc output node

Currently a borehole wc output node alone does not tell you much. Post ideas what should be added to the node here.

How the plugin uses the structure needs to be overworked

So far the plugin assumes atoms at sites and does not care about weights or vacancies. There should be checks for the whole functionality of structureData and warnings/ignores if Fleur is unable to use certain structureDatas. Otherwise the Prov between different codes is at risk...

Error in parsing the inp.xml

Hi,

I am trying to run the Cu_bulk example and I get the following parsing error

XMLSyntaxError: Element 'relPos', attribute 'label': The attribute 'label' is not allowed. (line 0)

I am using MaX-R2 version of fleur and the latest aiida-fleur. Am I missing something here?

Fleurinp modifier functions

The functions of Fleurinp modifier have to be overworked.

In detail for noco, lda+U, los and other features.
Also the standard xml methods

Bug SCF for magnetic systems

currently for magnetic systems we store the overall_charge and charge_density1 and charge_density2.

maybe this should become a list under one key charge_density.
currently scf fails because it accesses charge_density. also the numbers do not seem right, check the parsing.

FleurCalculation, verdi calculation inputcat should show inp.xml

this was not possible before, but there was an adjustment in AiiDA. Maybe know it is.

(You have to set some variable in the plugin, but in the case of a fleurcalculation this can only be set AFTER the fleurinp data node was connected to the calculation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.