Reading integrals from Fotran


I am not sure how this question is related to this forum. I have a Fortran code. I would like to
1.1) load PSI4 to calculated integrals
1.2) use these integrals in Fortran.
many times.

I can try to
2.1) use Fortran to system call a python code
2.2) in that python code, use PSI4 to write integrals into a file
3.3) use Fortran to read the file of integrals

I am not sure if I will spend a lot of time in system call and/or reading/writing files. The interaction between Fortran code and PSI4 is iteratively. Time is a concern.

Is there any more efficient approach? E.g., Fortran to system call PSI4, then read PSI4 integrals to skip reading/writing file, and/or skip system call python; or use some Fortran integral library to compute integrals and everything inside Fortran.

The system is less than 10 main group atoms (most are hydrogens) with double/triple zeta basis functions. I think they can be stored in memory.

Thank you very much

The Fortran code CP2K uses libint2 (same library as psi4), so that is possible but probably a lot of work to do from scratch.

One solution is using the FCIDUMP format that is used by a few programs.

If the integrals fit into memory then you can save them in a numpy array and write them however you like.
(example usage: psi4numpy/3a_restricted-hartree-fock.ipynb at master ยท psi4/psi4numpy ยท GitHub)

Integrals via the mintshelper class are saved into an ascii format called IWL (integrals with labels).

I am not familiar enough with this for important details like normalization and ordering but there are in principle multiple options.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.