maituoy / BayesianOpt4dftu

MIT License
37 stars 11 forks source link

The initial value of U & The switch of U for elements & The range of U & The choice of xc #24

Closed louiskywalker closed 1 year ago

louiskywalker commented 2 years ago

Hi Yu,

Thanks and congrats for your brilliant work!

I have few issues feel uncertain about, it will be so kind of you to help me out:

  1. How should I set my initial value of U? should I choose a known value from experience or LR method, or should I set it randomly, say, 0?

  2. When I set the U range from -10 to 10, sometimes, the iteration will stuck in the edge, like, -10, then the calculation will raise a KeyError, which will break the optimization. For situation like this, should I extend the range? If I extend it, what range is safe for the result? KeyError: 'Data point [-10.] is not unique'

Thank you so much for your time and patience!

maituoy commented 2 years ago

Sorry for the late response. For your questions:

  1. The initial U can be any value. It may affect the number of iterations you get to the global maximum.
  2. This is a common issue known to many bayesian optimization users. Currently, we do not have a perfect solution. Usually, we increase the kappa value so that the algorithm does not easily fall into a local maximum. If it is encountered with a large kappa value, in most cases, it means the optimization has converged (acquisition function sample to the same point).

Hope this helps!

Best, Maituo

louiskywalker commented 2 years ago

Sorry for the late response. For your questions:

  1. The initial U can be any value. It may affect the number of iterations you get to the global maximum.
  2. This is a common issue known to many bayesian optimization users. Currently, we do not have a perfect solution. Usually, we increase the kappa value so that the algorithm does not easily fall into a local maximum. If it is encountered with a large kappa value, in most cases, it means the optimization has converged (acquisition function sample to the same point).

Hope this helps!

Best, Maituo

Hi Maituo,

Thanks for your detailed reply, it really helps a lot!

I got two more issues when executing my GaN calculation:

①When executing the 1D optimization for Ga in zinc-blende GaN system which contains two atoms, the optimization shows monotonicity, which means as the U value decreases, the gap value increases, and it requires a U value lower than -30 eV to finish the iteration. I wonder if it is correct.

②When executing the 1D optimization for Ga in wurtzite GaN system which contains four atoms, I haven't find the right way to set the U type and value for all four atoms. In traditional calculation, I should set U value precisely and U type of (2,2,-1,-1) for atom Ga, Ga, N, N to launch a DFT+U calculation. But it seems I haven't find way to set the right params in input.json and .py files to launch my calc. Could you please help me walk through the predicament?

Thanks a lot for your patience and time!

maituoy commented 2 years ago

For your first question: Based on my understanding, It's rare to see a U value larger than 10 eV or less than -10 eV. If it happens, you may want to ask yourself if it contains any physical meanings. Since the algorithm will not judge if the result is physically meaningful or not. So if the U value leads to a closer band gap and band structure to the HSE result, I would say it's correct for the purpose of this code. But it will require your domain knowledge to justify it from the physics perspective.

For the second question, are the two Ga (N) atoms different from each other? If what you want to do is to set different U values to the Ga atoms separately, I don't think it's realizable with VASP. If they are the same, the only thing you have to change is the structure information in the input.json. The DFT+U part should be kept the same.

louiskywalker commented 2 years ago

Thanks for your patient reply!

For the first answer, I will check my input structure and params again to make sure they are physically meaningful.

For the second answer, I find that I misunderstand the +U method, which should attach U to elements rather than atoms separately in INCAR file.

Thanks again for your time!