coltonbh / qcio

A package for structured Quantum Chemistry data.
MIT License
4 stars 2 forks source link

Suggested Parsing / Feature Additions #65

Open hotmeme opened 1 month ago

hotmeme commented 1 month ago

1. GeomeTRIC Max Iteration Exception

GeomeTRIC sometimes fails to optimize structures (in my case, a transition state) because it hits the maximum number of optimization frames (maxiter gets exceeded). In the event this happens, it throws the following exception, which is not super helpful:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/qcop/adapters/geometric.py", line 109, in compute_results
    optimizer.optimizeGeometry()
  File "/opt/conda/lib/python3.11/site-packages/geometric/optimize.py", line 704, in optimizeGeometry
    raise GeomOptNotConvergedError("Optimizer.optimizeGeometry() failed to converge.")
geometric.errors.GeomOptNotConvergedError: Optimizer.optimizeGeometry() failed to converge.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/qcop/adapters/base.py", line 160, in compute
    results, stdout = self.compute_results(
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/qcop/adapters/geometric.py", line 111, in compute_results
    raise GeometricError() from e
qcop.exceptions.GeometricError: Something went wrong with geomeTRIC. See the traceback above for details.

2. Suggested Values to Parse for and Save

Computational chemists love doing geometry optimizations straight into Hessian calculations. So much so that in programs like Gaussian, a single input file with "opt freq" will perform the optimization and then the "frequency" calculation. At that point, there are a few values we are interested in.

  1. We want to know the number of imaginary frequencies and their values. This tells us if we got a proper minimum or TS, and if the value of the imaginary frequency seems reasonable for the TS we were looking for.
  2. We want to know the Gibbs free energy corrected energy (contains the SCF energy with the Gibbs correction). That way we can just pull this value and compare it to the GFE of other structures.

You could pull just the imaginary frequencies and count them. Or you could have an object that just lists all of the frequencies. Then people could check the first few to see the imaginary freqs.
Both would be useful. Just depends how you want to play it.

3. Suggested features for your visualizers

Create a scrubber for the optimization frames. Add text at the bottom that says frame XX/YYY. That way we know what frame we are looking at, and we can look at specific frames of interest from the energy plot. There is another thing that would make this way better, but it would be a little annoying to do in a way that lets it load quickly. If you scrub the scrubber to frame 30, the 30th dot on the plot of energy vs. optimization frame should be highlighted (maybe change its color to bright orange or something). Then you can very clearly see through the energy plot and the visualization exactly what frame you are looking at geometrically and how the energy of it compares to those surrounding it.

And finally, one more suggestion that would be so epic, but surely the most laborious to implement. The visualizer could interact with the normal modes of that final frequency calculation.
It would be awesome if you could see a list of the frequencies, click on any one of them, and then watch the animation of the molecule vibrating in accordance with the corresponding normal vibrational mode.
This information comes from the same area of the output: it prints the cartesian displacements of each atom that make it vibrate like that respective normal mode.
But you would have to build the whole interactivity around people clicking the frequency they want, and then you creating the animation that displaces the atoms accordingly.
Take it or leave it, but this is definitely something people would use.
Extremely useful for visualizing vibrational modes and seeing the character of the transition state you converged to.
Tells us which minima are probably connected by the TS we found. Helps us eliminate unwanted imaginary frequencies when they pop up in any optimization.

Okay, that's all. Thanks!