gpu4pyscf 1.4.2__tar.gz → 1.4.3__tar.gz
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.
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/CHANGELOG +21 -0
- {gpu4pyscf-1.4.2/gpu4pyscf.egg-info → gpu4pyscf-1.4.3}/PKG-INFO +1 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/__init__.py +3 -1
- gpu4pyscf-1.4.3/gpu4pyscf/_patch_pyscf.py +164 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/df.py +6 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/df_jk.py +41 -27
- gpu4pyscf-1.4.3/gpu4pyscf/df/grad/tdrks_ris.py +39 -0
- gpu4pyscf-1.4.3/gpu4pyscf/df/nac/__init__.py +15 -0
- gpu4pyscf-1.4.3/gpu4pyscf/df/nac/tdrhf.py +38 -0
- gpu4pyscf-1.4.3/gpu4pyscf/df/nac/tdrks.py +36 -0
- gpu4pyscf-1.4.3/gpu4pyscf/df/nac/tdrks_ris.py +35 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/numint.py +18 -19
- gpu4pyscf-1.4.3/gpu4pyscf/dft/rkspu.py +350 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/roks.py +14 -1
- gpu4pyscf-1.4.3/gpu4pyscf/dft/ukspu.py +242 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/__init__.py +1 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/rhf.py +25 -13
- gpu4pyscf-1.4.3/gpu4pyscf/grad/rkspu.py +130 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/tdrhf.py +4 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/tdrks.py +8 -8
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/tdrks_ris.py +18 -18
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/tduhf.py +4 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/tduks.py +8 -8
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/uhf.py +7 -13
- gpu4pyscf-1.4.3/gpu4pyscf/grad/ukspu.py +77 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/gto/int3c1e.py +8 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/gto/mole.py +12 -10
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/cupy_helper.py +5 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/utils.py +8 -9
- gpu4pyscf-1.4.3/gpu4pyscf/nac/__init__.py +18 -0
- gpu4pyscf-1.4.3/gpu4pyscf/nac/finite_diff.py +213 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/nac/tdrhf.py +10 -15
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/nac/tdrks.py +19 -23
- gpu4pyscf-1.4.3/gpu4pyscf/nac/tdrks_ris.py +509 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/aft.py +31 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/df.py +33 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/fft.py +30 -5
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/fft_jk.py +2 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/int3c2e.py +0 -3
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/__init__.py +4 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/krks.py +3 -2
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/dft/krkspu.py +326 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/kuks.py +1 -1
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/dft/kukspu.py +280 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/multigrid.py +6 -7
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/multigrid_v2.py +101 -24
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/numint.py +3 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/rks.py +6 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/uks.py +1 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/krhf.py +5 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/krks.py +4 -0
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad/krks_stress.py +396 -0
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad/krkspu.py +144 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/kuhf.py +2 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/kuks.py +4 -0
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad/kuks_stress.py +335 -0
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad/kukspu.py +86 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/rhf.py +3 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/rks.py +5 -1
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad/rks_stress.py +480 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/uhf.py +3 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/grad/uks.py +5 -1
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad/uks_stress.py +270 -0
- gpu4pyscf-1.4.3/gpu4pyscf/pbc/gto/int1e.py +228 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/lib/kpts_helper.py +17 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/scf/hf.py +18 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/scf/khf.py +7 -2
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/scf/kuhf.py +1 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/scf/uhf.py +1 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/tools/pbc.py +3 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/properties/eda.py +2 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/hf.py +24 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/hf_lowmem.py +28 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/rohf.py +14 -1
- gpu4pyscf-1.4.3/gpu4pyscf/tdscf/_krylov_tools.py +1285 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/_lr_eig.py +16 -15
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/math_helper.py +198 -41
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/rhf.py +3 -2
- gpu4pyscf-1.4.3/gpu4pyscf/tdscf/ris.py +1565 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/rks.py +6 -4
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/spectralib.py +30 -20
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/uhf.py +3 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/uks.py +6 -0
- gpu4pyscf-1.4.3/gpu4pyscf/tools/ase_interface.py +145 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3/gpu4pyscf.egg-info}/PKG-INFO +1 -1
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf.egg-info/SOURCES.txt +19 -1
- gpu4pyscf-1.4.2/gpu4pyscf/grad/dispersion.py +0 -29
- gpu4pyscf-1.4.2/gpu4pyscf/nac/__init__.py +0 -2
- gpu4pyscf-1.4.2/gpu4pyscf/pbc/dft/krkspu.py +0 -259
- gpu4pyscf-1.4.2/gpu4pyscf/pbc/dft/kukspu.py +0 -208
- gpu4pyscf-1.4.2/gpu4pyscf/tdscf/_krylov_tools.py +0 -641
- gpu4pyscf-1.4.2/gpu4pyscf/tdscf/ris.py +0 -1814
- gpu4pyscf-1.4.2/gpu4pyscf/tools/ase_interface.py +0 -81
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/LICENSE +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/MANIFEST.in +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/README.md +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/__config__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/cc/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/cc/ccsd_incore.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/cderi.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/jk.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/rhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/rks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/tdrhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/tdrks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/tduhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/tduks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/uhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/grad/uks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/hessian/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/hessian/jk.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/hessian/rhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/hessian/rks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/hessian/uhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/hessian/uks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/int3c2e.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/df/int3c2e_bdiv.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/gen_grid.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/gks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/libxc.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/libxc_structs.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/radi.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/rks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/rks_lowmem.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/uks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/xc_alias.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/dft/xc_deriv.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/solvent/hessian → gpu4pyscf-1.4.3/gpu4pyscf/drivers}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/drivers/basis_vDZP_NWCHEM.dat +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/drivers/dft_3c_driver.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/drivers/dft_driver.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/drivers/ecp_vDZP_NWCHEM.dat +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/drivers/opt_3c_driver.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/drivers/opt_driver.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/pop → gpu4pyscf-1.4.3/gpu4pyscf/fci}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/fci/direct_spin1.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/rks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/grad/uks.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/solvent/grad → gpu4pyscf-1.4.3/gpu4pyscf/gto}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/gto/ecp.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/gto/int3c1e_ip.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/gto/int3c1e_ipip.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/dispersion.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/jk.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/rhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/rks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/uhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/hessian/uks.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/cublas.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/cusolver.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/cutensor.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/diis.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/logger.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/memcpy.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/lib/multi_gpu.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/mp/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/mp/dfmp2.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/mp/mp2.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/aft_jk.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/df_jk.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/df_jk_real.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/ft_ao.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/df/rsdf_builder.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/dft/gen_grid.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/pbc/lib → gpu4pyscf-1.4.3/gpu4pyscf/pbc/grad}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/gto/__init__.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/pbc/grad → gpu4pyscf-1.4.3/gpu4pyscf/pbc/lib}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/scf/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/tools/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pbc/tools/k2gamma.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/fci → gpu4pyscf-1.4.3/gpu4pyscf/pop}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/pop/esp.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/properties/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/properties/ir.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/properties/polarizability.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/properties/raman.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/properties/shielding.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/qmmm/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/qmmm/chelpg.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/qmmm/pbc/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/qmmm/pbc/itrf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/qmmm/pbc/mm_mole.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/qmmm/pbc/tools.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/_response_functions.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/cphf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/diis.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/dispersion.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/ghf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/hf_symm.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/int2c2e.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/int4c2e.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/j_engine.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/jk.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/soscf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/ucphf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/uhf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/scf/uhf_symm.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/_attach_solvent.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/gto → gpu4pyscf-1.4.3/gpu4pyscf/solvent/grad}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/grad/pcm.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/grad/smd.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/grad/smd_experiment.py +0 -0
- {gpu4pyscf-1.4.2/gpu4pyscf/drivers → gpu4pyscf-1.4.3/gpu4pyscf/solvent/hessian}/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/hessian/pcm.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/hessian/smd.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/hessian/smd_experiment.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/pcm.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/smd.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/smd_experiment.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/tdscf/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/solvent/tdscf/pcm.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/_uhf_resp_sf.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tdscf/parameter.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tools/__init__.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf/tools/method_config.py +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf.egg-info/dependency_links.txt +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf.egg-info/requires.txt +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/gpu4pyscf.egg-info/top_level.txt +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/setup.cfg +0 -0
- {gpu4pyscf-1.4.2 → gpu4pyscf-1.4.3}/setup.py +0 -0
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
v1.4.3 (2025-08-20)
|
|
2
|
+
-------------------
|
|
3
|
+
* New Features
|
|
4
|
+
- Geometry optimization for excited states using TDDFT-ris methods.
|
|
5
|
+
- Non-adiabatic coupling vectors for TDDFT-ris methods.
|
|
6
|
+
- Analytical gradients for DFT+U with k-point sampling.
|
|
7
|
+
- Stress tensor calculations for semi-local DFT with k-point sampling and at the gamma-point.
|
|
8
|
+
- ASE interface to support crystal lattice optimization.
|
|
9
|
+
- Multigrid v2 algorithm for meta-GGA functionals.
|
|
10
|
+
* Improvements
|
|
11
|
+
- GPU kernels for PBC overlap and kinetic integrals.
|
|
12
|
+
- Reduced GPU memory usage for TDDFT-ris by storing tensors in host memory.
|
|
13
|
+
- In PBC methods, scaled k-points (fractional coordinates) are stored to
|
|
14
|
+
simplify lattice optimization calculations.
|
|
15
|
+
- A preconditioned Krylov solver to accelerate convergence in TDDFT and
|
|
16
|
+
dynamic polarizability calculations.
|
|
17
|
+
* Fixes
|
|
18
|
+
- Basis decontraction issue for d and f orbitals.
|
|
19
|
+
- A bug in Multigrid v2 algorithm related to non-orthogonal lattices.
|
|
20
|
+
- Incorrect virtual orbital energies when level_shift was enabled.
|
|
21
|
+
|
|
1
22
|
v1.4.2 (2025-07-20)
|
|
2
23
|
-------------------
|
|
3
24
|
* New Features
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
__version__ = '1.4.
|
|
15
|
+
__version__ = '1.4.3'
|
|
16
|
+
|
|
17
|
+
from . import _patch_pyscf
|
|
16
18
|
|
|
17
19
|
from . import lib, grad, hessian, solvent, scf, dft, tdscf, nac
|
|
18
20
|
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Copyright 2025 The PySCF Developers. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import numpy as np
|
|
16
|
+
import cupy
|
|
17
|
+
import pyscf
|
|
18
|
+
|
|
19
|
+
if int(pyscf.__version__.split('.')[1]) <= 10:
|
|
20
|
+
def _fftdf_to_gpu(self):
|
|
21
|
+
from gpu4pyscf.pbc.df.fft import FFTDF
|
|
22
|
+
return FFTDF(self.cell, self.kpts)
|
|
23
|
+
from pyscf.pbc.df.fft import FFTDF
|
|
24
|
+
FFTDF.to_gpu = _fftdf_to_gpu
|
|
25
|
+
|
|
26
|
+
def _aftdf_to_gpu(self):
|
|
27
|
+
from gpu4pyscf.pbc.df.aft import AFTDF
|
|
28
|
+
return AFTDF(self.cell, self.kpts)
|
|
29
|
+
from pyscf.pbc.df.aft import AFTDF
|
|
30
|
+
AFTDF.to_gpu = _aftdf_to_gpu
|
|
31
|
+
|
|
32
|
+
def _gdf_to_gpu(self):
|
|
33
|
+
from gpu4pyscf.pbc.df.df import GDF
|
|
34
|
+
return GDF(self.cell, self.kpts)
|
|
35
|
+
from pyscf.pbc.df.df import GDF
|
|
36
|
+
GDF.to_gpu = _gdf_to_gpu
|
|
37
|
+
|
|
38
|
+
# patch PySCF Cell class, updating lattice parameters is not avail in pyscf 2.10
|
|
39
|
+
from pyscf import lib
|
|
40
|
+
from pyscf.lib import logger
|
|
41
|
+
from pyscf.gto import mole
|
|
42
|
+
from pyscf.pbc.gto.cell import Cell
|
|
43
|
+
def set_geom_(self, atoms_or_coords=None, unit=None, symmetry=None,
|
|
44
|
+
a=None, inplace=True):
|
|
45
|
+
'''Update geometry and lattice parameters
|
|
46
|
+
|
|
47
|
+
Kwargs:
|
|
48
|
+
atoms_or_coords : list, str, or numpy.ndarray
|
|
49
|
+
When specified in list or str, it is processed as the Mole.atom
|
|
50
|
+
attribute. If inputing a (N, 3) numpy array, this array
|
|
51
|
+
represents the coordinates of the atoms in the molecule.
|
|
52
|
+
a : list, str, or numpy.ndarray
|
|
53
|
+
If specified, it is assigned to the cell.a attribute. Its data
|
|
54
|
+
format should be the same to cell.a
|
|
55
|
+
unit : str
|
|
56
|
+
The unit for the input `atoms_or_coords` and `a`. If specified,
|
|
57
|
+
cell.unit will be updated to this value. If not provided, the
|
|
58
|
+
current cell.unit will be used for the two inputs.
|
|
59
|
+
symmetry : bool
|
|
60
|
+
Whether to enable space_group_symmetry. It is a reserved input
|
|
61
|
+
argument. This functionality is not supported yet.
|
|
62
|
+
inplace : bool
|
|
63
|
+
Whether to overwrite the existing Mole object.
|
|
64
|
+
'''
|
|
65
|
+
if inplace:
|
|
66
|
+
cell = self
|
|
67
|
+
else:
|
|
68
|
+
cell = self.copy(deep=False)
|
|
69
|
+
cell._env = cell._env.copy()
|
|
70
|
+
|
|
71
|
+
if unit is not None and cell.unit != unit:
|
|
72
|
+
if isinstance(unit, str):
|
|
73
|
+
if mole.is_au(unit):
|
|
74
|
+
_unit = 1.
|
|
75
|
+
else:
|
|
76
|
+
_unit = lib.param.BOHR
|
|
77
|
+
else:
|
|
78
|
+
_unit = unit
|
|
79
|
+
if a is None:
|
|
80
|
+
a = self.lattice_vectors() * _unit
|
|
81
|
+
if atoms_or_coords is None:
|
|
82
|
+
atoms_or_coords = self.atom_coords() * _unit
|
|
83
|
+
|
|
84
|
+
if a is not None:
|
|
85
|
+
logger.info(cell, 'Set new lattice vectors')
|
|
86
|
+
logger.info(cell, '%s', a)
|
|
87
|
+
cell.a = a
|
|
88
|
+
if cell._mesh_from_build:
|
|
89
|
+
cell.mesh = None
|
|
90
|
+
if cell._rcut_from_build:
|
|
91
|
+
cell.rcut = None
|
|
92
|
+
cell._built = False
|
|
93
|
+
cell.enuc = None
|
|
94
|
+
|
|
95
|
+
if atoms_or_coords is not None:
|
|
96
|
+
cell = mole.MoleBase.set_geom_(cell, atoms_or_coords, unit, symmetry)
|
|
97
|
+
if not cell._built:
|
|
98
|
+
cell.build(False, False)
|
|
99
|
+
return cell
|
|
100
|
+
Cell.set_geom_ = set_geom_
|
|
101
|
+
|
|
102
|
+
def get_lattice_Ls(cell, nimgs=None, rcut=None, dimension=None, discard=True):
|
|
103
|
+
'''This version employs more strict criteria when discarding images in lattice sum.
|
|
104
|
+
It can be replaced by the built-in version available in PySCF 2.10.
|
|
105
|
+
'''
|
|
106
|
+
if dimension is None:
|
|
107
|
+
# For atoms near the boundary of the cell, it is necessary (even in low-
|
|
108
|
+
# dimensional systems) to include lattice translations in all 3 dimensions.
|
|
109
|
+
if cell.dimension < 2 or cell.low_dim_ft_type == 'inf_vacuum':
|
|
110
|
+
dimension = cell.dimension
|
|
111
|
+
else:
|
|
112
|
+
dimension = 3
|
|
113
|
+
if rcut is None:
|
|
114
|
+
rcut = cell.rcut
|
|
115
|
+
|
|
116
|
+
if dimension == 0 or rcut <= 0 or cell.natm == 0:
|
|
117
|
+
return np.zeros((1, 3))
|
|
118
|
+
|
|
119
|
+
a = cell.lattice_vectors()
|
|
120
|
+
|
|
121
|
+
scaled_atom_coords = cell.get_scaled_atom_coords()
|
|
122
|
+
atom_boundary_max = scaled_atom_coords[:,:dimension].max(axis=0)
|
|
123
|
+
atom_boundary_min = scaled_atom_coords[:,:dimension].min(axis=0)
|
|
124
|
+
if (np.any(atom_boundary_max > 1) or np.any(atom_boundary_min < -1)):
|
|
125
|
+
atom_boundary_max[atom_boundary_max > 1] = 1
|
|
126
|
+
atom_boundary_min[atom_boundary_min <-1] = -1
|
|
127
|
+
ovlp_penalty = atom_boundary_max - atom_boundary_min
|
|
128
|
+
dR = ovlp_penalty.dot(a[:dimension])
|
|
129
|
+
dR_basis = np.diag(dR)
|
|
130
|
+
|
|
131
|
+
# Search the minimal x,y,z requiring |x*a[0]+y*a[1]+z*a[2]+dR|^2 > rcut^2
|
|
132
|
+
# Ls boundary should be derived by decomposing (a, Rij) for each atom-pair.
|
|
133
|
+
# For reasons unclear, the so-obtained Ls boundary seems not large enough.
|
|
134
|
+
# The upper-bound of the Ls boundary is generated by find_boundary function.
|
|
135
|
+
def find_boundary(a):
|
|
136
|
+
aR = np.vstack([a, dR_basis])
|
|
137
|
+
r = np.linalg.qr(aR.T)[1]
|
|
138
|
+
ub = (rcut + abs(r[2,3:]).sum()) / abs(r[2,2])
|
|
139
|
+
return ub
|
|
140
|
+
|
|
141
|
+
xb = find_boundary(a[[1,2,0]])
|
|
142
|
+
if dimension > 1:
|
|
143
|
+
yb = find_boundary(a[[2,0,1]])
|
|
144
|
+
else:
|
|
145
|
+
yb = 0
|
|
146
|
+
if dimension > 2:
|
|
147
|
+
zb = find_boundary(a)
|
|
148
|
+
else:
|
|
149
|
+
zb = 0
|
|
150
|
+
bounds = np.ceil([xb, yb, zb]).astype(int)
|
|
151
|
+
Ts = lib.cartesian_prod((np.arange(-bounds[0], bounds[0]+1),
|
|
152
|
+
np.arange(-bounds[1], bounds[1]+1),
|
|
153
|
+
np.arange(-bounds[2], bounds[2]+1)))
|
|
154
|
+
Ls = np.dot(Ts[:,:dimension], a[:dimension])
|
|
155
|
+
|
|
156
|
+
if discard and len(Ls) > 1:
|
|
157
|
+
r = cell.atom_coords()
|
|
158
|
+
rr = r[:,None] - r
|
|
159
|
+
dist_max = np.linalg.norm(rr, axis=2).max()
|
|
160
|
+
Ls_mask = np.linalg.norm(Ls, axis=1) < rcut + dist_max
|
|
161
|
+
Ls = Ls[Ls_mask]
|
|
162
|
+
return np.asarray(Ls, order='C')
|
|
163
|
+
# Patch the get_lattice_Ls for pyscf-2.9 or older
|
|
164
|
+
Cell.get_lattice_Ls = get_lattice_Ls
|
|
@@ -26,6 +26,7 @@ from gpu4pyscf.lib.cupy_helper import (
|
|
|
26
26
|
from gpu4pyscf.df import int3c2e, df_jk
|
|
27
27
|
from gpu4pyscf.df import int3c2e_bdiv
|
|
28
28
|
from gpu4pyscf.lib import logger
|
|
29
|
+
from gpu4pyscf.lib import utils
|
|
29
30
|
from gpu4pyscf import __config__
|
|
30
31
|
from gpu4pyscf.__config__ import _streams, num_devices
|
|
31
32
|
|
|
@@ -38,7 +39,6 @@ LINEAR_DEP_THR = incore.LINEAR_DEP_THR
|
|
|
38
39
|
GROUP_SIZE = 256
|
|
39
40
|
|
|
40
41
|
class DF(lib.StreamObject):
|
|
41
|
-
from gpu4pyscf.lib.utils import to_gpu, device
|
|
42
42
|
|
|
43
43
|
_keys = {'intopt', 'nao', 'naux', 'cd_low', 'mol', 'auxmol', 'use_gpu_memory'}
|
|
44
44
|
|
|
@@ -71,10 +71,12 @@ class DF(lib.StreamObject):
|
|
|
71
71
|
self.reset()
|
|
72
72
|
self._auxbasis = x
|
|
73
73
|
|
|
74
|
+
to_gpu = utils.to_gpu
|
|
75
|
+
device = utils.device
|
|
76
|
+
|
|
74
77
|
def to_cpu(self):
|
|
75
|
-
from
|
|
76
|
-
|
|
77
|
-
return obj.reset()
|
|
78
|
+
from pyscf.df.df import DF
|
|
79
|
+
return utils.to_cpu(self, out=DF(self.mol, auxbasis=self.auxbasis))
|
|
78
80
|
|
|
79
81
|
def build(self, direct_scf_tol=1e-14, omega=None):
|
|
80
82
|
mol = self.mol
|
|
@@ -25,7 +25,7 @@ from gpu4pyscf.lib import logger
|
|
|
25
25
|
from gpu4pyscf.lib.cupy_helper import (
|
|
26
26
|
contract, transpose_sum, reduce_to_device, tag_array)
|
|
27
27
|
from gpu4pyscf.dft import rks, uks, numint
|
|
28
|
-
from gpu4pyscf.scf import hf, uhf
|
|
28
|
+
from gpu4pyscf.scf import hf, uhf, rohf
|
|
29
29
|
from gpu4pyscf.df import df, int3c2e
|
|
30
30
|
from gpu4pyscf.__config__ import _streams, num_devices
|
|
31
31
|
|
|
@@ -192,13 +192,24 @@ class _DFHF:
|
|
|
192
192
|
if dm is None: dm = self.make_rdm1()
|
|
193
193
|
assert not self.direct_scf
|
|
194
194
|
|
|
195
|
+
if isinstance(self, rohf.ROHF):
|
|
196
|
+
if getattr(dm, 'mo_coeff', None) is not None:
|
|
197
|
+
mo_coeff = cupy.repeat(dm.mo_coeff[None], 2, axis=0)
|
|
198
|
+
mo_occ = cupy.asarray([dm.mo_occ>0, dm.mo_occ==2],
|
|
199
|
+
dtype=numpy.double)
|
|
200
|
+
if dm.ndim == 2: # RHF DM
|
|
201
|
+
dm = cupy.repeat(dm[None]*.5, 2, axis=0)
|
|
202
|
+
dm = tag_array(dm, mo_coeff=mo_coeff, mo_occ=mo_occ)
|
|
203
|
+
elif dm.ndim == 2: # RHF DM
|
|
204
|
+
dm = cupy.repeat(dm[None]*.5, 2, axis=0)
|
|
205
|
+
|
|
195
206
|
# for DFT
|
|
196
207
|
if isinstance(self, rks.KohnShamDFT):
|
|
197
208
|
t0 = logger.init_timer(self)
|
|
198
209
|
rks.initialize_grids(self, mol, dm)
|
|
199
210
|
ni = self._numint
|
|
200
|
-
if
|
|
201
|
-
n, exc, vxc = ni.
|
|
211
|
+
if isinstance(self, (uhf.UHF, rohf.ROHF)): # UKS
|
|
212
|
+
n, exc, vxc = ni.nr_uks(mol, self.grids, self.xc, dm)
|
|
202
213
|
logger.debug(self, 'nelec by numeric integration = %s', n)
|
|
203
214
|
if self.do_nlc():
|
|
204
215
|
if ni.libxc.is_nlc(self.xc):
|
|
@@ -206,30 +217,31 @@ class _DFHF:
|
|
|
206
217
|
else:
|
|
207
218
|
assert ni.libxc.is_nlc(self.nlc)
|
|
208
219
|
xc = self.nlc
|
|
209
|
-
n, enlc, vnlc = ni.nr_nlc_vxc(mol, self.nlcgrids, xc, dm)
|
|
220
|
+
n, enlc, vnlc = ni.nr_nlc_vxc(mol, self.nlcgrids, xc, dm[0]+dm[1])
|
|
210
221
|
exc += enlc
|
|
211
222
|
vxc += vnlc
|
|
212
223
|
logger.debug(self, 'nelec with nlc grids = %s', n)
|
|
213
|
-
t0 = logger.
|
|
224
|
+
t0 = logger.timer(self, 'vxc', *t0)
|
|
214
225
|
|
|
215
226
|
if not ni.libxc.is_hybrid_xc(self.xc):
|
|
216
|
-
vj = self.get_j(mol, dm, hermi)
|
|
227
|
+
vj = self.get_j(mol, dm[0]+dm[1], hermi)
|
|
217
228
|
vxc += vj
|
|
218
229
|
else:
|
|
219
230
|
omega, alpha, hyb = ni.rsh_and_hybrid_coeff(self.xc, spin=mol.spin)
|
|
220
231
|
vj, vk = self.get_jk(mol, dm, hermi)
|
|
232
|
+
vj = vj[0] + vj[1]
|
|
221
233
|
vxc += vj
|
|
222
234
|
vk *= hyb
|
|
223
|
-
if omega
|
|
224
|
-
vklr = self.get_k(mol, dm, hermi, omega=
|
|
235
|
+
if abs(omega) > 1e-10:
|
|
236
|
+
vklr = self.get_k(mol, dm, hermi, omega=omega)
|
|
225
237
|
vklr *= (alpha - hyb)
|
|
226
238
|
vk += vklr
|
|
227
|
-
vxc -= vk
|
|
228
|
-
exc -= cupy.einsum('
|
|
229
|
-
ecoul = cupy.einsum('
|
|
239
|
+
vxc -= vk
|
|
240
|
+
exc -= cupy.einsum('sij,sji->', dm, vk).real * .5
|
|
241
|
+
ecoul = cupy.einsum('sij,ji->', dm, vj).real * .5
|
|
230
242
|
|
|
231
|
-
elif
|
|
232
|
-
n, exc, vxc = ni.
|
|
243
|
+
elif isinstance(self, hf.RHF):
|
|
244
|
+
n, exc, vxc = ni.nr_rks(mol, self.grids, self.xc, dm)
|
|
233
245
|
logger.debug(self, 'nelec by numeric integration = %s', n)
|
|
234
246
|
if self.do_nlc():
|
|
235
247
|
if ni.libxc.is_nlc(self.xc):
|
|
@@ -237,39 +249,41 @@ class _DFHF:
|
|
|
237
249
|
else:
|
|
238
250
|
assert ni.libxc.is_nlc(self.nlc)
|
|
239
251
|
xc = self.nlc
|
|
240
|
-
n, enlc, vnlc = ni.nr_nlc_vxc(mol, self.nlcgrids, xc, dm
|
|
252
|
+
n, enlc, vnlc = ni.nr_nlc_vxc(mol, self.nlcgrids, xc, dm)
|
|
241
253
|
exc += enlc
|
|
242
254
|
vxc += vnlc
|
|
243
255
|
logger.debug(self, 'nelec with nlc grids = %s', n)
|
|
244
|
-
t0 = logger.
|
|
256
|
+
t0 = logger.timer_debug1(self, 'vxc tot', *t0)
|
|
245
257
|
|
|
246
258
|
if not ni.libxc.is_hybrid_xc(self.xc):
|
|
247
|
-
vj = self.get_j(mol, dm
|
|
259
|
+
vj = self.get_j(mol, dm, hermi)
|
|
248
260
|
vxc += vj
|
|
249
261
|
else:
|
|
250
262
|
omega, alpha, hyb = ni.rsh_and_hybrid_coeff(self.xc, spin=mol.spin)
|
|
251
263
|
vj, vk = self.get_jk(mol, dm, hermi)
|
|
252
|
-
vj = vj[0] + vj[1]
|
|
253
264
|
vxc += vj
|
|
254
265
|
vk *= hyb
|
|
255
|
-
if
|
|
256
|
-
vklr = self.get_k(mol, dm, hermi, omega=omega)
|
|
266
|
+
if omega != 0:
|
|
267
|
+
vklr = self.get_k(mol, dm, hermi, omega=abs(omega))
|
|
257
268
|
vklr *= (alpha - hyb)
|
|
258
269
|
vk += vklr
|
|
259
|
-
vxc -= vk
|
|
260
|
-
exc -= cupy.einsum('
|
|
261
|
-
ecoul = cupy.einsum('
|
|
270
|
+
vxc -= vk * .5
|
|
271
|
+
exc -= cupy.einsum('ij,ji', dm, vk).real * .25
|
|
272
|
+
ecoul = cupy.einsum('ij,ji', dm, vj).real * .5
|
|
273
|
+
|
|
274
|
+
else:
|
|
275
|
+
raise NotImplementedError("DF only supports R/U/RO KS.")
|
|
262
276
|
t0 = logger.timer_debug1(self, 'jk total', *t0)
|
|
263
277
|
return tag_array(vxc, ecoul=ecoul, exc=exc, vj=None, vk=None)
|
|
264
278
|
|
|
265
|
-
if
|
|
266
|
-
vj, vk = self.get_jk(mol, dm, hermi=hermi)
|
|
267
|
-
return vj - vk * .5
|
|
268
|
-
elif dm.ndim == 3:
|
|
279
|
+
if isinstance(self, (uhf.UHF, rohf.ROHF)):
|
|
269
280
|
vj, vk = self.get_jk(mol, dm, hermi=hermi)
|
|
270
281
|
return vj[0] + vj[1] - vk
|
|
282
|
+
elif isinstance(self, hf.RHF):
|
|
283
|
+
vj, vk = self.get_jk(mol, dm, hermi=hermi)
|
|
284
|
+
return vj - vk * .5
|
|
271
285
|
else:
|
|
272
|
-
raise NotImplementedError("
|
|
286
|
+
raise NotImplementedError("DF only supports R/U/RO HF.")
|
|
273
287
|
|
|
274
288
|
def to_cpu(self):
|
|
275
289
|
obj = self.undo_df().to_cpu().density_fit()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copyright 2021-2025 The PySCF Developers. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from gpu4pyscf.df import int3c2e, df
|
|
16
|
+
from gpu4pyscf.df.grad import tdrhf as tdrhf_grad_df
|
|
17
|
+
from gpu4pyscf.tdscf import ris
|
|
18
|
+
from gpu4pyscf.grad import tdrks_ris as tdrks_ris_grad
|
|
19
|
+
from gpu4pyscf import __config__
|
|
20
|
+
|
|
21
|
+
class Gradients(tdrks_ris_grad.Gradients):
|
|
22
|
+
from gpu4pyscf.lib.utils import to_gpu, device
|
|
23
|
+
|
|
24
|
+
_keys = {'with_df', 'auxbasis_response'}
|
|
25
|
+
def __init__(self, td):
|
|
26
|
+
# Whether to include the response of DF auxiliary basis when computing
|
|
27
|
+
# nuclear gradients of J/K matrices
|
|
28
|
+
tdrks_ris_grad.Gradients.__init__(self, td)
|
|
29
|
+
|
|
30
|
+
auxbasis_response = True
|
|
31
|
+
get_jk = tdrhf_grad_df.get_jk
|
|
32
|
+
|
|
33
|
+
def check_sanity(self):
|
|
34
|
+
assert isinstance(self.base._scf, df.df_jk._DFHF)
|
|
35
|
+
assert isinstance(self.base, ris.TDDFT) or isinstance(self.base, ris.TDA)
|
|
36
|
+
|
|
37
|
+
get_veff = tdrhf_grad_df.get_veff
|
|
38
|
+
|
|
39
|
+
Grad = Gradients
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Copyright 2021-2024 The PySCF Developers. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from . import tdrhf, tdrks, tdrks_ris
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright 2021-2024 The PySCF Developers. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from gpu4pyscf.nac import tdrhf as tdrhf_nac
|
|
16
|
+
from gpu4pyscf.df.grad.tdrhf import get_jk, get_veff
|
|
17
|
+
from gpu4pyscf.tdscf import rhf as tdrhf
|
|
18
|
+
from gpu4pyscf.lib import logger
|
|
19
|
+
from gpu4pyscf.df import df
|
|
20
|
+
from gpu4pyscf.lib.cupy_helper import tag_array
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class NAC(tdrhf_nac.NAC):
|
|
24
|
+
from gpu4pyscf.lib.utils import to_gpu, device
|
|
25
|
+
|
|
26
|
+
_keys = {'with_df', 'auxbasis_response'}
|
|
27
|
+
def __init__(self, td):
|
|
28
|
+
# Whether to include the response of DF auxiliary basis when computing
|
|
29
|
+
# nuclear gradients of J/K matrices
|
|
30
|
+
tdrhf_nac.NAC.__init__(self, td)
|
|
31
|
+
|
|
32
|
+
auxbasis_response = True
|
|
33
|
+
get_jk = get_jk
|
|
34
|
+
get_veff = get_veff
|
|
35
|
+
|
|
36
|
+
def check_sanity(self):
|
|
37
|
+
assert isinstance(self.base._scf, df.df_jk._DFHF)
|
|
38
|
+
assert isinstance(self.base, tdrhf.TDHF) or isinstance(self.base, tdrhf.TDA)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright 2021-2024 The PySCF Developers. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from gpu4pyscf.nac import tdrks as tdrks_nac
|
|
16
|
+
from gpu4pyscf.df.nac import tdrhf as tdrhf_nac_df
|
|
17
|
+
from gpu4pyscf.df import df
|
|
18
|
+
from gpu4pyscf.tdscf import rks as tdrks
|
|
19
|
+
|
|
20
|
+
class NAC(tdrks_nac.NAC):
|
|
21
|
+
from gpu4pyscf.lib.utils import to_gpu, device
|
|
22
|
+
|
|
23
|
+
_keys = {'with_df', 'auxbasis_response'}
|
|
24
|
+
def __init__(self, td):
|
|
25
|
+
# Whether to include the response of DF auxiliary basis when computing
|
|
26
|
+
# nuclear gradients of J/K matrices
|
|
27
|
+
tdrks_nac.NAC.__init__(self, td)
|
|
28
|
+
|
|
29
|
+
auxbasis_response = True
|
|
30
|
+
get_jk = tdrhf_nac_df.get_jk
|
|
31
|
+
|
|
32
|
+
def check_sanity(self):
|
|
33
|
+
assert isinstance(self.base._scf, df.df_jk._DFHF)
|
|
34
|
+
assert isinstance(self.base, tdrks.TDDFT) or isinstance(self.base, tdrks.TDA)
|
|
35
|
+
|
|
36
|
+
get_veff = tdrhf_nac_df.get_veff
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Copyright 2021-2024 The PySCF Developers. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from gpu4pyscf.nac import tdrks_ris as tdrks_ris_nac
|
|
16
|
+
from gpu4pyscf.df.nac import tdrhf as tdrhf_nac_df
|
|
17
|
+
from gpu4pyscf.df import df
|
|
18
|
+
from gpu4pyscf.tdscf import ris
|
|
19
|
+
|
|
20
|
+
class NAC(tdrks_ris_nac.NAC):
|
|
21
|
+
from gpu4pyscf.lib.utils import to_gpu, device
|
|
22
|
+
|
|
23
|
+
_keys = {'with_df', 'auxbasis_response'}
|
|
24
|
+
def __init__(self, td):
|
|
25
|
+
# Whether to include the response of DF auxiliary basis when computing
|
|
26
|
+
# nuclear gradients of J/K matrices
|
|
27
|
+
tdrks_ris_nac.NAC.__init__(self, td)
|
|
28
|
+
|
|
29
|
+
auxbasis_response = True
|
|
30
|
+
get_veff = tdrhf_nac_df.get_veff
|
|
31
|
+
get_jk = tdrhf_nac_df.get_jk
|
|
32
|
+
|
|
33
|
+
def check_sanity(self):
|
|
34
|
+
assert isinstance(self.base._scf, df.df_jk._DFHF)
|
|
35
|
+
assert isinstance(self.base, ris.TDDFT) or isinstance(self.base, ris.TDA)
|
|
@@ -1528,18 +1528,24 @@ def cache_xc_kernel(ni, mol, grids, xc_code, mo_coeff, mo_occ, spin=0,
|
|
|
1528
1528
|
def batch_square(a):
|
|
1529
1529
|
return a[0]**2 + a[1]**2 + a[2]**2
|
|
1530
1530
|
|
|
1531
|
-
def eval_xc_eff(ni, xc_code, rho, deriv=1, omega=None, xctype=None,
|
|
1531
|
+
def eval_xc_eff(ni, xc_code, rho, deriv=1, omega=None, xctype=None,
|
|
1532
|
+
verbose=None, spin=None):
|
|
1532
1533
|
'''
|
|
1533
1534
|
Different from PySCF, this function employ cuda version libxc
|
|
1534
1535
|
'''
|
|
1535
1536
|
if omega is None: omega = ni.omega
|
|
1536
1537
|
if xctype is None: xctype = ni._xc_type(xc_code)
|
|
1537
1538
|
|
|
1538
|
-
|
|
1539
|
-
|
|
1539
|
+
if spin is None:
|
|
1540
|
+
spin_polarized = rho.ndim >= 2 and rho.shape[0] == 2
|
|
1541
|
+
if spin_polarized:
|
|
1542
|
+
spin = 1
|
|
1543
|
+
else:
|
|
1544
|
+
spin = 0
|
|
1545
|
+
xcfuns = ni._init_xcfuns(xc_code, spin)
|
|
1540
1546
|
|
|
1541
1547
|
inp = {}
|
|
1542
|
-
if
|
|
1548
|
+
if spin == 0:
|
|
1543
1549
|
assert rho.dtype == np.float64
|
|
1544
1550
|
if xctype == 'LDA':
|
|
1545
1551
|
inp['rho'] = rho.ravel()
|
|
@@ -1599,23 +1605,16 @@ def eval_xc_eff(ni, xc_code, rho, deriv=1, omega=None, xctype=None, verbose=None
|
|
|
1599
1605
|
kxc = None
|
|
1600
1606
|
|
|
1601
1607
|
exc = ret_full["zk"]
|
|
1602
|
-
if
|
|
1603
|
-
|
|
1604
|
-
if
|
|
1605
|
-
|
|
1606
|
-
if
|
|
1607
|
-
kxc = [ret_full[label] for label in kxc_labels if label in ret_full]
|
|
1608
|
-
else:
|
|
1609
|
-
vxc = [ret_full[label] for label in vxc_labels if label in ret_full]
|
|
1610
|
-
if do_fxc:
|
|
1611
|
-
fxc = [ret_full[label] for label in fxc_labels if label in ret_full]
|
|
1612
|
-
if do_kxc:
|
|
1613
|
-
kxc = [ret_full[label] for label in kxc_labels if label in ret_full]
|
|
1608
|
+
vxc = [ret_full[label] for label in vxc_labels if label in ret_full]
|
|
1609
|
+
if do_fxc:
|
|
1610
|
+
fxc = [ret_full[label] for label in fxc_labels if label in ret_full]
|
|
1611
|
+
if do_kxc:
|
|
1612
|
+
kxc = [ret_full[label] for label in kxc_labels if label in ret_full]
|
|
1614
1613
|
if do_kxc:
|
|
1615
|
-
kxc = xc_deriv.transform_kxc(rho, fxc, kxc, xctype,
|
|
1614
|
+
kxc = xc_deriv.transform_kxc(rho, fxc, kxc, xctype, spin)
|
|
1616
1615
|
if do_fxc:
|
|
1617
|
-
fxc = xc_deriv.transform_fxc(rho, vxc, fxc, xctype,
|
|
1618
|
-
vxc = xc_deriv.transform_vxc(rho, vxc, xctype,
|
|
1616
|
+
fxc = xc_deriv.transform_fxc(rho, vxc, fxc, xctype, spin)
|
|
1617
|
+
vxc = xc_deriv.transform_vxc(rho, vxc, xctype, spin)
|
|
1619
1618
|
return exc, vxc, fxc, kxc
|
|
1620
1619
|
|
|
1621
1620
|
def _init_xcfuns(xc_code, spin):
|