Giter Site home page Giter Site logo

jageo / lobsterpy Goto Github PK

View Code? Open in Web Editor NEW
64.0 1.0 27.0 129.84 MB

Package to perform automatic bonding analysis with the program Lobster in the field of computational materials science and quantum chemistry

Home Page: https://jageo.github.io/LobsterPy/

License: BSD 3-Clause "New" or "Revised" License

Python 98.48% TeX 1.52%
computational-chemistry plotting chemical-bonding materials-informatics python computational-materials-science

lobsterpy's Introduction

CI Status pre-commit.ci status codecov build-docs PyPI version PyPI downloads Downloads supported python versions DOI status

Getting started

LobsterPy Logo which consists of a green Python and a red Lobster

LobsterPy is a package that enables automatic analysis of LOBSTER outputs to get summarized bonding information and relevant bond plots. Additionally, one can also generate features for machine learning studies from LOBSTER outputs. One can download LOBSTER from http://www.cohp.de.

Important

Recently released LOBSTER 5.0 now generates POSCAR.lobster for any kind of LOBSTER calculation by default (This file has same format as the POSCAR from VASP). Thus, LobsterPy in principle, now supports usage with all DFT codes supported by LOBSTER and is no longer limited to VASP. Almost all of the core functionalities of LobsterPy could be used. The user must use POSCAR.lobster for path_to_poscar and -fstruct argument in python and cli interface, respectively.

The only functionality limited to VASP is DOS comparisons and basis set analysis in the calc_quality_summary method of the Analysis class, as it relies on VASP output files, namely vasprun.xml and POTCAR.

Please note that LobsterPy relies on the LOBSTER computation output files. Thus, it will be only able to analyze data that has been computed in the LOBSTER run.

LobsterPyAnimation

Installation

Python version

Before the installation, please make sure that you are using one of the supported Python versions (see pyproject.toml).

Standard installation

Install using pip install lobsterpy

Installation with featurizer

Install using pip install lobsterpy[featurizer]

Basic usage

  • Automatic analysis and plotting of COHPs / COBIS / COOPs:

    Output Automatic Analysis

You can use lobsterpy description for an automated analysis of COHPs for relevant cation-anion bonds or lobsterpy automatic-plot to plot the results automatically. It will evaluate all COHPs with ICOHP values down to 10% of the strongest ICOHP. You can enforce an analysis of all bonds by using lobsterpy automatic-plot --allbonds. You can also switch the automatic analysis to use the ICOBIs or ICOOPs. You need to add --cobis or --coops along with the mentioned commands for e.g.like lobsterpy description --cobis

An interactive plotter is available via lobsterpy automatic-plot-ia.

Currently, the computed Mulliken charges will be used to determine cations and anions. If no CHARGE.lobster is available, the algorithm will fall back to the BondValence analysis from pymatgen.

Please be aware that LobsterPy can only analyze bonds that have been included in the initial Lobster computation. Thus, please use the cohpgenerator within Lobster (i.e., put cohpGenerator from 0.1 to 5.0 in the lobsterin).

It is also possible to start this automatic analysis from a Python script. See "examples" for scripts.

  • Plotting DOS from LOBSTER computations:

    To plot densities of states obtained from LOBSTER use lobsterpy plot-dos.

  • Generic COHP/ COOP / COBI plotter:

    We included options to plot COHPs/COBIs/COOPs from the command line. lobsterpy plot 1 2 will plot COHPs of the first and second bond from COHPCAR.lobster. It is possible to sum or integrate the COHPs as well (--summed, --integrated). You can switch to COBIs or COOPs by using --cobis or --coops, respectively.

  • Other command line tools:

    lobsterpy create-inputs will create standard inputs based on existing POSCAR, POTCAR, and INCAR files. It will allow testing for different basis sets that are available in Lobster. This feature is currently only available for PBE_54 POTCARs, as only the pbeVASPfit2015 basis in LOBSTER that has been fitted to PBE POTCARs includes additional orbitals relevant to solid-state materials. Please check out our publication https://doi.org/10.1002/cplu.202200123 and LOBSTER program manual for more information

  • Further help?

    You can get further information by using lobsterpy --help and also by typing lobsterpy description --help, lobsterpy automatic-plot --help, lobsterpy plot --help.

Comprehensive documentation

Contributing

A short guide to contributing to LobsterPy can be found here. Additional information for developers can be found here.

How to cite?

Please cite our paper: A. A. Naik, K. Ueltzen, C. Ertural, A. J. Jackson, J. George, Journal of Open Source Software 2024, 9, 6286. https://joss.theoj.org/papers/10.21105/joss.06286. Please cite pymatgen, Lobster, and ChemEnv correctly as well.

You can find more information on the methodology of the automatic analysis in J. George, G. Petretto, A. Naik, M. Esters, A. J. Jackson, R. Nelson, R. Dronskowski, G.-M. Rignanese, G. Hautier, ChemPlusChem 2022, 87, e202200123. https://doi.org/10.1002/cplu.202200123.

LobsterPy is now a part of an atomate2 workflow

LobsterWorkflow

We have now also included the automatic analysis into a fully automatic workflow using VASP and Lobster in atomate2. More documentation and information will follow soon.

Acknowledgements

The development of the program has been supported by a computing time grant. We gratefully acknowledge the Gauss Centre for Supercomputing e.V. (www.gauss-centre.eu) for funding this project by providing computing time on the GCS Supercomputer SuperMUC-NG at Leibniz Supercomputing Centre (www.lrz.de) (project pn73da).

lobsterpy's People

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  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

lobsterpy's Issues

Increase test coverage cli.py

There are a few lines in the cli.py that are not yet covered by tests including

        if args.addtotaldos:
            dos_plotter.add_dos(dos=lobs_dos, label="Total DOS")

)
Maybe, we could address this.

plotting DOS or COXX not possible with latest lobsterpy version

Describe the bug
when plotting things with lobsterpy via lobterpy autoplot or lobsterpy plotdos, the following error is thrown:
OSError: '/home/certural/miniconda3/envs/atomate2/lib/python3.10/site-packages/lobsterpy/plotting/lobsterpy_base.mplstyle' not found in the style library and input is not a valid URL or path; see style.available for list of available styles

To Reproduce
e.g. lobsterpy plotdos

Expected behavior
Plotting nice plots

PS: this issue is more for documentation @naik-aakash is already working on a fix :)

Inspection for lobsterout

Add something to inspect a lobsterout and other lobsteroutputs so that user's can be confident about their lobster results.

Easy lobsterin generation

Add an option to the commandline to generate lobsterin and compute number of bands based on a POSCAR and POTCAR file. Doing this via pymatgen or within atomate is currently a bit labor-intensive.

Documentation/Tutorial

A tutorial with the basic functions of lobsterpy might be useful for users that have never done a Lobster computation.

Add more bond options

Add all potential options for bonds that are also available in pymatgen:

e.g., only cation-cation bonds

Orbital-resolved automatic analysis

Is your feature request related to a problem? Please describe.
I would like to implement an automatic analysis including orbital-resolved interactions. I will add this as an additional option so that people can also skip the orbital-resolved analysis.

I hope to accomplish this in the next 4 weeks.

update test durations files

After merging all the PRs and reorganizing test files, update the old test durations files for optimized pytest runs

calc_quality_summary : dict keys needs to follow snakecase and some renaming

Currently not all keys do not have snake_case convention: got over looked in paper

As lot of things are changed compared to our publication, maybe better to fix them now itself.

Also for example some keys like : charges and bandoverlaps could be renamed to be bit more descriptive as our larger schema already same keys with different data in it on top level

What do you think @JaGeo ?

Code-agnostic automatic analyisis

It would be good to get our automatic analysis working for QE and Abinit outputs as well.

@davSchnieders, it would be great if you could provide a sample output. We could then make automatic analysis work for QE as well.

clean up cli argparse

Currently, lot of not necessary arguments show up for differnent possible actions. Could be cleanup a bit by regrouping the args

Skip showing of plots in automatic analysis

Is your feature request related to a problem? Please describe.
For large structures, there should be the option to skip the showing of the plots and only the save option should be used.

This has to be tested and also added to command line tools.

Orbital resolved data in featurizer

Add possibility to obtain orbital-resolved features in featurizer . Should be useful to get data for orbital interaction diagrams as well

  • COXX fingerprints
  • COXX center, width, skew, kurtosis

some error

Hi,
when I run lobsterpy automatic-plot ,it reported as followed,
/data/software/anaconda/2020.07/envs/lobsterpy/lib/python3.8/site-packages/pymatgen/electronic_structure/cohp.py:164: UserWarning: This method has not been tested on many examples. Check the parameter limit, pls!
warnings.warn("This method has not been tested on many examples. Check the parameter limit, pls!")
and it did not generate any results.How can solve the problem.thanks
zhou chao

Some train ๐Ÿš‚ thoughts

Recently with the new and temporary students (that are also rather inexperienced with using cli etc.) I think a lot about user friendliness. So I thought maybe it is a good idea to have a default functionality for each lobsterpy feature e.g. lobsterpy plotdos will automatically do something like lobsterpy plotdos --elements [list of atoms from POSCAR] instead of throwing an error. The default should be chosen in a way to get most out of it with minimum complexity (e.g. in case of the DOS plotting elementwise DOS is more common than plotting orbitalwise DOS and also maybe easier to comprehend for beginners (I'm not sure about the last part, but when I learned this stuff a good while ago, this was true for me)).
Since I try to improve my programming skills in python (and C++) anyways by doing exercises on the weekend or so, I thought maybe I could implement it the next WE, if you (@JaGeo and @naik-aakash) are ok with this?

Update readme

We need to update the installation process description in the readme.

question

Describe the bug
when i run lobsterpy automatic-plot --allbonds
it reported
/data/software/anaconda/2020.07/envs/lobsterpy/lib/python3.8/site-packages/pymatgen/electronic_structure/cohp.py:164: UserWarning: This method has not been tested on many examples. Check the parameter limit, pls!
warnings.warn("This method has not been tested on many examples. Check the parameter limit, pls!")
The compound CrN has 1 symmetry-independent atoms(s) with relevant bonds: Cr1.
Cr1 has a single (CN=1) coordination environment. It has 1 Cr-Cr (mean ICOHP: -0.2 eV, antibonding interaction below EFermi) bonds.

what does it mean ? the Cr-Cr is anti bonding? but i cannot seen it in my picture. And it did not generate any output? How can I do with it.I asked before, but I didn't check the reply in time. I'm very sorry to ask again

Test speed-up

As the tests are currently taking forever to run, we (@naik-aakash) should probably also look into speeding up the tests and linting. I had in mind to maybe also switch to a ruff linter.

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.