pyscf 2.6.2__py3-none-macosx_11_0_arm64.whl → 2.7.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.
- pyscf/__init__.py +2 -2
- pyscf/adc/__init__.py +3 -8
- pyscf/adc/dfadc.py +22 -6
- pyscf/adc/radc.py +106 -15
- pyscf/adc/radc_amplitudes.py +7 -1
- pyscf/adc/radc_ao2mo.py +4 -2
- pyscf/adc/radc_ea.py +524 -8
- pyscf/adc/radc_ip.py +492 -60
- pyscf/adc/radc_ip_cvs.py +4 -2
- pyscf/adc/uadc.py +116 -27
- pyscf/adc/uadc_amplitudes.py +215 -20
- pyscf/adc/uadc_ao2mo.py +30 -9
- pyscf/adc/uadc_ea.py +34 -44
- pyscf/adc/uadc_ip.py +9 -4
- pyscf/adc/uadc_ip_cvs.py +4 -1
- pyscf/agf2/__init__.py +2 -2
- pyscf/agf2/aux_space.py +1 -1
- pyscf/agf2/chkfile.py +1 -1
- pyscf/ao2mo/outcore.py +6 -4
- pyscf/cc/__init__.py +21 -3
- pyscf/cc/bccd.py +0 -46
- pyscf/cc/ccsd.py +16 -8
- pyscf/cc/uccsd.py +1 -1
- pyscf/data/elements.py +1 -1
- pyscf/df/__init__.py +2 -1
- pyscf/df/addons.py +79 -51
- pyscf/df/autoaux.py +191 -0
- pyscf/df/df.py +5 -1
- pyscf/df/grad/casscf.py +0 -41
- pyscf/df/hessian/rhf.py +2 -10
- pyscf/df/hessian/rks.py +1 -7
- pyscf/df/hessian/uhf.py +3 -13
- pyscf/df/hessian/uks.py +1 -8
- pyscf/df/incore.py +17 -5
- pyscf/dft/dks.py +1 -1
- pyscf/dft/libxc.py +65 -639
- pyscf/dft/numint.py +7 -3
- pyscf/dft/radi.py +39 -5
- pyscf/dft/rks.py +1 -1
- pyscf/dft/xc_deriv.py +1 -1
- pyscf/dft/xcfun.py +53 -2
- pyscf/eph/eph_fd.py +1 -1
- pyscf/eph/rhf.py +6 -36
- pyscf/eph/rks.py +0 -4
- pyscf/eph/uhf.py +1 -7
- pyscf/eph/uks.py +1 -7
- pyscf/fci/addons.py +117 -2
- pyscf/fci/cistring.py +1 -1
- pyscf/fci/direct_nosym.py +3 -3
- pyscf/fci/direct_spin0_symm.py +22 -43
- pyscf/fci/direct_spin1.py +65 -9
- pyscf/fci/direct_spin1_symm.py +49 -14
- pyscf/fci/direct_uhf.py +4 -4
- pyscf/fci/selected_ci_symm.py +1 -1
- pyscf/grad/lagrange.py +11 -3
- pyscf/grad/mp2.py +1 -1
- pyscf/grad/sacasscf.py +1 -1
- pyscf/grad/tdrks.py +1 -1
- pyscf/gto/basis/__init__.py +7 -0
- pyscf/gto/basis/bse.py +68 -15
- pyscf/gto/basis/parse_cp2k_pp.py +1 -1
- pyscf/gto/basis/parse_nwchem.py +1 -1
- pyscf/gto/basis/parse_nwchem_ecp.py +2 -1
- pyscf/gto/basis/sap_grasp_large.dat +2438 -0
- pyscf/gto/basis/sap_grasp_small.dat +1434 -0
- pyscf/gto/mole.py +99 -44
- pyscf/gw/gw_ac.py +2 -2
- pyscf/gw/gw_cd.py +2 -2
- pyscf/gw/rpa.py +2 -2
- pyscf/gw/ugw_ac.py +2 -2
- pyscf/gw/urpa.py +1 -1
- pyscf/hessian/rhf.py +30 -128
- pyscf/hessian/rks.py +1 -6
- pyscf/hessian/uhf.py +28 -138
- pyscf/hessian/uks.py +1 -8
- pyscf/lib/ao2mo/nr_ao2mo.c +1 -1
- pyscf/lib/ao2mo/nrr_ao2mo.c +1 -1
- pyscf/lib/ao2mo/r_ao2mo.c +1 -1
- pyscf/lib/cc/ccsd_pack.c +1 -1
- pyscf/lib/cc/ccsd_t.c +6 -6
- pyscf/lib/cc/uccsd_t.c +4 -4
- pyscf/lib/deps/include/XCFun/XCFunExport.h +1 -0
- pyscf/lib/dft/grid_common.c +1 -1
- pyscf/lib/dft/libxc_itrf.c +4 -1
- pyscf/lib/dft/xcfun_itrf.c +1 -1
- pyscf/lib/diis.py +1 -1
- pyscf/lib/exceptions.py +3 -0
- pyscf/lib/gto/fill_grids_int2c.c +11 -9
- pyscf/lib/gto/fill_int2e.c +7 -5
- pyscf/lib/gto/fill_r_4c.c +1 -1
- pyscf/lib/gto/ft_ao.c +1 -1
- pyscf/lib/gto/ft_ao.h +1 -1
- pyscf/lib/gto/gto.h +2 -2
- pyscf/lib/gto/nr_ecp.c +3 -2
- 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 +112 -192
- pyscf/lib/mcscf/fci_contract.c +2 -2
- pyscf/lib/misc.py +47 -14
- pyscf/lib/numpy_helper.py +1 -1
- pyscf/lib/pbc/nr_ecp.c +10 -3
- pyscf/lib/pbc/pbc.h +1 -1
- pyscf/lib/vhf/nr_sgx_direct.c +8 -6
- pyscf/lib/vhf/optimizer.c +2 -2
- pyscf/lo/iao.py +1 -1
- pyscf/lo/ibo.py +3 -3
- pyscf/lo/pipek_jacobi.py +1 -1
- pyscf/mcscf/__init__.py +2 -2
- pyscf/mcscf/addons.py +3 -3
- pyscf/mcscf/apc.py +2 -2
- pyscf/mcscf/casci.py +8 -6
- pyscf/mcscf/chkfile.py +70 -41
- pyscf/mcscf/dmet_cas.py +2 -2
- pyscf/mcscf/mc1step.py +62 -38
- pyscf/mcscf/newton_casscf.py +5 -5
- pyscf/mcscf/ucasci.py +1 -1
- pyscf/mcscf/umc1step.py +44 -25
- pyscf/md/integrators.py +3 -3
- pyscf/mp/mp2.py +6 -5
- pyscf/mp/ump2.py +7 -6
- pyscf/pbc/adc/kadc_rhf.py +1 -1
- pyscf/pbc/adc/kadc_rhf_amplitudes.py +2 -2
- pyscf/pbc/ao2mo/eris.py +1 -1
- pyscf/pbc/cc/kccsd_rhf.py +3 -3
- pyscf/pbc/cc/kccsd_t_rhf.py +2 -2
- pyscf/pbc/ci/kcis_rhf.py +2 -2
- pyscf/pbc/df/aft.py +2 -2
- pyscf/pbc/df/aft_ao2mo.py +1 -1
- pyscf/pbc/df/df.py +84 -11
- pyscf/pbc/df/df_jk.py +2 -1
- pyscf/pbc/df/fft.py +6 -2
- pyscf/pbc/df/fft_ao2mo.py +4 -0
- pyscf/pbc/df/fft_jk.py +11 -3
- pyscf/pbc/df/ft_ao.py +4 -3
- pyscf/pbc/df/gdf_builder.py +5 -4
- pyscf/pbc/df/incore.py +1 -1
- pyscf/pbc/df/mdf.py +6 -3
- pyscf/pbc/df/rsdf.py +2 -2
- pyscf/pbc/df/rsdf_builder.py +11 -6
- pyscf/pbc/df/rsdf_helper.py +1 -1
- pyscf/pbc/dft/cdft.py +5 -5
- pyscf/pbc/dft/multigrid/multigrid.py +19 -26
- pyscf/pbc/dft/multigrid/multigrid_pair.py +1 -1
- pyscf/pbc/dft/multigrid/pp.py +1 -1
- pyscf/pbc/dft/numint.py +30 -21
- pyscf/pbc/eph/eph_fd.py +1 -1
- pyscf/pbc/geomopt/geometric_solver.py +1 -1
- pyscf/pbc/gto/cell.py +37 -19
- pyscf/pbc/gto/ecp.py +12 -12
- pyscf/pbc/gto/eval_gto.py +2 -2
- pyscf/pbc/gto/pseudo/pp.py +1 -1
- pyscf/pbc/gw/krgw_ac.py +4 -4
- pyscf/pbc/gw/krgw_cd.py +4 -4
- pyscf/pbc/gw/kugw_ac.py +3 -3
- pyscf/pbc/lib/kpts_helper.py +4 -3
- pyscf/pbc/lib/linalg_helper.py +1 -1
- pyscf/pbc/mp/kmp2.py +1 -1
- pyscf/pbc/mpitools/mpi.py +1 -1
- pyscf/pbc/scf/addons.py +15 -11
- pyscf/pbc/scf/cphf.py +1 -1
- pyscf/pbc/scf/ghf.py +1 -1
- pyscf/pbc/scf/hf.py +21 -24
- pyscf/pbc/scf/kghf.py +33 -29
- pyscf/pbc/scf/khf.py +71 -26
- pyscf/pbc/scf/krohf.py +5 -7
- pyscf/pbc/scf/kuhf.py +53 -22
- pyscf/pbc/scf/rsjk.py +13 -9
- pyscf/pbc/scf/scfint.py +1 -1
- pyscf/pbc/scf/stability.py +1 -1
- pyscf/pbc/scf/uhf.py +3 -1
- pyscf/pbc/symm/symmetry.py +2 -2
- pyscf/pbc/tdscf/kproxy.py +1 -1
- pyscf/pbc/tdscf/kproxy_supercell.py +2 -2
- pyscf/pbc/tdscf/krhf.py +215 -133
- pyscf/pbc/tdscf/krhf_slow_supercell.py +1 -1
- pyscf/pbc/tdscf/krks.py +1 -45
- pyscf/pbc/tdscf/kuhf.py +58 -105
- pyscf/pbc/tdscf/kuks.py +0 -56
- pyscf/pbc/tdscf/proxy.py +1 -1
- pyscf/pbc/tdscf/rhf.py +111 -3
- pyscf/pbc/tdscf/rks.py +2 -1
- pyscf/pbc/tdscf/uhf.py +203 -1
- pyscf/pbc/tdscf/uks.py +2 -1
- pyscf/pbc/tools/k2gamma.py +7 -4
- pyscf/pbc/tools/pbc.py +63 -56
- pyscf/pbc/tools/pyscf_ase.py +0 -1
- pyscf/pbc/tools/pywannier90.py +1 -1
- pyscf/qmmm/mm_mole.py +1 -1
- pyscf/scf/_response_functions.py +2 -2
- pyscf/scf/_vhf.py +14 -10
- pyscf/scf/addons.py +29 -15
- pyscf/scf/cphf.py +14 -52
- pyscf/scf/dhf.py +39 -10
- pyscf/scf/dispersion.py +9 -8
- pyscf/scf/ghf.py +25 -13
- pyscf/scf/ghf_symm.py +2 -2
- pyscf/scf/hf.py +245 -29
- pyscf/scf/rohf.py +37 -5
- pyscf/scf/stability.py +142 -112
- pyscf/scf/ucphf.py +21 -16
- pyscf/scf/uhf.py +95 -58
- pyscf/sgx/sgx.py +1 -1
- pyscf/sgx/sgx_jk.py +4 -4
- pyscf/solvent/_ddcosmo_tdscf_grad.py +1 -1
- pyscf/solvent/ddcosmo.py +1 -1
- pyscf/solvent/pol_embed.py +1 -1
- pyscf/soscf/ciah.py +1 -1
- pyscf/soscf/newton_ah.py +1 -1
- pyscf/symm/__init__.py +1 -1
- pyscf/symm/addons.py +5 -5
- pyscf/tdscf/_lr_eig.py +505 -0
- pyscf/tdscf/common_slow.py +1 -1
- pyscf/tdscf/dhf.py +41 -37
- pyscf/tdscf/dks.py +0 -4
- pyscf/tdscf/ghf.py +91 -71
- pyscf/tdscf/gks.py +16 -16
- pyscf/tdscf/proxy.py +2 -2
- pyscf/tdscf/rhf.py +143 -96
- pyscf/tdscf/rks.py +15 -14
- pyscf/tdscf/uhf.py +117 -70
- pyscf/tdscf/uks.py +17 -18
- pyscf/tools/fcidump.py +3 -0
- pyscf/x2c/sfx2c1e.py +1 -1
- pyscf/x2c/tdscf.py +4 -4
- pyscf/x2c/x2c.py +15 -11
- {pyscf-2.6.2.dist-info → pyscf-2.7.0.dist-info}/METADATA +24 -24
- {pyscf-2.6.2.dist-info → pyscf-2.7.0.dist-info}/NOTICE +3 -1
- {pyscf-2.6.2.dist-info → pyscf-2.7.0.dist-info}/RECORD +242 -240
- {pyscf-2.6.2.dist-info → pyscf-2.7.0.dist-info}/WHEEL +1 -1
- pyscf/dft/gen_libxc_param.py +0 -35
- pyscf/dft/gen_xcfun_param.py +0 -209
- {pyscf-2.6.2.dist-info → pyscf-2.7.0.dist-info}/LICENSE +0 -0
- {pyscf-2.6.2.dist-info → pyscf-2.7.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.
|
|
38
|
+
__version__ = '2.7.0'
|
|
39
39
|
|
|
40
40
|
import os
|
|
41
41
|
import sys
|
|
@@ -56,7 +56,7 @@ if PYSCF_EXT_PATH:
|
|
|
56
56
|
__path__.append(os.path.join(p, f, 'pyscf'))
|
|
57
57
|
del f
|
|
58
58
|
elif os.path.exists(p):
|
|
59
|
-
# Load all
|
|
59
|
+
# Load all modules defined inside the file PYSCF_EXT_PATH
|
|
60
60
|
with open(p, 'r') as f:
|
|
61
61
|
__path__.extend(f.read().splitlines())
|
|
62
62
|
del f
|
pyscf/adc/__init__.py
CHANGED
|
@@ -42,12 +42,8 @@ def ADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
|
|
|
42
42
|
|
|
43
43
|
if mf.istype('UHF'):
|
|
44
44
|
return UADC(mf, frozen, mo_coeff, mo_occ)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
# 'is converted to UHF object and UADC method is called.')
|
|
48
|
-
# mf = mf.to_uhf(mf)
|
|
49
|
-
# return UADC(mf, frozen, mo_coeff, mo_occ)
|
|
50
|
-
# TODO add ROHF functionality
|
|
45
|
+
elif mf.istype('ROHF'):
|
|
46
|
+
return UADC(mf, frozen, mo_coeff, mo_occ)
|
|
51
47
|
elif mf.istype('RHF'):
|
|
52
48
|
return RADC(mf, frozen, mo_coeff, mo_occ)
|
|
53
49
|
else :
|
|
@@ -61,8 +57,7 @@ def UADC(mf, frozen=None, mo_coeff=None, mo_occ=None):
|
|
|
61
57
|
if not (frozen is None or frozen == 0):
|
|
62
58
|
raise NotImplementedError
|
|
63
59
|
|
|
64
|
-
mf
|
|
65
|
-
if not mf.istype('UHF'):
|
|
60
|
+
if not (mf.istype('UHF') or mf.istype('ROHF')):
|
|
66
61
|
mf = mf.to_uhf()
|
|
67
62
|
|
|
68
63
|
return uadc.UADC(mf, frozen, mo_coeff, mo_occ)
|
pyscf/adc/dfadc.py
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
# Author: Abdelrahman Ahmed <>
|
|
17
|
+
# Samragni Banerjee <samragnibanerjee4@gmail.com>
|
|
18
|
+
# James Serna <jamcar456@gmail.com>
|
|
19
|
+
# Terrence Stahl <>
|
|
20
|
+
# Alexander Sokolov <alexander.y.sokolov@gmail.com>
|
|
21
|
+
#
|
|
15
22
|
|
|
16
23
|
import numpy as np
|
|
17
24
|
|
|
@@ -58,6 +65,7 @@ def get_ovvv_spin_df(myadc, Lov, Lvv, p, chnk_size):
|
|
|
58
65
|
#vvvv = np.ascontiguousarray(vvvv.transpose(0,2,1,3)).reshape(-1, nvir, nvir * nvir)
|
|
59
66
|
return ovvv
|
|
60
67
|
|
|
68
|
+
|
|
61
69
|
def get_vvvv_df(myadc, Lvv, p, chnk_size):
|
|
62
70
|
|
|
63
71
|
''' Returns approximate vvvv integrals used in restricted implementation'''
|
|
@@ -75,11 +83,13 @@ def get_vvvv_df(myadc, Lvv, p, chnk_size):
|
|
|
75
83
|
Lvv = Lvv.reshape(naux,nvir*nvir)
|
|
76
84
|
vvvv = np.dot(Lvv_temp, Lvv)
|
|
77
85
|
vvvv = vvvv.reshape(-1, nvir, nvir, nvir)
|
|
78
|
-
vvvv =
|
|
86
|
+
vvvv = vvvv.transpose(0,2,1,3).reshape(-1, nvir, nvir, nvir)
|
|
87
|
+
vvvv = np.ascontiguousarray(vvvv)
|
|
88
|
+
|
|
79
89
|
return vvvv
|
|
80
90
|
|
|
81
91
|
|
|
82
|
-
def get_vvvv_antisym_df(myadc, Lvv, p, chnk_size):
|
|
92
|
+
def get_vvvv_antisym_df(myadc, Lvv, p, chnk_size, pack = True):
|
|
83
93
|
|
|
84
94
|
''' Returns approximate antisymmetrized vvvv integrals (alpha/beta spin) used in unrestricted implementation'''
|
|
85
95
|
|
|
@@ -95,9 +105,13 @@ def get_vvvv_antisym_df(myadc, Lvv, p, chnk_size):
|
|
|
95
105
|
Lvv = Lvv.reshape(naux,nvir*nvir)
|
|
96
106
|
vvvv = np.dot(Lvv_temp, Lvv)
|
|
97
107
|
vvvv = vvvv.reshape(-1, nvir, nvir, nvir)
|
|
98
|
-
vvvv = vvvv.transpose(0,2,1,3)
|
|
108
|
+
vvvv = vvvv.transpose(0,2,1,3)
|
|
99
109
|
vvvv -= vvvv.transpose(0,1,3,2)
|
|
100
|
-
|
|
110
|
+
|
|
111
|
+
if pack:
|
|
112
|
+
vvvv = np.ascontiguousarray(vvvv[:, :, ind_vv_g[0], ind_vv_g[1]])
|
|
113
|
+
else:
|
|
114
|
+
vvvv = np.ascontiguousarray(vvvv)
|
|
101
115
|
|
|
102
116
|
return vvvv
|
|
103
117
|
|
|
@@ -116,7 +130,9 @@ def get_vVvV_df(myadc, Lvv, LVV, p, chnk_size):
|
|
|
116
130
|
Lvv_temp = np.ascontiguousarray(Lvv.T.reshape(-1,naux))
|
|
117
131
|
|
|
118
132
|
LVV = LVV.reshape(naux,nvir_2*nvir_2)
|
|
119
|
-
vvvv = np.dot(Lvv_temp, LVV)
|
|
120
|
-
vvvv =
|
|
133
|
+
vvvv = np.dot(Lvv_temp, LVV)
|
|
134
|
+
vvvv = vvvv.reshape(-1,nvir_1,nvir_2,nvir_2)
|
|
135
|
+
vvvv = vvvv.transpose(0,2,1,3)
|
|
136
|
+
vvvv = np.ascontiguousarray(vvvv)
|
|
121
137
|
|
|
122
138
|
return vvvv
|
pyscf/adc/radc.py
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
#
|
|
15
|
-
# Author:
|
|
15
|
+
# Author: Abdelrahman Ahmed <>
|
|
16
|
+
# Samragni Banerjee <samragnibanerjee4@gmail.com>
|
|
17
|
+
# James Serna <jamcar456@gmail.com>
|
|
18
|
+
# Terrence Stahl <>
|
|
16
19
|
# Alexander Sokolov <alexander.y.sokolov@gmail.com>
|
|
17
20
|
#
|
|
18
21
|
|
|
@@ -50,7 +53,7 @@ def kernel(adc, nroots=1, guess=None, eris=None, verbose=None):
|
|
|
50
53
|
imds = adc.get_imds(eris)
|
|
51
54
|
matvec, diag = adc.gen_matvec(imds, eris)
|
|
52
55
|
|
|
53
|
-
guess = adc.get_init_guess(nroots, diag, ascending=True)
|
|
56
|
+
guess = adc.get_init_guess(nroots, diag, ascending = True)
|
|
54
57
|
|
|
55
58
|
conv, adc.E, U = lib.linalg_helper.davidson_nosym1(
|
|
56
59
|
lambda xs : [matvec(x) for x in xs],
|
|
@@ -61,6 +64,7 @@ def kernel(adc, nroots=1, guess=None, eris=None, verbose=None):
|
|
|
61
64
|
|
|
62
65
|
if adc.compute_properties:
|
|
63
66
|
adc.P,adc.X = adc.get_properties(nroots)
|
|
67
|
+
nfalse = np.shape(conv)[0] - np.sum(conv)
|
|
64
68
|
|
|
65
69
|
header = ("\n*************************************************************"
|
|
66
70
|
"\n ADC calculation summary"
|
|
@@ -71,15 +75,88 @@ def kernel(adc, nroots=1, guess=None, eris=None, verbose=None):
|
|
|
71
75
|
print_string = ('%s root %d | Energy (Eh) = %14.10f | Energy (eV) = %12.8f ' %
|
|
72
76
|
(adc.method, n, adc.E[n], adc.E[n]*27.2114))
|
|
73
77
|
if adc.compute_properties:
|
|
74
|
-
print_string += ("| Spec
|
|
78
|
+
print_string += ("| Spec. factor = %10.8f " % adc.P[n])
|
|
75
79
|
print_string += ("| conv = %s" % conv[n])
|
|
76
80
|
logger.info(adc, print_string)
|
|
77
81
|
|
|
82
|
+
if nfalse >= 1:
|
|
83
|
+
logger.warn(adc, "Davidson iterations for " + str(nfalse) + " root(s) did not converge!!!")
|
|
84
|
+
|
|
78
85
|
log.timer('ADC', *cput0)
|
|
79
86
|
|
|
80
87
|
return adc.E, adc.U, adc.P, adc.X
|
|
81
88
|
|
|
82
89
|
|
|
90
|
+
def make_ref_rdm1(adc):
|
|
91
|
+
|
|
92
|
+
if adc.method not in ("adc(2)", "adc(2)-x", "adc(3)"):
|
|
93
|
+
raise NotImplementedError(adc.method)
|
|
94
|
+
|
|
95
|
+
t1 = adc.t1
|
|
96
|
+
t2 = adc.t2
|
|
97
|
+
t2_ce = t1[0][:]
|
|
98
|
+
t1_ccee = t2[0][:]
|
|
99
|
+
|
|
100
|
+
######################
|
|
101
|
+
einsum_type = True
|
|
102
|
+
nocc = adc._nocc
|
|
103
|
+
nvir = adc._nvir
|
|
104
|
+
|
|
105
|
+
nmo = nocc + nvir
|
|
106
|
+
|
|
107
|
+
OPDM = np.zeros((nmo,nmo))
|
|
108
|
+
|
|
109
|
+
####### ADC(2) SPIN ADAPTED REF OPDM with SQA ################
|
|
110
|
+
### OCC-OCC ###
|
|
111
|
+
OPDM[:nocc, :nocc] += lib.einsum('IJ->IJ', np.identity(nocc), optimize = einsum_type).copy()
|
|
112
|
+
OPDM[:nocc, :nocc] -= 2 * lib.einsum('Iiab,Jiab->IJ', t1_ccee, t1_ccee, optimize = einsum_type)
|
|
113
|
+
OPDM[:nocc, :nocc] += lib.einsum('Iiab,Jiba->IJ', t1_ccee, t1_ccee, optimize = einsum_type)
|
|
114
|
+
|
|
115
|
+
### OCC-VIR ###
|
|
116
|
+
OPDM[:nocc, nocc:] += lib.einsum('IA->IA', t2_ce, optimize = einsum_type).copy()
|
|
117
|
+
|
|
118
|
+
### VIR-OCC ###
|
|
119
|
+
OPDM[nocc:, :nocc] += lib.einsum('IA->AI', t2_ce, optimize = einsum_type).copy()
|
|
120
|
+
|
|
121
|
+
### VIR-VIR ###
|
|
122
|
+
OPDM[nocc:, nocc:] += 2 * lib.einsum('ijAa,ijBa->AB', t1_ccee, t1_ccee, optimize = einsum_type)
|
|
123
|
+
OPDM[nocc:, nocc:] -= lib.einsum('ijAa,jiBa->AB', t1_ccee, t1_ccee, optimize = einsum_type)
|
|
124
|
+
|
|
125
|
+
####### ADC(3) SPIN ADAPTED REF OPDM WITH SQA ################
|
|
126
|
+
if adc.method == "adc(3)":
|
|
127
|
+
t3_ce = adc.t1[1][:]
|
|
128
|
+
t2_ccee = t2[1][:]
|
|
129
|
+
|
|
130
|
+
#### OCC-OCC ###
|
|
131
|
+
OPDM[:nocc, :nocc] -= 2 * lib.einsum('Iiab,Jiab->IJ',
|
|
132
|
+
t1_ccee, t2_ccee, optimize = einsum_type)
|
|
133
|
+
OPDM[:nocc, :nocc] += lib.einsum('Iiab,Jiba->IJ', t1_ccee, t2_ccee, optimize = einsum_type)
|
|
134
|
+
OPDM[:nocc, :nocc] -= 2 * lib.einsum('Jiab,Iiab->IJ',
|
|
135
|
+
t1_ccee, t2_ccee, optimize = einsum_type)
|
|
136
|
+
OPDM[:nocc, :nocc] += lib.einsum('Jiab,Iiba->IJ', t1_ccee, t2_ccee, optimize = einsum_type)
|
|
137
|
+
|
|
138
|
+
##### OCC-VIR ### ####
|
|
139
|
+
OPDM[:nocc, nocc:] += lib.einsum('IA->IA', t3_ce, optimize = einsum_type).copy()
|
|
140
|
+
OPDM[:nocc, nocc:] += lib.einsum('IiAa,ia->IA', t1_ccee, t2_ce, optimize = einsum_type)
|
|
141
|
+
OPDM[:nocc, nocc:] -= 1/2 * \
|
|
142
|
+
lib.einsum('iIAa,ia->IA', t1_ccee, t2_ce, optimize = einsum_type)
|
|
143
|
+
###### VIR-OCC ###
|
|
144
|
+
OPDM[nocc:, :nocc] += lib.einsum('IA->AI', t3_ce, optimize = einsum_type).copy()
|
|
145
|
+
OPDM[nocc:, :nocc] += lib.einsum('IiAa,ia->AI', t1_ccee, t2_ce, optimize = einsum_type)
|
|
146
|
+
OPDM[nocc:, :nocc] -= 1/2 * \
|
|
147
|
+
lib.einsum('iIAa,ia->AI', t1_ccee, t2_ce, optimize = einsum_type)
|
|
148
|
+
|
|
149
|
+
##### VIR=VIR ###
|
|
150
|
+
OPDM[nocc:, nocc:] += 2 * lib.einsum('ijAa,ijBa->AB',
|
|
151
|
+
t1_ccee, t2_ccee, optimize = einsum_type)
|
|
152
|
+
OPDM[nocc:, nocc:] -= lib.einsum('ijAa,jiBa->AB', t1_ccee, t2_ccee, optimize = einsum_type)
|
|
153
|
+
OPDM[nocc:, nocc:] += 2 * lib.einsum('ijBa,ijAa->AB',
|
|
154
|
+
t1_ccee, t2_ccee, optimize = einsum_type)
|
|
155
|
+
OPDM[nocc:, nocc:] -= lib.einsum('ijBa,jiAa->AB', t1_ccee, t2_ccee, optimize = einsum_type)
|
|
156
|
+
|
|
157
|
+
return 2 * OPDM
|
|
158
|
+
|
|
159
|
+
|
|
83
160
|
class RADC(lib.StreamObject):
|
|
84
161
|
'''Ground state calculations
|
|
85
162
|
|
|
@@ -112,13 +189,12 @@ class RADC(lib.StreamObject):
|
|
|
112
189
|
memorymin = getattr(__config__, 'adc_radc_RADC_memorymin', 2000)
|
|
113
190
|
|
|
114
191
|
_keys = {
|
|
115
|
-
'tol_residual','conv_tol', 'e_corr', 'method', 'mo_coeff',
|
|
192
|
+
'tol_residual','conv_tol', 'e_corr', 'method', 'method_type', 'mo_coeff',
|
|
116
193
|
'mol', 'mo_energy', 'incore_complete',
|
|
117
|
-
'scf_energy', 'e_tot', 't1', 'frozen', 'chkfile',
|
|
118
|
-
'max_space', '
|
|
119
|
-
'imds', 'method', 'method_type', 'with_df', 'compute_properties',
|
|
194
|
+
'scf_energy', 'e_tot', 't1', 't2', 'frozen', 'chkfile',
|
|
195
|
+
'max_space', 'mo_occ', 'max_cycle', 'imds', 'with_df', 'compute_properties',
|
|
120
196
|
'approx_trans_moments', 'evec_print_tol', 'spec_factor_print_tol',
|
|
121
|
-
'
|
|
197
|
+
'E', 'U', 'P', 'X', 'ncvs', 'dip_mom', 'dip_mom_nuc'
|
|
122
198
|
}
|
|
123
199
|
|
|
124
200
|
def __init__(self, mf, frozen=0, mo_coeff=None, mo_occ=None):
|
|
@@ -141,7 +217,7 @@ class RADC(lib.StreamObject):
|
|
|
141
217
|
self.max_space = getattr(__config__, 'adc_radc_RADC_max_space', 12)
|
|
142
218
|
self.max_cycle = getattr(__config__, 'adc_radc_RADC_max_cycle', 50)
|
|
143
219
|
self.conv_tol = getattr(__config__, 'adc_radc_RADC_conv_tol', 1e-12)
|
|
144
|
-
self.tol_residual = getattr(__config__, '
|
|
220
|
+
self.tol_residual = getattr(__config__, 'adc_radc_RADC_tol_residual', 1e-6)
|
|
145
221
|
self.scf_energy = mf.e_tot
|
|
146
222
|
|
|
147
223
|
self.frozen = frozen
|
|
@@ -172,9 +248,23 @@ class RADC(lib.StreamObject):
|
|
|
172
248
|
self.P = None
|
|
173
249
|
self.X = None
|
|
174
250
|
|
|
251
|
+
dip_ints = -self.mol.intor('int1e_r',comp=3)
|
|
252
|
+
dip_mom = np.zeros((dip_ints.shape[0], self._nmo, self._nmo))
|
|
253
|
+
|
|
254
|
+
for i in range(dip_ints.shape[0]):
|
|
255
|
+
dip = dip_ints[i,:,:]
|
|
256
|
+
dip_mom[i,:,:] = np.dot(mo_coeff.T, np.dot(dip, mo_coeff))
|
|
257
|
+
|
|
258
|
+
self.dip_mom = dip_mom
|
|
259
|
+
|
|
260
|
+
charges = self.mol.atom_charges()
|
|
261
|
+
coords = self.mol.atom_coords()
|
|
262
|
+
self.dip_mom_nuc = lib.einsum('i,ix->x', charges, coords)
|
|
263
|
+
|
|
175
264
|
compute_amplitudes = radc_amplitudes.compute_amplitudes
|
|
176
265
|
compute_energy = radc_amplitudes.compute_energy
|
|
177
266
|
transform_integrals = radc_ao2mo.transform_integrals_incore
|
|
267
|
+
make_ref_rdm1 = make_ref_rdm1
|
|
178
268
|
|
|
179
269
|
def dump_flags(self, verbose=None):
|
|
180
270
|
logger.info(self, '')
|
|
@@ -194,8 +284,8 @@ class RADC(lib.StreamObject):
|
|
|
194
284
|
return self
|
|
195
285
|
|
|
196
286
|
def kernel_gs(self):
|
|
197
|
-
assert
|
|
198
|
-
assert
|
|
287
|
+
assert(self.mo_coeff is not None)
|
|
288
|
+
assert(self.mo_occ is not None)
|
|
199
289
|
|
|
200
290
|
self.method = self.method.lower()
|
|
201
291
|
if self.method not in ("adc(2)", "adc(2)-x", "adc(3)"):
|
|
@@ -236,8 +326,8 @@ class RADC(lib.StreamObject):
|
|
|
236
326
|
return self.e_corr, self.t1, self.t2
|
|
237
327
|
|
|
238
328
|
def kernel(self, nroots=1, guess=None, eris=None):
|
|
239
|
-
assert
|
|
240
|
-
assert
|
|
329
|
+
assert(self.mo_coeff is not None)
|
|
330
|
+
assert(self.mo_occ is not None)
|
|
241
331
|
|
|
242
332
|
self.method = self.method.lower()
|
|
243
333
|
if self.method not in ("adc(2)", "adc(2)-x", "adc(3)"):
|
|
@@ -293,8 +383,8 @@ class RADC(lib.StreamObject):
|
|
|
293
383
|
|
|
294
384
|
def _finalize(self):
|
|
295
385
|
'''Hook for dumping results and clearing up the object.'''
|
|
296
|
-
logger.note(self, '
|
|
297
|
-
self.e_corr)
|
|
386
|
+
logger.note(self, 'MP%s correlation energy of reference state (a.u.) = %.8f',
|
|
387
|
+
self.method[4], self.e_corr)
|
|
298
388
|
return self
|
|
299
389
|
|
|
300
390
|
def ea_adc(self, nroots=1, guess=None, eris=None):
|
|
@@ -338,6 +428,7 @@ class RADC(lib.StreamObject):
|
|
|
338
428
|
def make_rdm1(self):
|
|
339
429
|
return self._adc_es.make_rdm1()
|
|
340
430
|
|
|
431
|
+
|
|
341
432
|
if __name__ == '__main__':
|
|
342
433
|
from pyscf import scf
|
|
343
434
|
from pyscf import gto
|
pyscf/adc/radc_amplitudes.py
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
#
|
|
15
|
-
# Author:
|
|
15
|
+
# Author: Abdelrahman Ahmed <>
|
|
16
|
+
# Samragni Banerjee <samragnibanerjee4@gmail.com>
|
|
17
|
+
# James Serna <jamcar456@gmail.com>
|
|
18
|
+
# Terrence Stahl <>
|
|
16
19
|
# Alexander Sokolov <alexander.y.sokolov@gmail.com>
|
|
17
20
|
#
|
|
18
21
|
|
|
@@ -526,7 +529,10 @@ def compute_energy(myadc, t2, eris):
|
|
|
526
529
|
e_mp = 2 * lib.einsum('ijab,iabj', t2_new, eris_ovvo,optimize=True)
|
|
527
530
|
e_mp -= lib.einsum('ijab,ibaj', t2_new, eris_ovvo,optimize=True)
|
|
528
531
|
|
|
532
|
+
logger.info(myadc, "Reference correlation energy (doubles): %.8f", e_mp)
|
|
533
|
+
|
|
529
534
|
del t2_new
|
|
535
|
+
|
|
530
536
|
return e_mp
|
|
531
537
|
|
|
532
538
|
|
pyscf/adc/radc_ao2mo.py
CHANGED
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
#
|
|
15
|
-
# Author:
|
|
15
|
+
# Author: Abdelrahman Ahmed <>
|
|
16
|
+
# Samragni Banerjee <samragnibanerjee4@gmail.com>
|
|
17
|
+
# James Serna <jamcar456@gmail.com>
|
|
18
|
+
# Terrence Stahl <>
|
|
16
19
|
# Alexander Sokolov <alexander.y.sokolov@gmail.com>
|
|
17
|
-
#
|
|
18
20
|
|
|
19
21
|
import numpy as np
|
|
20
22
|
import pyscf.ao2mo as ao2mo
|