Author Topic: Convergence of dE and dH  (Read 3916 times)

0 Members and 1 Guest are viewing this topic.

Offline asanchez

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: ie
  • Reputation: 1
    • View Profile
Convergence of dE and dH
« on: July 26, 2015, 15:19 »
I have a question regarding the convergence of these two reported values (dE & dH). When running DFT calculations with 1000+ atoms I notice that often the convergence of dH gets below tolerance (by default 1.e-5 iirc) much before dE. The difference also tends to be a couple of orders of magnitude.

I wonder if this is because dE refers to the total system energy (extensive property) whereas dH is per matrix element which if I understand correctly shouldn't scale with the number of atoms in the system.

If so, wouldn't it make sense to set all tolerances to be per atom?

I understand that calculations usually converge dE in a few more steps anyway but when dealing with large systems each extra iteration might mean a sizeable amount of time.

Thanks for your time

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 94
    • View Profile
    • QuantumATK at Synopsys
Re: Convergence of dE and dH
« Reply #1 on: July 27, 2015, 12:09 »
But doing so would just converge dE even quicker, still leaving dH trailing, no? Because "per atom" would mean dE/N but still H. Or did I miss your point?

I think it's more a question that the band structure energy (note that E is not the DFT total energy, it's the weighted sum of occupied states) becomes stable but the SCF loop still needs to move some charge between different orbitals to get a converged density matrix/Hamiltonian. So you could have an "almost-converged" state where the total energy is ok, but things like forces and even band structures may not look so good, if you interrupt earlier. One should also note that the default convergence criterion 4e-5 in ATK is actually quite lax, for really good forces etc one should typically go down an order of magnitude more.

Offline asanchez

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: ie
  • Reputation: 1
    • View Profile
Re: Convergence of dE and dH
« Reply #2 on: July 27, 2015, 13:41 »
Well I thought convergence of both quantities (dE & dH) would still be required. So if dE is converged and you have to wait for dH to be that's perfectly fine. I just wondered if it's necessary the other way around (i.e., does it make sense to wait for dE once dH is converged or is it a waste of time?).

I am not an expert on these things of course it just occurred to me that if we require two quantities to be converged to the same level they should be comparable. And if dE is extensive (scales with the total number of atoms) and dH isn't it seems strange to me.

You may encounter a situation in which you have many atoms and even though the individual H matrix elements are converged you still struggle to get E to converge to the desired threshold. If we're using, for example, a 1.e-6 tolerance, and we have 1000 atoms we could have at some point dH < 1.e-6 and dE ~ 1.e-5. There being 1.e3 atoms I would think that dE is actually converged to the same level of accuracy (if not more) as dH since that 1.e-5 refers to 1000 atoms whereas dH refers to individual matrix elements.

Just a thought anyway, I'm no expert. I'll have to think a bit more about E being the weighted sum of occupied states and what that means for convergence of the quantity. Very interesting reading your replies though so thank you for taking the time.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 94
    • View Profile
    • QuantumATK at Synopsys
Re: Convergence of dE and dH
« Reply #3 on: July 27, 2015, 16:38 »
I have actually never seen dH converge before dE, unless something is wrong (and dH is zero for some reason), so I'm not sure it's a practical concern at all.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5571
  • Country: dk
  • Reputation: 94
    • View Profile
    • QuantumATK at Synopsys
Re: Convergence of dE and dH
« Reply #4 on: July 28, 2015, 17:48 »
Ah well, for bulk supercells, depending on how you mix, dH can converge slightly faster. But you still want dE below the same level, esp. considering what I mentioned about the default tolerance not being so strict.