Git Product home page Git Product logo

dfttoolbox's Introduction

DFTtoolbox

DFTtoolbox is a Python module that aims to help computational condensed matter physicist or material scientists who use density functional theory (DFT) codes , such as quantum espresso, abinit, elk, etc., as a tool to study material properties quickly build their calculations and analyze the calculated results.

Most DFT codes usually come with massive variables. Users are required to be familar with all the variable not only in the building stage but also the postprocess stage. Therefore, the philosophy of DFTtoolbox is "the less user input the better!". Users only need to feed very few variables to DFTtoolbox to build a DFT input file or to analyze the calculated results. No painc learning curves for DFT codes anymore!

Prerequisite

DFTtoolbox is a Python module which helps DFT code users quickly build an input file in seconds and analyze+visuallize the output data immediately.

Currently, DFTtoolbox can support three popular DFT codes:

DFTtoolbox is based on numpy and matplotlib. Before installing DFTtoolbox, please make sure you have these package installed. Also, DFTtoolbox can only read the crystal structure and band high-symmytry path in xcrysden format (.xsf and .kpf). If you're not familar with xcrysden, check their websit (http://www.xcrysden.org/). It is very easy to learn. Then you are all set !

How does DFTtoolbox build a DFT task ?

Before building a input file using DFTtoolbox, the user has to prepare the structure file and the k-path file in xcrysden format (.xsf and .kpf.) Then DFTtoolbox can:

  • initialize a ground state calculation The user only need to feed very few parameters, DFTtoolbox will automatically generate the input files to perform four basic ground state calculation: -- self-consistent field calculation -- band structure calculation -- projected band structure calculation (i.e. fatband) -- partial density of state calculation

  • initialize a structural relaxation calculation DFTtoolbox can automatically generate an input file for structural relaxation by requesting "zero" input! DFTtoolbox will pick the values that fit for most calculations for you.

Note: Because DFTtoolbox is designed based on the philosophy "the less user inputs the better". I don't want you to learn another complicated code to deal with the already-very-complicated DFT codes. So the input files are only for general purposes and will not fit all kinds of ground state or structural relaxation calculations. However even if the generated input files don't completely satisify your need, it is always a good starting point for you to tweak your own input files.

How does DFTtoolbox help analyze the results?

One of the painc part of DFT users is the output files are usually very complicated and are lack of appropriate tools to visuallize the results beaufitully and easily. DFTtoolbox can automatically read the output data of band calculation, projected band calculation and PDOS calculations, save them in numpy array format (.npz files) and plot the results with publishable qualities. A convenient feature of DFTtoolbox is that it can combine arbitary states to plot projected band structures and PDOS making it a useful tool to band character analysis. In addition, if you want to use your own tools to plot the results, the output .npz file can also let you load the data in numpy standard format immediately, so you can postprocess your data in Python framework easily.

Is there a quick tutorial?

Yes, check (/examples/). There is a simple example FeO. I believe anyone can learn how to use it in a few minutes. You will find it only needs very few necesary input variabless to initialize or postprocess a DFT calculation.
Also, in /template/ there are template files for your to use.

Installation

  • from the tarball: Just download the tarball. Unzip it and put it anywhere you want. Go to the folder, type:

python setup.py install

  • from PyPI:

pip install DFTtoolbox

Figures Demo

Here are examples of the figure generated by DFTtoolbox. These figure were obtained from ferromagnetic FeO. This example has been included in the module.

  • Fig.1 band stucture (green and blue are different spin) band
  • Fig.2 band structure projected on Fe d-orbital Fatband
  • Fig.3 PDOS (data-1: Fe d-oribtal, data-2: O p-orbital) PDOS

dfttoolbox's People

Contributors

pipidog avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

dfttoolbox's Issues

Adivce: maybe compatibility for cell symmetry would be good

The problem comes that when I am using QE to compute bands and building unit cell with symmetry, for example, setting 'ibrav = 6' with no CELL_PARAMETERS module.
The output fatband file have three less lines than situtation 'ibrav = 0'.
And then the 'fatband_read' function goes to wrong lines and reads wrong input, and program breaks down.
Would you please add some sentences checking the symmetry, so that it can handle different input files? It would be lots of help, I think.
Many thanks

pip install error FileNotFoundError: 'C:/Users/pipid/Dropbox/Code/DFTtoolbox/README.md'

Hi,

I tried both pip install DFTtoolbox and python setup.py install the clone and got the error:

Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    with open('C:/Users/pipidog/Dropbox/Code/DFTtoolbox/README.md') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/pipidog/Dropbox/Code/DFTtoolbox/README.md'

Please advise.

Cheers, H

error

pp.band_read(Ef=Ef,bandfile='pw.bands.out')

File "/home/yang/.local/lib/python3.8/site-packages/DFTtoolbox/qe.py", line 370, in band_read
for n, bandlines_n in enumerate(bandlines[k_ln[0]+2:k_ln[1]]):

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.