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/pbc/tdscf/krhf_slow.py
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
# Author: Artem Pulkin
|
|
2
|
-
# flake8: noqa
|
|
3
|
-
"""
|
|
4
|
-
This and other `_slow` modules implement the time-dependent Hartree-Fock procedure. The primary performance drawback is
|
|
5
|
-
that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
|
|
6
|
-
TDHF matrices explicitly via an AO-MO transformation, i.e. with a O(N^5) complexity scaling. As a result, regular
|
|
7
|
-
`numpy.linalg.eig` can be used to retrieve TDHF roots in a reliable fashion without any issues related to the Davidson
|
|
8
|
-
procedure. Several variants of TDHF are available:
|
|
9
|
-
|
|
10
|
-
* `pyscf.tdscf.rhf_slow`: the molecular implementation;
|
|
11
|
-
* `pyscf.pbc.tdscf.rhf_slow`: PBC (periodic boundary condition) implementation for RHF objects of `pyscf.pbc.scf`
|
|
12
|
-
modules;
|
|
13
|
-
* `pyscf.pbc.tdscf.krhf_slow_supercell`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
|
|
14
|
-
an arbitrary number of k-points but has a overhead due to an effective construction of a supercell.
|
|
15
|
-
* `pyscf.pbc.tdscf.krhf_slow_gamma`: A Gamma-point calculation resembling the original `pyscf.pbc.tdscf.krhf`
|
|
16
|
-
module. Despite its name, it accepts KRHF objects with an arbitrary number of k-points but finds only few TDHF roots
|
|
17
|
-
corresponding to collective oscillations without momentum transfer;
|
|
18
|
-
* (this module) `pyscf.pbc.tdscf.krhf_slow`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
|
|
19
|
-
an arbitrary number of k-points and employs k-point conservation (diagonalizes matrix blocks separately).
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
from pyscf.pbc.tdscf import krhf_slow_supercell as td
|
|
23
|
-
from pyscf.tdscf import rhf_slow
|
|
24
|
-
from pyscf.tdscf.common_slow import mknj2i
|
|
25
|
-
|
|
26
|
-
import numpy
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# Convention for these modules:
|
|
30
|
-
# * PhysERI, PhysERI4, PhysERI8 are 2-electron integral routines computed directly (for debug purposes), with a 4-fold
|
|
31
|
-
# symmetry and with an 8-fold symmetry
|
|
32
|
-
# * vector_to_amplitudes reshapes and normalizes the solution
|
|
33
|
-
# * TDRHF provides a container
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class PhysERI(td.PhysERI):
|
|
37
|
-
primary_driver = "full"
|
|
38
|
-
|
|
39
|
-
def __init__(self, model, frozen=None):
|
|
40
|
-
"""
|
|
41
|
-
The TDHF ERI implementation performing a full transformation of integrals to Bloch functions. No symmetries are
|
|
42
|
-
employed in this class. The ERIs are returned in blocks of k-points.
|
|
43
|
-
|
|
44
|
-
Args:
|
|
45
|
-
model (KRHF): the base model;
|
|
46
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
47
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
48
|
-
"""
|
|
49
|
-
super(PhysERI, self).__init__(model, frozen=frozen)
|
|
50
|
-
|
|
51
|
-
def get_k_ix(self, item, like):
|
|
52
|
-
"""
|
|
53
|
-
Retrieves block indexes: row and column.
|
|
54
|
-
Args:
|
|
55
|
-
item (str): a string of 'mknj' letters;
|
|
56
|
-
like (tuple): a 2-tuple with sample pair of k-points;
|
|
57
|
-
|
|
58
|
-
Returns:
|
|
59
|
-
Row and column indexes of a sub-block with conserving momentum.
|
|
60
|
-
"""
|
|
61
|
-
item_i = numpy.argsort(mknj2i(item))
|
|
62
|
-
item_code = ''.join("++--"[i] for i in item_i)
|
|
63
|
-
if item_code[0] == item_code[1]:
|
|
64
|
-
kc = self.kconserv # ++-- --++
|
|
65
|
-
elif item_code[0] == item_code[2]:
|
|
66
|
-
kc = self.kconserv.swapaxes(1, 2) # +-+- -+-+
|
|
67
|
-
elif item_code[1] == item_code[2]:
|
|
68
|
-
kc = self.kconserv.transpose(2, 0, 1) # +--+ -++-
|
|
69
|
-
else:
|
|
70
|
-
raise RuntimeError("Unknown case: {}".format(item_code))
|
|
71
|
-
|
|
72
|
-
y = kc[like]
|
|
73
|
-
x = kc[0, y[0]]
|
|
74
|
-
|
|
75
|
-
return x, y
|
|
76
|
-
|
|
77
|
-
def tdhf_diag(self, block):
|
|
78
|
-
"""
|
|
79
|
-
Retrieves the merged diagonal block only with specific pairs of k-indexes (k, block[k]).
|
|
80
|
-
Args:
|
|
81
|
-
block (Iterable): a k-point pair `k2 = pair[k1]` for each k1;
|
|
82
|
-
|
|
83
|
-
Returns:
|
|
84
|
-
The diagonal block.
|
|
85
|
-
"""
|
|
86
|
-
return super(PhysERI, self).tdhf_diag(pairs=enumerate(block))
|
|
87
|
-
|
|
88
|
-
def eri_mknj(self, item, pair_row, pair_column):
|
|
89
|
-
"""
|
|
90
|
-
Retrieves the merged ERI block using 'mknj' notation with pairs of k-indexes (k1, k1, k2, k2).
|
|
91
|
-
Args:
|
|
92
|
-
item (str): a 4-character string of 'mknj' letters;
|
|
93
|
-
pair_row (Iterable): a k-point pair `k2 = pair_row[k1]` for each k1 (row indexes in the final matrix);
|
|
94
|
-
pair_column (Iterable): a k-point pair `k4 = pair_row[k3]` for each k3 (column indexes in the final matrix);
|
|
95
|
-
|
|
96
|
-
Returns:
|
|
97
|
-
The corresponding block of ERI (phys notation).
|
|
98
|
-
"""
|
|
99
|
-
return super(PhysERI, self).eri_mknj(
|
|
100
|
-
item,
|
|
101
|
-
pairs_row=enumerate(pair_row),
|
|
102
|
-
pairs_column=enumerate(pair_column),
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
def tdhf_primary_form(self, k):
|
|
106
|
-
"""
|
|
107
|
-
A primary form of TDHF matrixes (full).
|
|
108
|
-
Args:
|
|
109
|
-
k (tuple, int): momentum transfer: either a pair of k-point indexes specifying the momentum transfer
|
|
110
|
-
vector or a single integer with the second index assuming the first index being zero;
|
|
111
|
-
|
|
112
|
-
Returns:
|
|
113
|
-
Output type: "full", and the corresponding matrix.
|
|
114
|
-
"""
|
|
115
|
-
r1, r2, c1, c2 = get_block_k_ix(self, k)
|
|
116
|
-
d1 = self.tdhf_diag(r1)
|
|
117
|
-
d2 = self.tdhf_diag(r2)
|
|
118
|
-
a = d1 + 2 * self["knmj", r1, c1] - self["knjm", r1, c1]
|
|
119
|
-
b = 2 * self["kjmn", r1, c2] - self["kjnm", r1, c2]
|
|
120
|
-
a_ = d2 + 2 * self["mjkn", r2, c2] - self["mjnk", r2, c2]
|
|
121
|
-
b_ = 2 * self["mnkj", r2, c1] - self["mnjk", r2, c1]
|
|
122
|
-
return "full", numpy.block([[a, b], [-b_, -a_]])
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
class PhysERI4(PhysERI):
|
|
126
|
-
|
|
127
|
-
def __init__(self, model, frozen=None):
|
|
128
|
-
"""
|
|
129
|
-
The TDHF ERI implementation performing partial transformations of integrals to Bloch functions. A 4-fold
|
|
130
|
-
symmetry of complex-valued functions is employed in this class. The ERIs are returned in blocks of k-points.
|
|
131
|
-
|
|
132
|
-
Args:
|
|
133
|
-
model (KRHF): the base model;
|
|
134
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
135
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
136
|
-
"""
|
|
137
|
-
td.PhysERI4.__init__.im_func(self, model, frozen=frozen)
|
|
138
|
-
|
|
139
|
-
symmetries = [
|
|
140
|
-
((0, 1, 2, 3), False),
|
|
141
|
-
((1, 0, 3, 2), False),
|
|
142
|
-
((2, 3, 0, 1), True),
|
|
143
|
-
((3, 2, 1, 0), True),
|
|
144
|
-
]
|
|
145
|
-
|
|
146
|
-
def __calc_block__(self, item, k):
|
|
147
|
-
if self.kconserv[k[:3]] == k[3]:
|
|
148
|
-
return td.PhysERI4.__calc_block__.im_func(self, item, k)
|
|
149
|
-
else:
|
|
150
|
-
raise ValueError("K is not conserved: {}, expected {}".format(
|
|
151
|
-
repr(k),
|
|
152
|
-
k[:3] + (self.kconserv[k[:3]],),
|
|
153
|
-
))
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
class PhysERI8(PhysERI4):
|
|
157
|
-
def __init__(self, model, frozen=None):
|
|
158
|
-
"""
|
|
159
|
-
The TDHF ERI implementation performing partial transformations of integrals to Bloch functions. An 8-fold
|
|
160
|
-
symmetry of real-valued functions is employed in this class. The ERIs are returned in blocks of k-points.
|
|
161
|
-
|
|
162
|
-
Args:
|
|
163
|
-
model (KRHF): the base model;
|
|
164
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
165
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
166
|
-
"""
|
|
167
|
-
super(PhysERI8, self).__init__(model, frozen=frozen)
|
|
168
|
-
|
|
169
|
-
symmetries = [
|
|
170
|
-
((0, 1, 2, 3), False),
|
|
171
|
-
((1, 0, 3, 2), False),
|
|
172
|
-
((2, 3, 0, 1), False),
|
|
173
|
-
((3, 2, 1, 0), False),
|
|
174
|
-
|
|
175
|
-
((2, 1, 0, 3), False),
|
|
176
|
-
((3, 0, 1, 2), False),
|
|
177
|
-
((0, 3, 2, 1), False),
|
|
178
|
-
((1, 2, 3, 0), False),
|
|
179
|
-
]
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
def get_block_k_ix(eri, k):
|
|
183
|
-
"""
|
|
184
|
-
Retrieves k indexes of the block with a specific momentum transfer.
|
|
185
|
-
Args:
|
|
186
|
-
eri (TDDFTMatrixBlocks): ERI of the problem;
|
|
187
|
-
k (tuple, int): momentum transfer: either a pair of k-point indexes specifying the momentum transfer
|
|
188
|
-
vector or a single integer with the second index assuming the first index being zero;
|
|
189
|
-
|
|
190
|
-
Returns:
|
|
191
|
-
4 arrays: r1, r2, c1, c2 specifying k-indexes of the ERI matrix block.
|
|
192
|
-
|
|
193
|
-
+-----------------+-------------+-------------+-----+-----------------+-------------+-------------+-----+-----------------+
|
|
194
|
-
| | k34=0,c1[0] | k34=1,c1[1] | ... | k34=nk-1,c1[-1] | k34=0,c2[0] | k34=1,c2[1] | ... | k34=nk-1,c2[-1] |
|
|
195
|
-
+-----------------+-------------+-------------+-----+-----------------+-------------+-------------+-----+-----------------+
|
|
196
|
-
| k12=0,r1[0] | | |
|
|
197
|
-
+-----------------+ | |
|
|
198
|
-
| k12=1,r1[1] | | |
|
|
199
|
-
+-----------------+ Block r1, c1 | Block r1, c2 |
|
|
200
|
-
| ... | | |
|
|
201
|
-
+-----------------+ | |
|
|
202
|
-
| k12=nk-1,r1[-1] | | |
|
|
203
|
-
+-----------------+---------------------------------------------------+---------------------------------------------------+
|
|
204
|
-
| k12=0,r2[0] | | |
|
|
205
|
-
+-----------------+ | |
|
|
206
|
-
| k12=1,r2[1] | | |
|
|
207
|
-
+-----------------+ Block r2, c1 | Block r2, c2 |
|
|
208
|
-
| ... | | |
|
|
209
|
-
+-----------------+ | |
|
|
210
|
-
| k12=nk-1,r2[-1] | | |
|
|
211
|
-
+-----------------+---------------------------------------------------+---------------------------------------------------+
|
|
212
|
-
"""
|
|
213
|
-
# All checks here are for debugging purposes
|
|
214
|
-
if isinstance(k, int):
|
|
215
|
-
k = (0, k)
|
|
216
|
-
r1, c1 = eri.get_k_ix("knmj", k)
|
|
217
|
-
assert r1[k[0]] == k[1]
|
|
218
|
-
# knmj and kjmn share row indexes
|
|
219
|
-
_, c2 = eri.get_k_ix("kjmn", (0, r1[0]))
|
|
220
|
-
assert abs(r1 - _).max() == 0
|
|
221
|
-
# knmj and mnkj share column indexes
|
|
222
|
-
_, r2 = eri.get_k_ix("mnkj", (0, c1[0]))
|
|
223
|
-
assert abs(c1 - _).max() == 0
|
|
224
|
-
_r, _c = eri.get_k_ix("mjkn", (0, r2[0]))
|
|
225
|
-
assert abs(r2 - _r).max() == 0
|
|
226
|
-
assert abs(c2 - _c).max() == 0
|
|
227
|
-
_c, _r = eri.get_k_ix("mjkn", (0, c2[0]))
|
|
228
|
-
assert abs(r2 - _r).max() == 0
|
|
229
|
-
assert abs(c2 - _c).max() == 0
|
|
230
|
-
|
|
231
|
-
assert abs(r1 - c1).max() == 0
|
|
232
|
-
assert abs(r2 - c2).max() == 0
|
|
233
|
-
assert abs(r1[r2] - numpy.arange(len(r1))).max() == 0
|
|
234
|
-
# The output is, basically, r1, argsort(r1), r1, argsort(r1)
|
|
235
|
-
return r1, r2, c1, c2
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
def vector_to_amplitudes(vectors, nocc, nmo):
|
|
239
|
-
"""
|
|
240
|
-
Transforms (reshapes) and normalizes vectors into amplitudes.
|
|
241
|
-
Args:
|
|
242
|
-
vectors (numpy.ndarray): raw eigenvectors to transform;
|
|
243
|
-
nocc (tuple): numbers of occupied orbitals;
|
|
244
|
-
nmo (int): the total number of orbitals per k-point;
|
|
245
|
-
|
|
246
|
-
Returns:
|
|
247
|
-
Amplitudes with the following shape: (# of roots, 2 (x or y), # of kpts, # of occupied orbitals,
|
|
248
|
-
# of virtual orbitals).
|
|
249
|
-
"""
|
|
250
|
-
if not all(i == nocc[0] for i in nocc):
|
|
251
|
-
raise NotImplementedError("Varying occupation numbers are not implemented yet")
|
|
252
|
-
nk = len(nocc)
|
|
253
|
-
nocc = nocc[0]
|
|
254
|
-
if not all(i == nmo[0] for i in nmo):
|
|
255
|
-
raise NotImplementedError("Varying AO spaces are not implemented yet")
|
|
256
|
-
nmo = nmo[0]
|
|
257
|
-
vectors = numpy.asanyarray(vectors)
|
|
258
|
-
vectors = vectors.reshape(2, nk, nocc, nmo-nocc, vectors.shape[1])
|
|
259
|
-
norm = (abs(vectors) ** 2).sum(axis=(1, 2, 3))
|
|
260
|
-
norm = 2 * (norm[0] - norm[1])
|
|
261
|
-
vectors /= norm ** .5
|
|
262
|
-
return vectors.transpose(4, 0, 1, 2, 3)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
class TDRHF(rhf_slow.TDRHF):
|
|
266
|
-
eri4 = PhysERI4
|
|
267
|
-
eri8 = PhysERI8
|
|
268
|
-
v2a = staticmethod(vector_to_amplitudes)
|
|
269
|
-
|
|
270
|
-
def __init__(self, mf, frozen=None):
|
|
271
|
-
"""
|
|
272
|
-
Performs TDHF calculation. Roots and eigenvectors are stored in `self.e`, `self.xy`.
|
|
273
|
-
Args:
|
|
274
|
-
mf (RHF): the base restricted Hartree-Fock model;
|
|
275
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
276
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
277
|
-
"""
|
|
278
|
-
super(TDRHF, self).__init__(mf, frozen=frozen)
|
|
279
|
-
self.e = {}
|
|
280
|
-
self.xy = {}
|
|
281
|
-
|
|
282
|
-
def kernel(self, k=None):
|
|
283
|
-
"""
|
|
284
|
-
Calculates eigenstates and eigenvalues of the TDHF problem.
|
|
285
|
-
Args:
|
|
286
|
-
k (tuple, int): momentum transfer: either an index specifying the momentum transfer or a list of such
|
|
287
|
-
indexes;
|
|
288
|
-
|
|
289
|
-
Returns:
|
|
290
|
-
Positive eigenvalues and eigenvectors.
|
|
291
|
-
"""
|
|
292
|
-
if k is None:
|
|
293
|
-
k = numpy.arange(len(self._scf.kpts))
|
|
294
|
-
|
|
295
|
-
if isinstance(k, int):
|
|
296
|
-
k = [k]
|
|
297
|
-
|
|
298
|
-
for kk in k:
|
|
299
|
-
self.e[kk], self.xy[kk] = self.__kernel__(k=kk)
|
|
300
|
-
return self.e, self.xy
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# Author: Artem Pulkin
|
|
2
|
-
# flake8: noqa
|
|
3
|
-
"""
|
|
4
|
-
This and other `_slow` modules implement the time-dependent Hartree-Fock procedure. The primary performance drawback is
|
|
5
|
-
that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
|
|
6
|
-
TDHF matrices explicitly via an AO-MO transformation, i.e. with a O(N^5) complexity scaling. As a result, regular
|
|
7
|
-
`numpy.linalg.eig` can be used to retrieve TDHF roots in a reliable fashion without any issues related to the Davidson
|
|
8
|
-
procedure. Several variants of TDHF are available:
|
|
9
|
-
|
|
10
|
-
* `pyscf.tdscf.rhf_slow`: the molecular implementation;
|
|
11
|
-
* `pyscf.pbc.tdscf.rhf_slow`: PBC (periodic boundary condition) implementation for RHF objects of `pyscf.pbc.scf`
|
|
12
|
-
modules;
|
|
13
|
-
* `pyscf.pbc.tdscf.krhf_slow_supercell`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
|
|
14
|
-
an arbitrary number of k-points but has a overhead due to an effective construction of a supercell;
|
|
15
|
-
* (this module) `pyscf.pbc.tdscf.krhf_slow_gamma`: A Gamma-point calculation resembling the original `pyscf.pbc.tdscf.krhf`
|
|
16
|
-
module. Despite its name, it accepts KRHF objects with an arbitrary number of k-points but finds only few TDHF roots
|
|
17
|
-
corresponding to collective oscillations without momentum transfer;
|
|
18
|
-
* `pyscf.pbc.tdscf.krhf_slow`: PBC implementation for KRHF objects of `pyscf.pbc.scf` modules. Works with
|
|
19
|
-
an arbitrary number of k-points and employs k-point conservation (diagonalizes matrix blocks separately).
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
from pyscf.pbc.tdscf import krhf_slow_supercell as td
|
|
23
|
-
from pyscf.tdscf import rhf_slow
|
|
24
|
-
|
|
25
|
-
import numpy
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# Convention for these modules:
|
|
29
|
-
# * PhysERI, PhysERI4, PhysERI8 are 2-electron integral routines computed directly (for debug purposes), with a 4-fold
|
|
30
|
-
# symmetry and with an 8-fold symmetry
|
|
31
|
-
# * vector_to_amplitudes reshapes and normalizes the solution
|
|
32
|
-
# * TDRHF provides a container
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class PhysERI(td.PhysERI):
|
|
36
|
-
|
|
37
|
-
def __init__(self, model, frozen=None):
|
|
38
|
-
"""
|
|
39
|
-
The TDHF ERI implementation performing a full transformation of integrals to Bloch functions. No symmetries are
|
|
40
|
-
employed in this class. Only a subset of transformed ERI is returned, corresponding to oscillations without a
|
|
41
|
-
momentum transfer. The k-points of the returned ERIs come in two pairs :math:`(k_1 k_1 | k_2 k_2)`. As a result,
|
|
42
|
-
one of the diagonal blocks of the full TDHF matrix can be reconstructed. For other blocks, look into `PhysERI`
|
|
43
|
-
class of this momdule.
|
|
44
|
-
|
|
45
|
-
Args:
|
|
46
|
-
model (KRHF): the base model;
|
|
47
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
48
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
49
|
-
"""
|
|
50
|
-
super(PhysERI, self).__init__(model, frozen=frozen)
|
|
51
|
-
|
|
52
|
-
def tdhf_diag(self):
|
|
53
|
-
"""
|
|
54
|
-
Retrieves the merged diagonal block with equal pairs of k-indexes (k, k) only.
|
|
55
|
-
|
|
56
|
-
Returns:
|
|
57
|
-
The diagonal block.
|
|
58
|
-
"""
|
|
59
|
-
return super(PhysERI, self).tdhf_diag(pairs=((i, i) for i in range(len(self.model.kpts))))
|
|
60
|
-
|
|
61
|
-
def __calc_block__(self, item, k):
|
|
62
|
-
if k in self.__full_eri_k__:
|
|
63
|
-
return super(PhysERI, self).__calc_block__(item, k)
|
|
64
|
-
else:
|
|
65
|
-
raise RuntimeError("The block k = {:d} + {:d} - {:d} - {:d} does not conserve momentum".format(*k))
|
|
66
|
-
|
|
67
|
-
def eri_mknj(self, item):
|
|
68
|
-
"""
|
|
69
|
-
Retrieves the merged ERI block using 'mknj' notation with pairs of k-indexes (k1, k1, k2, k2).
|
|
70
|
-
Args:
|
|
71
|
-
item (str): a 4-character string of 'mknj' letters;
|
|
72
|
-
|
|
73
|
-
Returns:
|
|
74
|
-
The corresponding block of ERI (phys notation).
|
|
75
|
-
"""
|
|
76
|
-
return super(PhysERI, self).eri_mknj(
|
|
77
|
-
item,
|
|
78
|
-
pairs_row=((i, i) for i in range(len(self.model.kpts))),
|
|
79
|
-
pairs_column=((i, i) for i in range(len(self.model.kpts))),
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
class PhysERI4(PhysERI):
|
|
84
|
-
|
|
85
|
-
def __init__(self, model, frozen=None):
|
|
86
|
-
"""
|
|
87
|
-
The TDHF ERI implementation performing partial transformations of integrals to Bloch functions. A 4-fold
|
|
88
|
-
symmetry of complex-valued functions is employed in this class. Only a subset of transformed ERI is returned,
|
|
89
|
-
corresponding to oscillations without a momentum transfer. The k-points of the returned ERIs come in two pairs
|
|
90
|
-
:math:`(k_1 k_1 | k_2 k_2)`. As a result, one of the diagonal blocks of the full TDHF matrix can be
|
|
91
|
-
reconstructed. For other blocks, look into `PhysERI` class of this momdule.
|
|
92
|
-
|
|
93
|
-
Args:
|
|
94
|
-
model (KRHF): the base model;
|
|
95
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
96
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
97
|
-
"""
|
|
98
|
-
super(PhysERI4, self).__init__(model, frozen=frozen)
|
|
99
|
-
|
|
100
|
-
symmetries = [
|
|
101
|
-
((0, 1, 2, 3), False),
|
|
102
|
-
((1, 0, 3, 2), False),
|
|
103
|
-
((2, 3, 0, 1), True),
|
|
104
|
-
((3, 2, 1, 0), True),
|
|
105
|
-
]
|
|
106
|
-
|
|
107
|
-
def __calc_block__(self, item, k):
|
|
108
|
-
if k in self.__full_eri_k__:
|
|
109
|
-
return td.PhysERI4.__calc_block__.im_func(self, item, k)
|
|
110
|
-
else:
|
|
111
|
-
raise RuntimeError("The block k = {:d} + {:d} - {:d} - {:d} does not conserve momentum".format(*k))
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class PhysERI8(PhysERI4):
|
|
115
|
-
def __init__(self, model, frozen=None):
|
|
116
|
-
"""
|
|
117
|
-
The TDHF ERI implementation performing partial transformations of integrals to Bloch functions. An 8-fold
|
|
118
|
-
symmetry of real-valued functions is employed in this class. Only a subset of transformed ERI is returned,
|
|
119
|
-
corresponding to oscillations without a momentum transfer. The k-points of the returned ERIs come in two pairs
|
|
120
|
-
:math:`(k_1 k_1 | k_2 k_2)`. As a result, one of the diagonal blocks of the full TDHF matrix can be
|
|
121
|
-
reconstructed. For other blocks, look into `PhysERI` class of this momdule.
|
|
122
|
-
|
|
123
|
-
Args:
|
|
124
|
-
model (KRHF): the base model;
|
|
125
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals for all
|
|
126
|
-
k-points or multiple lists of frozen orbitals for each k-point;
|
|
127
|
-
"""
|
|
128
|
-
super(PhysERI8, self).__init__(model, frozen=frozen)
|
|
129
|
-
|
|
130
|
-
symmetries = [
|
|
131
|
-
((0, 1, 2, 3), False),
|
|
132
|
-
((1, 0, 3, 2), False),
|
|
133
|
-
((2, 3, 0, 1), False),
|
|
134
|
-
((3, 2, 1, 0), False),
|
|
135
|
-
|
|
136
|
-
((2, 1, 0, 3), False),
|
|
137
|
-
((3, 0, 1, 2), False),
|
|
138
|
-
((0, 3, 2, 1), False),
|
|
139
|
-
((1, 2, 3, 0), False),
|
|
140
|
-
]
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
def vector_to_amplitudes(vectors, nocc, nmo):
|
|
144
|
-
"""
|
|
145
|
-
Transforms (reshapes) and normalizes vectors into amplitudes.
|
|
146
|
-
Args:
|
|
147
|
-
vectors (numpy.ndarray): raw eigenvectors to transform;
|
|
148
|
-
nocc (tuple): numbers of occupied orbitals;
|
|
149
|
-
nmo (int): the total number of orbitals per k-point;
|
|
150
|
-
|
|
151
|
-
Returns:
|
|
152
|
-
Amplitudes with the following shape: (# of roots, 2 (x or y), # of kpts, # of kpts, # of occupied orbitals,
|
|
153
|
-
# of virtual orbitals).
|
|
154
|
-
"""
|
|
155
|
-
if not all(i == nocc[0] for i in nocc):
|
|
156
|
-
raise NotImplementedError("Varying occupation numbers are not implemented yet")
|
|
157
|
-
nk = len(nocc)
|
|
158
|
-
nocc = nocc[0]
|
|
159
|
-
if not all(i == nmo[0] for i in nmo):
|
|
160
|
-
raise NotImplementedError("Varying AO spaces are not implemented yet")
|
|
161
|
-
nmo = nmo[0]
|
|
162
|
-
vectors = numpy.asanyarray(vectors)
|
|
163
|
-
# Compared to krhf_slow_supercell, only one k-point index is present here. The second index corresponds to
|
|
164
|
-
# momentum transfer and is integrated out
|
|
165
|
-
vectors = vectors.reshape(2, nk, nocc, nmo-nocc, vectors.shape[1])
|
|
166
|
-
norm = (abs(vectors) ** 2).sum(axis=(1, 2, 3))
|
|
167
|
-
norm = 2 * (norm[0] - norm[1])
|
|
168
|
-
vectors /= norm ** .5
|
|
169
|
-
return vectors.transpose(4, 0, 1, 2, 3)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
class TDRHF(rhf_slow.TDRHF):
|
|
173
|
-
eri4 = PhysERI4
|
|
174
|
-
eri8 = PhysERI8
|
|
175
|
-
v2a = staticmethod(vector_to_amplitudes)
|