Cannot generate internal coordinates for geometry optimization

Hi! I am trying to run a geometry optimization on a polymer chain, however as soon as I add functional groups to the side chains on the polymer I am getting the error “Wrong Number of Internal Coordinates” when attempting to generate delocalized coordinates. I have already redrawn the structure multiple times to make sure it is not just me missing any atoms or bonds in the structure but that did not help and everything is fine when I am running just the polymer backbone with unfunctionalized side chains.

This is my input file:

0 1
C -27.9255856 -6.4590273 -0.2720646
C -29.5164874 -7.6743296 -0.8033325

H -88.3343560 -42.7033274 -6.2514485
H -86.7328517 -43.7286632 -7.7138279

GUI = 2
JOB_TYPE = Optimization
MEM_TOTAL = 56000

And this is the error in my output file:

Energy is ****************

Attempting to generate delocalized coordinates

ERROR Wrong Number of Internal Coordinates
Should be: *** Found: ***
WARNING Problems with Internal Coordinates
Switching to Cartesian Coordinates

Translations and Rotations Projected Out of Hessian

Thanks in advance for any help!!

@aschmitt can you either post the full input file here or email it to

In addition what version of Q-Chem are you using?

I just emailed you the full input file!

@aschmitt I received your input file, thank you. Can you tell me which version of Q-Chem you are using so I can investigate this issue?

Of course, I totally forgot to include that information, sorry about that! I am using qchem 5.3.2 (the module on our computational cluster is qchem-openmp/5.3.2)

I was able to reproduce this issue with Q-Chem 5.3.2. I took a look at your structure and my best guess is the connections between the monomers are near linear (180 degrees) and the topology generation doesn’t replace them appropriately. Probably due to a less than ideal starting structure.

If you can use Q-Chem 6.0 we have a new geometry optimization driver LIBOPT3 which has a different topology generator and would not run into this problem.

If you don’t have access to Q-Chem 6.0 my suggestion is to use cartesian optimization GEOM_OPT_COORDS = 0 for a few cycles, then take this structure and start the job over to use delocalized coordinates. The thought is to move away from the initial structure and have the topology generator make a different topology that will avoid this error.

Thank you so much for looking into this issue, I truly appreciate it! I just checked on our cluster and unfortunately we do not have Q-Chem 6.0 yet but I will give the cartesian optimization a try. In order to do that I would add the GEOM_OPT_COORDS = 0 line in my input file in between $rem and $end but otherwise keep the input file the same right?
Sorry if this is an obvious question, I just want to make sure I am understanding correctly and again thank you for your help!

That is right, but I would do like only 5~10 cycles. Then start the job over with the lowest energy structure from the quick cartesian optimization job. The goal of the Cartesian optimization is to just create a better initial structure, not find the minimum.

Got it, thank you for the clarification! I just ran it with the Cartesian coordinates for 10 cycles but since I still had SCF_CONVERGENCE = 6 as the conversion criteria I understandibly didn’t reach that and got this error message in my output file:

SCF converges when DIIS error is below 1.0e-06

Cycle Energy DIIS error

1 -669425.3554939281      8.60e-03  
2 -669403.3594569888      1.16e-03  
3 -669166.8045815306      1.54e-03  
4 -658250.6564718827      4.43e-03  
5 -669217.3748446500      1.34e-03  
6 -668807.7705422167      2.02e-03  
7 -669422.1859777810      5.42e-04  
8 -669423.4240907889      5.24e-04  
9 -669423.4484878446      4.98e-04  

10 -669434.8012870399 2.70e-04
gen_scfman_exception: SCF failed to converge

Q-Chem fatal error occurred in module libgscf/gen_scfman/gen_scfman_main.C, line 223:

Error in gen_scfman

If I am correct I don’t really have to worry about that because in the .fchk file I should still have the optimized geometry from the 10th cycle that I can use as the starting point for the optimiuation without the GEOM_OPT_COORDS = 0 line, right?

Yes, or the Q-Chem output file will also have the previous geometry.

Peter’s solution (run a few steps in Cartesians) is probably easier, but I am also reminded that it’s possible to specify connectivity data in the $opt section,

Sorry for the late response, I was waiting for the calculation starting from the optimized cartesian coordinates to be done, which it finally is but in the output file I am still seeing the same error message regarding the generation of the delocalized internal coordinates.
I was looking into specifying connectivity dara in the $opt section too but given that these polymer chains have 2165 atoms, unfortunately I don’t think it’s viable to specify all their connectivities individually.

Ok another thing you can try is to use GEOM_OPT_LINEAR_ANGLE which is the threshold used in the old optimizer for detecting near linear angles. The default value is 165, so I suggest looking at one of the near linear angles that is linking the monomers and set this value to remove these troublesome angles. This should enable to topology generator to redefine these from angles to co-linear angles. Hopefully this resolves some of the issues.

Thank you for the suggestion! Would I be adding GEOM_OPT_LINEAR_ANGLE = xxx to my input file with xxx being the actual value for the angles of the bonds connecting my monomers on the backbone?
Because I am not exactly sure how I would determine those angles from the structure. I also ran the same backbone structure with the same angles linking the monomers for the unfunctionalized polymer side chains before and that optimization didn’t give me an error for determining the internal coordinates but I am not sure if that necessarily means the angles aren’t the problem.
Thank you again for all your help!

In IQMol you can load your structure and highlight the atoms to calculate the torsion. But what happens is any angle below that threshold will be considered a linear angle. If finding its exact angle is a problem then just change the value to something reasonable like 145 or so.