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

Atom not in list bug with geometric optimizer #2871

Closed
q-posev opened this issue Feb 7, 2023 · 3 comments · Fixed by #2872
Closed

Atom not in list bug with geometric optimizer #2871

q-posev opened this issue Feb 7, 2023 · 3 comments · Fixed by #2872

Comments

@q-posev
Copy link
Contributor

q-posev commented Feb 7, 2023

Hello Psi4,

I am running a geometry optimisation for a small molecule with a chlorium atom (see the Psi4 input at the bottom of this page) and get the following error. It comes from the fact that the atomic symbols are uppercased by Psi4 (e.g. CL for chlorium) while geometric engine expects them capitalized (e.g. Cl). I have a one-liner fix for this which should go in the driver.py module. I can open a PR or communicate the fix here, whatever you prefer.

Traceback (most recent call last):
  File "/opt/conda/envs/psi4-env/bin/psi4", line 338, in <module>
    exec(content)
  File "<string>", line 50, in <module>
  File "/opt/conda/envs/psi4-env/lib//python3.9/site-packages/psi4/driver/driver.py", line 1152, in optimize
    return optimize_geometric(name, **kwargs)
  File "/opt/conda/envs/psi4-env/lib//python3.9/site-packages/psi4/driver/driver.py", line 918, in optimize_geometric
    optimizer.prepareFirstStep()
  File "/opt/conda/envs/psi4-env/lib//python3.9/site-packages/geometric/optimize.py", line 376, in prepareFirstStep
    self.H0 = self.IC.guess_hessian(self.coords)
  File "/opt/conda/envs/psi4-env/lib//python3.9/site-packages/geometric/internal.py", line 3457, in guess_hessian
    Hprim = self.Prims.guess_hessian(coords)
  File "/opt/conda/envs/psi4-env/lib//python3.9/site-packages/geometric/internal.py", line 2730, in guess_hessian
    elem1 = min(Elements.index(self.elem[ic.a]), Elements.index(self.elem[ic.b]))

ValueError: 'CL' is not in list

Printing out the relevant lines from the Psithon --> Python processed input file:
      'coordsys' : 'tric',
      'convergence_set' : 'GAU_LOOSE',
      'convergence_energy' : 1e-4,
    }
    core.set_global_option("GEOM_MAXITER", 5)
--> optimize('mp2', engine='geometric', optimizer_keywords=geometric_keywords)

Versions:

  • geometric 1.0
  • psi4 1.7+6ce35a5
  • python 3.9

Psi4 input file:

memory 14000 MB
molecule ligand {
0 1
Cl  -1.0833   -0.2140    0.0000  
O   -0.3456    1.2535    0.0000  
O    1.0833    1.2535    0.0000  
N    1.0362   -0.4689    0.0000  
N   -0.0436   -1.2535    0.0000  
N    0.7813   -1.2535    0.0000  
C    0.3688    0.0160    0.0000  
C   -0.2986   -0.4689    0.0000  
C    0.3688    0.8410    0.0000  

units angstrom
no_com
no_reorient
symmetry c1
}

set basis 6-311G(d,p)
set opt_type min
geometric_keywords = {
  'coordsys' : 'tric',
  'convergence_set' : 'GAU_LOOSE',
  'convergence_energy' : 1e-4,
}
optimize('mp2', engine='geometric', optimizer_keywords=geometric_keywords)
@JonathonMisiewicz
Copy link
Contributor

A PR would be perfect, thanks!

@q-posev
Copy link
Contributor Author

q-posev commented Feb 7, 2023

@JonathonMisiewicz Done!

@q-posev
Copy link
Contributor Author

q-posev commented Feb 10, 2023

Just a note that this bug actually affects all atoms that have 2 letters, not only Cl, making the current Psi4/geometric interface functional only for single-letter atoms.

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.

2 participants