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.
Files changed (89) hide show
  1. pyscf/__init__.py +1 -1
  2. pyscf/adc/__init__.py +0 -2
  3. pyscf/ao2mo/nrr_outcore.py +3 -3
  4. pyscf/ao2mo/outcore.py +3 -3
  5. pyscf/ao2mo/r_outcore.py +3 -3
  6. pyscf/ao2mo/semi_incore.py +2 -2
  7. pyscf/cc/ccsd_lambda.py +1 -1
  8. pyscf/cc/dfccsd.py +1 -1
  9. pyscf/cc/rccsd_lambda.py +1 -1
  10. pyscf/cc/rccsd_slow.py +1 -1
  11. pyscf/ci/cisd.py +1 -1
  12. pyscf/ci/ucisd.py +1 -1
  13. pyscf/df/df_jk.py +2 -0
  14. pyscf/df/incore.py +3 -1
  15. pyscf/df/outcore.py +3 -4
  16. pyscf/dft/__init__.py +0 -10
  17. pyscf/dft/gen_grid.py +1 -1
  18. pyscf/geomopt/__init__.py +1 -1
  19. pyscf/grad/ccsd.py +1 -1
  20. pyscf/grad/rhf.py +1 -0
  21. pyscf/grad/rks.py +1 -0
  22. pyscf/grad/uccsd.py +1 -1
  23. pyscf/gto/__init__.py +0 -1
  24. pyscf/gto/basis/__init__.py +0 -1
  25. pyscf/gto/eval_gto.py +11 -2
  26. pyscf/gto/mole.py +2 -2
  27. pyscf/hessian/dispersion.py +5 -5
  28. pyscf/hessian/rhf.py +1 -0
  29. pyscf/hessian/rks.py +1 -0
  30. pyscf/lib/chkfile.py +3 -2
  31. pyscf/lib/diis.py +1 -1
  32. pyscf/lib/libagf2.dylib +0 -0
  33. pyscf/lib/libao2mo.dylib +0 -0
  34. pyscf/lib/libcc.dylib +0 -0
  35. pyscf/lib/libcgto.dylib +0 -0
  36. pyscf/lib/libcvhf.dylib +0 -0
  37. pyscf/lib/libdft.dylib +0 -0
  38. pyscf/lib/libfci.dylib +0 -0
  39. pyscf/lib/libmcscf.dylib +0 -0
  40. pyscf/lib/libnp_helper.dylib +0 -0
  41. pyscf/lib/libpbc.dylib +0 -0
  42. pyscf/lib/libri.dylib +0 -0
  43. pyscf/lib/libxc_itrf.dylib +0 -0
  44. pyscf/lib/libxcfun_itrf.dylib +0 -0
  45. pyscf/lib/linalg_helper.py +4 -7
  46. pyscf/lib/misc.py +92 -15
  47. pyscf/lib/numpy_helper.py +1 -1
  48. pyscf/lib/parameters.py +1 -0
  49. pyscf/mcscf/chkfile.py +3 -2
  50. pyscf/mp/dfmp2.py +1 -1
  51. pyscf/mp/ump2.py +1 -1
  52. pyscf/mrpt/nevpt2.py +1 -1
  53. pyscf/pbc/adc/__init__.py +0 -1
  54. pyscf/pbc/cc/eom_kccsd_uhf.py +2 -2
  55. pyscf/pbc/cc/kccsd_rhf_ksymm.py +1 -0
  56. pyscf/pbc/cc/kccsd_t_rhf.py +1 -1
  57. pyscf/pbc/df/outcore.py +4 -4
  58. pyscf/pbc/df/rsdf.py +7 -4
  59. pyscf/pbc/df/rsdf_builder.py +3 -4
  60. pyscf/pbc/df/rsdf_helper.py +2 -2
  61. pyscf/pbc/dft/__init__.py +0 -12
  62. pyscf/pbc/dft/kgks.py +3 -0
  63. pyscf/pbc/dft/multigrid/multigrid.py +2 -2
  64. pyscf/pbc/dft/numint.py +1 -1
  65. pyscf/pbc/dft/numint2c.py +1 -0
  66. pyscf/pbc/lib/kpts.py +1 -1
  67. pyscf/pbc/mp/kmp2_ksymm.py +1 -0
  68. pyscf/pbc/mpicc/kccsd_rhf.py +1 -1
  69. pyscf/pbc/mpicc/kintermediates_rhf.py +6 -6
  70. pyscf/pbc/scf/__init__.py +0 -10
  71. pyscf/pbc/scf/ghf.py +1 -0
  72. pyscf/pbc/scf/hf.py +1 -1
  73. pyscf/pbc/scf/kghf.py +2 -0
  74. pyscf/pbc/scf/khf.py +1 -1
  75. pyscf/pbc/scf/khf_ksymm.py +1 -1
  76. pyscf/pbc/symm/group.py +1 -1
  77. pyscf/scf/__init__.py +0 -7
  78. pyscf/scf/chkfile.py +2 -1
  79. pyscf/scf/dhf.py +2 -2
  80. pyscf/scf/hf.py +6 -0
  81. pyscf/scf/ucphf.py +1 -1
  82. pyscf/solvent/__init__.py +1 -1
  83. pyscf/x2c/x2c.py +2 -2
  84. {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/METADATA +3 -3
  85. {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/RECORD +89 -89
  86. {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/WHEEL +1 -1
  87. {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/LICENSE +0 -0
  88. {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/NOTICE +0 -0
  89. {pyscf-2.6.0.dist-info → pyscf-2.6.2.dist-info}/top_level.txt +0 -0
pyscf/__init__.py CHANGED
@@ -35,7 +35,7 @@ to try out the package::
35
35
 
36
36
  '''
37
37
 
38
- __version__ = '2.6.0'
38
+ __version__ = '2.6.2'
39
39
 
40
40
  import os
41
41
  import sys
pyscf/adc/__init__.py CHANGED
@@ -70,8 +70,6 @@ def UADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
70
70
  UADC.__doc__ = uadc.UADC.__doc__
71
71
 
72
72
  def RADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
73
- __doc__ = radc.RADC.__doc__
74
-
75
73
  if not (frozen is None or frozen == 0):
76
74
  raise NotImplementedError
77
75
 
@@ -95,11 +95,11 @@ def general(mol, mo_coeffs, erifile, dataname='eri_mo',
95
95
 
96
96
  if isinstance(erifile, str):
97
97
  if h5py.is_hdf5(erifile):
98
- feri = h5py.File(erifile, 'a')
98
+ feri = lib.H5FileWrap(erifile, 'a')
99
99
  if dataname in feri:
100
100
  del(feri[dataname])
101
101
  else:
102
- feri = h5py.File(erifile, 'w')
102
+ feri = lib.H5FileWrap(erifile, 'w')
103
103
  else:
104
104
  assert(isinstance(erifile, h5py.Group))
105
105
  feri = erifile
@@ -250,7 +250,7 @@ def half_e1(mol, mo_coeffs, swapfile,
250
250
  log.debug('step1: (ij,kl) = (%d,%d), mem cache %.8g MB, iobuf %.8g MB',
251
251
  nij_pair, nao_pair, mem_words*16/1e6, iobuf_words*16/1e6)
252
252
 
253
- fswap = h5py.File(swapfile, 'w')
253
+ fswap = lib.H5FileWrap(swapfile, 'w')
254
254
  for icomp in range(comp):
255
255
  fswap.create_group(str(icomp)) # for h5py old version
256
256
 
pyscf/ao2mo/outcore.py CHANGED
@@ -238,11 +238,11 @@ def general(mol, mo_coeffs, erifile, dataname='eri_mo',
238
238
 
239
239
  if isinstance(erifile, str):
240
240
  if h5py.is_hdf5(erifile):
241
- feri = h5py.File(erifile, 'a')
241
+ feri = lib.H5FileWrap(erifile, 'a')
242
242
  if dataname in feri:
243
243
  del (feri[dataname])
244
244
  else:
245
- feri = h5py.File(erifile, 'w')
245
+ feri = lib.H5FileWrap(erifile, 'w')
246
246
  else:
247
247
  assert (isinstance(erifile, h5py.Group))
248
248
  feri = erifile
@@ -431,7 +431,7 @@ def half_e1(mol, mo_coeffs, swapfile,
431
431
  if isinstance(swapfile, h5py.Group):
432
432
  fswap = swapfile
433
433
  else:
434
- fswap = lib.H5TmpFile(swapfile)
434
+ fswap = lib.H5FileWrap(swapfile, 'a')
435
435
  for icomp in range(comp):
436
436
  fswap.create_group(str(icomp)) # for h5py old version
437
437
 
pyscf/ao2mo/r_outcore.py CHANGED
@@ -74,11 +74,11 @@ def general(mol, mo_coeffs, erifile, dataname='eri_mo',
74
74
 
75
75
  if isinstance(erifile, str):
76
76
  if h5py.is_hdf5(erifile):
77
- feri = h5py.File(erifile, 'a')
77
+ feri = lib.H5FileWrap(erifile, 'a')
78
78
  if dataname in feri:
79
79
  del (feri[dataname])
80
80
  else:
81
- feri = h5py.File(erifile, 'w')
81
+ feri = lib.H5FileWrap(erifile, 'w')
82
82
  else:
83
83
  assert (isinstance(erifile, h5py.Group))
84
84
  feri = erifile
@@ -214,7 +214,7 @@ def half_e1(mol, mo_coeffs, swapfile,
214
214
  log.debug('step1: (ij,kl) = (%d,%d), mem cache %.8g MB, iobuf %.8g MB',
215
215
  nij_pair, nao_pair, mem_words*16/1e6, iobuf_words*16/1e6)
216
216
 
217
- fswap = h5py.File(swapfile, 'w')
217
+ fswap = lib.H5FileWrap(swapfile, 'w')
218
218
  for icomp in range(comp):
219
219
  fswap.create_group(str(icomp)) # for h5py old version
220
220
 
@@ -140,11 +140,11 @@ def general(eri, mo_coeffs, erifile, dataname='eri_mo',
140
140
 
141
141
  if isinstance(erifile, str):
142
142
  if h5py.is_hdf5(erifile):
143
- feri = h5py.File(erifile, 'a')
143
+ feri = lib.H5FileWrap(erifile, 'a')
144
144
  if dataname in feri:
145
145
  del (feri[dataname])
146
146
  else:
147
- feri = h5py.File(erifile,'w',libver='latest')
147
+ feri = lib.H5FileWrap(erifile,'w', libver='latest')
148
148
  else:
149
149
  assert (isinstance(erifile, h5py.Group))
150
150
  feri = erifile
pyscf/cc/ccsd_lambda.py CHANGED
@@ -364,7 +364,7 @@ def update_lambda(mycc, t1, t2, l1, l2, eris=None, imds=None):
364
364
  return l1new, l2new
365
365
 
366
366
  def _cp(a):
367
- return numpy.array(a, copy=False, order='C')
367
+ return numpy.asarray(a, order='C')
368
368
 
369
369
 
370
370
  if __name__ == '__main__':
pyscf/cc/dfccsd.py CHANGED
@@ -191,7 +191,7 @@ def _make_df_eris(cc, mo_coeff=None):
191
191
  return eris
192
192
 
193
193
  def _cp(a):
194
- return numpy.array(a, copy=False, order='C')
194
+ return numpy.asarray(a, order='C')
195
195
 
196
196
  if __name__ == '__main__':
197
197
  from pyscf import gto
pyscf/cc/rccsd_lambda.py CHANGED
@@ -69,7 +69,7 @@ def make_intermediates(mycc, t1, t2, eris):
69
69
  oooo = np.asarray(eris.oooo)
70
70
  woooo = lib.einsum('icjl,kc->ikjl', ovoo, t1)
71
71
  woooo += lib.einsum('jcil,kc->iljk', ovoo, t1)
72
- woooo += oooo.copy()
72
+ woooo += oooo
73
73
  woooo += lib.einsum('icjd,klcd->ikjl', ovov, tau)
74
74
 
75
75
  theta = t2*2 - t2.transpose(0,1,3,2)
pyscf/cc/rccsd_slow.py CHANGED
@@ -1047,7 +1047,7 @@ class _IMDS:
1047
1047
  raise NotImplementedError
1048
1048
 
1049
1049
  def _cp(a):
1050
- return np.array(a, copy=False, order='C')
1050
+ return np.asarray(a, order='C')
1051
1051
 
1052
1052
 
1053
1053
  if __name__ == '__main__':
pyscf/ci/cisd.py CHANGED
@@ -1141,7 +1141,7 @@ scf.hf.RHF.CISD = lib.class_as_method(RCISD)
1141
1141
  scf.rohf.ROHF.CISD = None
1142
1142
 
1143
1143
  def _cp(a):
1144
- return numpy.array(a, copy=False, order='C')
1144
+ return numpy.asarray(a, order='C')
1145
1145
 
1146
1146
 
1147
1147
  if __name__ == '__main__':
pyscf/ci/ucisd.py CHANGED
@@ -976,4 +976,4 @@ from pyscf import scf
976
976
  scf.uhf.UHF.CISD = lib.class_as_method(CISD)
977
977
 
978
978
  def _cp(a):
979
- return numpy.array(a, copy=False, order='C')
979
+ return numpy.asarray(a, order='C')
pyscf/df/df_jk.py CHANGED
@@ -200,6 +200,8 @@ class _DFHF:
200
200
  return uks.Hessian(self)
201
201
  else:
202
202
  return uhf.Hessian(self)
203
+ elif isinstance(self, scf.rohf.ROHF):
204
+ raise NotImplementedError
203
205
  elif isinstance(self, scf.rhf.RHF):
204
206
  if isinstance(self, scf.hf.KohnShamDFT):
205
207
  return rks.Hessian(self)
pyscf/df/incore.py CHANGED
@@ -28,7 +28,9 @@ from pyscf import __config__
28
28
 
29
29
 
30
30
  MAX_MEMORY = getattr(__config__, 'df_outcore_max_memory', 2000) # 2GB
31
- LINEAR_DEP_THR = getattr(__config__, 'df_df_DF_lindep', 1e-9)
31
+ # LINEAR_DEP_THR cannot be below 1e-7,
32
+ # see qchem default setting in https://manual.q-chem.com/5.4/sec_Basis_Customization.html
33
+ LINEAR_DEP_THR = getattr(__config__, 'df_df_DF_lindep', 1e-7)
32
34
 
33
35
 
34
36
  # This function is aliased for backward compatibility.
pyscf/df/outcore.py CHANGED
@@ -27,12 +27,11 @@ from pyscf.lib import logger
27
27
  from pyscf import ao2mo
28
28
  from pyscf.ao2mo import _ao2mo
29
29
  from pyscf.ao2mo.outcore import _load_from_h5g
30
- from pyscf.df.incore import _eig_decompose
30
+ from pyscf.df.incore import _eig_decompose, LINEAR_DEP_THR
31
31
  from pyscf.df.addons import make_auxmol
32
32
  from pyscf import __config__
33
33
 
34
34
  MAX_MEMORY = getattr(__config__, 'df_outcore_max_memory', 2000) # 2GB
35
- LINEAR_DEP_THR = getattr(__config__, 'df_df_DF_lindep', 1e-12)
36
35
 
37
36
  #
38
37
  # for auxe1 (P|ij)
@@ -303,11 +302,11 @@ def _create_h5file(erifile, dataname):
303
302
  erifile = erifile.name
304
303
 
305
304
  if h5py.is_hdf5(erifile):
306
- feri = h5py.File(erifile, 'a')
305
+ feri = lib.H5FileWrap(erifile, 'a')
307
306
  if dataname in feri:
308
307
  del (feri[dataname])
309
308
  else:
310
- feri = h5py.File(erifile, 'w')
309
+ feri = lib.H5FileWrap(erifile, 'w')
311
310
  return feri
312
311
 
313
312
  del (MAX_MEMORY)
pyscf/dft/__init__.py CHANGED
@@ -66,7 +66,6 @@ def KS(mol, xc='LDA,VWN'):
66
66
  KS.__doc__ = '''
67
67
  A wrap function to create DFT object (RKS or UKS).\n
68
68
  ''' + rks.RKS.__doc__
69
- gto.Mole.KS = gto.Mole.DFT = property(KS)
70
69
  DFT = KS
71
70
 
72
71
  def RKS(mol, xc='LDA,VWN'):
@@ -78,7 +77,6 @@ def RKS(mol, xc='LDA,VWN'):
78
77
  else:
79
78
  return ROKS(mol, xc)
80
79
  RKS.__doc__ = rks.RKS.__doc__
81
- gto.Mole.RKS = property(RKS)
82
80
 
83
81
  def ROKS(mol, xc='LDA,VWN'):
84
82
  if not mol.symmetry or mol.groupname == 'C1':
@@ -86,7 +84,6 @@ def ROKS(mol, xc='LDA,VWN'):
86
84
  else:
87
85
  return rks_symm.ROKS(mol, xc)
88
86
  ROKS.__doc__ = roks.ROKS.__doc__
89
- gto.Mole.ROKS = property(ROKS)
90
87
 
91
88
  def UKS(mol, xc='LDA,VWN'):
92
89
  if not mol.symmetry or mol.groupname == 'C1':
@@ -94,7 +91,6 @@ def UKS(mol, xc='LDA,VWN'):
94
91
  else:
95
92
  return uks_symm.UKS(mol, xc)
96
93
  UKS.__doc__ = uks.UKS.__doc__
97
- gto.Mole.UKS = property(UKS)
98
94
 
99
95
  def GKS(mol, xc='LDA,VWN'):
100
96
  if not mol.symmetry or mol.groupname == 'C1':
@@ -102,7 +98,6 @@ def GKS(mol, xc='LDA,VWN'):
102
98
  else:
103
99
  return gks_symm.GKS(mol, xc)
104
100
  GKS.__doc__ = gks.GKS.__doc__
105
- gto.Mole.GKS = property(GKS)
106
101
 
107
102
  def DKS(mol, xc='LDA,VWN'):
108
103
  from pyscf.scf import dhf
@@ -110,12 +105,8 @@ def DKS(mol, xc='LDA,VWN'):
110
105
  return dks.RDKS(mol, xc=xc)
111
106
  else:
112
107
  return dks.UDKS(mol, xc=xc)
113
-
114
108
  UDKS = dks.UDKS
115
109
  RDKS = dks.RDKS
116
- gto.Mole.DKS = property(DKS)
117
- gto.Mole.UDKS = property(UDKS)
118
- gto.Mole.RDKS = property(RDKS)
119
110
 
120
111
  def X2C(mol, *args):
121
112
  '''X2C Kohn-Sham'''
@@ -126,4 +117,3 @@ def X2C(mol, *args):
126
117
  else:
127
118
  return dft.UKS(mol, *args)
128
119
  X2C_KS = X2C
129
- gto.Mole.X2C_KS = property(X2C)
pyscf/dft/gen_grid.py CHANGED
@@ -366,7 +366,7 @@ def arg_group_grids(mol, coords, box_size=GROUP_BOX_SIZE):
366
366
  box_ids[box_ids[:,2] > boxes[2], 2] = boxes[2]
367
367
  rev_idx, counts = numpy.unique(box_ids, axis=0, return_inverse=True,
368
368
  return_counts=True)[1:3]
369
- return rev_idx.argsort(kind='stable')
369
+ return rev_idx.ravel().argsort(kind='stable')
370
370
 
371
371
  def _load_conf(mod, name, default):
372
372
  var = getattr(__config__, name, None)
pyscf/geomopt/__init__.py CHANGED
@@ -22,6 +22,6 @@ def optimize(method, *args, **kwargs):
22
22
  except ImportError as e1:
23
23
  try:
24
24
  from . import berny_solver as geom
25
- except ImportError as e2:
25
+ except ImportError:
26
26
  raise e1
27
27
  return geom.optimize(method, *args, **kwargs)
pyscf/grad/ccsd.py CHANGED
@@ -416,7 +416,7 @@ def _load_block_tril(h5dat, row0, row1, nao, out=None):
416
416
  return out
417
417
 
418
418
  def _cp(a):
419
- return numpy.array(a, copy=False, order='C')
419
+ return numpy.asarray(a, order='C')
420
420
 
421
421
  class Gradients(rhf_grad.GradientsBase):
422
422
 
pyscf/grad/rhf.py CHANGED
@@ -474,3 +474,4 @@ Grad = Gradients
474
474
  from pyscf import scf
475
475
  # Inject to RHF class
476
476
  scf.hf.RHF.Gradients = lib.class_as_method(Gradients)
477
+ scf.rohf.ROHF.Gradients = lib.invalid_method('Gradients')
pyscf/grad/rks.py CHANGED
@@ -622,3 +622,4 @@ Grad = Gradients
622
622
 
623
623
  from pyscf import dft
624
624
  dft.rks.RKS.Gradients = dft.rks_symm.RKS.Gradients = lib.class_as_method(Gradients)
625
+ dft.roks.ROKS.Gradients = lib.invalid_method('Gradients')
pyscf/grad/uccsd.py CHANGED
@@ -485,7 +485,7 @@ def _rdm2_mo2ao(mycc, d2, mo_coeff, fsave=None):
485
485
  return fsave
486
486
 
487
487
  def _cp(a):
488
- return numpy.array(a, copy=False, order='C')
488
+ return numpy.asarray(a, order='C')
489
489
 
490
490
  class Gradients(ccsd_grad.Gradients):
491
491
  grad_elec = grad_elec
pyscf/gto/__init__.py CHANGED
@@ -24,5 +24,4 @@ from pyscf.gto.moleintor import getints, getints_by_shell
24
24
  from pyscf.gto.eval_gto import eval_gto
25
25
  from pyscf.gto import ecp
26
26
 
27
- parse = basis.parse
28
27
  #import pyscf.gto.mole.cmd_args
@@ -531,7 +531,6 @@ def _convert_contraction(contr_string):
531
531
  def _truncate(basis, contr_scheme, symb, split_name):
532
532
  # keep only first n_keep contractions for each l
533
533
  contr_b = []
534
- b_index = 0
535
534
  for l, n_keep in enumerate(contr_scheme):
536
535
  n_saved = 0
537
536
  if n_keep > 0:
pyscf/gto/eval_gto.py CHANGED
@@ -82,8 +82,14 @@ def eval_gto(mol, eval_name, coords, comp=None, shls_slice=None, non0tab=None,
82
82
  If provided, results are written into this array.
83
83
 
84
84
  Returns:
85
- 2D array of shape (N,nao) Or 3D array of shape (\*,N,nao) to store AO
86
- values on grids.
85
+ An 2D to 4D array for AO values on grids.
86
+ If eval_name is scalar functions, such as GTOval and GTOval_ip_cart,
87
+ the shape of the return is (N,nao) for GTOval, and (*,N,nao) for other
88
+ functions.
89
+ If eval_name is spinor functions, such as GTOval_spinor and GTOval_sp_spinor,
90
+ the shape of the return is (2,N,nao) for GTOval_spinor, and (2,*,N,nao)
91
+ for other functions. The leading dimension 2 represents the spin-up and
92
+ spin-down components of the spinor basis.
87
93
 
88
94
  Examples:
89
95
 
@@ -95,6 +101,9 @@ def eval_gto(mol, eval_name, coords, comp=None, shls_slice=None, non0tab=None,
95
101
  >>> ao_value = mol.eval_gto("GTOval_ig_sph", coords)
96
102
  >>> print(ao_value.shape)
97
103
  (3, 100, 24)
104
+ >>> ao_a, ao_b = mol.eval_gto("GTOval_spinor", coords)
105
+ >>> print(ao_a.shape)
106
+ (100, 24)
98
107
  '''
99
108
  eval_name, comp = _get_intor_and_comp(mol, eval_name, comp)
100
109
 
pyscf/gto/mole.py CHANGED
@@ -3189,7 +3189,7 @@ class MoleBase(lib.StreamObject):
3189
3189
  return self._env[ptr:ptr+3].copy()
3190
3190
 
3191
3191
  def atom_coords(self, unit='Bohr'):
3192
- '''np.asarray([mol.atom_coords(i) for i in range(mol.natm)])'''
3192
+ '''np.asarray([mol.atom_coord(i) for i in range(mol.natm)])'''
3193
3193
  ptr = self._atm[:,PTR_COORD]
3194
3194
  c = self._env[numpy.vstack((ptr,ptr+1,ptr+2)).T].copy()
3195
3195
  if not is_au(unit):
@@ -3840,7 +3840,7 @@ def _parse_nuc_mod(str_or_int_or_fn):
3840
3840
  def _update_from_cmdargs_(mol):
3841
3841
  try:
3842
3842
  # Detect whether in Ipython shell
3843
- __IPYTHON__ # noqa:
3843
+ __IPYTHON__ # noqa: F821
3844
3844
  return
3845
3845
  except Exception:
3846
3846
  pass
@@ -46,7 +46,7 @@ def get_dispersion(hessobj, disp=None, with_3body=None):
46
46
  if with_3body is not None:
47
47
  with_3body = disp_with_3body
48
48
 
49
- if mf.disp[:2].upper() == 'D3':
49
+ if disp_version[:2].upper() == 'D3':
50
50
  logger.info(mf, "Calc dispersion correction with DFTD3.")
51
51
  logger.info(mf, f"Parameters: xc={method}, version={disp_version}, atm={with_3body}")
52
52
  logger.warn(mf, "DFTD3 does not support analytical Hessian, using finite difference")
@@ -57,21 +57,21 @@ def get_dispersion(hessobj, disp=None, with_3body=None):
57
57
  for j in range(3):
58
58
  coords[i,j] += eps
59
59
  mol.set_geom_(coords, unit='Bohr')
60
- d3_model = dftd3.DFTD3Dispersion(mol, xc=method, version=mf.disp, atm=with_3body)
60
+ d3_model = dftd3.DFTD3Dispersion(mol, xc=method, version=disp_version, atm=with_3body)
61
61
  res = d3_model.get_dispersion(grad=True)
62
62
  g1 = res.get('gradient')
63
63
 
64
64
  coords[i,j] -= 2.0*eps
65
65
  mol.set_geom_(coords, unit='Bohr')
66
- d3_model = dftd3.DFTD3Dispersion(mol, xc=method, version=mf.disp, atm=with_3body)
66
+ d3_model = dftd3.DFTD3Dispersion(mol, xc=method, version=disp_version, atm=with_3body)
67
67
  res = d3_model.get_dispersion(grad=True)
68
68
  g2 = res.get('gradient')
69
69
 
70
70
  coords[i,j] += eps
71
71
  h_disp[i,:,j,:] = (g1 - g2)/(2.0*eps)
72
- return h_disp
72
+ return h_disp
73
73
 
74
- elif mf.disp[:2].upper() == 'D4':
74
+ elif disp_version[:2].upper() == 'D4':
75
75
  logger.info(mf, "Calc dispersion correction with DFTD4.")
76
76
  logger.info(mf, f"Parameters: xc={method}, atm={with_3body}")
77
77
  logger.warn(mf, "DFTD4 does not support analytical Hessian, using finite difference.")
pyscf/hessian/rhf.py CHANGED
@@ -618,6 +618,7 @@ class Hessian(HessianBase):
618
618
  # Inject to RHF class
619
619
  from pyscf import scf
620
620
  scf.hf.RHF.Hessian = lib.class_as_method(Hessian)
621
+ scf.rohf.ROHF.Hessian = lib.invalid_method('Hessian')
621
622
 
622
623
 
623
624
  if __name__ == '__main__':
pyscf/hessian/rks.py CHANGED
@@ -593,3 +593,4 @@ class Hessian(rhf_hess.HessianBase):
593
593
 
594
594
  from pyscf import dft
595
595
  dft.rks.RKS.Hessian = dft.rks_symm.RKS.Hessian = lib.class_as_method(Hessian)
596
+ dft.roks.ROKS.Hessian = dft.rks_symm.ROKS.Hessian = lib.invalid_method('Hessian')
pyscf/lib/chkfile.py CHANGED
@@ -105,6 +105,7 @@ def dump(chkfile, key, value):
105
105
  >>> f['symm/Ci/op']
106
106
  <HDF5 dataset "op": shape (2,), type "|S1">
107
107
  '''
108
+ from pyscf.lib import H5FileWrap
108
109
  def save_as_group(key, value, root):
109
110
  if isinstance(value, dict):
110
111
  root1 = root.create_group(key)
@@ -126,14 +127,14 @@ def dump(chkfile, key, value):
126
127
  save_as_group('%06d'%k, v, root1)
127
128
 
128
129
  if h5py.is_hdf5(chkfile):
129
- with h5py.File(chkfile, 'r+') as fh5:
130
+ with H5FileWrap(chkfile, 'r+') as fh5:
130
131
  if key in fh5:
131
132
  del (fh5[key])
132
133
  elif key + '__from_list__' in fh5:
133
134
  del (fh5[key+'__from_list__'])
134
135
  save_as_group(key, value, fh5)
135
136
  else:
136
- with h5py.File(chkfile, 'w') as fh5:
137
+ with H5FileWrap(chkfile, 'w') as fh5:
137
138
  save_as_group(key, value, fh5)
138
139
  dump_chkfile_key = save = dump
139
140
 
pyscf/lib/diis.py CHANGED
@@ -217,7 +217,7 @@ class DIIS:
217
217
  if nd < self.min_space:
218
218
  return x
219
219
 
220
- dt = numpy.array(self.get_err_vec(self._head-1), copy=False)
220
+ dt = numpy.asarray(self.get_err_vec(self._head-1))
221
221
  if self._H is None:
222
222
  self._H = numpy.zeros((self.space+1,self.space+1), dt.dtype)
223
223
  self._H[0,1:] = self._H[1:,0] = 1
pyscf/lib/libagf2.dylib CHANGED
Binary file
pyscf/lib/libao2mo.dylib CHANGED
Binary file
pyscf/lib/libcc.dylib CHANGED
Binary file
pyscf/lib/libcgto.dylib CHANGED
Binary file
pyscf/lib/libcvhf.dylib CHANGED
Binary file
pyscf/lib/libdft.dylib CHANGED
Binary file
pyscf/lib/libfci.dylib CHANGED
Binary file
pyscf/lib/libmcscf.dylib CHANGED
Binary file
Binary file
pyscf/lib/libpbc.dylib CHANGED
Binary file
pyscf/lib/libri.dylib CHANGED
Binary file
Binary file
Binary file
@@ -33,7 +33,7 @@ from pyscf import __config__
33
33
 
34
34
  SAFE_EIGH_LINDEP = getattr(__config__, 'lib_linalg_helper_safe_eigh_lindep', 1e-15)
35
35
  DAVIDSON_LINDEP = getattr(__config__, 'lib_linalg_helper_davidson_lindep', 1e-14)
36
- DSOLVE_LINDEP = getattr(__config__, 'lib_linalg_helper_dsolve_lindep', 1e-15)
36
+ DSOLVE_LINDEP = getattr(__config__, 'lib_linalg_helper_dsolve_lindep', 1e-13)
37
37
  MAX_MEMORY = getattr(__config__, 'lib_linalg_helper_davidson_max_memory', 2000) # 2GB
38
38
 
39
39
  # sort by similarity has problem which flips the ordering of eigenvalues when
@@ -1477,15 +1477,12 @@ def _qr(xs, dot, lindep=1e-14):
1477
1477
  xs = (r.T).dot(qs)
1478
1478
  '''
1479
1479
  nvec = len(xs)
1480
- dtype = xs[0].dtype
1481
- qs = numpy.empty((nvec,xs[0].size), dtype=dtype)
1482
- rmat = numpy.empty((nvec,nvec), order='F', dtype=dtype)
1480
+ xs = qs = numpy.array(xs, copy=True)
1481
+ rmat = numpy.eye(nvec, order='F', dtype=xs.dtype)
1483
1482
 
1484
1483
  nv = 0
1485
1484
  for i in range(nvec):
1486
- xi = numpy.array(xs[i], copy=True)
1487
- rmat[:,nv] = 0
1488
- rmat[nv,nv] = 1
1485
+ xi = xs[i]
1489
1486
  for j in range(nv):
1490
1487
  prod = dot(qs[j].conj(), xi)
1491
1488
  xi -= qs[j] * prod