pyscf 2.6.2__py3-none-macosx_11_0_arm64.whl → 2.8.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/__init__.py +13 -2
- pyscf/ao2mo/_ao2mo.py +10 -1
- pyscf/ao2mo/incore.py +3 -0
- pyscf/ao2mo/nrr_outcore.py +2 -2
- pyscf/ao2mo/outcore.py +9 -7
- pyscf/ao2mo/r_outcore.py +2 -2
- pyscf/cc/__init__.py +21 -3
- pyscf/cc/bccd.py +0 -46
- pyscf/cc/ccsd.py +29 -13
- pyscf/cc/ccsd_rdm.py +6 -1
- pyscf/cc/gccsd.py +2 -2
- pyscf/cc/uccsd.py +7 -7
- pyscf/cc/uccsd_rdm.py +2 -2
- pyscf/data/elements.py +1 -1
- pyscf/df/__init__.py +2 -1
- pyscf/df/addons.py +79 -51
- pyscf/df/autoaux.py +195 -0
- pyscf/df/df.py +5 -1
- pyscf/df/df_jk.py +27 -25
- pyscf/df/grad/casscf.py +0 -41
- pyscf/df/grad/rhf.py +31 -1
- 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 +18 -6
- pyscf/df/outcore.py +6 -6
- pyscf/dft/dks.py +1 -1
- pyscf/dft/gks.py +25 -21
- pyscf/dft/libxc.py +91 -645
- pyscf/dft/numint.py +40 -19
- pyscf/dft/radi.py +48 -7
- pyscf/dft/rks.py +29 -25
- pyscf/dft/roks.py +7 -1
- pyscf/dft/uks.py +34 -25
- 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 -10
- 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/ccsd.py +3 -7
- pyscf/grad/ccsd_slow.py +2 -3
- pyscf/grad/lagrange.py +11 -3
- pyscf/grad/mp2.py +13 -4
- pyscf/grad/sacasscf.py +1 -1
- pyscf/grad/tdrks.py +1 -1
- pyscf/grad/uccsd.py +3 -7
- pyscf/grad/ump2.py +2 -4
- pyscf/gto/basis/__init__.py +17 -4
- pyscf/gto/basis/bse.py +68 -15
- pyscf/gto/basis/def2-mtzvp.dat +4719 -0
- pyscf/gto/basis/def2-mtzvpp.dat +4739 -0
- pyscf/gto/basis/dyall-basis/__init__.py +0 -0
- pyscf/gto/basis/dyall-basis/dyall_2zp.py +6492 -0
- pyscf/gto/basis/dyall-basis/dyall_3zp.py +8343 -0
- pyscf/gto/basis/dyall-basis/dyall_4zp.py +10055 -0
- pyscf/gto/basis/dyall-basis/dyall_aae2z.py +1818 -0
- pyscf/gto/basis/dyall-basis/dyall_aae3z.py +2521 -0
- pyscf/gto/basis/dyall-basis/dyall_aae4z.py +3351 -0
- pyscf/gto/basis/dyall-basis/dyall_acv2z.py +1790 -0
- pyscf/gto/basis/dyall-basis/dyall_acv3z.py +2417 -0
- pyscf/gto/basis/dyall-basis/dyall_acv4z.py +3085 -0
- pyscf/gto/basis/dyall-basis/dyall_ae2z.py +6619 -0
- pyscf/gto/basis/dyall-basis/dyall_ae3z.py +9027 -0
- pyscf/gto/basis/dyall-basis/dyall_ae4z.py +11839 -0
- pyscf/gto/basis/dyall-basis/dyall_av2z.py +1742 -0
- pyscf/gto/basis/dyall-basis/dyall_av3z.py +2318 -0
- pyscf/gto/basis/dyall-basis/dyall_av4z.py +2905 -0
- pyscf/gto/basis/dyall-basis/dyall_cv2z.py +6558 -0
- pyscf/gto/basis/dyall-basis/dyall_cv3z.py +8767 -0
- pyscf/gto/basis/dyall-basis/dyall_cv4z.py +11098 -0
- pyscf/gto/basis/dyall-basis/dyall_v2z.py +6472 -0
- pyscf/gto/basis/dyall-basis/dyall_v3z.py +8539 -0
- pyscf/gto/basis/dyall-basis/dyall_v4z.py +10658 -0
- pyscf/gto/basis/ma-def2-qzvp.dat +5959 -0
- pyscf/gto/basis/ma-def2-qzvpp.dat +6195 -0
- pyscf/gto/basis/ma-def2-svp.dat +3504 -0
- pyscf/gto/basis/ma-def2-svpp.dat +3504 -0
- pyscf/gto/basis/ma-def2-tzvp.dat +4347 -0
- pyscf/gto/basis/ma-def2-tzvpp.dat +4549 -0
- pyscf/gto/basis/parse_cp2k.py +8 -7
- pyscf/gto/basis/parse_cp2k_pp.py +1 -1
- pyscf/gto/basis/parse_nwchem.py +26 -11
- 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/eval_gto.py +1 -1
- pyscf/gto/ft_ao.py +6 -6
- pyscf/gto/mole.py +123 -71
- pyscf/gto/moleintor.py +1 -1
- pyscf/gw/gw_ac.py +2 -2
- pyscf/gw/gw_cd.py +2 -2
- pyscf/gw/rpa.py +135 -246
- pyscf/gw/ugw_ac.py +2 -2
- pyscf/gw/urpa.py +80 -131
- 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/CMakeLists.txt +6 -2
- 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/config.h +0 -1
- pyscf/lib/config.h.in +0 -1
- pyscf/lib/deps/include/XCFun/XCFunExport.h +1 -0
- pyscf/lib/deps/include/xc.h +28 -18
- pyscf/lib/deps/include/xc_funcs.h +50 -2
- pyscf/lib/deps/include/xc_version.h +3 -3
- pyscf/lib/deps/lib/libcint.6.dylib +0 -0
- pyscf/lib/deps/lib/{libxc.12.dylib → libxc.15.dylib} +0 -0
- pyscf/lib/deps/lib/libxcfun.2.dylib +0 -0
- pyscf/lib/dft/grid_common.c +1 -1
- pyscf/lib/dft/libxc_itrf.c +10 -7
- pyscf/lib/dft/nr_numint_sparse.c +3 -3
- pyscf/lib/dft/xcfun_itrf.c +1 -1
- pyscf/lib/diis.py +2 -2
- pyscf/lib/exceptions.py +6 -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/libmp.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 +117 -198
- pyscf/lib/logger.py +2 -1
- pyscf/lib/mcscf/fci_contract.c +10 -3
- pyscf/lib/misc.py +63 -22
- pyscf/lib/mp/CMakeLists.txt +22 -0
- pyscf/lib/mp/mp2.c +518 -0
- pyscf/lib/mp/mp2.h +44 -0
- pyscf/lib/np_helper/CMakeLists.txt +1 -1
- pyscf/lib/np_helper/imatcopy.c +360 -0
- pyscf/lib/np_helper/np_helper.c +94 -0
- pyscf/lib/np_helper/np_helper.h +26 -0
- pyscf/lib/numpy_helper.py +195 -11
- pyscf/lib/pbc/nr_direct.c +2 -7
- pyscf/lib/pbc/nr_ecp.c +10 -3
- pyscf/lib/pbc/pbc.h +1 -1
- pyscf/lib/vhf/fblas.h +3 -0
- pyscf/lib/vhf/nr_sgx_direct.c +8 -6
- pyscf/lib/vhf/nr_sr_vhf.c +8 -12
- pyscf/lib/vhf/optimizer.c +2 -2
- pyscf/lib/vhf/rkb_screen.c +139 -0
- 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 +13 -7
- pyscf/mcscf/chkfile.py +69 -41
- pyscf/mcscf/dmet_cas.py +2 -2
- pyscf/mcscf/mc1step.py +72 -44
- pyscf/mcscf/newton_casscf.py +5 -5
- pyscf/mcscf/ucasci.py +1 -1
- pyscf/mcscf/umc1step.py +49 -28
- pyscf/md/integrators.py +3 -3
- pyscf/mp/__init__.py +1 -0
- pyscf/mp/dfmp2.py +498 -59
- pyscf/mp/dfmp2_native.py +11 -1
- pyscf/mp/dfmp2_slow.py +133 -0
- pyscf/mp/dfump2.py +672 -0
- pyscf/mp/dfump2_native.py +9 -0
- pyscf/mp/dfump2_slow.py +161 -0
- pyscf/mp/gmp2.py +6 -47
- pyscf/mp/mp2.py +25 -10
- pyscf/mp/ump2.py +30 -24
- 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 +8 -9
- pyscf/pbc/df/aft_ao2mo.py +1 -1
- pyscf/pbc/df/df.py +85 -12
- pyscf/pbc/df/df_jk.py +6 -2
- pyscf/pbc/df/fft.py +9 -5
- pyscf/pbc/df/fft_ao2mo.py +4 -0
- pyscf/pbc/df/fft_jk.py +18 -10
- pyscf/pbc/df/ft_ao.py +4 -3
- pyscf/pbc/df/gdf_builder.py +5 -4
- pyscf/pbc/df/incore.py +2 -2
- pyscf/pbc/df/mdf.py +6 -3
- pyscf/pbc/df/mdf_jk.py +2 -1
- pyscf/pbc/df/outcore.py +10 -10
- pyscf/pbc/df/rsdf.py +2 -2
- pyscf/pbc/df/rsdf_builder.py +13 -8
- pyscf/pbc/df/rsdf_helper.py +6 -6
- pyscf/pbc/df/rsdf_jk.py +2 -1
- pyscf/pbc/dft/cdft.py +5 -5
- pyscf/pbc/dft/gen_grid.py +3 -2
- pyscf/pbc/dft/gks.py +14 -3
- pyscf/pbc/dft/kgks.py +15 -4
- pyscf/pbc/dft/krks.py +28 -10
- pyscf/pbc/dft/krks_ksymm.py +21 -9
- pyscf/pbc/dft/krkspu.py +1 -30
- pyscf/pbc/dft/krkspu_ksymm.py +0 -30
- pyscf/pbc/dft/kuks.py +30 -13
- pyscf/pbc/dft/kuks_ksymm.py +22 -10
- pyscf/pbc/dft/kukspu.py +0 -27
- pyscf/pbc/dft/kukspu_ksymm.py +0 -30
- pyscf/pbc/dft/multigrid/multigrid.py +36 -33
- pyscf/pbc/dft/multigrid/multigrid_pair.py +7 -2
- pyscf/pbc/dft/multigrid/pp.py +1 -1
- pyscf/pbc/dft/numint.py +56 -31
- pyscf/pbc/dft/rks.py +16 -24
- pyscf/pbc/dft/uks.py +21 -4
- pyscf/pbc/eph/eph_fd.py +1 -1
- pyscf/pbc/geomopt/geometric_solver.py +1 -1
- pyscf/pbc/gto/_pbcintor.py +1 -0
- pyscf/pbc/gto/cell.py +194 -23
- pyscf/pbc/gto/ecp.py +12 -12
- pyscf/pbc/gto/eval_gto.py +3 -3
- pyscf/pbc/gto/neighborlist.py +4 -1
- 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/_response_functions.py +141 -34
- 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 -32
- pyscf/pbc/scf/kghf.py +33 -29
- pyscf/pbc/scf/khf.py +103 -29
- pyscf/pbc/scf/khf_ksymm.py +15 -1
- pyscf/pbc/scf/krohf.py +5 -7
- pyscf/pbc/scf/kuhf.py +54 -23
- pyscf/pbc/scf/kuhf_ksymm.py +1 -1
- pyscf/pbc/scf/rsjk.py +14 -10
- pyscf/pbc/scf/scfint.py +1 -1
- pyscf/pbc/scf/stability.py +27 -15
- pyscf/pbc/scf/uhf.py +3 -1
- pyscf/pbc/symm/symmetry.py +2 -2
- pyscf/pbc/tdscf/krhf.py +238 -154
- pyscf/pbc/tdscf/krks.py +1 -45
- pyscf/pbc/tdscf/kuhf.py +319 -171
- pyscf/pbc/tdscf/kuks.py +0 -56
- pyscf/pbc/tdscf/rhf.py +116 -3
- pyscf/pbc/tdscf/rks.py +2 -1
- pyscf/pbc/tdscf/uhf.py +214 -1
- pyscf/pbc/tdscf/uks.py +2 -1
- pyscf/pbc/tools/k2gamma.py +20 -6
- pyscf/pbc/tools/lattice.py +3 -3
- pyscf/pbc/tools/pbc.py +111 -91
- 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 +87 -46
- pyscf/scf/_vhf.py +15 -10
- pyscf/scf/addons.py +29 -15
- pyscf/scf/cphf.py +14 -52
- pyscf/scf/dhf.py +121 -38
- pyscf/scf/dispersion.py +10 -9
- pyscf/scf/ghf.py +25 -13
- pyscf/scf/ghf_symm.py +2 -2
- pyscf/scf/hf.py +262 -30
- pyscf/scf/rohf.py +37 -5
- pyscf/scf/stability.py +142 -112
- pyscf/scf/ucphf.py +21 -16
- pyscf/scf/uhf.py +104 -61
- pyscf/sgx/sgx.py +1 -1
- pyscf/sgx/sgx_jk.py +4 -4
- pyscf/solvent/__init__.py +2 -2
- pyscf/solvent/_attach_solvent.py +2 -0
- pyscf/solvent/_ddcosmo_tdscf_grad.py +1 -1
- pyscf/solvent/cosmors.py +366 -0
- pyscf/solvent/ddcosmo.py +1 -1
- pyscf/solvent/pcm.py +4 -4
- pyscf/solvent/pol_embed.py +1 -1
- pyscf/solvent/smd.py +5 -3
- pyscf/soscf/ciah.py +3 -11
- pyscf/soscf/newton_ah.py +5 -2
- pyscf/symm/__init__.py +1 -1
- pyscf/symm/addons.py +5 -5
- pyscf/symm/geom.py +1 -5
- pyscf/tdscf/_lr_eig.py +1002 -0
- pyscf/tdscf/dhf.py +84 -87
- pyscf/tdscf/dks.py +0 -4
- pyscf/tdscf/ghf.py +139 -127
- pyscf/tdscf/gks.py +27 -25
- pyscf/tdscf/rhf.py +194 -147
- pyscf/tdscf/rks.py +26 -22
- pyscf/tdscf/uhf.py +166 -118
- pyscf/tdscf/uks.py +32 -31
- pyscf/tools/fcidump.py +3 -0
- pyscf/tools/qcschema.py +265 -0
- pyscf/x2c/sfx2c1e.py +1 -1
- pyscf/x2c/tdscf.py +41 -41
- pyscf/x2c/x2c.py +15 -11
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/METADATA +39 -36
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/NOTICE +14 -1
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/RECORD +348 -316
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/WHEEL +1 -1
- pyscf/dft/gen_libxc_param.py +0 -35
- pyscf/dft/gen_xcfun_param.py +0 -209
- pyscf/pbc/tdscf/kproxy.py +0 -189
- pyscf/pbc/tdscf/kproxy_supercell.py +0 -664
- pyscf/pbc/tdscf/krhf_slow.py +0 -300
- pyscf/pbc/tdscf/krhf_slow_gamma.py +0 -175
- pyscf/pbc/tdscf/krhf_slow_supercell.py +0 -250
- pyscf/pbc/tdscf/proxy.py +0 -39
- pyscf/pbc/tdscf/rhf_slow.py +0 -35
- pyscf/tdscf/common_slow.py +0 -799
- pyscf/tdscf/proxy.py +0 -258
- pyscf/tdscf/rhf_slow.py +0 -181
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/LICENSE +0 -0
- {pyscf-2.6.2.dist-info → pyscf-2.8.0.dist-info}/top_level.txt +0 -0
pyscf/gto/eval_gto.py
CHANGED
|
@@ -121,7 +121,7 @@ def eval_gto(mol, eval_name, coords, comp=None, shls_slice=None, non0tab=None,
|
|
|
121
121
|
if shls_slice is None:
|
|
122
122
|
shls_slice = (0, nbas)
|
|
123
123
|
sh0, sh1 = shls_slice
|
|
124
|
-
nao = ao_loc[sh1] - ao_loc[sh0]
|
|
124
|
+
nao = int(ao_loc[sh1] - ao_loc[sh0])
|
|
125
125
|
if 'spinor' in eval_name:
|
|
126
126
|
ao = numpy.ndarray((2,comp,nao,ngrids), dtype=numpy.complex128,
|
|
127
127
|
buffer=out).transpose(0,1,3,2)
|
pyscf/gto/ft_ao.py
CHANGED
|
@@ -72,13 +72,13 @@ def ft_aopair(mol, Gv, shls_slice=None, aosym='s1', b=numpy.eye(3),
|
|
|
72
72
|
fill = 'fill_s1hermi'
|
|
73
73
|
else:
|
|
74
74
|
fill = 'fill_s1'
|
|
75
|
-
ni = ao_loc[shls_slice[1]] - ao_loc[shls_slice[0]]
|
|
76
|
-
nj = ao_loc[shls_slice[3]] - ao_loc[shls_slice[2]]
|
|
75
|
+
ni = int(ao_loc[shls_slice[1]] - ao_loc[shls_slice[0]])
|
|
76
|
+
nj = int(ao_loc[shls_slice[3]] - ao_loc[shls_slice[2]])
|
|
77
77
|
shape = (nj, ni, nGv)
|
|
78
78
|
else:
|
|
79
79
|
fill = 'fill_s2'
|
|
80
|
-
i0 = ao_loc[shls_slice[0]]
|
|
81
|
-
i1 = ao_loc[shls_slice[1]]
|
|
80
|
+
i0 = int(ao_loc[shls_slice[0]])
|
|
81
|
+
i1 = int(ao_loc[shls_slice[1]])
|
|
82
82
|
nij = i1*(i1+1)//2 - i0*(i0+1)//2
|
|
83
83
|
shape = (nij, nGv)
|
|
84
84
|
if comp != 1:
|
|
@@ -179,9 +179,9 @@ def ft_ao(mol, Gv, shls_slice=None, b=numpy.eye(3),
|
|
|
179
179
|
atm, bas, env = gto.conc_env(mol._atm, mol._bas, mol._env,
|
|
180
180
|
ghost_atm, ghost_bas, ghost_env)
|
|
181
181
|
ao_loc = mol.ao_loc_nr()
|
|
182
|
-
nao = ao_loc[mol.nbas]
|
|
182
|
+
nao = int(ao_loc[mol.nbas])
|
|
183
183
|
ao_loc = numpy.asarray(numpy.hstack((ao_loc, [nao+1])), dtype=numpy.int32)
|
|
184
|
-
ni = ao_loc[shls_slice[1]] - ao_loc[shls_slice[0]]
|
|
184
|
+
ni = int(ao_loc[shls_slice[1]] - ao_loc[shls_slice[0]])
|
|
185
185
|
shape = (ni, nGv)
|
|
186
186
|
mat = numpy.zeros(shape, order='C', dtype=numpy.complex128)
|
|
187
187
|
phase = 0
|
pyscf/gto/mole.py
CHANGED
|
@@ -97,6 +97,7 @@ BASE = getattr(__config__, 'BASE', 0)
|
|
|
97
97
|
NORMALIZE_GTO = getattr(__config__, 'NORMALIZE_GTO', True)
|
|
98
98
|
DISABLE_EVAL = getattr(__config__, 'DISABLE_EVAL', False)
|
|
99
99
|
ARGPARSE = getattr(__config__, 'ARGPARSE', False)
|
|
100
|
+
DUMPINPUT = getattr(__config__, 'DUMPINPUT', True)
|
|
100
101
|
|
|
101
102
|
def M(*args, **kwargs):
|
|
102
103
|
r'''This is a shortcut to build up Mole object.
|
|
@@ -319,7 +320,7 @@ def format_atom(atoms, origin=0, axes=None,
|
|
|
319
320
|
coordinates to AU, rotate and shift the molecule.
|
|
320
321
|
If the :attr:`~Mole.atom` is a string, it takes ";" and "\\n"
|
|
321
322
|
for the mark to separate atoms; "," and arbitrary length of blank space
|
|
322
|
-
to
|
|
323
|
+
to separate the individual terms for an atom. Blank line will be ignored.
|
|
323
324
|
|
|
324
325
|
Args:
|
|
325
326
|
atoms : list or str
|
|
@@ -459,7 +460,7 @@ def format_basis(basis_tab, sort_basis=True):
|
|
|
459
460
|
if len(_basis) == 0:
|
|
460
461
|
raise BasisNotFoundError('Basis not found for %s' % symb)
|
|
461
462
|
|
|
462
|
-
# Sort basis
|
|
463
|
+
# Sort basis according to angular momentum. This is important for method
|
|
463
464
|
# decontract_basis, which assumes that basis functions with the same
|
|
464
465
|
# angular momentum are grouped together. Related to issue #1620 #1770
|
|
465
466
|
if sort_basis:
|
|
@@ -497,7 +498,7 @@ def _generate_basis_converter():
|
|
|
497
498
|
_basis = load(raw_basis, _std_symbol_without_ghost(symb))
|
|
498
499
|
elif (any(isinstance(x, str) for x in raw_basis)
|
|
499
500
|
# The first element is the basis of internal format
|
|
500
|
-
or not isinstance(raw_basis[0][0], int)):
|
|
501
|
+
or not isinstance(raw_basis[0][0], (numpy.integer, int))):
|
|
501
502
|
stdsymb = _std_symbol_without_ghost(symb)
|
|
502
503
|
_basis = []
|
|
503
504
|
for rawb in raw_basis:
|
|
@@ -572,7 +573,7 @@ def to_uncontracted_cartesian_basis(mol):
|
|
|
572
573
|
'''
|
|
573
574
|
return decontract_basis(mol, to_cart=True)
|
|
574
575
|
|
|
575
|
-
def decontract_basis(mol, atoms=None, to_cart=False):
|
|
576
|
+
def decontract_basis(mol, atoms=None, to_cart=False, aggregate=False):
|
|
576
577
|
'''Decontract the basis of a Mole or a Cell. Returns a Mole (Cell) object
|
|
577
578
|
with the uncontracted basis environment and a list of coefficients that
|
|
578
579
|
transform the uncontracted basis to the original basis. Each element in
|
|
@@ -584,6 +585,9 @@ def decontract_basis(mol, atoms=None, to_cart=False):
|
|
|
584
585
|
are decontracted
|
|
585
586
|
to_cart: bool
|
|
586
587
|
Decontract basis and transfer to Cartesian basis
|
|
588
|
+
aggregate: bool
|
|
589
|
+
Whether to aggregate the transformation coefficients into a giant
|
|
590
|
+
transformation matrix
|
|
587
591
|
|
|
588
592
|
Examples:
|
|
589
593
|
|
|
@@ -602,17 +606,27 @@ def decontract_basis(mol, atoms=None, to_cart=False):
|
|
|
602
606
|
bas_exps = mol.bas_exps()
|
|
603
607
|
def _to_full_contraction(mol, bas_idx):
|
|
604
608
|
es = numpy.hstack([bas_exps[i] for i in bas_idx])
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
609
|
+
_, e_idx, rev_idx = numpy.unique(es.round(9), True, True)
|
|
610
|
+
if aggregate:
|
|
611
|
+
cs = scipy.linalg.block_diag(
|
|
612
|
+
*[mol._libcint_ctr_coeff(i) for i in bas_idx])
|
|
613
|
+
if len(es) != len(e_idx):
|
|
614
|
+
cs_new = numpy.zeros((e_idx.size, cs.shape[1]))
|
|
615
|
+
for i, j in enumerate(rev_idx):
|
|
616
|
+
cs_new[j] += cs[i]
|
|
617
|
+
es = es[e_idx][::-1]
|
|
618
|
+
cs = cs_new[::-1]
|
|
619
|
+
yield es, cs
|
|
620
|
+
else:
|
|
621
|
+
if len(es) != len(e_idx):
|
|
622
|
+
raise RuntimeError('Duplicated pGTOs across shells')
|
|
623
|
+
for i in bas_idx:
|
|
624
|
+
yield bas_exps[i], mol._libcint_ctr_coeff(i)
|
|
612
625
|
|
|
613
626
|
_bas = []
|
|
614
|
-
|
|
627
|
+
env = [mol._env.copy()]
|
|
615
628
|
contr_coeff = []
|
|
629
|
+
pexp = env[0].size
|
|
616
630
|
|
|
617
631
|
lmax = mol._bas[:,ANG_OF].max()
|
|
618
632
|
if mol.cart:
|
|
@@ -648,7 +662,7 @@ def decontract_basis(mol, atoms=None, to_cart=False):
|
|
|
648
662
|
continue
|
|
649
663
|
|
|
650
664
|
lmax = mol._bas[ib0:ib1,ANG_OF].max()
|
|
651
|
-
|
|
665
|
+
|
|
652
666
|
for l in range(lmax+1):
|
|
653
667
|
bas_idx = ib0 + numpy.where(mol._bas[ib0:ib1,ANG_OF] == l)[0]
|
|
654
668
|
if len(bas_idx) == 0:
|
|
@@ -656,30 +670,27 @@ def decontract_basis(mol, atoms=None, to_cart=False):
|
|
|
656
670
|
if bas_idx[0] + len(bas_idx) != bas_idx[-1] + 1:
|
|
657
671
|
raise NotImplementedError('Discontinuous bases of same angular momentum')
|
|
658
672
|
|
|
659
|
-
mol_exps, b_coeff
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
norm = gto_norm(l, mol_exps)
|
|
666
|
-
if atoms is None:
|
|
673
|
+
for mol_exps, b_coeff in _to_full_contraction(mol, bas_idx):
|
|
674
|
+
nprim, nc = b_coeff.shape
|
|
675
|
+
bs = numpy.zeros((nprim, BAS_SLOTS), dtype=numpy.int32)
|
|
676
|
+
bs[:,ATOM_OF] = ia
|
|
677
|
+
bs[:,ANG_OF ] = l
|
|
678
|
+
bs[:,NCTR_OF] = bs[:,NPRIM_OF] = 1
|
|
667
679
|
bs[:,PTR_EXP] = pexp + numpy.arange(nprim)
|
|
668
680
|
bs[:,PTR_COEFF] = pexp + numpy.arange(nprim, nprim*2)
|
|
669
|
-
|
|
670
|
-
|
|
681
|
+
norm = gto_norm(l, mol_exps)
|
|
682
|
+
env.append(mol_exps)
|
|
683
|
+
env.append(norm)
|
|
671
684
|
pexp += nprim * 2
|
|
672
|
-
|
|
673
|
-
bs[:,PTR_EXP] = _env.size + numpy.arange(nprim)
|
|
674
|
-
bs[:,PTR_COEFF] = _env.size + numpy.arange(nprim, nprim*2)
|
|
675
|
-
_env = np.hstack([_env, mol_exps, norm])
|
|
676
|
-
_bas.append(bs)
|
|
685
|
+
_bas.append(bs)
|
|
677
686
|
|
|
678
|
-
|
|
679
|
-
|
|
687
|
+
c = numpy.einsum('pi,p,xm->pxim', b_coeff, 1./norm, c2s[l])
|
|
688
|
+
contr_coeff.append(c.reshape(nprim * c2s[l].shape[0], -1))
|
|
680
689
|
|
|
681
690
|
pmol._bas = numpy.asarray(numpy.vstack(_bas), dtype=numpy.int32)
|
|
682
|
-
pmol._env =
|
|
691
|
+
pmol._env = numpy.hstack(env)
|
|
692
|
+
if aggregate:
|
|
693
|
+
contr_coeff = scipy.linalg.block_diag(*contr_coeff)
|
|
683
694
|
return pmol, contr_coeff
|
|
684
695
|
|
|
685
696
|
def format_ecp(ecp_tab):
|
|
@@ -1244,19 +1255,15 @@ def unpack(moldic):
|
|
|
1244
1255
|
def dumps(mol):
|
|
1245
1256
|
'''Serialize Mole object to a JSON formatted str.
|
|
1246
1257
|
'''
|
|
1247
|
-
exclude_keys = {'output', 'stdout', '_keys',
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
# FIXME: nparray and kpts for cell objects may need to be excluded
|
|
1251
|
-
nparray_keys = {'_atm', '_bas', '_env', '_ecpbas',
|
|
1252
|
-
'_symm_orig', '_symm_axes'}
|
|
1253
|
-
|
|
1258
|
+
exclude_keys = {'output', 'stdout', '_keys', '_ctx_lock',
|
|
1259
|
+
# Constructing in function loads
|
|
1260
|
+
'symm_orb', 'irrep_id', 'irrep_name'}
|
|
1254
1261
|
moldic = dict(mol.__dict__)
|
|
1255
1262
|
for k in exclude_keys:
|
|
1256
1263
|
if k in moldic:
|
|
1257
1264
|
del (moldic[k])
|
|
1258
|
-
for k in
|
|
1259
|
-
if isinstance(moldic[k], numpy.ndarray):
|
|
1265
|
+
for k in moldic:
|
|
1266
|
+
if isinstance(moldic[k], (numpy.ndarray, numpy.generic)):
|
|
1260
1267
|
moldic[k] = moldic[k].tolist()
|
|
1261
1268
|
moldic['atom'] = repr(mol.atom)
|
|
1262
1269
|
moldic['basis']= repr(mol.basis)
|
|
@@ -1278,6 +1285,8 @@ def dumps(mol):
|
|
|
1278
1285
|
dic1[k] = list(v)
|
|
1279
1286
|
elif isinstance(v, dict):
|
|
1280
1287
|
dic1[k] = skip_value(v)
|
|
1288
|
+
elif isinstance(v, np.generic):
|
|
1289
|
+
dic1[k] = v.tolist()
|
|
1281
1290
|
else:
|
|
1282
1291
|
msg =('Function mol.dumps drops attribute %s because '
|
|
1283
1292
|
'it is not JSON-serializable' % k)
|
|
@@ -1367,9 +1376,9 @@ def npgto_nr(mol, cart=None):
|
|
|
1367
1376
|
cart = mol.cart
|
|
1368
1377
|
l = mol._bas[:,ANG_OF]
|
|
1369
1378
|
if cart:
|
|
1370
|
-
return ((l+1)*(l+2)//2 * mol._bas[:,NPRIM_OF]).sum()
|
|
1379
|
+
return int(((l+1)*(l+2)//2 * mol._bas[:,NPRIM_OF]).sum())
|
|
1371
1380
|
else:
|
|
1372
|
-
return ((l*2+1) * mol._bas[:,NPRIM_OF]).sum()
|
|
1381
|
+
return int(((l*2+1) * mol._bas[:,NPRIM_OF]).sum())
|
|
1373
1382
|
def nao_nr(mol, cart=None):
|
|
1374
1383
|
'''Total number of contracted GTOs for the given :class:`Mole` object'''
|
|
1375
1384
|
if cart is None:
|
|
@@ -1377,11 +1386,11 @@ def nao_nr(mol, cart=None):
|
|
|
1377
1386
|
if cart:
|
|
1378
1387
|
return nao_cart(mol)
|
|
1379
1388
|
else:
|
|
1380
|
-
return ((mol._bas[:,ANG_OF]*2+1) * mol._bas[:,NCTR_OF]).sum()
|
|
1389
|
+
return int(((mol._bas[:,ANG_OF]*2+1) * mol._bas[:,NCTR_OF]).sum())
|
|
1381
1390
|
def nao_cart(mol):
|
|
1382
1391
|
'''Total number of contracted cartesian GTOs for the given :class:`Mole` object'''
|
|
1383
1392
|
l = mol._bas[:,ANG_OF]
|
|
1384
|
-
return ((l+1)*(l+2)//2 * mol._bas[:,NCTR_OF]).sum()
|
|
1393
|
+
return int(((l+1)*(l+2)//2 * mol._bas[:,NCTR_OF]).sum())
|
|
1385
1394
|
|
|
1386
1395
|
# nao_id0:nao_id1 corresponding to bas_id0:bas_id1
|
|
1387
1396
|
def nao_nr_range(mol, bas_id0, bas_id1):
|
|
@@ -1406,8 +1415,8 @@ def nao_nr_range(mol, bas_id0, bas_id1):
|
|
|
1406
1415
|
(2, 6)
|
|
1407
1416
|
'''
|
|
1408
1417
|
ao_loc = moleintor.make_loc(mol._bas[:bas_id1], 'sph')
|
|
1409
|
-
nao_id0 = ao_loc[bas_id0]
|
|
1410
|
-
nao_id1 = ao_loc[-1]
|
|
1418
|
+
nao_id0 = int(ao_loc[bas_id0])
|
|
1419
|
+
nao_id1 = int(ao_loc[-1])
|
|
1411
1420
|
return nao_id0, nao_id1
|
|
1412
1421
|
|
|
1413
1422
|
def nao_2c(mol):
|
|
@@ -1417,7 +1426,7 @@ def nao_2c(mol):
|
|
|
1417
1426
|
dims = (l*4+2) * mol._bas[:,NCTR_OF]
|
|
1418
1427
|
dims[kappa<0] = (l[kappa<0] * 2 + 2) * mol._bas[kappa<0,NCTR_OF]
|
|
1419
1428
|
dims[kappa>0] = (l[kappa>0] * 2) * mol._bas[kappa>0,NCTR_OF]
|
|
1420
|
-
return dims.sum()
|
|
1429
|
+
return int(dims.sum())
|
|
1421
1430
|
|
|
1422
1431
|
# nao_id0:nao_id1 corresponding to bas_id0:bas_id1
|
|
1423
1432
|
def nao_2c_range(mol, bas_id0, bas_id1):
|
|
@@ -1442,8 +1451,8 @@ def nao_2c_range(mol, bas_id0, bas_id1):
|
|
|
1442
1451
|
(4, 12)
|
|
1443
1452
|
'''
|
|
1444
1453
|
ao_loc = moleintor.make_loc(mol._bas[:bas_id1], '')
|
|
1445
|
-
nao_id0 = ao_loc[bas_id0]
|
|
1446
|
-
nao_id1 = ao_loc[-1]
|
|
1454
|
+
nao_id0 = int(ao_loc[bas_id0])
|
|
1455
|
+
nao_id1 = int(ao_loc[-1])
|
|
1447
1456
|
return nao_id0, nao_id1
|
|
1448
1457
|
|
|
1449
1458
|
def ao_loc_nr(mol, cart=None):
|
|
@@ -1961,7 +1970,7 @@ def same_mol(mol1, mol2, tol=1e-5, cmp_basis=True, ignore_chiral=False):
|
|
|
1961
1970
|
is_same_mol = same_mol
|
|
1962
1971
|
|
|
1963
1972
|
def chiral_mol(mol1, mol2=None):
|
|
1964
|
-
'''Detect whether the given
|
|
1973
|
+
'''Detect whether the given molecule is chiral molecule or two molecules
|
|
1965
1974
|
are chiral isomers.
|
|
1966
1975
|
'''
|
|
1967
1976
|
if mol2 is None:
|
|
@@ -2091,7 +2100,7 @@ def tostring(mol, format='raw'):
|
|
|
2091
2100
|
output.append('%-4s %s' % (symb, line))
|
|
2092
2101
|
return '\n'.join(output)
|
|
2093
2102
|
else:
|
|
2094
|
-
raise NotImplementedError
|
|
2103
|
+
raise NotImplementedError(f'format={format}')
|
|
2095
2104
|
|
|
2096
2105
|
def tofile(mol, filename, format=None):
|
|
2097
2106
|
'''Write molecular geometry to a file of the required format.
|
|
@@ -2197,7 +2206,7 @@ class MoleBase(lib.StreamObject):
|
|
|
2197
2206
|
subgroup
|
|
2198
2207
|
|
|
2199
2208
|
atom : list or str
|
|
2200
|
-
To define
|
|
2209
|
+
To define molecular structure. The internal format is
|
|
2201
2210
|
|
|
2202
2211
|
| atom = [[atom1, (x, y, z)],
|
|
2203
2212
|
| [atom2, (x, y, z)],
|
|
@@ -2333,7 +2342,6 @@ class MoleBase(lib.StreamObject):
|
|
|
2333
2342
|
self._env = numpy.zeros(PTR_ENV_START)
|
|
2334
2343
|
self._ecpbas = numpy.zeros((0,8), dtype=numpy.int32)
|
|
2335
2344
|
|
|
2336
|
-
self.stdout = sys.stdout
|
|
2337
2345
|
self.groupname = 'C1'
|
|
2338
2346
|
self.topgroup = 'C1'
|
|
2339
2347
|
self.symm_orb = None
|
|
@@ -2452,12 +2460,12 @@ class MoleBase(lib.StreamObject):
|
|
|
2452
2460
|
__getstate__ = dumps
|
|
2453
2461
|
__setstate__ = loads_
|
|
2454
2462
|
|
|
2455
|
-
def build(self, dump_input=
|
|
2463
|
+
def build(self, dump_input=DUMPINPUT, parse_arg=ARGPARSE,
|
|
2456
2464
|
verbose=None, output=None, max_memory=None,
|
|
2457
2465
|
atom=None, basis=None, unit=None, nucmod=None, ecp=None, pseudo=None,
|
|
2458
2466
|
charge=None, spin=0, symmetry=None, symmetry_subgroup=None,
|
|
2459
2467
|
cart=None, magmom=None):
|
|
2460
|
-
'''Setup
|
|
2468
|
+
'''Setup molecule and initialize some control parameters. Whenever you
|
|
2461
2469
|
change the value of the attributes of :class:`Mole`, you need call
|
|
2462
2470
|
this function to refresh the internal data of Mole.
|
|
2463
2471
|
|
|
@@ -2473,7 +2481,7 @@ class MoleBase(lib.StreamObject):
|
|
|
2473
2481
|
max_memory : int, float
|
|
2474
2482
|
Allowd memory in MB. If given, overwrite :attr:`Mole.max_memory`
|
|
2475
2483
|
atom : list or str
|
|
2476
|
-
To define
|
|
2484
|
+
To define molecular structure.
|
|
2477
2485
|
basis : dict or str
|
|
2478
2486
|
To define basis set.
|
|
2479
2487
|
nucmod : dict or str
|
|
@@ -2750,7 +2758,7 @@ class MoleBase(lib.StreamObject):
|
|
|
2750
2758
|
' X Y Z unit Magmom\n')
|
|
2751
2759
|
for ia,atom in enumerate(self._atom):
|
|
2752
2760
|
coorda = tuple([x * param.BOHR for x in atom[1]])
|
|
2753
|
-
coordb = tuple(
|
|
2761
|
+
coordb = tuple(atom[1])
|
|
2754
2762
|
magmom = self.magmom[ia]
|
|
2755
2763
|
self.stdout.write('[INPUT]%3d %-4s %16.12f %16.12f %16.12f AA '
|
|
2756
2764
|
'%16.12f %16.12f %16.12f Bohr %4.1f\n'
|
|
@@ -3059,18 +3067,17 @@ class MoleBase(lib.StreamObject):
|
|
|
3059
3067
|
mol._env[ptr+0] = unit * atoms_or_coords[:,0]
|
|
3060
3068
|
mol._env[ptr+1] = unit * atoms_or_coords[:,1]
|
|
3061
3069
|
mol._env[ptr+2] = unit * atoms_or_coords[:,2]
|
|
3070
|
+
# reset nuclear energy
|
|
3071
|
+
mol.enuc = None
|
|
3062
3072
|
else:
|
|
3063
3073
|
mol.symmetry = symmetry
|
|
3064
3074
|
mol.build(False, False)
|
|
3065
3075
|
|
|
3066
|
-
# reset nuclear energy
|
|
3067
|
-
mol.enuc = None
|
|
3068
|
-
|
|
3069
3076
|
if mol.verbose >= logger.INFO:
|
|
3070
3077
|
logger.info(mol, 'New geometry')
|
|
3071
3078
|
for ia, atom in enumerate(mol._atom):
|
|
3072
3079
|
coorda = tuple([x * param.BOHR for x in atom[1]])
|
|
3073
|
-
coordb = tuple(
|
|
3080
|
+
coordb = tuple(atom[1])
|
|
3074
3081
|
coords = coorda + coordb
|
|
3075
3082
|
logger.info(mol, ' %3d %-4s %16.12f %16.12f %16.12f AA '
|
|
3076
3083
|
'%16.12f %16.12f %16.12f Bohr\n',
|
|
@@ -3147,7 +3154,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3147
3154
|
'''
|
|
3148
3155
|
if self._atm[atm_id,NUC_MOD_OF] != NUC_FRAC_CHARGE:
|
|
3149
3156
|
# regular QM atoms
|
|
3150
|
-
return self._atm[atm_id,CHARGE_OF]
|
|
3157
|
+
return int(self._atm[atm_id,CHARGE_OF])
|
|
3151
3158
|
else:
|
|
3152
3159
|
# MM atoms with fractional charges
|
|
3153
3160
|
return self._env[self._atm[atm_id,PTR_FRAC_CHARGE]]
|
|
@@ -3211,7 +3218,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3211
3218
|
>>> mol.atom_nshells(1)
|
|
3212
3219
|
5
|
|
3213
3220
|
'''
|
|
3214
|
-
return (self._bas[:,ATOM_OF] == atm_id).sum()
|
|
3221
|
+
return int((self._bas[:,ATOM_OF] == atm_id).sum())
|
|
3215
3222
|
|
|
3216
3223
|
def atom_shell_ids(self, atm_id):
|
|
3217
3224
|
r'''A list of the shell-ids of the given atom
|
|
@@ -3258,7 +3265,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3258
3265
|
>>> mol.bas_atom(7)
|
|
3259
3266
|
1
|
|
3260
3267
|
'''
|
|
3261
|
-
return self._bas[bas_id,ATOM_OF]
|
|
3268
|
+
return int(self._bas[bas_id,ATOM_OF])
|
|
3262
3269
|
|
|
3263
3270
|
def bas_angular(self, bas_id):
|
|
3264
3271
|
r'''The angular momentum associated with the given basis
|
|
@@ -3273,7 +3280,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3273
3280
|
>>> mol.bas_atom(7)
|
|
3274
3281
|
2
|
|
3275
3282
|
'''
|
|
3276
|
-
return self._bas[bas_id,ANG_OF]
|
|
3283
|
+
return int(self._bas[bas_id,ANG_OF])
|
|
3277
3284
|
|
|
3278
3285
|
def bas_nctr(self, bas_id):
|
|
3279
3286
|
r'''The number of contracted GTOs for the given shell
|
|
@@ -3288,7 +3295,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3288
3295
|
>>> mol.bas_atom(3)
|
|
3289
3296
|
3
|
|
3290
3297
|
'''
|
|
3291
|
-
return self._bas[bas_id,NCTR_OF]
|
|
3298
|
+
return int(self._bas[bas_id,NCTR_OF])
|
|
3292
3299
|
|
|
3293
3300
|
def bas_nprim(self, bas_id):
|
|
3294
3301
|
r'''The number of primitive GTOs for the given shell
|
|
@@ -3303,7 +3310,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3303
3310
|
>>> mol.bas_atom(3)
|
|
3304
3311
|
11
|
|
3305
3312
|
'''
|
|
3306
|
-
return self._bas[bas_id,NPRIM_OF]
|
|
3313
|
+
return int(self._bas[bas_id,NPRIM_OF])
|
|
3307
3314
|
|
|
3308
3315
|
def bas_kappa(self, bas_id):
|
|
3309
3316
|
r'''Kappa (if l < j, -l-1, else l) of the given shell
|
|
@@ -3318,7 +3325,7 @@ class MoleBase(lib.StreamObject):
|
|
|
3318
3325
|
>>> mol.bas_kappa(3)
|
|
3319
3326
|
0
|
|
3320
3327
|
'''
|
|
3321
|
-
return self._bas[bas_id,KAPPA_OF]
|
|
3328
|
+
return int(self._bas[bas_id,KAPPA_OF])
|
|
3322
3329
|
|
|
3323
3330
|
def bas_exp(self, bas_id):
|
|
3324
3331
|
r'''exponents (ndarray) of the given shell
|
|
@@ -3431,6 +3438,11 @@ class MoleBase(lib.StreamObject):
|
|
|
3431
3438
|
| 1 : hermitian
|
|
3432
3439
|
| 2 : anti-hermitian
|
|
3433
3440
|
|
|
3441
|
+
shls_slice : 4-element, 6-element or 8-element tuple
|
|
3442
|
+
Label the start-stop shells for each index in the integral.
|
|
3443
|
+
For example, the 8-element tuple for the 2-electron integral
|
|
3444
|
+
tensor (ij|kl) = intor('int2e') are specified as
|
|
3445
|
+
(ish_start, ish_end, jsh_start, jsh_end, ksh_start, ksh_end, lsh_start, lsh_end)
|
|
3434
3446
|
grids : ndarray
|
|
3435
3447
|
Coordinates of grids for the int1e_grids integrals
|
|
3436
3448
|
|
|
@@ -3748,7 +3760,7 @@ class Mole(MoleBase):
|
|
|
3748
3760
|
def ao2mo(self, mo_coeffs, erifile=None, dataname='eri_mo', intor='int2e',
|
|
3749
3761
|
**kwargs):
|
|
3750
3762
|
'''Integral transformation for arbitrary orbitals and arbitrary
|
|
3751
|
-
integrals. See more
|
|
3763
|
+
integrals. See more detailed documentation in func:`ao2mo.kernel`.
|
|
3752
3764
|
|
|
3753
3765
|
Args:
|
|
3754
3766
|
mo_coeffs (an np array or a list of arrays) : A matrix of orbital
|
|
@@ -3800,7 +3812,7 @@ class Mole(MoleBase):
|
|
|
3800
3812
|
return ao2mo.kernel(self, mo_coeffs, erifile, dataname, intor, **kwargs)
|
|
3801
3813
|
|
|
3802
3814
|
def to_cell(self, a, dimension=3):
|
|
3803
|
-
'''Put a molecule in a cell with periodic boundary
|
|
3815
|
+
'''Put a molecule in a cell with periodic boundary conditions
|
|
3804
3816
|
|
|
3805
3817
|
Args:
|
|
3806
3818
|
a : (3,3) ndarray
|
|
@@ -4054,7 +4066,7 @@ def fakemol_for_charges(coords, expnt=1e16):
|
|
|
4054
4066
|
# approximate point charge with gaussian distribution exp(-1e16*r^2)
|
|
4055
4067
|
fakebas[:,PTR_EXP] = ptr
|
|
4056
4068
|
fakebas[:,PTR_COEFF] = ptr+1
|
|
4057
|
-
fakeenv.append([expnt, 1/(2*numpy.sqrt(numpy.pi)*gaussian_int(2,expnt))])
|
|
4069
|
+
fakeenv.append([expnt, 1 / (2*numpy.sqrt(numpy.pi)*gaussian_int(2,expnt))])
|
|
4058
4070
|
ptr += 2
|
|
4059
4071
|
else:
|
|
4060
4072
|
assert expnt.size == nbas
|
|
@@ -4071,6 +4083,46 @@ def fakemol_for_charges(coords, expnt=1e16):
|
|
|
4071
4083
|
fakemol._built = True
|
|
4072
4084
|
return fakemol
|
|
4073
4085
|
|
|
4086
|
+
def fakemol_for_cgtf_charge(coord, expnt=1e16, contr_coeff=1):
|
|
4087
|
+
'''Constructs a "fake" Mole object that has a Gaussian charge
|
|
4088
|
+
distribution at the specified coordinate (coord). The charge
|
|
4089
|
+
can be given as a linear combination of Gaussians with
|
|
4090
|
+
exponents expnt and contraction coefficients contr_coeff.
|
|
4091
|
+
'''
|
|
4092
|
+
assert coord.shape[0] == 1
|
|
4093
|
+
expnt = numpy.asarray(expnt).ravel()
|
|
4094
|
+
contr_coeff = numpy.asarray(contr_coeff).ravel()
|
|
4095
|
+
|
|
4096
|
+
fakeatm = numpy.zeros((1,ATM_SLOTS), dtype=numpy.int32)
|
|
4097
|
+
fakebas = numpy.zeros((1,BAS_SLOTS), dtype=numpy.int32)
|
|
4098
|
+
fakeenv = [0] * PTR_ENV_START
|
|
4099
|
+
ptr = PTR_ENV_START
|
|
4100
|
+
fakeatm[:,PTR_COORD] = numpy.arange(ptr, ptr+3, 3)
|
|
4101
|
+
fakeenv.append(coord.ravel())
|
|
4102
|
+
ptr += 3
|
|
4103
|
+
fakebas[:,ATOM_OF] = 0#numpy.arange(nbas)
|
|
4104
|
+
fakebas[:,NPRIM_OF] = contr_coeff.size
|
|
4105
|
+
fakebas[:,NCTR_OF] = 1
|
|
4106
|
+
if expnt.size == 1:
|
|
4107
|
+
expnt = expnt[0]
|
|
4108
|
+
fakebas[:,PTR_EXP] = ptr
|
|
4109
|
+
fakebas[:,PTR_COEFF] = ptr+1
|
|
4110
|
+
fakeenv.append([expnt, 1 / (2*numpy.sqrt(numpy.pi)*gaussian_int(2,expnt))])
|
|
4111
|
+
ptr += 2
|
|
4112
|
+
else:
|
|
4113
|
+
assert expnt.size == contr_coeff.size
|
|
4114
|
+
fakebas[:,PTR_EXP] = ptr
|
|
4115
|
+
fakebas[:,PTR_COEFF] = ptr + contr_coeff.size
|
|
4116
|
+
coeff = contr_coeff / (2 * numpy.sqrt(numpy.pi) * gaussian_int(2, expnt))
|
|
4117
|
+
fakeenv.append(numpy.vstack((expnt, coeff)).ravel())
|
|
4118
|
+
|
|
4119
|
+
fakemol = Mole()
|
|
4120
|
+
fakemol._atm = fakeatm
|
|
4121
|
+
fakemol._bas = fakebas
|
|
4122
|
+
fakemol._env = numpy.hstack(fakeenv)
|
|
4123
|
+
fakemol._built = True
|
|
4124
|
+
return fakemol
|
|
4125
|
+
|
|
4074
4126
|
def classify_ecp_pseudo(mol, ecp, pp):
|
|
4075
4127
|
'''
|
|
4076
4128
|
Check whether ecp keywords are presented in pp and whether pp keywords are
|
pyscf/gto/moleintor.py
CHANGED
|
@@ -594,7 +594,7 @@ def getints4c(intor_name, atm, bas, env, shls_slice=None, comp=1,
|
|
|
594
594
|
if aosym == 's8':
|
|
595
595
|
assert (shls_slice is None)
|
|
596
596
|
from pyscf.scf import _vhf
|
|
597
|
-
nao = ao_loc[-1]
|
|
597
|
+
nao = int(ao_loc[-1])
|
|
598
598
|
nao_pair = nao*(nao+1)//2
|
|
599
599
|
out = numpy.ndarray((nao_pair*(nao_pair+1)//2), buffer=out)
|
|
600
600
|
if nao_pair == 0:
|
pyscf/gw/gw_ac.py
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
Spin-restricted G0W0 approximation with analytic continuation
|
|
21
21
|
This implementation has N^4 scaling, and is faster than GW-CD (N^4)
|
|
22
22
|
and analytic GW (N^6) methods.
|
|
23
|
-
GW-AC is recommended for valence states only, and is
|
|
23
|
+
GW-AC is recommended for valence states only, and is inaccurate for core states.
|
|
24
24
|
|
|
25
25
|
Method:
|
|
26
26
|
See T. Zhu and G.K.-L. Chan, arxiv:2007.03148 (2020) for details
|
|
@@ -230,7 +230,7 @@ def _get_scaled_legendre_roots(nw):
|
|
|
230
230
|
|
|
231
231
|
def _get_clenshaw_curtis_roots(nw):
|
|
232
232
|
"""
|
|
233
|
-
Clenshaw-Curtis
|
|
233
|
+
Clenshaw-Curtis quadrature on [0,inf)
|
|
234
234
|
Ref: J. Chem. Phys. 132, 234114 (2010)
|
|
235
235
|
Returns:
|
|
236
236
|
freqs : 1D ndarray
|
pyscf/gw/gw_cd.py
CHANGED
|
@@ -192,7 +192,7 @@ def get_rho_response_R(gw, omega, Lpq):
|
|
|
192
192
|
|
|
193
193
|
def get_sigmaR_diag(gw, omega, orbp, ef, Lpq):
|
|
194
194
|
'''
|
|
195
|
-
Compute self-energy for poles inside
|
|
195
|
+
Compute self-energy for poles inside contour
|
|
196
196
|
(more and more expensive away from Fermi surface)
|
|
197
197
|
'''
|
|
198
198
|
mo_energy = gw._scf.mo_energy
|
|
@@ -234,7 +234,7 @@ def _get_scaled_legendre_roots(nw):
|
|
|
234
234
|
|
|
235
235
|
def _get_clenshaw_curtis_roots(nw):
|
|
236
236
|
"""
|
|
237
|
-
Clenshaw-Curtis
|
|
237
|
+
Clenshaw-Curtis quadrature on [0,inf)
|
|
238
238
|
Ref: J. Chem. Phys. 132, 234114 (2010)
|
|
239
239
|
Returns:
|
|
240
240
|
freqs : 1D ndarray
|