Coder Social home page Coder Social logo

lrgresearch / gpaw-tools Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 11.0 1.79 MB

gpaw-tools is a powerful and user-friendly UI/GUI tool for conducting Density Functional Theory (DFT) and molecular dynamics (MD) calculations

Home Page: https://www.lrgresearch.org/gpaw-tools/

License: MIT License

Python 100.00%
gpaw dft lcao paw gui scripts-collection

gpaw-tools's Introduction

gpaw-tools

License: MIT Issues: Pull requests: Latest version: Release date: Commits: Last Commit:

Introduction

gpaw-tools is a powerful and user-friendly UI/GUI tool for conducting Density Functional Theory (DFT) and molecular dynamics (MD) calculations. Our goal is to make DFT and MD calculations more accessible and easy to use for individuals and small groups, by providing a simple command-line interface and graphical user interface.

The gpaw-tools package is built on top of the ASE, ASAP3, KIM-API, PHONOPY, and GPAW libraries, which are well-established and widely used in the scientific community. It allows users to simulate the properties of materials, optimize structures, investigate chemical reactions and processes, and perform calculations on systems with a large number of atoms. With gpaw-tools, researchers, students, and engineers in a wide range of fields, including materials science, chemistry, physics, and engineering, can easily conduct DFT and MD calculations and explore the electronic, optical, and phonon structure of material systems. We are constantly working to improve and expand the capabilities of gpaw-tools, and we welcome feedback and contributions from the community.

gpaw-tools have:

  1. The main solver code gpawsolver.py can run in PW or LCAO mode. It can perform structure optimization, equation of state and elastic tensor calculations, use several different XCs (as well as hybrid XCs) for spin-polarized DOS and band structure calculations, electron densities, phonon calculations, and optical properties (RPA and BSE). In addition to calculations, it can draw DOS and band structures, save all data, and figure in an ordered way.
  2. A force-field quick optimization script asapsolve.py for MD calculations using ASAP3 with OpenKIM potentials.
  3. To choose better cut-off energy, lattice parameter, and k-points, there are 4 scripts called optimize_cutoff.py, optimize_kpoints.py, optimize_kptsdensity.py, and optimize_latticeparam.py.
  4. A simple Graphical User Interface (GUI) for gpawsolve.py (and also you may say that GUI for GPAW) which is called gg.py.

Usage

Installation

You need to install many packages to run gpaw-tools successfully. Please refer to the main installation web page for more.

gpawsolve.py

This is the main code for easy and ordered PW/LCAO Calculations with ASE/GPAW. It can run as a command.

Command line usage: gpawsolve.py -v -e -d -h -i <inputfile.py> -g <geometryfile.cif>

Argument list:

-g, --geometry    : Use a CIF file for geometry
-i, --input       : Use an input file for variables (input.py) If you do not use this argument, parameters 
                    will be taken from the related lines of gpawsolve.py. Visit the "Input File Keywords" webpage for more.
-e, --energymeas  : Energy consumption measurement. This feature only works with Intel CPUs after the Sandy Bridge generation.
                    Results will be written in a file in the results folder (as kWh!).
-h, --help        : Help
-d, --drawfigures : Draws DOS and band structure figures at the end of the calculation.
-v, --version     : Version information of running code and the latest stable code. Also gives a download link.

Instead of using a geometry file, you can put an ASE Atoms object into your input file for the geometry. As an example please note the example at: examples\Bulk-GaAs-noCIF folder.

How to run?

Change <core_number> with core numbers to use. For getting maximum performance from your PC you can use total number of cores - 1 or total RAM/2Gb as a <core_number>. For CPUs supporting hyperthreading, users can use more than one instance of gpawsolve.py to achieve maximum efficiency.

Usage: $ mpirun -np <core_number> gpawsolve.py <args>

or

$ gpaw -P<core_number> python /path/to/gpawsolve.py -- <args>

Calculation selector (Not complete, not up-to-date information)

Method XCs Structure optim. Spin polarized Ground Elastic DOS DFT+U Band Electron Density Optical
PW Local and LibXC Yes Yes Yes Yes Yes Yes Yes Yes Yes
PW GLLBSC / M No Yes Yes Yes Yes No Yes Yes Yes
PW HSE03, HSE06 No Yes Yes n/a Yes No No No No
PW-G0W0 Local and LibXC No No Yes No No No Some No No
LCAO Local and LibXC No Yes Yes Yes Yes Yes Yes Yes No

*: Just some ground state energy calculations.

gg.py

Basic DFT calculations can be done graphically with the script gg.py. This script behaves as a GUI to run gpawsolve.py script. To execute the GUI, type simply:

$ gg.py

asapsolve.py

The inter-atomic potential is a useful tool to perform a quick geometric optimization of the studied system before starting a precise DFT calculation. The asapsolve.py script is written for geometric optimizations with inter-atomic potentials. The bulk configuration of atoms can be provided by the user given as a CIF file. A general potential is given for any calculation. However, the user can provide the necessary OpenKIM potential by changing the related line in the input file.

Mainly, asapsolve.py is not related to GPAW. However, it is dependent on ASAP3/OpenKIM and Kimpy. Therefore, the user must install the necessary libraries before using the script. Please refer to related page for the installation needs.

The main usage is:

$ asapsolve.py <args>

Arguments

asapsolve.py -v -h -i <inputfile.py> -g <geometryfile.cif>

Argument list:

-g, --geometry   : Use a CIF file for geometry
-i, --input      : Use an input file for variables (input.py) 

-h --help        : Help
-v --version     : Version information of running code and the latest stable code. It also gives a download link.

optimizations/optimize_cutoff (and kpoints)(and kptsdensity)(and latticeparam).py

Users must provide an ASE Atoms object and simply insert the object inside these scripts. With the scripts, the user can do convergence tests for cut-off energy, k-points, and k-point density and can calculate the energy-dependent lattice parameter values. These codes are mainly based on Prof. J. Kortus, R. Wirnata's Electr. Structure & Properties of Solids course notes and GPAW's tutorials. Scripts can easily be called with MPI:

gpaw -P<core_number> python optimize_cutoff.py -- Structure.cif
gpaw -P<core_number> python optimize_kpoints.py -- Structure.cif
gpaw -P<core_number> python optimize_kptsdensity.py -- Structure.cif
gpaw -P<core_number> python optimize_latticeparam.py -- Structure.cif

optimize_latticeparam.py can perform simultaneous calculation for lattice parameters a and c. And can also draw 3D contour graph for Energy versus lattice parameters (a and c).

examples/

There are some example calculations given with different usage scenarios. Please send us more calculations to include in this folder.

Input File Keywords

There are many keywords that can be used in input files. You can find more at here

Release notes

Release notes are listed at here.

Citing

Please do not forget that gpaw-tools is a UI/GUI software. For the main DFT calculations, it uses ASE and GPAW. It also uses the Elastic python package for elastic tensor solutions and ASAP with the KIM database for interatomic interaction calculations and Phonopy for the phonon calculations. Therefore, you must know what you use, and cite them properly. Here, the basic citation information of each package is given.

ASE

GPAW

KIM

Elastic

Phonopy

And for gpaw-tools usage, please use the following citation:

There are many other packages that need to be cited. With GPAW, you may need to cite LibXC or cite for LCAO, TDDFT, and linear-response calculations. Please visit their pages for many other citation possibilities. For more you can visit https://wiki.fysik.dtu.dk/ase/faq.html#how-should-i-cite-ase, https://wiki.fysik.dtu.dk/gpaw/faq.html#citation-how-should-i-cite-gpaw, and https://openkim.org/how-to-cite/.

Licensing

This project is licensed under the terms of the MIT license.

gpaw-tools's People

Contributors

aegenc avatar beyzalisesivdin avatar hokkagbaz avatar lgtm-migrator avatar sblisesivdin avatar

Stargazers

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

Watchers

 avatar  avatar

gpaw-tools's Issues

G0W0 Problem

We can remove the GW method from gpaw-tools because some of its features were removed from GPAW, as pointed out at https://wiki.fysik.dtu.dk/gpaw/releasenotes.html#version-22-8-0, and the rest is not mature enough.

Discussed in #77

Originally posted by LAZAARKOUSSAI January 1, 2024
MoS2 example error:


Number of atoms imported from CIF file:3
Spacegroup of CIF file (from SPGlib): Amm2 (38)
Special Points usable for this spacegroup: {'G': array([0., 0., 0.]), 'A': array([0. , 0. , 0.5]), 'H': array([0.33333333, 0.33333333, 0.5 ]), 'K': array([0.33333333, 0.33333333, 0. ]), 'L': array([0.5, 0. , 0.5]), 'M': array([0.5, 0. , 0. ])}
Passing ground state calculation for GW calculation...
Traceback (most recent call last):
File "/home/....../gpaw-tools-main/gpawsolve.py", line 1842, in
gpawsolver.groundcalc()
File "/home/....../gpaw-tools-main/gpawsolve.py", line 383, in groundcalc
gw = G0W0(struct+'-1-Result-Ground.gpw', filename=struct+'-1-', bands=(GW_valence_band_no, GW_conduction_band_no),
File "/home/....../.local/lib/python3.10/site-packages/gpaw/response/g0w0.py", line 1125, in init
super().init(filename=filename,
TypeError: G0W0Calculator.init() got an unexpected keyword argument 'method'

Need more benchmarks and suggestions for the next benchmark script

gpaw-tools/Benchmarks/ has only one computer benchmark. We need more benchmarks. If we go public as I mentioned in #3, it may be better to put a link or banner to home README.md to invite more benchmark results with merge requests.

Also, we may change the 2021 benchmark script. The structure that is calculated in 2021 script has a kpoint scheme of 20x1x1. Total of 20 kpoints will be very small to calculate in relatively big systems. It will be OK for PCs.

Is `shrinkgpw.py` necessary?

Can't we implement the feature of shrinkgpw.py in gpawsolve.py as an argument? For example -s argument. When you use this argument, calculations needed full wavefunctions (like electron density) will be done, at the end, this file will be changed with smaller one.

This is logical because if you use shrinkgpw.py, gpw file will have a new filename and -r argument will not be work. You must rename the gpw files.

Occupation method is missing

Is your feature request related to a problem? Please describe.
GPAW can use ‘fermi-dirac’, ‘marzari-vanderbilt’, ‘methfessel-paxton’, ‘fixed’, ‘tetrahedron-method’, ‘improved-tetrahedron-method’ and ‘orbital-free’ occupation calculations. And also, because of the large default smearing, optical results are not seemed to be realistic.

Describe the solution you'd like
We can add a new keyword "occupation" with value like {'name': 'fermi-dirac', 'width': 0.01}

Describe alternatives you've considered
n/a

Additional context
n/a

Better Python usage?

Up to this point, code simplicity, and better readability were important. However, to reach a wider developer spectrum, it may be better to use better Python practices. Usage of function based structure, usage of main etc.

Variable naming is not very elegant

Some of the variables used CamelCase, some used Snake_case, some used lower_snake. So we must choose a case style. But this change will be a big thing. gg.py and gpawsolve.py must be edited at the same time. Also, it will make compatibility issues with the older versions. Examples must be changed also. However, before having a user base, we can do it asap.

Restart mode must be enhanced for Band and Optical Calculations

For the band calculations and optical calculations, there are gpw files that are produced separately from the ground-state calculations gpw file. Therefore, when -r arg is used for band calculations and optical calculations, these separate gpw files can be used to continue, instead of using the ground-state calculation's gpw file.

Unnecessary variables in config files

Since v21.10.0, config files are used as input-parameters file, there are some parameters that do not related with computation: WantCIFexport and draw_graphs. Is it possible to move them as arguments to the gpawsolve.py command?

Going on public?

OK. As LRG, gpaw-tools meets our expectations with its current case. As a previous user of ATK2017, we mostly used force-field calculations for our pre-calculations and we are mostly interested in electronic and optical properties of the materials that we are interested in. With gpaw-tools we can do all of them now.

However, the current case of the gpaw-tools is highly dependent to LRG and mostly to @sblisesivdin . Therefore, it may be better to open it to public and can look for more developers and more study cases. It will be also good for issue hunting. Instead of -live and fix- type issue hunting, we may have many merge requests to investigate.

Also, as a firm believer of open source, @sblisesivdin will accept the idea of helping the many new DFT students to find gpaw, learn and practice DFT without any important knowledge of Python.

We need to discuss this.

Spin calculation do not work with gpaw version 22.1.0

I'm triying to perform the spin dependent calculation of WSe2. I use gpaw-tools 21.12.0 and the recent one 22.3.0. nothing changed. The program ended prematurely. However, when I'm using gpaw 21.6.0 instead of 22.1.0 it's working. Therefore, I think there is something wrong about the communication between the gpaw-tools and gpaw after gpaw version 22.1.0.
Thanks in advance.

quickoptimize.py must be enhanced

The current script is doing calculations with Atoms import in the script. However, it can be simply changed as gpawsolve.py to import cif file and export as cif file.

Code is not working with calling gpaw

After 7918019 or somewhere near, code is not working anymore with calling gpaw as:

gpaw -P5 python gpawsolve.py -o -c config.py -i inputfile.cif

but working with:

python gpawsolve.py -o -c config.py -i inputfile.cif

Lack of hybrid functionals

gpawsolve.py can solve with known XCs like LDA, PBE, revPBE and RPBE. However, hybrid functionals are used widely nowadays. We need to implement the usage of hybrid functionals -at least one of them quickly- asap.

Calculation log is not shown until matplotlib windows closed in gg.py

In gg.py, after finishing a calculation with "draw DOS and band figures" options highlighted, the Calculation general log is not drawn after matplotlib figures are shown.

gg.py is logically independent of gpawsolve.py. Therefore we may expect that the final state of the log must be drawn.

GW0 or G0W0?

Line 214 of gpawsolve.py is showing the method as 'GW0', not 'G0W0'. We need to correct it try to write for both.

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.