@@ -715,13 +715,13 @@ def _parse_basis_args_cint_3c2e(system, basis1, basis2, basis3, origin=None):
715715 system , system .basis , common_origin = origin
716716 )
717717 nsh_bas = system .basis .nshells
718- shell_slice = [0 , nsh_bas , 0 , nsh_bas , nsh_bas , nsh_bas + nsh_aux ]
718+ shell_slice = [nsh_bas , nsh_bas + nsh_aux , 0 , nsh_bas , 0 , nsh_bas ]
719719 elif basis2 is not None and basis3 is None :
720720 bas_atm , bas_bas , bas_env = basis_to_cint_envs (
721721 system , basis2 , common_origin = origin
722722 )
723723 nsh_bas = basis2 .nshells
724- shell_slice = [0 , nsh_bas , 0 , nsh_bas , nsh_bas , nsh_bas + nsh_aux ]
724+ shell_slice = [nsh_bas , nsh_bas + nsh_aux , 0 , nsh_bas , 0 , nsh_bas ]
725725 elif basis2 is not None and basis3 is not None and basis2 != basis3 :
726726 raise ValueError (
727727 "libcint doesn't support (P|QR) with Q and R being different basis sets."
@@ -734,10 +734,10 @@ def _parse_basis_args_cint_3c2e(system, basis1, basis2, basis3, origin=None):
734734
735735
736736def _f2c (arr ):
737- if arr .shape [- 1 ] == 1 :
738- return np . ascontiguousarray ( arr [..., 0 ])
737+ if arr .shape [0 ] == 1 :
738+ return arr [0 ]
739739 else :
740- return np . ascontiguousarray ( np . rollaxis ( arr , - 1 , 0 ))
740+ return arr
741741
742742
743743def cint_overlap (system , basis1 = None , basis2 = None ):
@@ -783,6 +783,7 @@ def cint_overlap_spinor(system, basis1=None, basis2=None):
783783 _require_libcint ()
784784 atm , bas , env , shell_slice = _parse_basis_args_cint_1e (system , basis1 , basis2 )
785785 res = ints .cint_int1e_ovlp_spinor (shell_slice , atm , bas , env )
786+ np .conjugate (res , out = res )
786787 return _f2c (res )
787788
788789
@@ -857,7 +858,10 @@ def cint_opVop(system, basis1=None, basis2=None):
857858 _require_libcint ()
858859 atm , bas , env , shell_slice = _parse_basis_args_cint_1e (system , basis1 , basis2 )
859860 res = ints .cint_int1e_spnucsp_sph (shell_slice , atm , bas , env )
861+ # the x/y/z components are antisymmetric due to the cross produce (swapping the two basis functions changes the sign)
862+ # libcint returns the transposed version, hence the sign flip
860863 # C-layout, first index is the integral component (slowest changing)
864+ res [:- 1 ] *= - 1
861865 return _f2c (res )
862866
863867
@@ -885,6 +889,7 @@ def cint_opVop_spinor(system, basis1=None, basis2=None):
885889 _require_libcint ()
886890 atm , bas , env , shell_slice = _parse_basis_args_cint_1e (system , basis1 , basis2 )
887891 res = ints .cint_int1e_spnucsp_spinor (shell_slice , atm , bas , env )
892+ np .conj (res , out = res )
888893 return _f2c (res )
889894
890895
@@ -958,4 +963,4 @@ def cint_coulomb_3c(system, basis1=None, basis2=None, basis3=None):
958963 system , basis1 , basis2 , basis3
959964 )
960965 res = ints .cint_int3c2e_sph (shell_slice , atm , bas , env )
961- return res . transpose ( 2 , 0 , 1 ). copy () # copy makes sure it's C-contiguous
966+ return res
0 commit comments