deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
171 stars 130 forks source link

How to use the function of deltaspin in abacus package to get training set? #4034

Closed kaiqi-wang closed 6 months ago

kaiqi-wang commented 6 months ago

Details

Dear everyone,

I want to use the deltaspin function in Abacus to generate a training dataset, and then use deepspin to train the potential function considering non collinear magnetism. What is the specific process to obtain a training set using abacus? Can you explain it in detail? Thank you in advance.

Have you read FAQ on the online manual http://abacus.deepmodeling.com/en/latest/community/faq.html

Task list for Issue attackers (only for developers)

hongriTianqi commented 6 months ago

@kaiqi-wang Thanks for your question. There are several materials for you to follow to facilitate your workflow:

  1. The ABACUS online manual: a. On how to set input paramters of a DeltaSpin calculation in ABACUS: https://abacus.deepmodeling.com/en/latest/advanced/input_files/input-main.html#deltaspin b. Explanation of the usage of the DeltaSpin method: https://abacus.deepmodeling.com/en/latest/advanced/scf/spin.html#constraint-dft-for-collinear-spin-polarized-calculations

  2. A hands-on notebook on how to run DeltaSpin examples in ABACUS: https://bohrium.dp.tech/notebooks/18421733825 (in Chinese)

  3. The DeePMD or DP-Gen process is the same as the process without DeltaSpin, except that you need to include the freedom of atomic magnetization. DeepSpin has been incorporated into DeepMD-kit after v2.2.2. You may consult https://docs.deepmodeling.com/projects/deepmd/en/r2/model/train-energy-spin.html#spin to get more information.

With the above materials, you might have been able to prepare training sets for DeePSPin with ABACUS. A full step by step workflow to follow is not available now. However, you may use the same full process that employs VASP ( https://bohrium.dp.tech/notebooks/8241832233) to build your own.

Thanks for your questions again. Please feel free to comment on this issue if you need more helps.

kaiqi-wang commented 6 months ago

Thank you for your patient response and I want to know that is the above process only one frames in a systems ? How can I get a series of frames? ( https://docs.deepmodeling.com/projects/deepmd/en/r2/data/index.html ) I notice the files in the path of _abacus-develop-3.6.0/examples/noncollinear/BCC_Fe_NCdeltaspin , and I would like to know is this a example to get a frame ? How can I get a series of frames to build a training set ?

I'm not sure my understanding is correct. So sincerely looking forward to your reply.

hongriTianqi commented 6 months ago

@kaiqi-wang In order to build a series of frames from one structure, you need to follow the following steps: (1) optimize the structure to get the ground-state structure and ground state magnetic moments. (2) perturb the structure to get perturbed ones. Using a function in dpdata, for example:

from dpgen.data.tools.create_random_disturb import create_disturbs_abacus_dev
abacus_stru_file = os.path.join("./", "STRU")
create_disturbs_abacus_dev(abacus_stru_file, nfile=10, dmax=0.1, etmax=0,write_d=False)

(3) perturb the atomic magnetization moments randomly for each of the structure.

The steps (2) and (3) might be combined to only one step.

kaiqi-wang commented 6 months ago

I am grateful for your reply and also have three questions about this.

  1. So after step (2) and (3), I will perform a deltaspin calculation on every possible perturb structrue and perturb magnetization monents in order to get a frame data, right?
  2. How to get atomic magnetization moments for each of the structure? Is possible to get it through like dpdata?
  3. Can a series of perturbative structure and magnetization moments be obtained in a AIMD process ?

I have a lot of questions, sorry to bother you.

hongriTianqi commented 6 months ago

@kaiqi-wang

  1. Yes, correct.
  2. The atomic magnetic moments can be set by rotating the spin direction or change the absolute value of the moments. There are no ready functions or scripts available now. One need to prepare it by themselves.
  3. Yes.
kaiqi-wang commented 6 months ago

thanks a lot. best wishes to you.

kaiqi-wang commented 6 months ago

@hongriTianqi hello, may I add your wechat?