question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KRKS with MDF fails to converge

See original GitHub issue

I’m trying to run examples/pbc/21-k_points_all_electron_scf.py, but the KRHF job with MDF fails to converge. Then I tried KRKS with 6-31gs and three different DFs, and found that only KRKS with MDF fails, while GDF and RSDF works well. My input looks like

 lib.num_threads(28)

cell = gto.M(
    a = numpy.eye(3)*3.5668,
    atom = '''C     0.      0.      0.
              C     0.8917  0.8917  0.8917
              C     1.7834  1.7834  0.
              C     2.6751  2.6751  0.8917
              C     1.7834  0.      1.7834
              C     2.6751  0.8917  2.6751
              C     0.      1.7834  1.7834
              C     0.8917  2.6751  2.6751''',
    basis = '6-31gs',
    verbose = 4,
)

nk = [4,4,4]  # 4 k-poins for each axis, 4^3=64 kpts in total
kpts = cell.make_kpts(nk)

# Mixed density fitting
#
kmf = scf.KRKS(cell, kpts).mix_density_fit()
# In the MDF scheme, modifying the default mesh for PWs to reduce the cost
# The default mesh for PWs is a very dense-grid scheme which is automatically
# generated based on the AO basis. It is often not necessary to use dense grid
# for MDF method.
kmf.xc = 'bp86'
kmf.with_df.mesh = [10,10,10]
kmf.kernel()

# Density fitting
#
kmf = dft.KRKS(cell, kpts).density_fit(auxbasis='weigend')
kmf.xc = 'bp86'
kmf.kernel()

# Range-separated density fitting (RSDF)
# RSDF uses the same amount of memory & disk as GDF and achieves a similar
# accuracy as GDF but is often 5~10x faster than GDF in the DF initialization
# step. The following run should give an energy very close to the one above.
# see '35-range_separated_density_fitting.py' for more details of RSDF.
#
kmf = dft.KRKS(cell, kpts).rs_density_fit(auxbasis='weigend')
kmf.xc = 'bp86'
kmf.kernel()

The last part of output of MDF:

cycle= 48 E= -303.852099067206  delta_E= 0.000118  |g|= 5.63  |ddm|= 3.24
HOMO = 0.503518440799  LUMO = 0.650701422235
cycle= 49 E= -303.852167596699  delta_E= -6.85e-05  |g|=  5.6  |ddm|= 0.882
HOMO = 0.503541680834  LUMO = 0.650693150238
cycle= 50 E= -303.852098370327  delta_E= 6.92e-05  |g|= 5.63  |ddm|= 1.12
SCF not converged.
SCF energy = -303.852098370327

while GDF and RSDF both converges to an energy around -304.914. I’m using version d096d6f.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sunqmcommented, Jan 6, 2022

MDF may break the symmetry between k-points. For example, integrals (i_k1,j_k2|k_k2,l_k1) should be conjugated to (i_k2,j_k1|k_k1,l_k2). If they are computed with GDF or regular FT, we can find the symmetry. This symmetry is not strictly held in MDF. It may produce large errors when computing KHF exchange . It should not affect integrals in pure DFT. I’m not clear why bp86 shows such big numerical error. So the best solution for the moment is to use GDF only in your calculations

0reactions
hebrewsnablacommented, Sep 19, 2022

Pulling #1429 (and using odd number of mesh) resolves this problem. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

https://pyscf.org/_sources/user/pbc/scf.rst.txt
KRHF(cell, kpts=cell.make_kpts([2,2,2])).run() # converged SCF energy ... The finite-size error of the exchange energy decays as :math:`N_k^{-1}`, ...
Read more >
On the experimental design of the material microstructures - CORE
Also, if 1000⇥1000 does not contain the full information then the KL norm will not show asymptotic convergence for scan sizes less than...
Read more >
Development of Support Vector Machines (SVMs) in Graphics ...
In summary, theparameter change is a driver for the rate of convergence for training error in thealgorithm [13].Visually, the perceptron decision surface ...
Read more >
(PDF) A homotopy between the solutions of the elastic and ...
We give error estimates with respect to the homotopy parameter. ... strong convergence e. everywhere 2 The two boundary value problems Let Ω...
Read more >
Development of Support Vector Machines (SVMs) in ... - CISUC
Thus, current single-threaded algorithms are often unable to scale with the de- ... experiment using the all kernels and the combination features MDF....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found