Skip to content
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

Psi4 and PCMSolver: cavity file looks wrong with Psi4 1.9.1 #207

Open
proteins247 opened this issue Apr 25, 2024 · 1 comment
Open

Psi4 and PCMSolver: cavity file looks wrong with Psi4 1.9.1 #207

proteins247 opened this issue Apr 25, 2024 · 1 comment

Comments

@proteins247
Copy link

proteins247 commented Apr 25, 2024

This may be related to #206, but it also might not be. If it's related, hopefully this can provide some clues to solving that issue.

I noticed that with a test molecule, when I visualize the cavity.off file (as well as the cavity.npz file), the cavity looks wrong. This occurs when I use Psi4 version 1.9.1, which I presume uses a later version of PCMSolver.

Here's what I see when I open the cavity.off file with GeomView:
image

I installed an older version of Psi4, version 1.7, which uses an older version of PCMSolver. The cavity.off file looks correct when visualized:
image

GeomView is only rendering what the .off files contain. It's apparent that the .off file generated from version 1.9.1 is strange. For example, here is the first face, spanning several angstroms.

0.00000000000000    5.38493480770725    -0.24495631562047    1.0000    1.0000    1.0000    0.7500   # Tess 1
7.48623343416459    6.51468476188352    -0.22384001935377    1.0000    1.0000    1.0000    0.7500   # Tess 1
6.65809546936335    0.02562006853899    3.07844533351791    1.0000    1.0000    1.0000    0.7500   # Tess 1

The input to Psi4 that I used to calculate this was as follows:

memory 15 GB

set_num_threads(16)

molecule {
0 1
N  -1.5465417693  -1.2796398575   0.0107903739
C  -0.8413899636  -2.3906314381  -0.0120482313
N   0.5052752739  -2.5213778186  -0.0345451095
C   1.2094891640  -1.4085182175  -0.0332303580
N   0.5765247879  -0.2053080169  -0.0109009439
C  -0.8176536479  -0.1485416994   0.0112079948
C  -1.1272753970   1.2054086149   0.0297830830
C   0.1198679222   1.8638606215   0.0171572095
N   1.1608971994   1.0102822254  -0.0076621882
C   0.3861857826   3.3247286526   0.0283747103
C  -2.4998302207   1.7721058115   0.0565833777
N   2.5464535183  -1.3943103040  -0.0510913442
H  -1.3929333841  -3.3217921764  -0.0132603618
H  -0.5365584640   3.8957889465   0.0444441706
H   0.9729286912   3.6055639415   0.9014309682
H   0.9531467069   3.6226355491  -0.8520120554
H  -2.4837924379   2.8584384720   0.0694927000
H  -3.0756048325   1.4590404534  -0.8135420402
H  -3.0501019187   1.4378645900   0.9352621355
H   3.0306629236  -0.5155845127  -0.0588247822
H   3.0415632768  -2.2638329572  -0.0779693955

}

set {
    basis def2-SVP
    scf_type df
    pcm true
}

pcm = {
    Units = Angstrom
    Medium {
    SolverType = CPCM
    correction = 0.5
    Solvent = Water
    }

    Cavity {
    RadiiSet = UFF
    Type = GePol
    Scaling = True
    Area = 0.3
    Mode = Implicit
    }
}

set print 3
energy('BP86')

4-26 edited to add: changing units to Angstrom means area 0.3 is in angstroms^2. See followup comment.

When I look at the output of psi4 for both versions, the reported energetics are still the same

   => Energetics <=

    Nuclear Repulsion Energy =            696.3357089573493113
    One-Electron Energy =               -2119.6263820573644807
    Two-Electron Energy =                 953.7017744256992273
    DFT Exchange-Correlation Energy =     -75.9570151273202185
    Empirical Dispersion Energy =           0.0000000000000000
    VV10 Nonlocal Energy =                  0.0000000000000000
    PCM Polarization Energy =              -0.0074516131966917
    Total Energy =                       -545.5533654148330243

The cavity generated by Psi4 version 1.7 has 1262 tessera, while the cavity from Psi4 version 1.9.1 has 1252 tessera.

How this affects me is that Psi4 using PCMSolver seems to fail for many organic molecules that I am testing with the PCMSolver fatal error. S matrix is not positive-definite! error, as described in #206. In those cases, the cavity also looks incorrect. I took a molecule that failed with this error and found that the calculation successfully completes when I use Psi4 1.7.

Note that Psi4 1.9.1 does generate cavities that look correct as well, particular for smaller, simpler molecules that I've tested.

Your Environment

  • Version used: Psi4 1.9.1 which uses PCMSolver 1.2.3?
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): installed both versions using conda
  • For psi4 1.7 conda create -c psi4 -c conda-forge -n psi4_1_7 python psi4=1.7.0 pydantic=1.10 dftd3 dftd4 gcp
  • For psi4 1.9.1 conda create -c conda-forge -n psi4_1_9 python psi4 dftd3-python dftd4-python gcp-correction
  • Operating System and version: Linux x86 64
@proteins247
Copy link
Author

My misunderstanding about settings for PCMSolver led to a mistake in the psi4 input file above. I put in Units = Angstrom, but I also left in Area = 0.3, which I see is the default value in the documentation. But the documentation specifies 0.3 a.u.^2. With Units = Angstrom, I end up specifying faces that are roughly 4x larger, 0.3 Å^2. I also now understand that PCMSolver works with a.u., and the output cavity files are also in a.u.

I reran my test cases, now with the following input for psi4 in the PCMSolver section.

pcm = {
    Medium {
    SolverType = CPCM
    correction = 0.5
    Solvent = Water
    }

    Cavity {
    RadiiSet = Bondi
    Type = GePol
    Scaling = True              # default
    Area = 0.3                  # default
    Mode = Implicit             # default
    }
}

The results are not changed, however.

  • Psi4 1.7 on above test molecule: normal looking cavity.off, total E = -545.5591642321282961
  • Psi4 1.9.1 on above test molecule: weird looking cavity.off, total E = -545.5591641912924388
  • Psi4 1.7 on a larger test molecule: calculation succeeds (did take 3x longer than before)
  • Psi4 1.9.1 on a larger test molecule: S matrix is not positive-definite!

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

No branches or pull requests

1 participant