Skip to content

One-electron integrals - sometimes square, sometimes triangle #2985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
konpat opened this issue Jun 13, 2023 · 2 comments · Fixed by #2986
Closed

One-electron integrals - sometimes square, sometimes triangle #2985

konpat opened this issue Jun 13, 2023 · 2 comments · Fixed by #2986

Comments

@konpat
Copy link
Contributor

konpat commented Jun 13, 2023

Since moving to LibInt2, the functions that access one-electron integrals, such as ao_overlap(), ao_kinetic(), ... behave differently when given no parameters (so the integrals are computed within the orbital basis set) and when given two basis set parameters (which is e.g. needed to access integrals in an auxiliary basis). The former gives an appropriate symmetric matrix with all integrals filled in. The latter produces a matrix with only the lower triangle filled with integrals and the upper triangle containing zeros. I think it would be better if the integral functions always filled in the other triangle (by symmetry) and returned a symmetric matrix.

Here's the Python code that demonstrates the issue in case of the AO overlap integrals:

import sys
import numpy as np
import psi4

psi4.set_memory('16 GB')
np.set_printoptions(threshold=sys.maxsize)

mol = psi4.geometry("""
0 1
O -0.0669991400 0.0000000000 1.4943547400
H 0.8157342700 0.0000000000 1.8658663900
H 0.0688551000 0.0000000000 0.5391427700

units angstrom
symmetry c1
""")

psi4.set_options({'basis': 'aug-cc-pvdz',
                  'df_basis_mp2':'aug-cc-pvdz-ri',
                })

conv = psi4.core.BasisSet.build(mol,'BASIS', psi4.core.get_global_option('BASIS'))
aux = psi4.core.BasisSet.build(mol,'DF_BASIS_MP2',"", "RIFIT", psi4.core.get_global_option('DF_BASIS_MP2'))

wfn = psi4.core.Wavefunction.build(mol, psi4.core.get_global_option('BASIS'))
mints = psi4.core.MintsHelper(wfn.basisset())

Soo = np.asarray(mints.ao_overlap())
Sxx = np.asarray(mints.ao_overlap(aux,aux))

print("Orbital overlap matrix")
print(Soo)
print("Auxiliary overlap matrix")
print(Sxx)
@EricaCMitchell
Copy link
Contributor

The MintsHelper functions for the one-electron integrals automatically assumes no symmetry if two basis sets are given, even if they are the same. Changes to the code since Libint1 have made it so the one_body_ao_computer runs off shellpairs in filling the returned matrix so symmetry is run even though its set to false in the function. I have included a simple fix to this in my PR #2982 , I’m just waiting for review.

@susilehtola
Copy link
Member

susilehtola commented Jun 14, 2023

@EricaCMitchell As commented in #2982, please split off the fix to this issue into a separate PR, which can be reviewed quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants