pyscf 2.6.0__py3-none-macosx_11_0_arm64.whl → 2.6.2__py3-none-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyscf/__init__.py +1 -1
- pyscf/adc/__init__.py +0 -2
- pyscf/ao2mo/nrr_outcore.py +3 -3
- pyscf/ao2mo/outcore.py +3 -3
- pyscf/ao2mo/r_outcore.py +3 -3
- pyscf/ao2mo/semi_incore.py +2 -2
- pyscf/cc/ccsd_lambda.py +1 -1
- pyscf/cc/dfccsd.py +1 -1
- pyscf/cc/rccsd_lambda.py +1 -1
- pyscf/cc/rccsd_slow.py +1 -1
- pyscf/ci/cisd.py +1 -1
- pyscf/ci/ucisd.py +1 -1
- pyscf/df/df_jk.py +2 -0
- pyscf/df/incore.py +3 -1
- pyscf/df/outcore.py +3 -4
- pyscf/dft/__init__.py +0 -10
- pyscf/dft/gen_grid.py +1 -1
- pyscf/geomopt/__init__.py +1 -1
- pyscf/grad/ccsd.py +1 -1
- pyscf/grad/rhf.py +1 -0
- pyscf/grad/rks.py +1 -0
- pyscf/grad/uccsd.py +1 -1
- pyscf/gto/__init__.py +0 -1
- pyscf/gto/basis/__init__.py +0 -1
- pyscf/gto/eval_gto.py +11 -2
- pyscf/gto/mole.py +2 -2
- pyscf/hessian/dispersion.py +5 -5
- pyscf/hessian/rhf.py +1 -0
- pyscf/hessian/rks.py +1 -0
- pyscf/lib/chkfile.py +3 -2
- pyscf/lib/diis.py +1 -1
- pyscf/lib/libagf2.dylib +0 -0
- pyscf/lib/libao2mo.dylib +0 -0
- pyscf/lib/libcc.dylib +0 -0
- pyscf/lib/libcgto.dylib +0 -0
- pyscf/lib/libcvhf.dylib +0 -0
- pyscf/lib/libdft.dylib +0 -0
- pyscf/lib/libfci.dylib +0 -0
- pyscf/lib/libmcscf.dylib +0 -0
- pyscf/lib/libnp_helper.dylib +0 -0
- pyscf/lib/libpbc.dylib +0 -0
- pyscf/lib/libri.dylib +0 -0
- pyscf/lib/libxc_itrf.dylib +0 -0
- pyscf/lib/libxcfun_itrf.dylib +0 -0
- pyscf/lib/linalg_helper.py +4 -7
- pyscf/lib/misc.py +92 -15
- pyscf/lib/numpy_helper.py +1 -1
- pyscf/lib/parameters.py +1 -0
- pyscf/mcscf/chkfile.py +3 -2
- pyscf/mp/dfmp2.py +1 -1
- pyscf/mp/ump2.py +1 -1
- pyscf/mrpt/nevpt2.py +1 -1
- pyscf/pbc/adc/__init__.py +0 -1
- pyscf/pbc/cc/eom_kccsd_uhf.py +2 -2
- pyscf/pbc/cc/kccsd_rhf_ksymm.py +1 -0
- pyscf/pbc/cc/kccsd_t_rhf.py +1 -1
- pyscf/pbc/df/outcore.py +4 -4
- pyscf/pbc/df/rsdf.py +7 -4
- pyscf/pbc/df/rsdf_builder.py +3 -4
- pyscf/pbc/df/rsdf_helper.py +2 -2
- pyscf/pbc/dft/__init__.py +0 -12
- pyscf/pbc/dft/kgks.py +3 -0
- pyscf/pbc/dft/multigrid/multigrid.py +2 -2
- pyscf/pbc/dft/numint.py +1 -1
- pyscf/pbc/dft/numint2c.py +1 -0
- pyscf/pbc/lib/kpts.py +1 -1
- pyscf/pbc/mp/kmp2_ksymm.py +1 -0
- pyscf/pbc/mpicc/kccsd_rhf.py +1 -1
- pyscf/pbc/mpicc/kintermediates_rhf.py +6 -6
- pyscf/pbc/scf/__init__.py +0 -10
- pyscf/pbc/scf/ghf.py +1 -0
- pyscf/pbc/scf/hf.py +1 -1
- pyscf/pbc/scf/kghf.py +2 -0
- pyscf/pbc/scf/khf.py +1 -1
- pyscf/pbc/scf/khf_ksymm.py +1 -1
- pyscf/pbc/symm/group.py +1 -1
- pyscf/scf/__init__.py +0 -7
- pyscf/scf/chkfile.py +2 -1
- pyscf/scf/dhf.py +2 -2
- pyscf/scf/hf.py +6 -0
- pyscf/scf/ucphf.py +1 -1
- pyscf/solvent/__init__.py +1 -1
- pyscf/x2c/x2c.py +2 -2
- {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/METADATA +3 -3
- {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/RECORD +89 -89
- {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/WHEEL +1 -1
- {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/LICENSE +0 -0
- {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/NOTICE +0 -0
- {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/top_level.txt +0 -0
pyscf/lib/misc.py
CHANGED
|
@@ -23,6 +23,7 @@ Some helper functions
|
|
|
23
23
|
import os
|
|
24
24
|
import sys
|
|
25
25
|
import time
|
|
26
|
+
import random
|
|
26
27
|
import platform
|
|
27
28
|
import warnings
|
|
28
29
|
import tempfile
|
|
@@ -1111,8 +1112,52 @@ class call_in_background:
|
|
|
1111
1112
|
if self.executor is not None:
|
|
1112
1113
|
self.executor.shutdown(wait=True)
|
|
1113
1114
|
|
|
1115
|
+
class H5FileWrap(h5py.File):
|
|
1116
|
+
'''
|
|
1117
|
+
A wrapper for h5py.File that allows global options to be set by
|
|
1118
|
+
the user via lib.param.H5F_WRITE_KWARGS, which is imported
|
|
1119
|
+
upon startup from the user's configuration file.
|
|
1120
|
+
|
|
1121
|
+
These options are, as the name suggests, not used when the
|
|
1122
|
+
HDF5 file is opened in read-only mode.
|
|
1123
|
+
|
|
1124
|
+
Example:
|
|
1125
|
+
|
|
1126
|
+
>>> with temporary_env(lib.param, H5F_WRITE_KWARGS={'driver': 'core'}):
|
|
1127
|
+
... with lib.H5TmpFile() as f:
|
|
1128
|
+
... print(f.driver)
|
|
1129
|
+
core
|
|
1130
|
+
'''
|
|
1131
|
+
def __init__(self, filename, mode, *args, **kwargs):
|
|
1132
|
+
if mode != 'r':
|
|
1133
|
+
options = param.H5F_WRITE_KWARGS.copy()
|
|
1134
|
+
options.update(kwargs)
|
|
1135
|
+
else:
|
|
1136
|
+
options = kwargs
|
|
1137
|
+
super().__init__(filename, mode, *args, **options)
|
|
1138
|
+
|
|
1139
|
+
def _finished(self):
|
|
1140
|
+
'''
|
|
1141
|
+
Close the file and flush it if it is open.
|
|
1142
|
+
Flushing explicitly should not be necessary:
|
|
1143
|
+
this is intended to avoid a bug that unpredictably
|
|
1144
|
+
causes outcore DF to hang on an NFS filesystem.
|
|
1145
|
+
'''
|
|
1146
|
+
try:
|
|
1147
|
+
if super().id:
|
|
1148
|
+
super().flush()
|
|
1149
|
+
super().close()
|
|
1150
|
+
except AttributeError: # close not defined in old h5py
|
|
1151
|
+
pass
|
|
1152
|
+
except ValueError: # if close() is called twice
|
|
1153
|
+
pass
|
|
1154
|
+
except ImportError: # exit program before de-referring the object
|
|
1155
|
+
pass
|
|
1156
|
+
|
|
1157
|
+
def __del__(self):
|
|
1158
|
+
self._finished()
|
|
1114
1159
|
|
|
1115
|
-
class H5TmpFile(
|
|
1160
|
+
class H5TmpFile(H5FileWrap):
|
|
1116
1161
|
'''Create and return an HDF5 temporary file.
|
|
1117
1162
|
|
|
1118
1163
|
Kwargs:
|
|
@@ -1130,22 +1175,40 @@ class H5TmpFile(h5py.File):
|
|
|
1130
1175
|
>>> from pyscf import lib
|
|
1131
1176
|
>>> ftmp = lib.H5TmpFile()
|
|
1132
1177
|
'''
|
|
1133
|
-
def __init__(self, filename=None, mode='a',
|
|
1178
|
+
def __init__(self, filename=None, mode='a', prefix='', suffix='',
|
|
1179
|
+
dir=param.TMPDIR, *args, **kwargs):
|
|
1180
|
+
self.delete_on_close = False
|
|
1134
1181
|
if filename is None:
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1182
|
+
filename = H5TmpFile._gen_unique_name(dir, pre=prefix, suf=suffix)
|
|
1183
|
+
self.delete_on_close = True
|
|
1184
|
+
super().__init__(filename, mode, *args, **kwargs)
|
|
1185
|
+
|
|
1186
|
+
# Python 3 stdlib does not have a way to just generate
|
|
1187
|
+
# temporary file names.
|
|
1188
|
+
@staticmethod
|
|
1189
|
+
def _gen_unique_name(directory, pre='', suf=''):
|
|
1190
|
+
absdir = os.path.abspath(directory)
|
|
1191
|
+
random.seed()
|
|
1192
|
+
for seq in range(10000):
|
|
1193
|
+
name = ''.join(random.choices('abcdefghijklmnopqrstuvwxyz0123456789', k=8))
|
|
1194
|
+
filename = os.path.join(absdir, pre + name + suf)
|
|
1195
|
+
try:
|
|
1196
|
+
f = open(filename, 'x')
|
|
1197
|
+
except FileExistsError:
|
|
1198
|
+
continue # try again
|
|
1199
|
+
f.close()
|
|
1200
|
+
return filename
|
|
1201
|
+
raise FileExistsError("No usable temporary file name found")
|
|
1202
|
+
|
|
1203
|
+
def close(self):
|
|
1204
|
+
filename = self.filename
|
|
1205
|
+
self._finished()
|
|
1206
|
+
if self.delete_on_close:
|
|
1207
|
+
if os.path.exists(filename):
|
|
1208
|
+
os.remove(filename)
|
|
1209
|
+
def __exit__(self, type, value, traceback):
|
|
1210
|
+
self.close()
|
|
1139
1211
|
|
|
1140
|
-
def __del__(self):
|
|
1141
|
-
try:
|
|
1142
|
-
self.close()
|
|
1143
|
-
except AttributeError: # close not defined in old h5py
|
|
1144
|
-
pass
|
|
1145
|
-
except ValueError: # if close() is called twice
|
|
1146
|
-
pass
|
|
1147
|
-
except ImportError: # exit program before de-referring the object
|
|
1148
|
-
pass
|
|
1149
1212
|
|
|
1150
1213
|
def fingerprint(a):
|
|
1151
1214
|
'''Fingerprint of numpy array'''
|
|
@@ -1249,6 +1312,20 @@ class light_speed(temporary_env):
|
|
|
1249
1312
|
temporary_env.__enter__(self)
|
|
1250
1313
|
return self.c
|
|
1251
1314
|
|
|
1315
|
+
class h5filewrite_options(temporary_env):
|
|
1316
|
+
'''Within the context of this macro, extra keyword arguments are
|
|
1317
|
+
passed to h5py.File() whenever an HDF5 file is opened for writing.
|
|
1318
|
+
|
|
1319
|
+
Examples:
|
|
1320
|
+
|
|
1321
|
+
>>> with h5filewrite_options(alignment_interval=4096, alignment_threshold=4096):
|
|
1322
|
+
... f = lib.H5FileWrap('mydata.h5', 'w')
|
|
1323
|
+
>>> print(h5py.h5p.PropFAID.get_alignment(f.id.get_access_plist()))
|
|
1324
|
+
(4096, 4096)
|
|
1325
|
+
'''
|
|
1326
|
+
def __init__(self, **kwargs):
|
|
1327
|
+
super().__init__(param, H5F_WRITE_KWARGS=kwargs)
|
|
1328
|
+
|
|
1252
1329
|
def repo_info(repo_path):
|
|
1253
1330
|
'''
|
|
1254
1331
|
Repo location, version, git branch and commit ID
|
pyscf/lib/numpy_helper.py
CHANGED
|
@@ -1144,7 +1144,7 @@ class NPArrayWithTag(numpy.ndarray):
|
|
|
1144
1144
|
|
|
1145
1145
|
# Whenever the contents of the array were modified (through ufunc), the tag
|
|
1146
1146
|
# should be expired. Overwrite the output of ufunc to restore ndarray type.
|
|
1147
|
-
def __array_wrap__(self, out, context=None):
|
|
1147
|
+
def __array_wrap__(self, out, context=None, return_scalar=False):
|
|
1148
1148
|
if out.ndim == 0: # if ufunc returns a scalar
|
|
1149
1149
|
return out[()]
|
|
1150
1150
|
else:
|
pyscf/lib/parameters.py
CHANGED
|
@@ -53,6 +53,7 @@ OUTPUT_DIGITS = getattr(__config__, 'OUTPUT_DIGITS', 5)
|
|
|
53
53
|
OUTPUT_COLS = getattr(__config__, 'OUTPUT_COLS', 5)
|
|
54
54
|
LOOSE_ZERO_TOL = getattr(__config__, 'LOOSE_ZERO_TOL', 1e-9)
|
|
55
55
|
LARGE_DENOM = getattr(__config__, 'LARGE_DENOM', 1e14)
|
|
56
|
+
H5F_WRITE_KWARGS = getattr(__config__, 'H5F_WRITE_KWARGS', {})
|
|
56
57
|
|
|
57
58
|
L_MAX = 8
|
|
58
59
|
ANGULAR = 'spdfghik'
|
pyscf/mcscf/chkfile.py
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#
|
|
21
21
|
|
|
22
22
|
import h5py
|
|
23
|
+
from pyscf.lib import H5FileWrap
|
|
23
24
|
from pyscf.lib.chkfile import load
|
|
24
25
|
from pyscf.lib.chkfile import dump, save
|
|
25
26
|
from pyscf.lib.chkfile import load_mol, save_mol
|
|
@@ -45,11 +46,11 @@ def dump_mcscf(mc, chkfile=None, key='mcscf',
|
|
|
45
46
|
#if ci_vector is None: ci_vector = mc.ci
|
|
46
47
|
|
|
47
48
|
if h5py.is_hdf5(chkfile):
|
|
48
|
-
fh5 =
|
|
49
|
+
fh5 = H5FileWrap(chkfile, 'a')
|
|
49
50
|
if key in fh5:
|
|
50
51
|
del (fh5[key])
|
|
51
52
|
else:
|
|
52
|
-
fh5 =
|
|
53
|
+
fh5 = H5FileWrap(chkfile, 'w')
|
|
53
54
|
|
|
54
55
|
if 'mol' not in fh5:
|
|
55
56
|
fh5['mol'] = mc.mol.dumps()
|
pyscf/mp/dfmp2.py
CHANGED
|
@@ -62,7 +62,7 @@ def kernel(mp, mo_energy=None, mo_coeff=None, eris=None, with_t2=WITH_T2,
|
|
|
62
62
|
for i in range(nocc):
|
|
63
63
|
buf = numpy.dot(Lov[:,i*nvir:(i+1)*nvir].T,
|
|
64
64
|
Lov).reshape(nvir,nocc,nvir)
|
|
65
|
-
gi = numpy.
|
|
65
|
+
gi = numpy.asarray(buf)
|
|
66
66
|
gi = gi.reshape(nvir,nocc,nvir).transpose(1,0,2)
|
|
67
67
|
t2i = gi/lib.direct_sum('jb+a->jba', eia, eia[i])
|
|
68
68
|
edi = numpy.einsum('jab,jab', t2i, gi) * 2
|
pyscf/mp/ump2.py
CHANGED
|
@@ -303,7 +303,7 @@ def make_fno(mp, thresh=1e-6, pct_occ=None, nvir_act=None, t2=None, eris=None):
|
|
|
303
303
|
masks = _mo_splitter(mp)
|
|
304
304
|
|
|
305
305
|
if nvir_act is not None:
|
|
306
|
-
if isinstance(nvir_act, (int,numpy.
|
|
306
|
+
if isinstance(nvir_act, (int, numpy.integer)):
|
|
307
307
|
nvir_act = [nvir_act]*2
|
|
308
308
|
|
|
309
309
|
no_frozen = []
|
pyscf/mrpt/nevpt2.py
CHANGED
|
@@ -990,7 +990,7 @@ def trans_e1_outcore(mc, mo, max_memory=None, ioblk_size=256, tmpdir=None,
|
|
|
990
990
|
time1 = [logger.process_clock(), logger.perf_counter()]
|
|
991
991
|
ao_loc = numpy.array(mol.ao_loc_nr(), dtype=numpy.int32)
|
|
992
992
|
cvcvfile = tempfile.NamedTemporaryFile(dir=tmpdir)
|
|
993
|
-
with
|
|
993
|
+
with lib.H5TmpFile(cvcvfile.name, 'w') as f5:
|
|
994
994
|
cvcv = f5.create_dataset('eri_mo', (ncore*nvir,ncore*nvir), 'f8')
|
|
995
995
|
ppaa, papa, pacv = _trans(mo, ncore, ncas, load_buf, cvcv, ao_loc)[:3]
|
|
996
996
|
time0 = logger.timer(mol, 'trans_cvcv', *time0)
|
pyscf/pbc/adc/__init__.py
CHANGED
|
@@ -19,7 +19,6 @@ from pyscf.pbc.adc import kadc_rhf_ip
|
|
|
19
19
|
from pyscf.pbc.adc import kadc_rhf_ea
|
|
20
20
|
|
|
21
21
|
def KRADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
|
|
22
|
-
from pyscf.pbc.adc import kadc_rhf
|
|
23
22
|
if not isinstance(mf, scf.khf.KRHF):
|
|
24
23
|
mf = mf.to_rhf()
|
|
25
24
|
return kadc_rhf.RADC(mf, frozen, mo_coeff, mo_occ)
|
pyscf/pbc/cc/eom_kccsd_uhf.py
CHANGED
|
@@ -1238,7 +1238,7 @@ if __name__ == '__main__':
|
|
|
1238
1238
|
r1, r2 = eom_kgccsd.spin2spatial_ip_doublet(spin_r1_ip, spin_r2_ip, kconserv, kshift, orbspin)
|
|
1239
1239
|
vector = myeom.amplitudes_to_vector(r1, r2, kshift)
|
|
1240
1240
|
vector = myeom.matvec(vector, kshift=kshift, imds=imds)
|
|
1241
|
-
Hr1, Hr2 = myeom.vector_to_amplitudes(vector, nkpts, (nmoa, nmob), (nocca, noccb))
|
|
1241
|
+
Hr1, Hr2 = myeom.vector_to_amplitudes(vector, 0, nkpts, (nmoa, nmob), (nocca, noccb))
|
|
1242
1242
|
Hr1a, Hr1b = Hr1
|
|
1243
1243
|
Hr2aaa, Hr2baa, Hr2abb, Hr2bbb = Hr2
|
|
1244
1244
|
print('ip Hr1a', abs(lib.fp(Hr1a) - (-0.34462696543560045-1.6104596956729178j)))
|
|
@@ -1263,7 +1263,7 @@ if __name__ == '__main__':
|
|
|
1263
1263
|
|
|
1264
1264
|
vector = myeom.amplitudes_to_vector(r1, r2, kshift)
|
|
1265
1265
|
vector = myeom.matvec(vector, kshift=kshift, imds=imds)
|
|
1266
|
-
Hr1, Hr2 = myeom.vector_to_amplitudes(vector, nkpts, (nmoa, nmob), (nocca, noccb))
|
|
1266
|
+
Hr1, Hr2 = myeom.vector_to_amplitudes(vector, 0, nkpts, (nmoa, nmob), (nocca, noccb))
|
|
1267
1267
|
Hr1a, Hr1b = Hr1
|
|
1268
1268
|
Hr2aaa, Hr2aba, Hr2bab, Hr2bbb = Hr2
|
|
1269
1269
|
|
pyscf/pbc/cc/kccsd_rhf_ksymm.py
CHANGED
|
@@ -326,6 +326,7 @@ def add_vvvv_(cc, Ht2, t1, t2, eris):
|
|
|
326
326
|
get_Wvvvv = lambda ka, kb, kc: _Wvvvv[ka, kb, kc]
|
|
327
327
|
|
|
328
328
|
kakb, igroup = np.unique(kqrts.kqrts_ibz[:,2:], axis=0, return_inverse=True)
|
|
329
|
+
igroup = igroup.ravel()
|
|
329
330
|
for i in range(np.amax(igroup) + 1):
|
|
330
331
|
ka, kb = kakb[i]
|
|
331
332
|
idx = np.where(igroup==i)[0]
|
pyscf/pbc/cc/kccsd_t_rhf.py
CHANGED
|
@@ -357,7 +357,7 @@ def check_read_success(filename, **kwargs):
|
|
|
357
357
|
mode = kwargs.get('mode', 'r')
|
|
358
358
|
if not os.path.isfile(filename):
|
|
359
359
|
return False
|
|
360
|
-
f =
|
|
360
|
+
f = lib.H5FileWrap(filename, mode=mode, **kwargs)
|
|
361
361
|
return f.attrs.get('completed', False)
|
|
362
362
|
write_complete = check_write_complete(filename, **kwargs)
|
|
363
363
|
return False and write_complete
|
pyscf/pbc/df/outcore.py
CHANGED
|
@@ -48,9 +48,9 @@ def aux_e1(cell, auxcell_or_auxbasis, erifile, intor='int3c2e', aosym='s2ij', co
|
|
|
48
48
|
if isinstance(erifile, h5py.Group):
|
|
49
49
|
feri = erifile
|
|
50
50
|
elif h5py.is_hdf5(erifile):
|
|
51
|
-
feri =
|
|
51
|
+
feri = lib.H5FileWrap(erifile, 'a')
|
|
52
52
|
else:
|
|
53
|
-
feri =
|
|
53
|
+
feri = lib.H5FileWrap(erifile, 'w')
|
|
54
54
|
if dataname in feri:
|
|
55
55
|
del (feri[dataname])
|
|
56
56
|
if dataname+'-kptij' in feri:
|
|
@@ -169,9 +169,9 @@ def _aux_e2(cell, auxcell_or_auxbasis, erifile, intor='int3c2e', aosym='s2ij', c
|
|
|
169
169
|
if isinstance(erifile, h5py.Group):
|
|
170
170
|
feri = erifile
|
|
171
171
|
elif h5py.is_hdf5(erifile):
|
|
172
|
-
feri =
|
|
172
|
+
feri = lib.H5FileWrap(erifile, 'a')
|
|
173
173
|
else:
|
|
174
|
-
feri =
|
|
174
|
+
feri = lib.H5FileWrap(erifile, 'w')
|
|
175
175
|
if dataname in feri:
|
|
176
176
|
del (feri[dataname])
|
|
177
177
|
if dataname+'-kptij' in feri:
|
pyscf/pbc/df/rsdf.py
CHANGED
|
@@ -47,6 +47,7 @@ import numpy as np
|
|
|
47
47
|
|
|
48
48
|
from pyscf import lib
|
|
49
49
|
from pyscf.lib import logger, zdotCN
|
|
50
|
+
from pyscf.lib import parameters as param
|
|
50
51
|
from pyscf.pbc.df.df import GDF
|
|
51
52
|
from pyscf.pbc.df import aft, aft_jk
|
|
52
53
|
from pyscf.pbc.df import ft_ao
|
|
@@ -421,9 +422,11 @@ class _RSGDFBuilder(rsdf_builder._RSGDFBuilder):
|
|
|
421
422
|
def outcore_auxe2(self, cderi_file, intor='int3c2e', aosym='s2', comp=None,
|
|
422
423
|
kptij_lst=None, j_only=False, dataname='j3c-junk',
|
|
423
424
|
shls_slice=None):
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
# Deadlock on NFS if you open an already-opened tmpfile in H5PY
|
|
426
|
+
# swapfile = tempfile.NamedTemporaryFile(dir=os.path.dirname(cderi_file))
|
|
427
|
+
fswap = lib.H5TmpFile(dir=os.path.dirname(cderi_file), prefix='.outcore_auxe2_swap')
|
|
428
|
+
# avoid trash files
|
|
429
|
+
os.unlink(fswap.filename)
|
|
427
430
|
|
|
428
431
|
cell = self.cell
|
|
429
432
|
if self.use_bvk and self.kpts_band is None:
|
|
@@ -573,7 +576,7 @@ class _RSGDFBuilder(rsdf_builder._RSGDFBuilder):
|
|
|
573
576
|
# Add (1) short-range G=0 (i.e., charge) part and (2) long-range part
|
|
574
577
|
tspans = np.zeros((3,2)) # lr, j2c_inv, j2c_cntr
|
|
575
578
|
tspannames = ["ftaop+pw", "j2c_inv", "j2c_cntr"]
|
|
576
|
-
feri =
|
|
579
|
+
feri = lib.H5FileWrap(cderi_file, 'w')
|
|
577
580
|
|
|
578
581
|
# TODO: Store rs_density_fit cderi tensor in v1 format for the moment.
|
|
579
582
|
# It should be changed to 'v2' format in the future.
|
pyscf/pbc/df/rsdf_builder.py
CHANGED
|
@@ -384,10 +384,9 @@ class _RSGDFBuilder(Int3cBuilder):
|
|
|
384
384
|
# separated temporary file can avoid this issue. The DF intermediates may
|
|
385
385
|
# be terribly huge. The temporary file should be placed in the same disk
|
|
386
386
|
# as cderi_file.
|
|
387
|
-
|
|
388
|
-
fswap = lib.H5TmpFile(swapfile.name)
|
|
387
|
+
fswap = lib.H5TmpFile(dir=os.path.dirname(cderi_file), prefix='.outcore_auxe2_swap')
|
|
389
388
|
# Unlink swapfile to avoid trash files
|
|
390
|
-
|
|
389
|
+
os.unlink(fswap.filename)
|
|
391
390
|
|
|
392
391
|
log = logger.new_logger(self)
|
|
393
392
|
cell = self.cell
|
|
@@ -926,7 +925,7 @@ class _RSGDFBuilder(Int3cBuilder):
|
|
|
926
925
|
'j3c', shls_slice, kk_idx=kk_idx)
|
|
927
926
|
cpu1 = log.timer('pass1: real space int3c2e', *cpu0)
|
|
928
927
|
|
|
929
|
-
feri =
|
|
928
|
+
feri = lib.H5FileWrap(cderi_file, 'w')
|
|
930
929
|
feri['kpts'] = kpts
|
|
931
930
|
feri['aosym'] = aosym
|
|
932
931
|
|
pyscf/pbc/df/rsdf_helper.py
CHANGED
|
@@ -1052,9 +1052,9 @@ def _aux_e2_nospltbas(cell, auxcell_or_auxbasis, omega, erifile,
|
|
|
1052
1052
|
if isinstance(erifile, h5py.Group):
|
|
1053
1053
|
feri = erifile
|
|
1054
1054
|
elif h5py.is_hdf5(erifile):
|
|
1055
|
-
feri =
|
|
1055
|
+
feri = lib.H5FileWrap(erifile, 'a')
|
|
1056
1056
|
else:
|
|
1057
|
-
feri =
|
|
1057
|
+
feri = lib.H5FileWrap(erifile, 'w')
|
|
1058
1058
|
if dataname in feri:
|
|
1059
1059
|
del (feri[dataname])
|
|
1060
1060
|
if dataname+'-kptij' in feri:
|
pyscf/pbc/dft/__init__.py
CHANGED
|
@@ -37,9 +37,6 @@ from pyscf.pbc.lib import kpts as libkpts
|
|
|
37
37
|
GKS = gks.GKS
|
|
38
38
|
UKS = uks.UKS
|
|
39
39
|
ROKS = roks.ROKS
|
|
40
|
-
gto.Cell.GKS = property(GKS)
|
|
41
|
-
gto.Cell.UKS = property(UKS)
|
|
42
|
-
gto.Cell.ROKS = property(ROKS)
|
|
43
40
|
|
|
44
41
|
def KRKS(cell, *args, **kwargs):
|
|
45
42
|
for arg in args:
|
|
@@ -49,7 +46,6 @@ def KRKS(cell, *args, **kwargs):
|
|
|
49
46
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
50
47
|
return krks_ksymm.KRKS(cell, *args, **kwargs)
|
|
51
48
|
return krks.KRKS(cell, *args, **kwargs)
|
|
52
|
-
gto.Cell.KRKS = property(KRKS)
|
|
53
49
|
|
|
54
50
|
def KUKS(cell, *args, **kwargs):
|
|
55
51
|
for arg in args:
|
|
@@ -59,12 +55,9 @@ def KUKS(cell, *args, **kwargs):
|
|
|
59
55
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
60
56
|
return kuks_ksymm.KUKS(cell, *args, **kwargs)
|
|
61
57
|
return kuks.KUKS(cell, *args, **kwargs)
|
|
62
|
-
gto.Cell.KUKS = property(KUKS)
|
|
63
58
|
|
|
64
59
|
KROKS = kroks.KROKS
|
|
65
60
|
KGKS = kgks.KGKS
|
|
66
|
-
gto.Cell.KROKS = property(KROKS)
|
|
67
|
-
gto.Cell.KGKS = property(KGKS)
|
|
68
61
|
|
|
69
62
|
def KRKSpU(cell, *args, **kwargs):
|
|
70
63
|
for arg in args:
|
|
@@ -74,7 +67,6 @@ def KRKSpU(cell, *args, **kwargs):
|
|
|
74
67
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
75
68
|
return krkspu_ksymm.KRKSpU(cell, *args, **kwargs)
|
|
76
69
|
return krkspu.KRKSpU(cell, *args, **kwargs)
|
|
77
|
-
gto.Cell.KRKSpU = property(KRKSpU)
|
|
78
70
|
|
|
79
71
|
def KUKSpU(cell, *args, **kwargs):
|
|
80
72
|
for arg in args:
|
|
@@ -84,7 +76,6 @@ def KUKSpU(cell, *args, **kwargs):
|
|
|
84
76
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
85
77
|
return kukspu_ksymm.KUKSpU(cell, *args, **kwargs)
|
|
86
78
|
return kukspu.KUKSpU(cell, *args, **kwargs)
|
|
87
|
-
gto.Cell.KUKSpU = property(KUKSpU)
|
|
88
79
|
|
|
89
80
|
def RKS(cell, *args, **kwargs):
|
|
90
81
|
if cell.spin == 0:
|
|
@@ -92,7 +83,6 @@ def RKS(cell, *args, **kwargs):
|
|
|
92
83
|
else:
|
|
93
84
|
return roks.ROKS(cell, *args, **kwargs)
|
|
94
85
|
RKS.__doc__ = rks.RKS.__doc__
|
|
95
|
-
gto.Cell.RKS = property(RKS)
|
|
96
86
|
|
|
97
87
|
def KS(cell, *args, **kwargs):
|
|
98
88
|
if cell.spin == 0:
|
|
@@ -102,7 +92,6 @@ def KS(cell, *args, **kwargs):
|
|
|
102
92
|
KS.__doc__ = '''
|
|
103
93
|
A wrap function to create DFT object (RKS or UKS) for PBC systems.\n
|
|
104
94
|
''' + rks.RKS.__doc__
|
|
105
|
-
gto.Cell.KS = property(KS)
|
|
106
95
|
|
|
107
96
|
def KKS(cell, *args, **kwargs):
|
|
108
97
|
if cell.spin == 0:
|
|
@@ -112,4 +101,3 @@ def KKS(cell, *args, **kwargs):
|
|
|
112
101
|
KKS.__doc__ = '''
|
|
113
102
|
A wrap function to create DFT object with k-point sampling (KRKS or KUKS).\n
|
|
114
103
|
''' + krks.KRKS.__doc__
|
|
115
|
-
gto.Cell.KKS = property(KKS)
|
pyscf/pbc/dft/kgks.py
CHANGED
|
@@ -35,6 +35,7 @@ from pyscf.pbc.dft import krks
|
|
|
35
35
|
from pyscf.pbc.dft import rks
|
|
36
36
|
from pyscf.pbc.dft import multigrid
|
|
37
37
|
from pyscf.pbc.dft.numint2c import KNumInt2C
|
|
38
|
+
from pyscf.dft import gks as mol_ks
|
|
38
39
|
from pyscf import __config__
|
|
39
40
|
|
|
40
41
|
def get_veff(ks, cell=None, dm=None, dm_last=0, vhf_last=0, hermi=1,
|
|
@@ -117,6 +118,8 @@ class KGKS(rks.KohnShamDFT, kghf.KGHF):
|
|
|
117
118
|
'''GKS class adapted for PBCs with k-point sampling.
|
|
118
119
|
'''
|
|
119
120
|
|
|
121
|
+
collinear = mol_ks.GKS.collinear
|
|
122
|
+
spin_samples = mol_ks.GKS.spin_samples
|
|
120
123
|
get_veff = get_veff
|
|
121
124
|
energy_elec = krks.energy_elec
|
|
122
125
|
get_rho = krks.get_rho
|
|
@@ -294,8 +294,8 @@ def eval_rho(cell, dm, shls_slice=None, hermi=0, xctype='LDA', kpts=None,
|
|
|
294
294
|
dm_i = dm_i.real
|
|
295
295
|
has_imag = dm_i.dtype == numpy.complex128
|
|
296
296
|
if has_imag:
|
|
297
|
-
dmR = numpy.
|
|
298
|
-
dmI = numpy.
|
|
297
|
+
dmR = numpy.asarray(dm_i.real, order='C')
|
|
298
|
+
dmI = numpy.asarray(dm_i.imag, order='C')
|
|
299
299
|
else:
|
|
300
300
|
# make a copy because the dm may be overwritten in the
|
|
301
301
|
# NUMINT_rho_drv inplace
|
pyscf/pbc/dft/numint.py
CHANGED
|
@@ -1264,7 +1264,7 @@ class KNumInt(lib.StreamObject, numint.LibXCMixin):
|
|
|
1264
1264
|
if isinstance(dms[0], numpy.ndarray) and dms[0].ndim == 2:
|
|
1265
1265
|
mo_coeff = [mo_coeff]
|
|
1266
1266
|
mo_occ = [mo_occ]
|
|
1267
|
-
nao =
|
|
1267
|
+
nao = dms[0].shape[-1]
|
|
1268
1268
|
ndms = len(mo_occ)
|
|
1269
1269
|
def make_rho(idm, ao, non0tab, xctype):
|
|
1270
1270
|
return self.eval_rho2(cell, ao, mo_coeff[idm], mo_occ[idm],
|
pyscf/pbc/dft/numint2c.py
CHANGED
|
@@ -335,6 +335,7 @@ class KNumInt2C(lib.StreamObject, numint.LibXCMixin):
|
|
|
335
335
|
collinear_samples = numint2c.NumInt2C.collinear_samples
|
|
336
336
|
|
|
337
337
|
make_mask = lib.invalid_method('make_mask')
|
|
338
|
+
eval_ao = staticmethod(pnumint.eval_ao_kpts)
|
|
338
339
|
|
|
339
340
|
def eval_rho(self, cell, ao_kpts, dm_kpts, non0tab=None, xctype='LDA',
|
|
340
341
|
hermi=0, with_lapl=True, verbose=None):
|
pyscf/pbc/lib/kpts.py
CHANGED
|
@@ -410,7 +410,7 @@ def symmetrize_wavefunction(kpts, psiR_k, mesh):
|
|
|
410
410
|
'''
|
|
411
411
|
raise RuntimeError('need verification')
|
|
412
412
|
psiR_k = np.asarray(psiR_k, order='C')
|
|
413
|
-
is_complex = psiR_k.dtype
|
|
413
|
+
is_complex = np.iscomplexobj(psiR_k.dtype)
|
|
414
414
|
nao = psiR_k.shape[1]
|
|
415
415
|
nG = psiR_k.shape[2]
|
|
416
416
|
psiR = np.zeros([kpts.nkpts,nao,nG], dtype = psiR_k.dtype, order='C')
|
pyscf/pbc/mp/kmp2_ksymm.py
CHANGED
|
@@ -54,6 +54,7 @@ def kernel(mp, mo_energy, mo_coeff, verbose=logger.NOTE, with_t2=WITH_T2):
|
|
|
54
54
|
|
|
55
55
|
kijab, weight, k4_bz2ibz = kd.make_k4_ibz(sym='s2')
|
|
56
56
|
_, igroup = np.unique(kijab[:,:2], axis=0, return_index=True)
|
|
57
|
+
igroup = igroup.ravel()
|
|
57
58
|
igroup = list(igroup) + [len(kijab)]
|
|
58
59
|
|
|
59
60
|
emp2_ss = emp2_os = 0.
|
pyscf/pbc/mpicc/kccsd_rhf.py
CHANGED
|
@@ -187,7 +187,7 @@ def cc_Woooo(cc,t1,t2,eris,feri2=None):
|
|
|
187
187
|
for iterkl, kl in enumerate(ranges1):
|
|
188
188
|
for iterki, ki in enumerate(ranges2):
|
|
189
189
|
kj = kconserv[kk,ki,kl]
|
|
190
|
-
oooo_tmp[iterkk,iterkl,iterki] = np.array(eris.oooo[kk,kl,ki],copy=True)
|
|
190
|
+
oooo_tmp[iterkk,iterkl,iterki] = np.array(eris.oooo[kk,kl,ki], copy=True)
|
|
191
191
|
oooo_tmp[iterkk,iterkl,iterki] += einsum('klic,jc->klij',eris.ooov[kk,kl,ki],t1[kj])
|
|
192
192
|
oooo_tmp[iterkk,iterkl,iterki] += einsum('klcj,ic->klij',eris.ooov[kl,kk,kj].transpose(1,0,3,2),t1[ki])
|
|
193
193
|
|
|
@@ -233,7 +233,7 @@ def cc_Wvvvv(cc,t1,t2,eris,feri2=None):
|
|
|
233
233
|
for kc in ranges1:
|
|
234
234
|
for kb in range(ka+1):
|
|
235
235
|
kd = kconserv[ka,kc,kb]
|
|
236
|
-
vvvv_tmp = np.array(eris.vvvv[ka,kb,kc],copy=True)
|
|
236
|
+
vvvv_tmp = np.array(eris.vvvv[ka,kb,kc], copy=True)
|
|
237
237
|
vvvv_tmp += einsum('akcd,kb->abcd',eris.ovvv[kb,ka,kd].transpose(1,0,3,2),-t1[kb])
|
|
238
238
|
vvvv_tmp += einsum('kbcd,ka->abcd',eris.ovvv[ka,kb,kc],-t1[ka])
|
|
239
239
|
Wvvvv[ka,kb,kc] = vvvv_tmp
|
|
@@ -336,7 +336,7 @@ def cc_Wvovo(cc,t1,t2,eris,feri2=None):
|
|
|
336
336
|
for iterkk, kk in enumerate(ranges1):
|
|
337
337
|
for iterkc, kc in enumerate(ranges2):
|
|
338
338
|
ki = kconserv[ka,kc,kk]
|
|
339
|
-
vovo_tmp[iterka,iterkk,iterkc] = np.
|
|
339
|
+
vovo_tmp[iterka,iterkk,iterkc] = np.asarray(eris.ovov[kk,ka,ki]).transpose(1,0,3,2)
|
|
340
340
|
vovo_tmp[iterka,iterkk,iterkc] -= einsum('lkci,la->akci',eris.ooov[kk,ka,ki].transpose(1,0,3,2),t1[ka])
|
|
341
341
|
vovo_tmp[iterka,iterkk,iterkc] += einsum('akcd,id->akci',eris.ovvv[kk,ka,ki].transpose(1,0,3,2),t1[ki])
|
|
342
342
|
# Beginning of change
|
|
@@ -391,7 +391,7 @@ def cc_Wovov(cc,t1,t2,eris,feri2=None):
|
|
|
391
391
|
for iterka, ka in enumerate(ranges1):
|
|
392
392
|
for iterki, ki in enumerate(ranges2):
|
|
393
393
|
kc = kconserv[kk,ki,ka]
|
|
394
|
-
ovov_tmp[iterkk,iterka,iterki] = np.
|
|
394
|
+
ovov_tmp[iterkk,iterka,iterki] = np.asarray(eris.ovov[kk,ka,ki])
|
|
395
395
|
ovov_tmp[iterkk,iterka,iterki] -= einsum('lkci,la->kaic',eris.ooov[kk,ka,ki].transpose(1,0,3,2),t1[ka])
|
|
396
396
|
ovov_tmp[iterkk,iterka,iterki] += einsum('akcd,id->kaic',eris.ovvv[kk,ka,ki].transpose(1,0,3,2),t1[ki])
|
|
397
397
|
# Beginning of change
|
|
@@ -1308,7 +1308,7 @@ def Wovoo(cc,t1,t2,eris,fint=None):
|
|
|
1308
1308
|
for iterki,ki in enumerate(ranges2):
|
|
1309
1309
|
kj = kconserv[kk,ki,kb]
|
|
1310
1310
|
|
|
1311
|
-
ovoo_tmp[iterkk,iterkb,iterki] = np.
|
|
1311
|
+
ovoo_tmp[iterkk,iterkb,iterki] = np.asarray(eris.ovoo[kk,kb,ki])
|
|
1312
1312
|
ovoo_tmp[iterkk,iterkb,iterki] += einsum('kbid,jd->kbij',WW1ovov_kbi[iterkk,iterkb,iterki], t1[kj])
|
|
1313
1313
|
ovoo_tmp[iterkk,iterkb,iterki] += einsum('klij,lb->kbij', WWoooo_kbi[iterkk,iterkb,iterki],-t1[kb])
|
|
1314
1314
|
#ovoo_tmp[iterkk,iterkb,iterki] += einsum('kbcj,ic->kbij',WW1ovvo_kbi[iterkk,iterkb,iterki],t1[ki])
|
|
@@ -1550,4 +1550,4 @@ def WvoovR1(cc,t1,t2,eris,fint=None):
|
|
|
1550
1550
|
return Wkaci
|
|
1551
1551
|
|
|
1552
1552
|
def _cp(a):
|
|
1553
|
-
return np.array(a,
|
|
1553
|
+
return np.array(a, order='C')
|
pyscf/pbc/scf/__init__.py
CHANGED
|
@@ -40,9 +40,6 @@ from pyscf.pbc.lib import kpts as libkpts
|
|
|
40
40
|
GHF = ghf.GHF
|
|
41
41
|
UHF = uhf.UHF
|
|
42
42
|
ROHF = rohf.ROHF
|
|
43
|
-
gto.Cell.GHF = property(GHF)
|
|
44
|
-
gto.Cell.UHF = property(UHF)
|
|
45
|
-
gto.Cell.ROHF = property(ROHF)
|
|
46
43
|
|
|
47
44
|
def RHF(cell, *args, **kwargs):
|
|
48
45
|
if cell.spin == 0:
|
|
@@ -50,7 +47,6 @@ def RHF(cell, *args, **kwargs):
|
|
|
50
47
|
else:
|
|
51
48
|
return rohf.ROHF(cell, *args, **kwargs)
|
|
52
49
|
RHF.__doc__ = rhf.RHF.__doc__
|
|
53
|
-
gto.Cell.RHF = property(RHF)
|
|
54
50
|
|
|
55
51
|
#KRHF = krhf.KRHF # KRHF supports cell.spin != 0 if number of k-points is even
|
|
56
52
|
def KRHF(cell, *args, **kwargs):
|
|
@@ -61,7 +57,6 @@ def KRHF(cell, *args, **kwargs):
|
|
|
61
57
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
62
58
|
return khf_ksymm.KRHF(cell, *args, **kwargs)
|
|
63
59
|
return krhf.KRHF(cell, *args, **kwargs)
|
|
64
|
-
gto.Cell.KRHF = property(KRHF)
|
|
65
60
|
|
|
66
61
|
def KUHF(cell, *args, **kwargs):
|
|
67
62
|
for arg in args:
|
|
@@ -71,10 +66,8 @@ def KUHF(cell, *args, **kwargs):
|
|
|
71
66
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
72
67
|
return kuhf_ksymm.KUHF(cell, *args, **kwargs)
|
|
73
68
|
return kuhf.KUHF(cell, *args, **kwargs)
|
|
74
|
-
gto.Cell.KUHF = property(KUHF)
|
|
75
69
|
|
|
76
70
|
KROHF = krohf.KROHF
|
|
77
|
-
gto.Cell.KROHF = property(KROHF)
|
|
78
71
|
|
|
79
72
|
#KGHF = kghf.KGHF
|
|
80
73
|
def KGHF(cell, *args, **kwargs):
|
|
@@ -85,7 +78,6 @@ def KGHF(cell, *args, **kwargs):
|
|
|
85
78
|
if isinstance(kwargs['kpts'], libkpts.KPoints):
|
|
86
79
|
return kghf_ksymm.KGHF(cell, *args, **kwargs)
|
|
87
80
|
return kghf.KGHF(cell, *args, **kwargs)
|
|
88
|
-
gto.Cell.KGHF = property(KGHF)
|
|
89
81
|
|
|
90
82
|
newton = newton_ah.newton
|
|
91
83
|
|
|
@@ -94,14 +86,12 @@ def HF(cell, *args, **kwargs):
|
|
|
94
86
|
return rhf.RHF(cell, *args, **kwargs)
|
|
95
87
|
else:
|
|
96
88
|
return uhf.UHF(cell, *args, **kwargs)
|
|
97
|
-
gto.Cell.HF = property(HF)
|
|
98
89
|
|
|
99
90
|
def KHF(cell, *args, **kwargs):
|
|
100
91
|
if cell.spin == 0:
|
|
101
92
|
return KRHF(cell, *args, **kwargs)
|
|
102
93
|
else:
|
|
103
94
|
return KUHF(cell, *args, **kwargs)
|
|
104
|
-
gto.Cell.KHF = property(KHF)
|
|
105
95
|
|
|
106
96
|
|
|
107
97
|
def KS(cell, *args, **kwargs):
|
pyscf/pbc/scf/ghf.py
CHANGED
|
@@ -100,6 +100,7 @@ def get_jk(mf, cell=None, dm=None, hermi=0, kpt=None, kpts_band=None,
|
|
|
100
100
|
class GHF(pbchf.SCF):
|
|
101
101
|
'''GHF class for PBCs.
|
|
102
102
|
'''
|
|
103
|
+
_keys = {'with_soc'}
|
|
103
104
|
|
|
104
105
|
def __init__(self, cell, kpt=np.zeros(3),
|
|
105
106
|
exxdiv=getattr(__config__, 'pbc_scf_SCF_exxdiv', 'ewald')):
|
pyscf/pbc/scf/hf.py
CHANGED
|
@@ -789,7 +789,7 @@ class SCF(mol_hf.SCF):
|
|
|
789
789
|
def dump_chk(self, envs):
|
|
790
790
|
if self.chkfile:
|
|
791
791
|
mol_hf.SCF.dump_chk(self, envs)
|
|
792
|
-
with
|
|
792
|
+
with lib.H5FileWrap(self.chkfile, 'a') as fh5:
|
|
793
793
|
fh5['scf/kpt'] = self.kpt
|
|
794
794
|
return self
|
|
795
795
|
|
pyscf/pbc/scf/kghf.py
CHANGED
|
@@ -186,6 +186,8 @@ def _cast_mol_init_guess(fn):
|
|
|
186
186
|
class KGHF(khf.KSCF):
|
|
187
187
|
'''GHF class for PBCs.
|
|
188
188
|
'''
|
|
189
|
+
_keys = {'with_soc'}
|
|
190
|
+
|
|
189
191
|
def __init__(self, cell, kpts=np.zeros((1,3)),
|
|
190
192
|
exxdiv=getattr(__config__, 'pbc_scf_SCF_exxdiv', 'ewald')):
|
|
191
193
|
khf.KSCF.__init__(self, cell, kpts, exxdiv)
|
pyscf/pbc/scf/khf.py
CHANGED
|
@@ -614,7 +614,7 @@ class KSCF(pbchf.SCF):
|
|
|
614
614
|
def dump_chk(self, envs):
|
|
615
615
|
if self.chkfile:
|
|
616
616
|
mol_hf.SCF.dump_chk(self, envs)
|
|
617
|
-
with
|
|
617
|
+
with lib.H5FileWrap(self.chkfile, 'a') as fh5:
|
|
618
618
|
fh5['scf/kpts'] = self.kpts
|
|
619
619
|
return self
|
|
620
620
|
|
pyscf/pbc/scf/khf_ksymm.py
CHANGED
|
@@ -245,7 +245,7 @@ class KsymAdaptedKSCF(khf.KSCF):
|
|
|
245
245
|
def dump_chk(self, envs):
|
|
246
246
|
if self.chkfile:
|
|
247
247
|
mol_hf.SCF.dump_chk(self, envs)
|
|
248
|
-
with
|
|
248
|
+
with lib.H5FileWrap(self.chkfile, 'a') as fh5:
|
|
249
249
|
fh5['scf/kpts'] = self.kpts.kpts_ibz #FIXME Shall we rebuild kpts? If so, more info is needed.
|
|
250
250
|
return self
|
|
251
251
|
|