-
-
Couldn't load subscription status.
- Fork 650
Description
I have found a bug in the initial guess for PBC DFT in (v2.5) (881dbbe) when I check against previous versions like (v2.2) (6eb7542)
I have made a minimal example to demonstrate what I observe in Uranium Nitride (UN):
import numpy as np
from pyscf.pbc import gto, df, tools
from pyscf.pbc import scf, dft
import scipy.linalg as LA
from pyscf import lib
from pyscf.df import addons
import pyscf.lib.chkfile as chk
import os
import sys
import argparse
cell = gto.M(
a = '''
0.000000000000000000e+00 2.444999999999999840e+00 2.444999999999999840e+00
2.444999999999999840e+00 0.000000000000000000e+00 2.444999999999999840e+00
2.444999999999999840e+00 2.444999999999999840e+00 0.000000000000000000e+00
''',
atom = '''
U 0.0 0.0 0.0
N 2.445 2.445 2.445
''',
unit = 'A',
basis = {'U': 'stuttgart-rsc', 'N': '6311g*'},
ecp = {'U': 'stuttgart-rsc'},
verbose = 7,
spin = 81, # 3x3x3 kmesh with spin 3/2 per kpt
)
cell.exp_to_discard = 0.1 # Removing diffuse functions
cell.build()
kmesh_old = cell.make_kpts([3,3,3])
mydf = df.GDF(cell)
mydf._prefer_ccdf = True
mydf.auxbasis = df.aug_etb(cell, beta=2.0)
mydf.kpts = kmesh_old
if os.path.exists("cderi.h5"):
mydf._cderi = "cderi.h5"
else:
mydf._cderi_to_save = "cderi.h5"
mydf.build()
mf = dft.KUKS(cell,kmesh_old).density_fit()
mf.kpts = mydf.kpts
mf.xc = 'pw91'
mf.with_df = mydf
mf.diis_space = 20
mf.diis_start_cycle = 3
mf.damp = 0.7
mf.grids.level = 9
mf.grids.prune = None
mf.max_cycle = 100
mf.kernel()
mf.analyze()
Here are the energies for UN in v2.5
3x3x3 -531.992945510117
4x4x4 -569.799533455806
5x5x5 -894220.28236006
Here are the energies for UN in v2.2
3x3x3 -531.99293375993
4x4x4 -531.996483180298
5x5x5 -531.995971287258
In my findings, both versions agree for energy and Mullikan occupations in a smaller kmesh like 3x3x3, but in any kmesh higher than this, the energies start to differ from each other by a considerable amount. The unphysically large energies show up from the first iteration, and this behavior persists across different guess options, such as 'minao' (my basic example), '1e', and 'atom'.
If we look at just 4x4x4 kmesh, and compare between versions, this may be due in part to occupations placed in the polarized orbitals of N.
v2.5
pop of 1 N 3dxy 0.00000 | 0.00000
pop of 1 N 3dyz 0.00000 | 0.00000
pop of 1 N 3dz^2 0.53124 | 0.53106
pop of 1 N 3dxz 0.39283 | 0.39280
pop of 1 N 3dx2-y2 0.00063 | 0.00063
v2.2
pop of 1 N 3dxy 0.00000 | 0.00000
pop of 1 N 3dyz 0.00000 | 0.00000
pop of 1 N 3dz^2 0.00061 | 0.00060
pop of 1 N 3dxz 0.00135 | 0.00134
pop of 1 N 3dx2-y2 0.00061 | 0.00060