pyscf 2.10.0__py3-none-macosx_11_0_arm64.whl → 2.11.0__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 (141) hide show
  1. pyscf/__init__.py +1 -1
  2. pyscf/cc/eom_rccsd.py +5 -2
  3. pyscf/df/df.py +29 -9
  4. pyscf/df/df_jk.py +10 -3
  5. pyscf/dft/gen_grid.py +52 -7
  6. pyscf/dft/libxc.py +431 -135
  7. pyscf/dft/numint.py +8 -1
  8. pyscf/dft/rkspu.py +124 -101
  9. pyscf/dft/ukspu.py +58 -40
  10. pyscf/fci/direct_spin1.py +1 -1
  11. pyscf/grad/ccsd.py +2 -2
  12. pyscf/grad/rkspu.py +131 -0
  13. pyscf/grad/tdrhf.py +0 -3
  14. pyscf/grad/tdrks.py +0 -3
  15. pyscf/grad/tduhf.py +0 -3
  16. pyscf/grad/tduks.py +0 -3
  17. pyscf/grad/ukspu.py +76 -0
  18. pyscf/gto/mole.py +103 -32
  19. pyscf/hessian/thermo.py +4 -1
  20. pyscf/lib/CMakeLists.txt +3 -2
  21. pyscf/lib/deps/include/cint.h +1 -1
  22. pyscf/lib/deps/lib/libcint.6.dylib +0 -0
  23. pyscf/lib/dft/libxc_itrf.c +200 -222
  24. pyscf/lib/exceptions.py +3 -0
  25. pyscf/lib/libagf2.dylib +0 -0
  26. pyscf/lib/libao2mo.dylib +0 -0
  27. pyscf/lib/libcc.dylib +0 -0
  28. pyscf/lib/libcgto.dylib +0 -0
  29. pyscf/lib/libcvhf.dylib +0 -0
  30. pyscf/lib/libdft.dylib +0 -0
  31. pyscf/lib/libfci.dylib +0 -0
  32. pyscf/lib/libmcscf.dylib +0 -0
  33. pyscf/lib/libmp.dylib +0 -0
  34. pyscf/lib/libnp_helper.dylib +0 -0
  35. pyscf/lib/libpbc.dylib +0 -0
  36. pyscf/lib/libpdft.dylib +0 -0
  37. pyscf/lib/libri.dylib +0 -0
  38. pyscf/lib/libxc_itrf.dylib +0 -0
  39. pyscf/lib/libxcfun_itrf.dylib +0 -0
  40. pyscf/lib/linalg_helper.py +4 -1
  41. pyscf/lib/misc.py +17 -2
  42. pyscf/lib/np_helper/CMakeLists.txt +1 -1
  43. pyscf/lib/np_helper/imatcopy.c +2 -2
  44. pyscf/lib/np_helper/np_broadcast.c +91 -0
  45. pyscf/lib/np_helper/np_helper.h +11 -0
  46. pyscf/lib/numpy_helper.py +52 -0
  47. pyscf/lib/pbc/grid_ao.c +522 -0
  48. pyscf/lo/pipek.py +31 -18
  49. pyscf/mcpdft/__init__.py +15 -15
  50. pyscf/mcpdft/mcpdft.py +1 -22
  51. pyscf/mcpdft/mspdft.py +0 -26
  52. pyscf/mcpdft/otfnal.py +33 -4
  53. pyscf/mcscf/apc.py +103 -59
  54. pyscf/mcscf/casci.py +7 -0
  55. pyscf/mp/dfmp2.py +10 -4
  56. pyscf/mp/dfump2.py +10 -4
  57. pyscf/pbc/df/aft.py +60 -16
  58. pyscf/pbc/df/df.py +50 -7
  59. pyscf/pbc/df/fft.py +57 -12
  60. pyscf/pbc/df/fft_jk.py +13 -1
  61. pyscf/pbc/df/mdf.py +34 -2
  62. pyscf/pbc/dft/__init__.py +4 -4
  63. pyscf/pbc/dft/gen_grid.py +4 -0
  64. pyscf/pbc/dft/gks.py +2 -2
  65. pyscf/pbc/dft/kgks.py +2 -2
  66. pyscf/pbc/dft/krks.py +2 -2
  67. pyscf/pbc/dft/krks_ksymm.py +2 -0
  68. pyscf/pbc/dft/krkspu.py +97 -174
  69. pyscf/pbc/dft/krkspu_ksymm.py +3 -1
  70. pyscf/pbc/dft/kroks.py +2 -2
  71. pyscf/pbc/dft/kuks.py +2 -2
  72. pyscf/pbc/dft/kuks_ksymm.py +2 -0
  73. pyscf/pbc/dft/kukspu.py +80 -69
  74. pyscf/pbc/dft/kukspu_ksymm.py +3 -1
  75. pyscf/pbc/dft/multigrid/multigrid.py +20 -0
  76. pyscf/pbc/dft/multigrid/multigrid_pair.py +5 -4
  77. pyscf/pbc/dft/numint.py +24 -19
  78. pyscf/pbc/dft/numint2c.py +3 -0
  79. pyscf/pbc/dft/rks.py +3 -2
  80. pyscf/pbc/dft/roks.py +2 -5
  81. pyscf/pbc/dft/uks.py +2 -2
  82. pyscf/pbc/grad/krhf.py +3 -0
  83. pyscf/pbc/grad/krks.py +3 -55
  84. pyscf/pbc/grad/krks_stress.py +404 -0
  85. pyscf/pbc/grad/krkspu.py +142 -0
  86. pyscf/pbc/grad/kuks.py +3 -20
  87. pyscf/pbc/grad/kuks_stress.py +308 -0
  88. pyscf/pbc/grad/kukspu.py +83 -0
  89. pyscf/pbc/grad/rhf.py +3 -0
  90. pyscf/pbc/grad/rks.py +6 -1
  91. pyscf/pbc/grad/rks_stress.py +462 -0
  92. pyscf/pbc/grad/uks.py +6 -1
  93. pyscf/pbc/grad/uks_stress.py +246 -0
  94. pyscf/pbc/gto/cell.py +129 -46
  95. pyscf/pbc/gto/eval_gto.py +1 -1
  96. pyscf/pbc/lib/kpts.py +15 -0
  97. pyscf/pbc/lib/kpts_helper.py +11 -0
  98. pyscf/pbc/scf/ghf.py +2 -2
  99. pyscf/pbc/scf/hf.py +16 -1
  100. pyscf/pbc/scf/kghf.py +2 -2
  101. pyscf/pbc/scf/khf.py +7 -1
  102. pyscf/pbc/scf/khf_ksymm.py +7 -4
  103. pyscf/pbc/scf/krohf.py +2 -2
  104. pyscf/pbc/scf/kuhf.py +2 -2
  105. pyscf/pbc/scf/rohf.py +2 -2
  106. pyscf/pbc/scf/uhf.py +2 -2
  107. pyscf/pbc/symm/symmetry.py +9 -3
  108. pyscf/pbc/tdscf/krhf.py +1 -0
  109. pyscf/pbc/tdscf/krks.py +4 -0
  110. pyscf/pbc/tools/pbc.py +28 -34
  111. pyscf/pbc/tools/pyscf_ase.py +91 -35
  112. pyscf/qmmm/itrf.py +43 -51
  113. pyscf/qmmm/mm_mole.py +1 -1
  114. pyscf/qmmm/pbc/__init__.py +19 -0
  115. pyscf/qmmm/pbc/itrf.py +1046 -0
  116. pyscf/qmmm/pbc/mm_mole.py +398 -0
  117. pyscf/scf/__init__.py +12 -12
  118. pyscf/scf/hf.py +8 -18
  119. pyscf/scf/stability.py +1 -0
  120. pyscf/scf/uhf.py +2 -0
  121. pyscf/solvent/_attach_solvent.py +2 -7
  122. pyscf/solvent/ddcosmo.py +1 -1
  123. pyscf/solvent/grad/pcm.py +2 -2
  124. pyscf/solvent/grad/smd.py +2 -0
  125. pyscf/solvent/hessian/pcm.py +1 -2
  126. pyscf/solvent/hessian/smd.py +6 -10
  127. pyscf/solvent/pcm.py +84 -11
  128. pyscf/solvent/smd.py +89 -16
  129. pyscf/tdscf/dhf.py +0 -3
  130. pyscf/tdscf/ghf.py +0 -3
  131. pyscf/tdscf/gks.py +0 -3
  132. pyscf/tdscf/rhf.py +23 -11
  133. pyscf/tdscf/rks.py +6 -8
  134. pyscf/tdscf/uhf.py +9 -4
  135. pyscf/tdscf/uks.py +5 -8
  136. {pyscf-2.10.0.dist-info → pyscf-2.11.0.dist-info}/METADATA +3 -3
  137. {pyscf-2.10.0.dist-info → pyscf-2.11.0.dist-info}/RECORD +141 -129
  138. {pyscf-2.10.0.dist-info → pyscf-2.11.0.dist-info}/licenses/NOTICE +2 -0
  139. {pyscf-2.10.0.dist-info → pyscf-2.11.0.dist-info}/WHEEL +0 -0
  140. {pyscf-2.10.0.dist-info → pyscf-2.11.0.dist-info}/licenses/LICENSE +0 -0
  141. {pyscf-2.10.0.dist-info → pyscf-2.11.0.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.10.0'
38
+ __version__ = '2.11.0'
39
39
 
40
40
  import os
41
41
  import sys
pyscf/cc/eom_rccsd.py CHANGED
@@ -58,6 +58,9 @@ def kernel(eom, nroots=1, koopmans=False, guess=None, left=False,
58
58
  # GHF or customized RHF/UHF may be of complex type
59
59
  real_system = (eom._cc._scf.mo_coeff[0].dtype == np.double)
60
60
 
61
+ mem_now = lib.current_memory()[0]
62
+ max_memory = max(0, eom.max_memory - mem_now)
63
+
61
64
  eig = lib.davidson_nosym1
62
65
  if user_guess or koopmans:
63
66
  assert len(guess) == nroots
@@ -69,14 +72,14 @@ def kernel(eom, nroots=1, koopmans=False, guess=None, left=False,
69
72
  return lib.linalg_helper._eigs_cmplx2real(w, v, idx, real_system)
70
73
  conv, es, vs = eig(matvec, guess, precond, pick=eig_close_to_init_guess,
71
74
  tol=eom.conv_tol, max_cycle=eom.max_cycle,
72
- max_space=eom.max_space, nroots=nroots, verbose=log)
75
+ max_space=eom.max_space, max_memory=max_memory, nroots=nroots, verbose=log)
73
76
  else:
74
77
  def pickeig(w, v, nroots, envs):
75
78
  real_idx = np.where(abs(w.imag) < 1e-3)[0]
76
79
  return lib.linalg_helper._eigs_cmplx2real(w, v, real_idx, real_system)
77
80
  conv, es, vs = eig(matvec, guess, precond, pick=pickeig,
78
81
  tol=eom.conv_tol, max_cycle=eom.max_cycle,
79
- max_space=eom.max_space, nroots=nroots, verbose=log)
82
+ max_space=eom.max_space, max_memory=max_memory, nroots=nroots, verbose=log)
80
83
 
81
84
  if eom.verbose >= logger.INFO:
82
85
  for n, en, vn, convn in zip(range(nroots), es, vs, conv):
pyscf/df/df.py CHANGED
@@ -42,16 +42,18 @@ class DF(lib.StreamObject):
42
42
  r'''
43
43
  Object to hold 3-index tensor
44
44
 
45
- Attributes:
45
+ Input Attributes:
46
46
  auxbasis : str or dict
47
- Same input format as :attr:`Mole.basis`
48
-
49
- auxmol : Mole object
50
- Read only Mole object to hold the auxiliary basis. auxmol is
51
- generated automatically in the initialization step based on the
52
- given auxbasis. It is used in the rest part of the code to
53
- determine the problem size, the integral batches etc. This object
54
- should NOT be modified.
47
+ Same format as the input attribute mol.basis. If auxbasis is set to
48
+ None, an optimal auxiliary basis set will be selected based on the
49
+ AO basis set, according to the records in the basis set exchange
50
+ database and the predefined mappings in `pyscf.df.addons.DEFAULT_AUXBASIS`.
51
+ For DFT methods, the selection of auxiliary basis sets is also
52
+ influenced by the xc functional. The J-FIT basis set will be used for
53
+ local and semi-local functionals (LDA, GGA, and meta-GGA). JK-FIT
54
+ basis set will be employed for hybrid and RSH functionals.
55
+ If optimal auxiliary basis sets are not available, the PySCF built-in
56
+ even-tempered Gaussian basis set will be used.
55
57
  _cderi_to_save : str
56
58
  If _cderi_to_save is specified, the DF integral tensor will be
57
59
  saved in this file.
@@ -68,9 +70,27 @@ class DF(lib.StreamObject):
68
70
  in the DF integral tensor. Thus the shape of DF integral tensor
69
71
  is (M,N*(N+1)/2), where M is the number of auxbasis functions and
70
72
  N is the number of basis functions of the orbital basis.
73
+ This attribute is not compatible between the CPU and GPU implementations.
74
+ It will not be transferred during the to_cpu() and to_gpu() calls.
71
75
  blockdim : int
72
76
  When reading DF integrals from disk the chunk size to load. It is
73
77
  used to improve IO performance.
78
+
79
+ Intermediate Attributes (These attributes are generated during calculations
80
+ and should not be modified. Additionally, they may not be compatible between
81
+ GPU and CPU implementations.)
82
+ auxmol : Mole object
83
+ Read only Mole object to hold the auxiliary basis. auxmol is
84
+ generated automatically in the initialization step based on the
85
+ given auxbasis. It is used in the rest part of the code to
86
+ determine the problem size, the integral batches etc. This object
87
+ should NOT be modified.
88
+ _vjopt : _VHFOpt instance
89
+ An instance that caches precomputation variables to optimize the
90
+ computation of the Coulomb matrix.
91
+ _rsh_df : dict
92
+ For range-separated DFT functionals, this object stores the density fitting
93
+ instances for long-range or short-range Coulomb integrals.
74
94
  '''
75
95
 
76
96
  blockdim = getattr(__config__, 'df_df_DF_blockdim', 240)
pyscf/df/df_jk.py CHANGED
@@ -37,9 +37,16 @@ def density_fit(mf, auxbasis=None, with_df=None, only_dfj=False):
37
37
 
38
38
  Kwargs:
39
39
  auxbasis : str or basis dict
40
- Same format to the input attribute mol.basis. If auxbasis is
41
- None, optimal auxiliary basis based on AO basis (if possible) or
42
- even-tempered Gaussian basis will be used.
40
+ Same format as the input attribute mol.basis. If auxbasis is set to
41
+ None, an optimal auxiliary basis set will be selected based on the
42
+ AO basis set, according to the records in the basis set exchange
43
+ database and the predefined mappings in `pyscf.df.addons.DEFAULT_AUXBASIS`.
44
+ For DFT methods, the selection of auxiliary basis sets is also
45
+ influenced by the xc functional. The J-FIT basis set will be used for
46
+ local and semi-local functionals (LDA, GGA, and meta-GGA). JK-FIT
47
+ basis set will be employed for hybrid and RSH functionals.
48
+ If optimal auxiliary basis sets are not available, the PySCF built-in
49
+ even-tempered Gaussian basis set will be used.
43
50
 
44
51
  only_dfj : str
45
52
  Compute Coulomb integrals only and no approximation for HF
pyscf/dft/gen_grid.py CHANGED
@@ -183,7 +183,32 @@ def original_becke(g):
183
183
 
184
184
  def gen_atomic_grids(mol, atom_grid={}, radi_method=radi.gauss_chebyshev,
185
185
  level=3, prune=nwchem_prune, **kwargs):
186
- '''Generate number of radial grids and angular grids for the given molecule.
186
+ '''Generate radial and angular grids for each atom within a molecule
187
+
188
+ Kwargs:
189
+ atom_grid : dict or tuple
190
+ A dict {atom: (n_rad, n_ang)} to define the grid settings for each
191
+ atom within the molecule. For atoms in mol.atom that are not
192
+ included in the dict, the radial and angular configuration
193
+ associated with `level` will be used as the default setting.
194
+ The dict can also accept a "default" key to specify default
195
+ configurations. atom_grid can be provided as a tuple (n_rad, n_ang).
196
+ In this case, the same grid setting will apply apply to all atoms.
197
+ radi_method : function
198
+ The method to generate radial grids. Supported functions include the
199
+ treutler_ahlrichs, delley, mura_knowles, gauss_chebeshev in the
200
+ `dft.radi` module.
201
+ level : integer
202
+ Predefined configurations for radial and angular grids based on
203
+ the period of the elements. The number of radial and angular grids
204
+ for each level can be found in dft.gen_grid.RAD_GRIDS and
205
+ dft.gen_grid.ANG_ORDER.
206
+ prune : function
207
+ The pruning scheme to reduce angular grids for radial griads.
208
+ Available functions include the nwchem_prune, sg1_prune,
209
+ and treutler_prune, implemented in the `dft.gen_grid` module.
210
+ If None is provided for this argument, no pruning scheme will
211
+ be applied.
187
212
 
188
213
  Returns:
189
214
  A dict, with the atom symbol for the dict key. For each atom type,
@@ -191,16 +216,18 @@ def gen_atomic_grids(mol, atom_grid={}, radi_method=radi.gauss_chebyshev,
191
216
  atom center; the second is the volume of that grid.
192
217
  '''
193
218
  if isinstance(atom_grid, (list, tuple)):
194
- atom_grid = {mol.atom_symbol(ia): atom_grid
195
- for ia in range(mol.natm)}
219
+ atom_grid = {mol.atom_symbol(ia): atom_grid for ia in range(mol.natm)}
220
+
221
+ default = atom_grid.get('default', None)
196
222
  atom_grids_tab = {}
197
223
  for ia in range(mol.natm):
198
224
  symb = mol.atom_symbol(ia)
199
225
 
200
226
  if symb not in atom_grids_tab:
201
227
  chg = gto.charge(symb)
202
- if symb in atom_grid:
203
- n_rad, n_ang = atom_grid[symb]
228
+ atom_config = atom_grid.get(symb, default)
229
+ if atom_config is not None:
230
+ n_rad, n_ang = atom_config
204
231
  if n_ang not in LEBEDEV_NGRID:
205
232
  if n_ang in LEBEDEV_ORDER:
206
233
  logger.warn(mol, 'n_ang %d for atom %d %s is not '
@@ -383,7 +410,7 @@ def _load_conf(mod, name, default):
383
410
  return var
384
411
 
385
412
  class Grids(lib.StreamObject):
386
- '''DFT mesh grids
413
+ '''Atomic grids for DFT numerical integration
387
414
 
388
415
  Attributes for Grids:
389
416
  level : int
@@ -434,7 +461,25 @@ class Grids(lib.StreamObject):
434
461
  Eg, grids.atom_grid = {'H': (20,110)} will generate 20 radial
435
462
  grids and 110 angular grids for H atom.
436
463
 
437
- Examples:
464
+ Saved results:
465
+ coords : ndarray
466
+ Coordinates of the integration grids.
467
+ weights : ndarray
468
+ Integration weights of the integration grids.
469
+
470
+ Intermediate Attributes (These attributes are generated during calculations
471
+ and should not be modified. Additionally, they may not be compatible between
472
+ GPU and CPU implementations):
473
+ non0tab :
474
+ The important grids for each AO shell.
475
+ screen_index :
476
+ An estimation of the AO values on the grids.
477
+ atm_idx :
478
+ Atom ID for each grid.
479
+ quadrature_weights :
480
+ Volume of each grid, not scaled by the Becke partitioning.
481
+
482
+ Examples:
438
483
 
439
484
  >>> mol = gto.M(atom='H 0 0 0; H 0 0 1.1')
440
485
  >>> grids = dft.gen_grid.Grids(mol)