Code Monkey home page Code Monkey logo

deeph-e3's Introduction

DeepH-E3

This code is the implementation of the DeepH-E3 method described in the paper General framework for E(3)-equivariant neural network representation of density functional theory Hamiltonian (arXiv:2210.13955).

You can find demo input files and instructions in these repositories: Dataset 1, Dataset 2 and Dataset 3. These are also the datasets used by the paper, so you can try to reproduce the results in the paper using those datasets.

The current code will be integrated into DeepH-pack in the future.

Installation

To use DeepH-E3, the following environment is required:

Python

The python interpreter version needs to be at least 3.9. The following packages are also needed:

  • Numpy
  • PyTorch = 1.9.0
  • PyTorch geometric = 1.7.2
  • e3nn version 0.3.5
  • h5py
  • TensorBoard
  • pathos
  • pymatgen

Julia

The installation of Julia is optional. If you want to parse openmx output and convert into the format used by DeepH-E3, or do sparse matrix diagonalization to obtain the band structure from DeepH-E3 output, then Julia is needed.

First prepare the Julia interpreter version 1.5.4. Then install the following packages:

  • Arpack.jl
  • HDF5.jl
  • ArgParse.jl
  • JLD.jl
  • JSON.jl
  • IterativeSolvers.jl
  • DelimitedFiles.jl
  • StaticArrays.jl

In order to use Julia with DeepH-E3, you have to add the julia executable to PATH.

Usage

The usage of DeepH-E3 is similar to that of DeepH-pack. Although not mandatory, it is recommended that you learn the usage of DeepH-pack first.

Preprocess

First, you have to convert the output of DFT codes to the format that can be directly read by DeepH-E3. It is recommended that you directly use the preprocess utility of DeepH-pack. You must set local_coordinate = False in the DeepH preprocess config.

DeepH-E3 also has its own input conversion utility. You can use the command

/path/to/deephe3-preprocess.py preprocess.ini

to preprocess DFT data. The default config file for preprocess.ini can be found in DeepH-E3/deephe3/default_configs/base_default.ini. This default config also includes a description of each input variables.

Train your model

Based on the data, one can train the DeepH-E3 model. Training can be done by the command

/path/to/deephe3-train.py train.ini

The default config file for train.ini can be found in DeepH-E3/deephe3/default_configs/train_default.ini. This default config also includes a description of each input variables.

Model inference

Once you have a trained model, you can use that model to predict the Hamiltonian of some material structures and get hamiltonians_pred.h5. Inference can be done by the command

/path/to/deephe3-eval.py eval.ini

The default config file for eval.ini can be found in DeepH-E3/deephe3/default_configs/eval_default.ini. This default config also includes a description of each input variables.

For large structures that are impossible to calculate with DFT, one needs the modified OpenMX code that only generates the overlap matrix: Overlap-only-OpenMX. In this case, DeepH-E3 needs the processed overlaps.h5 instead of hamiltonians.h5 to generate the crystal graph. You have to set inference=True in eval.ini.

deeph-e3's People

Contributors

xiaoxun-gong avatar mzjb avatar

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.