Lmax_exceeded error for optimizing single Zinc ion

I got the lmax_exceeded error when trying to compute the gradient for a single Zinc ion.

The input is:

molecule {
  2 1
 Zn        0.0  0.0  0.0

The output is:

  => Auxiliary Basis Set <=

  Basis Set: (3-21G AUX)
    Number of shells: 58
    Number of basis functions: 377
    Number of Cartesian functions: 377
    Spherical Harmonics?: false
    Max angular momentum: 6

Traceback (most recent call last):
  File "/share/apps/miniconda/py3/2021.11/envs/psi4test/bin/psi4", line 338, in <module>
  File "<string>", line 23, in <module>
  File "/share/apps/miniconda/py3/2021.11/envs/psi4test/lib//python3.10/site-packages/psi4/driver/driver.py", line 639, in gradient
    wfn = procedures['gradient'][lowername](lowername, molecule=molecule, **kwargs)
  File "/share/apps/miniconda/py3/2021.11/envs/psi4test/lib//python3.10/site-packages/psi4/driver/procrouting/proc.py", line 93, in select_scf_gradient
    return func(name, **kwargs)
  File "/share/apps/miniconda/py3/2021.11/envs/psi4test/lib//python3.10/site-packages/psi4/driver/procrouting/proc.py", line 2680, in run_scf_gradient
    grad = core.scfgrad(ref_wfn)

RuntimeError: Engine::lmax_exceeded -- angular momentum limit exceeded

I find that this is related to the MAX_AM_ERI parameter during libint2 compiling. The PSI4 document on How to get high angular momentum integrals from conda mentions that “The Linux package has base MAX_AM_ERI=7”. I tried to install psi4 by either one of the following method:

conda install psi4 python=3.10 -c psi4 
conda install psi4 python=3.10 -c psi4/label/dev 

With the binaries from conda, I still get the lmax_exceeded error. Am I missing something? Can anyone please tell me what is the correct way to install libint2 with MAX_AM_ERI=7?


  1. Your input file confuses me. A single atom always has zero gradient.
  2. Conda questions are for @loriab.

Thank you for the response. This input is just for a test and for quickly reproducing the problem.

Yes, I’m sorry; unfortunately, the integrals library is in a long transition period, and those are old notes you found. As an aside, one can’t switch out integrals libraries without recompiling psi4 itself. At the moment, I can’t build a larger AM lib, but I’m working on that.

Now to practicalities. What is your actual target basis set if not 3-21G? All the Karlsruhe (def2) basis sets (and misc. ones like 3-21g) use a common/universal jkfit basis that’s quad-zeta quality. If this was a non-TM molecule, and if you’re using a double- or triple-zeta orbital/primary basis, I’d suggest you could set df_basis_scf aug-cc-pvdz-jkfit (or tz) to get a tuned aux basis that’s doesn’t require such high AM. Unfortunately, even the basis set exchange doesn’t have a JKFIT for zinc besides the def2 one.

At the moment, the only things I can think of are:

  • do a custom aux basis and comment out the I functions for zinc to save the one AM level I think you’re over
  • I think energies are fine – the trouble comes with gradients. you could do finite difference gradients gradient(..., dertype=0)
  • download psi4 v1.5 (c. Dec 2021) for Linux. That was built with higher AM than the v1.6 and v1.7 that were released in 2022.
  • build current psi4 and libint2 yourself with GCC
  • wait for me to fix the current high AM troubles
1 Like

Thank you so much for your helps! Looks like the Psi4 v1.5 must be installed through the method discussed in Conda Install for 1.5

Here is what I did. I tried to install the Psi4 1.4 and 1.5 binaries through conda by the following commands:

conda create -n psi4_1.5 psi4=1.5 -c psi4
conda create -n psi4_1.4 psi4=1.4 -c psi4

Both installation gives the following errors for almost every input files that I tried, including the official sample test fiels:

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
libgdma.so         00007F9EBC3310DC  for__signal_handl     Unknown  Unknown
libpthread-2.31.s  00007F9EC3287420  Unknown               Unknown  Unknown
core.cpython-39-x  00007F9EBFBFA459  Unknown               Unknown  Unknown
core.cpython-39-x  00007F9EBF3724AF  Unknown               Unknown  Unknown
core.cpython-39-x  00007F9EBF2E9900  Unknown               Unknown  Unknown
core.cpython-39-x  00007F9EBF2E0D63  _ZN3psi12TwoBodyA     Unknown  Unknown

Then I found the post in forum on Conda Install for 1.5, and installed the Psi4 v1.5 through:

conda create -n psi4_1.5 psi4=1.5 python=3.9 libint2=*=hc9558a2_9 pytest=5 pcmsolver=*=py39h6d17ec8_2 -c psi4

And this version resolves the lmax_exceeded problem for me. I hope this is helpful to others who need to optimize the Zinc systems.

I am looking forward to the fix for Psi4 v1.7. Thank you again for your help @loriab !

1 Like

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