abacusmodeling / ABACUS-orbitals

4 stars 6 forks source link

Refactor&Feature: new version of orbital generation code with cleaner front-end interface, new spillage optimization method #7

Open kirk0830 opened 9 months ago

kirk0830 commented 9 months ago

BELOW I ATTACH README OF THE NEW VERSION:

ABACUS-orbitals

Configuration

Virtual environment

WE STRONGLY RECOMMEND TO SETUP A NEW CONDA ENVIRONMENT/VIRTUAL ENVIRONMENT FOR ABACUS-ORBITALS.

git clone https://github.com/kirk0830/abacus_orbital_generation.git
cd abacus_orbital_generation

Option1: If you prefer to use conda, then run the following commands to create a new conda environment and activate it.

conda create -n abacus_orbitals
conda activate abacus_orbitals

Option2: If you prefer to use virtual environment, then run the following commands to create a new virtual environment and activate it.

python3 -m venv abacus_orbitals
source abacus_orbitals/bin/activate

Installations

PERFORMANCE NOTE: WE RECOMMEND USE CONDA TO INSTALL pytorch PACKAGE BY conda install pytorch FIRST AND INSTALL ALL OTHERS BY FOLLOWING INSTRUCTION BELOW BE AWARE IF Intel-mkl IS SUCCESSFULLY LINKED TO pytorch
Once the virtual environment is activated (and mkl is ready), run the following commands to install ABACUS-orbitals.

pip install -e .

Tutorial (version < 0.2.0)

Find the tutorial in Gitbook written by Mohan Chen's Group.

input parameter description (version < 0.2.0)

An example of input script is shown below:

# PROGRAM CONFIGURATION
#EXE_env                                
EXE_mpi             mpirun -np 1        
EXE_pw              abacus              

# ELECTRONIC STRUCTURE CALCULATION
element             Fe                  
Ecut                100                 
Rcut                6 7 8 9 10          
Pseudo_dir          ./download/pseudopotentials/sg15_oncv_upf_2020-02-06/1.2
Pseudo_name         Fe_ONCV_PBE-1.2.upf 
smearing_sigma      0.015               

# REFERENCE SYSTEMS
# identifier     shape          nbands         lmax           nspin          bond_lengths   
  STRU1          dimer          8              3              1              1.8 2.0 2.3 2.8 3.8
  STRU2          trimer         10             3              1              1.9 2.1 2.6    

# SIAB PARAMETERS
max_steps 9000
# orb_id         stru_id        nbands_ref     orb_ref        orb_config     
  Level1         STRU1          4              none           2s1p1d         
  Level2         STRU1          4              fix            4s2p2d1f       
  Level3         STRU2          6              fix            6s3p3d2f       

# SAVE
# save_id        orb_id         zeta_notation  
  Save1          Level1         SZ             
  Save2          Level2         DZP            
  Save3          Level3         TZDP           

PROGRAM CONFIGURATION

In this section, user should define the executable files and the number of processors used in the calculation. The executable file of ABACUS is abacus. The executable file of MPI is mpirun. The number of processors used in the calculation is defined by EXE_mpi. For example, if the number of processors is 4, then EXE_mpi should be mpirun -np 4.

ELECTRONIC STRUCTURE CALCULATION

In this section, user should define the parameters used in the electronic structure calculation. The parameters are listed below:

REFERENCE SYSTEMS

In this section, user should define the reference systems. Reference systems' wavefunctions are training set of numerical atomic orbitals, therefore the quailities of numerical atomic orbitals are determined by the specifications of reference systems and learning configurations. The parameters are listed below:

SIAB PARAMETERS

In this section, user should define the parameters of SIAB. The parameters are listed below:

SAVE

In this section, user should define the orbitals to save. The parameters are listed below:

input parameter description (version >= 0.2.0)

In version >= 0.2.0, many parameters are removed due to redundancy. The input script is shown below:

{
    "environment": "module load intel/2019.5.281 openmpi/3.1.4 intel-mkl/2019.5.281 intel-mpi/2019.5.281",
    "mpi_command": "mpirun -np 1",
    "abacus_command": "abacus",

    "pseudo_dir": "./download/pseudopotentials/sg15_oncv_upf_2020-02-06/1.2",
    "pesudo_name": "Fe_ONCV_PBE-1.2.upf",
    "ecutwfc": 100,
    "bessel_nao_rcut": [6, 7, 8, 9, 10],
    "smearing_sigma": 0.015,

    "optimizer": "pytorch.SWAT",
    "spillage_coeff": [0.5, 0.5],
    "max_steps": 9000,

    "reference_systems": [
        {
            "shape": "dimer",
            "nbands": 8,
            "nspin": 1,
            "bond_lengths": "auto"
        },
        {
            "shape": "trimer",
            "nbands": 10,
            "nspin": 1,
            "bond_lengths": [1.9, 2.1, 2.6]
        }
    ],
    "orbitals": [
        {
            "zeta_notation": "SZ",
            "shape": "dimer",
            "nbands_ref": 4,
            "orb_ref": "none"
        },
        {
            "zeta_notation": "DZP",
            "shape": "dimer",
            "nbands_ref": 4,
            "orb_ref": "SZ"
        },
        {
            "zeta_notation": "TZDP",
            "shape": "trimer",
            "nbands_ref": 6,
            "orb_ref": "DZP"
        }
    ]
}

or given in plain text:

# PROGRAM CONFIGURATION
environment         module load intel/2019.5.281 openmpi/3.1.4 intel-mkl/2019.5.281 intel-mpi/2019.5.281
mpi_command         mpirun -np 1
abacus_command      abacus
# ELECTRONIC STRUCTURE CALCULATION
pseudo_dir          ./download/pseudopotentials/sg15_oncv_upf_2020-02-06/1.2
pesudo_name         Fe_ONCV_PBE-1.2.upf
ecutwfc             100
bessel_nao_rcut     6 7 8 9 10
smearing_sigma      0.015        # optional, default 0.015
ks_solver           cg           # optional, default dav
mixing_type         broyden      # optional, default broyden
mixing_ndim         8            # optional, default 8
mixing_beta         0.7          # optional, default 0.7
# SIAB PARAMETERS
optimizer           pytorch.SWAT # optimizers, can be pytorch.SWAT, SimulatedAnnealing, ...
spillage_coeff      0.5 0.5      # order of derivatives of wavefunction to include in Spillage, can be 0 or 1.
max_steps           9000
# REFERENCE SYSTEMS
# shape    nbands    nspin    bond_lengths   
  dimer    8         1        auto
  trimer   10        1        1.9 2.1 2.6
# ORBITALS
# zeta_notation    shape    nbands_ref   orb_ref
  SZ               dimer    4            none
  DZP              dimer    4            SZ
  TZDP             trimer   6            DZP

PROGRAM CONFIGURATION

In this section, user should define the executable files and the number of processors used in the calculation. The executable file of ABACUS is abacus. The executable file of MPI is mpirun. The number of processors used in the calculation is defined by mpi_command. For example, if the number of processors is 4, then mpi_command should be mpirun -np 4.

ELECTRONIC STRUCTURE CALCULATION

In this section, user should define the parameters used in the electronic structure calculation. As long as the parameters are available in ABACUS, they can be defined in this section. Some necessary and useful parameters are listed below:

SIAB PARAMETERS

In this section, user should define the parameters of SIAB. The parameters are listed below:

REFERENCE SYSTEMS

In this section, user should define the reference systems. Reference systems' wavefunctions are training set of numerical atomic orbitals, therefore the quailities of numerical atomic orbitals are determined by the specifications of reference systems and learning configurations. The parameters are listed below: