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/dft/gen_libxc_param.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# Copyright 2014-2019 The PySCF Developers. All Rights Reserved.
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
import os
|
|
17
|
-
import sys
|
|
18
|
-
ldpath = os.path.abspath(os.path.join(__file__, '..', '..', 'lib', 'deps', 'lib'))
|
|
19
|
-
if ldpath not in os.environ['LD_LIBRARY_PATH']:
|
|
20
|
-
sys.stderr.write(f'Set\n\tLD_LIBRARY_PATH={ldpath}:$LD_LIBRARY_PATH\n'
|
|
21
|
-
'and rerun the script\n')
|
|
22
|
-
exit()
|
|
23
|
-
|
|
24
|
-
pypath = os.path.join(__file__, '..', '..', 'lib', 'build', 'deps', 'src', 'libxc')
|
|
25
|
-
sys.path.insert(0, os.path.abspath(pypath))
|
|
26
|
-
import pylibxc
|
|
27
|
-
|
|
28
|
-
for xcname in pylibxc.util.xc_available_functional_names():
|
|
29
|
-
f = pylibxc.LibXCFunctional(xcname, 1)
|
|
30
|
-
f_id = f.get_number()
|
|
31
|
-
ref = f.get_references()
|
|
32
|
-
key = f"'{xcname.upper()}'"
|
|
33
|
-
print(f"{key:<31s}: {f_id:<3d}, # {ref[0]}")
|
|
34
|
-
for r in ref[1:]:
|
|
35
|
-
print(f" # {r}")
|
pyscf/dft/gen_xcfun_param.py
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# Copyright 2014-2020 The PySCF Developers. All Rights Reserved.
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
from pyscf import dft
|
|
17
|
-
import ctypes
|
|
18
|
-
|
|
19
|
-
libdft = dft.xcfun._itrf
|
|
20
|
-
libdft.xc_enumerate_parameters.restype = ctypes.c_char_p
|
|
21
|
-
libdft.XCFUN_xc_type.restype = ctypes.c_int
|
|
22
|
-
libdft.xc_describe_short.restype = ctypes.c_char_p
|
|
23
|
-
libdft.xc_describe_short.argtype = [ctypes.c_char_p]
|
|
24
|
-
libdft.xc_describe_long.restype = ctypes.c_char_p
|
|
25
|
-
libdft.xc_describe_long.argtype = [ctypes.c_char_p]
|
|
26
|
-
lda_ids = []
|
|
27
|
-
gga_ids = []
|
|
28
|
-
mgga_ids = []
|
|
29
|
-
mlgga_ids = []
|
|
30
|
-
xc_codes = {}
|
|
31
|
-
for i in range(68):
|
|
32
|
-
name = libdft.xc_enumerate_parameters(ctypes.c_int(i))
|
|
33
|
-
sdescr = libdft.xc_describe_short(name)
|
|
34
|
-
#ldescr = libdft.xc_describe_long(ctypes.c_int(i))
|
|
35
|
-
if sdescr is not None:
|
|
36
|
-
#print("'%s' : %d, # %s" % (name, i, sdescr.replace('\n', '. ')))
|
|
37
|
-
print('%-16s: %2d, # %s' % ("'%s'"%name, i, sdescr.replace('\n', '. ')))
|
|
38
|
-
xc_codes[name] = i
|
|
39
|
-
|
|
40
|
-
fntype = libdft.XCFUN_xc_type(ctypes.c_int(i))
|
|
41
|
-
if fntype == 0:
|
|
42
|
-
lda_ids.append(i)
|
|
43
|
-
elif fntype == 1:
|
|
44
|
-
gga_ids.append(i)
|
|
45
|
-
elif fntype == 2:
|
|
46
|
-
mgga_ids.append(i)
|
|
47
|
-
|
|
48
|
-
alias = {
|
|
49
|
-
'SLATER': 'SLATERX',
|
|
50
|
-
'LDA' : 'SLATERX',
|
|
51
|
-
'VWN' : 'VWN5C',
|
|
52
|
-
'VWN5' : 'VWN5C',
|
|
53
|
-
'B88' : 'BECKEX',
|
|
54
|
-
'LYP' : 'LYPC',
|
|
55
|
-
}
|
|
56
|
-
for k, v in alias.items():
|
|
57
|
-
print('%-16s: %2d, # %s' % ("'%s'"%k, xc_codes[v], v))
|
|
58
|
-
print('LDA_IDS = %s' % lda_ids)
|
|
59
|
-
print('GGA_IDS = %s' % gga_ids)
|
|
60
|
-
print('MGGA_IDS = %s' % mgga_ids)
|
|
61
|
-
|
|
62
|
-
#define XC_D0 0
|
|
63
|
-
#define XC_D1 1
|
|
64
|
-
#define XC_D2 2
|
|
65
|
-
#define XC_D3 3
|
|
66
|
-
#define XC_D4 4
|
|
67
|
-
|
|
68
|
-
#define XC_D00 0
|
|
69
|
-
#define XC_D10 1
|
|
70
|
-
#define XC_D01 2
|
|
71
|
-
#define XC_D20 3
|
|
72
|
-
#define XC_D11 4
|
|
73
|
-
#define XC_D02 5
|
|
74
|
-
#define XC_D30 6
|
|
75
|
-
#define XC_D21 7
|
|
76
|
-
#define XC_D12 8
|
|
77
|
-
#define XC_D03 9
|
|
78
|
-
#define XC_D40 10
|
|
79
|
-
#define XC_D31 11
|
|
80
|
-
#define XC_D22 12
|
|
81
|
-
#define XC_D13 13
|
|
82
|
-
#define XC_D04 14
|
|
83
|
-
|
|
84
|
-
#define XC_D00000 0
|
|
85
|
-
#define XC_D10000 1
|
|
86
|
-
#define XC_D01000 2
|
|
87
|
-
#define XC_D00100 3
|
|
88
|
-
#define XC_D00010 4
|
|
89
|
-
#define XC_D00001 5
|
|
90
|
-
#define XC_D20000 6
|
|
91
|
-
#define XC_D11000 7
|
|
92
|
-
#define XC_D10100 8
|
|
93
|
-
#define XC_D10010 9
|
|
94
|
-
#define XC_D10001 10
|
|
95
|
-
#define XC_D02000 11
|
|
96
|
-
#define XC_D01100 12
|
|
97
|
-
#define XC_D01010 13
|
|
98
|
-
#define XC_D01001 14
|
|
99
|
-
#define XC_D00200 15
|
|
100
|
-
#define XC_D00110 16
|
|
101
|
-
#define XC_D00101 17
|
|
102
|
-
#define XC_D00020 18
|
|
103
|
-
#define XC_D00011 19
|
|
104
|
-
#define XC_D00002 20
|
|
105
|
-
#define XC_D30000 21
|
|
106
|
-
#define XC_D21000 22
|
|
107
|
-
#define XC_D20100 23
|
|
108
|
-
#define XC_D20010 24
|
|
109
|
-
#define XC_D20001 25
|
|
110
|
-
#define XC_D12000 26
|
|
111
|
-
#define XC_D11100 27
|
|
112
|
-
#define XC_D11010 28
|
|
113
|
-
#define XC_D11001 29
|
|
114
|
-
#define XC_D10200 30
|
|
115
|
-
#define XC_D10110 31
|
|
116
|
-
#define XC_D10101 32
|
|
117
|
-
#define XC_D10020 33
|
|
118
|
-
#define XC_D10011 34
|
|
119
|
-
#define XC_D10002 35
|
|
120
|
-
#define XC_D03000 36
|
|
121
|
-
#define XC_D02100 37
|
|
122
|
-
#define XC_D02010 38
|
|
123
|
-
#define XC_D02001 39
|
|
124
|
-
#define XC_D01200 40
|
|
125
|
-
#define XC_D01110 41
|
|
126
|
-
#define XC_D01101 42
|
|
127
|
-
#define XC_D01020 43
|
|
128
|
-
#define XC_D01011 44
|
|
129
|
-
#define XC_D01002 45
|
|
130
|
-
#define XC_D00300 46
|
|
131
|
-
#define XC_D00210 47
|
|
132
|
-
#define XC_D00201 48
|
|
133
|
-
#define XC_D00120 49
|
|
134
|
-
#define XC_D00111 50
|
|
135
|
-
#define XC_D00102 51
|
|
136
|
-
#define XC_D00030 52
|
|
137
|
-
#define XC_D00021 53
|
|
138
|
-
#define XC_D00012 54
|
|
139
|
-
#define XC_D00003 55
|
|
140
|
-
#define XC_D40000 56
|
|
141
|
-
#define XC_D31000 57
|
|
142
|
-
#define XC_D30100 58
|
|
143
|
-
#define XC_D30010 59
|
|
144
|
-
#define XC_D30001 60
|
|
145
|
-
#define XC_D22000 61
|
|
146
|
-
#define XC_D21100 62
|
|
147
|
-
#define XC_D21010 63
|
|
148
|
-
#define XC_D21001 64
|
|
149
|
-
#define XC_D20200 65
|
|
150
|
-
#define XC_D20110 66
|
|
151
|
-
#define XC_D20101 67
|
|
152
|
-
#define XC_D20020 68
|
|
153
|
-
#define XC_D20011 69
|
|
154
|
-
#define XC_D20002 70
|
|
155
|
-
#define XC_D13000 71
|
|
156
|
-
#define XC_D12100 72
|
|
157
|
-
#define XC_D12010 73
|
|
158
|
-
#define XC_D12001 74
|
|
159
|
-
#define XC_D11200 75
|
|
160
|
-
#define XC_D11110 76
|
|
161
|
-
#define XC_D11101 77
|
|
162
|
-
#define XC_D11020 78
|
|
163
|
-
#define XC_D11011 79
|
|
164
|
-
#define XC_D11002 80
|
|
165
|
-
#define XC_D10300 81
|
|
166
|
-
#define XC_D10210 82
|
|
167
|
-
#define XC_D10201 83
|
|
168
|
-
#define XC_D10120 84
|
|
169
|
-
#define XC_D10111 85
|
|
170
|
-
#define XC_D10102 86
|
|
171
|
-
#define XC_D10030 87
|
|
172
|
-
#define XC_D10021 88
|
|
173
|
-
#define XC_D10012 89
|
|
174
|
-
#define XC_D10003 90
|
|
175
|
-
#define XC_D04000 91
|
|
176
|
-
#define XC_D03100 92
|
|
177
|
-
#define XC_D03010 93
|
|
178
|
-
#define XC_D03001 94
|
|
179
|
-
#define XC_D02200 95
|
|
180
|
-
#define XC_D02110 96
|
|
181
|
-
#define XC_D02101 97
|
|
182
|
-
#define XC_D02020 98
|
|
183
|
-
#define XC_D02011 99
|
|
184
|
-
#define XC_D02002 100
|
|
185
|
-
#define XC_D01300 101
|
|
186
|
-
#define XC_D01210 102
|
|
187
|
-
#define XC_D01201 103
|
|
188
|
-
#define XC_D01120 104
|
|
189
|
-
#define XC_D01111 105
|
|
190
|
-
#define XC_D01102 106
|
|
191
|
-
#define XC_D01030 107
|
|
192
|
-
#define XC_D01021 108
|
|
193
|
-
#define XC_D01012 109
|
|
194
|
-
#define XC_D01003 110
|
|
195
|
-
#define XC_D00400 111
|
|
196
|
-
#define XC_D00310 112
|
|
197
|
-
#define XC_D00301 113
|
|
198
|
-
#define XC_D00220 114
|
|
199
|
-
#define XC_D00211 115
|
|
200
|
-
#define XC_D00202 116
|
|
201
|
-
#define XC_D00130 117
|
|
202
|
-
#define XC_D00121 118
|
|
203
|
-
#define XC_D00112 119
|
|
204
|
-
#define XC_D00103 120
|
|
205
|
-
#define XC_D00040 121
|
|
206
|
-
#define XC_D00031 122
|
|
207
|
-
#define XC_D00022 123
|
|
208
|
-
#define XC_D00013 124
|
|
209
|
-
#define XC_D00004 125
|
pyscf/pbc/tdscf/kproxy.py
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
# Author: Artem Pulkin
|
|
2
|
-
# flake8: noqa
|
|
3
|
-
"""
|
|
4
|
-
This and other `proxy` modules implement the time-dependent mean-field procedure using the existing pyscf
|
|
5
|
-
implementations as a black box. The main purpose of these modules is to overcome the existing limitations in pyscf
|
|
6
|
-
(i.e. real-only orbitals, davidson diagonalizer, incomplete Bloch space, etc). The primary performance drawback is that,
|
|
7
|
-
unlike the original pyscf routines with an implicit construction of the eigenvalue problem, these modules construct TD
|
|
8
|
-
matrices explicitly by proxying to pyscf density response routines with a O(N^4) complexity scaling. As a result,
|
|
9
|
-
regular `numpy.linalg.eig` can be used to retrieve TD roots. Several variants of proxy-TD are available:
|
|
10
|
-
|
|
11
|
-
* `pyscf.tdscf.proxy`: the molecular implementation;
|
|
12
|
-
* `pyscf.pbc.tdscf.proxy`: PBC (periodic boundary condition) Gamma-point-only implementation;
|
|
13
|
-
* `pyscf.pbc.tdscf.kproxy_supercell`: PBC implementation constructing supercells. Works with an arbitrary number of
|
|
14
|
-
k-points but has an overhead due to ignoring the momentum conservation law. In addition, works only with
|
|
15
|
-
time reversal invariant (TRI) models: i.e. the k-point grid has to be aligned and contain at least one TRI momentum.
|
|
16
|
-
* (this module) `pyscf.pbc.tdscf.kproxy`: same as the above but respect the momentum conservation and, thus, diagonlizes smaller
|
|
17
|
-
matrices (the performance gain is the total number of k-points in the model).
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
# Convention for these modules:
|
|
21
|
-
# * PhysERI is the proxying class constructing time-dependent matrices
|
|
22
|
-
# * vector_to_amplitudes reshapes and normalizes the solution
|
|
23
|
-
# * TDProxy provides a container
|
|
24
|
-
|
|
25
|
-
from functools import reduce
|
|
26
|
-
from pyscf.pbc.tdscf import kproxy_supercell, krhf_slow
|
|
27
|
-
|
|
28
|
-
import numpy
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def kov2ov(nocc, nmo, k):
|
|
32
|
-
"""
|
|
33
|
-
Converts k point pairs into ov mask.
|
|
34
|
-
Args:
|
|
35
|
-
nocc (Iterable): occupation numbers per k-point;
|
|
36
|
-
nmo (Iterable): numbers of orbitals per k-point;
|
|
37
|
-
k (ndarray): k-point pairs;
|
|
38
|
-
|
|
39
|
-
Returns:
|
|
40
|
-
An ov-mask. Basis order: [k_o, o, k_v, v].
|
|
41
|
-
"""
|
|
42
|
-
nocc = numpy.asanyarray(nocc)
|
|
43
|
-
nmo = numpy.asanyarray(nmo)
|
|
44
|
-
|
|
45
|
-
nvirt = nmo - nocc
|
|
46
|
-
|
|
47
|
-
mask = numpy.zeros((sum(nocc), sum(nvirt)), dtype=bool)
|
|
48
|
-
|
|
49
|
-
o_e = numpy.cumsum(nocc)
|
|
50
|
-
o_s = o_e - o_e[0]
|
|
51
|
-
|
|
52
|
-
v_e = numpy.cumsum(nvirt)
|
|
53
|
-
v_s = v_e - v_e[0]
|
|
54
|
-
|
|
55
|
-
for k1, k2 in enumerate(k):
|
|
56
|
-
mask[o_s[k1]:o_e[k1], v_s[k2]:v_e[k2]] = True
|
|
57
|
-
|
|
58
|
-
return mask.reshape(-1)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
class PhysERI(kproxy_supercell.PhysERI):
|
|
62
|
-
def __init__(self, model, proxy, x, mf_constructor, frozen=None, **kwargs):
|
|
63
|
-
"""
|
|
64
|
-
A proxy class for calculating the TD matrix blocks (k-point version).
|
|
65
|
-
|
|
66
|
-
Args:
|
|
67
|
-
model: the base model with a time reversal-invariant k-point grid;
|
|
68
|
-
proxy: a pyscf proxy with TD response function, one of 'hf', 'dft';
|
|
69
|
-
x (Iterable): the original k-grid dimensions (numbers of k-points per each axis);
|
|
70
|
-
mf_constructor (Callable): a function constructing the mean-field object;
|
|
71
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals;
|
|
72
|
-
**kwargs: arguments to `k2s` function constructing supercells;
|
|
73
|
-
"""
|
|
74
|
-
super(PhysERI, self).__init__(model, proxy, x, mf_constructor, frozen=frozen, **kwargs)
|
|
75
|
-
|
|
76
|
-
def get_ov_space_mask(self):
|
|
77
|
-
"""
|
|
78
|
-
Prepares the space mask in the ov form.
|
|
79
|
-
Returns:
|
|
80
|
-
The mask in the ov form.
|
|
81
|
-
"""
|
|
82
|
-
return kproxy_supercell.orb2ov(numpy.concatenate(self.space), self.nocc_full, self.nmo_full)
|
|
83
|
-
|
|
84
|
-
def kov2ov(self, k):
|
|
85
|
-
"""
|
|
86
|
-
Converts k-ov mask into ov mask.
|
|
87
|
-
Args:
|
|
88
|
-
k (ndarray): k-point pairs;
|
|
89
|
-
|
|
90
|
-
Returns:
|
|
91
|
-
An ov-mask. Basis order: [k_o, o, k_v, v].
|
|
92
|
-
"""
|
|
93
|
-
mask = self.get_ov_space_mask()
|
|
94
|
-
return numpy.logical_and(mask, kov2ov(self.nocc_full, self.nmo_full, k))
|
|
95
|
-
|
|
96
|
-
def proxy_response_ov_batch(self, k_row, k_col):
|
|
97
|
-
"""
|
|
98
|
-
A raw response submatrix corresponding to specific k-points.
|
|
99
|
-
Args:
|
|
100
|
-
k_row (ndarray): sets of k-point pairs (row index);
|
|
101
|
-
k_col (ndarray): sets of k-point pairs (column index);
|
|
102
|
-
|
|
103
|
-
Returns:
|
|
104
|
-
A raw response matrix.
|
|
105
|
-
"""
|
|
106
|
-
masks_row = tuple(self.kov2ov(i) for i in k_row)
|
|
107
|
-
masks_col = tuple(self.kov2ov(i) for i in k_col)
|
|
108
|
-
|
|
109
|
-
full_mask_row = reduce(numpy.logical_or, masks_row)
|
|
110
|
-
full_mask_col = reduce(numpy.logical_or, masks_col)
|
|
111
|
-
|
|
112
|
-
big = kproxy_supercell.supercell_response_ov(
|
|
113
|
-
self.proxy_vind,
|
|
114
|
-
(full_mask_row, full_mask_col),
|
|
115
|
-
self.nocc_full,
|
|
116
|
-
self.nmo_full,
|
|
117
|
-
self.proxy_is_double(),
|
|
118
|
-
self.model_super.supercell_inv_rotation,
|
|
119
|
-
self.model,
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
result = []
|
|
123
|
-
|
|
124
|
-
for m_row, m_col in zip(masks_row, masks_col):
|
|
125
|
-
m_row_red = m_row[full_mask_row]
|
|
126
|
-
m_col_red = m_col[full_mask_col]
|
|
127
|
-
result.append(tuple(i[m_row_red][:, m_col_red] for i in big))
|
|
128
|
-
|
|
129
|
-
return tuple(result)
|
|
130
|
-
|
|
131
|
-
# This is needed for krhf_slow.get_block_k_ix
|
|
132
|
-
get_k_ix = krhf_slow.PhysERI.get_k_ix.im_func
|
|
133
|
-
|
|
134
|
-
def tdhf_primary_form(self, k):
|
|
135
|
-
"""
|
|
136
|
-
A primary form of TD matrices (full).
|
|
137
|
-
Args:
|
|
138
|
-
k (tuple, int): momentum transfer: either a pair of k-point indexes specifying the momentum transfer
|
|
139
|
-
vector or a single integer with the second index assuming the first index being zero;
|
|
140
|
-
|
|
141
|
-
Returns:
|
|
142
|
-
Output type: "full", and the corresponding matrix.
|
|
143
|
-
"""
|
|
144
|
-
r1, r2, c1, c2 = krhf_slow.get_block_k_ix(self, k)
|
|
145
|
-
(a, _), (_, b), (_, b_star), (a_star, _) = self.proxy_response_ov_batch((r1, r1, r2, r2), (c1, c2, c1, c2))
|
|
146
|
-
return "full", numpy.block([[a, b], [-b_star.conj(), -a_star.conj()]])
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
vector_to_amplitudes = krhf_slow.vector_to_amplitudes
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
class TDProxy(kproxy_supercell.TDProxy):
|
|
153
|
-
v2a = staticmethod(vector_to_amplitudes)
|
|
154
|
-
proxy_eri = PhysERI
|
|
155
|
-
|
|
156
|
-
def __init__(self, mf, proxy, x, mf_constructor, frozen=None, **kwargs):
|
|
157
|
-
"""
|
|
158
|
-
Performs TD calculation. Roots and eigenvectors are stored in `self.e`, `self.xy`.
|
|
159
|
-
Args:
|
|
160
|
-
mf: the base model with a time-reversal invariant k-point grid;
|
|
161
|
-
proxy: a pyscf proxy with TD response function, one of 'hf', 'dft';
|
|
162
|
-
x (Iterable): the original k-grid dimensions (numbers of k-points per each axis);
|
|
163
|
-
mf_constructor (Callable): a function constructing the mean-field object;
|
|
164
|
-
frozen (int, Iterable): the number of frozen valence orbitals or the list of frozen orbitals;
|
|
165
|
-
**kwargs: arguments to `k2s` function constructing supercells;
|
|
166
|
-
"""
|
|
167
|
-
super(TDProxy, self).__init__(mf, proxy, x, mf_constructor, frozen=frozen, **kwargs)
|
|
168
|
-
self.e = {}
|
|
169
|
-
self.xy = {}
|
|
170
|
-
|
|
171
|
-
def kernel(self, k=None):
|
|
172
|
-
"""
|
|
173
|
-
Calculates eigenstates and eigenvalues of the TDHF problem.
|
|
174
|
-
Args:
|
|
175
|
-
k (tuple, int): momentum transfer: either an index specifying the momentum transfer or a list of such
|
|
176
|
-
indexes;
|
|
177
|
-
|
|
178
|
-
Returns:
|
|
179
|
-
Positive eigenvalues and eigenvectors.
|
|
180
|
-
"""
|
|
181
|
-
if k is None:
|
|
182
|
-
k = numpy.arange(len(self._scf.kpts))
|
|
183
|
-
|
|
184
|
-
if isinstance(k, int):
|
|
185
|
-
k = [k]
|
|
186
|
-
|
|
187
|
-
for kk in k:
|
|
188
|
-
self.e[kk], self.xy[kk] = self.__kernel__(k=kk)
|
|
189
|
-
return self.e, self.xy
|