Error: maximum number of optimization cycles was reached

Spartan can produce a number of “job failed” messages. The most frequent reason for failure is “maximum number of optimization cycles was reached.” I’ll explain what this message means, why it is so common, and what you can do about it.

What does the message mean? When you ask Spartan to optimize a model’s geometry (this could be an equilibrium geometry or a transition state model), you are asking the software to find a geometry for the model that satisfies a set of numerical conditions. This is achieved by trial-and-error. The software assesses the initial geometry (cycle #1) to see if it is optimal. If the geometry isn’t satisfactory, a new geometry (cycle #2) is generated. The pattern of geometry assessment followed by geometry generation continues until an optimized geometry is reached.

The extra information that you need to appreciate is that Spartan begins its trial-and-error optimization procedure by estimating the number of cycles (geometries) that will need to be generated in order to find an optimal structure. Spartan will not evaluate more geometries than this number (note: it is possible to override this; come see me if you are interested in how to do this). So when you see this error message, all you are learning is that Spartan was unable to finish the optimization within the limits (#cycles) that it had set for itself.

Why is the message so common? “Maximum number of …” isn’t a failure in any real sense. Rather it is a signal from Spartan that the calculation is proving difficult. Spartan is giving you (the human) a chance to notice any progress that has been made and to (perhaps) intervene.

There are many reasons why a calculation might have trouble reaching a desired endpoint, but the most common one is this: the PES is probably flatter than usual. By a “flat PES,” I mean a surface for which changes in one or more coordinates has relatively little effect on the potential energy. A perfectly flat surface has no minimum, no maximum, and no saddle points, but even a relatively flat surface can be hard for Spartan to deal with.

PES tend to be flatter in the region of transition states, i.e., near saddles and there are at least two reasons for this. First, a saddle (unlike a minimum) represents a mixture of curvatures, positive and negative. Second, a transition state normally contains some partial bonds and the force constants (curvatures) for these bonds tend to be smaller than the force constants for fully developed bonds. Therefore, you can expect to see this message more often when you try to optimize transition states.

What do I do when I see this message? You have a few choices depending on the status of your current model. Suppose the current model (the one produced by the optimization that reached its maximum number of cycles):

  1. … is in total disarray. Sometimes Spartan takes the beautiful trial geometry that you gave it and blows it to smithereens. Clearly you need to start with a different trial geometry, but it may not be obvious what was wrong with the one that you provided. Consulting a professional is helpful. I’m in Rm. 408.
  2. … looks quite good. Also, the Max Grad. and Max Dist. values in the output are nearly zero. You can use Display: Output to view the history of your optimization. If you were calculating an equilibrium geometry, you will see three columns: Step, Energy, Max Grad., and Max Dist.. If you were calculating a transition state, you will also see an unlabeled column on the right that represents (roughly) the number of negative curvatures (imaginary frequencies) associated with each geometry. Ideally, this number will be 1 for a transition state. If the final cycles of optimization look good, i.e., Max Grad. and Max Dist. are both quite small (<0.01) and there is only one imaginary frequency (in the case of a transition state calculation), consider continuing the calculation from its current geometry without intervening in any way. Just select Setup: Submit.
  3. … looks good, but Max Grad. and Max Dist. values are not heading towards zero. The previous recommendation (#2) is essentially, “just keep going.” This makes sense if you are “nearly there,” but what if you aren’t? What if it looks like Spartan is circling and circling, but not honing in on the target? In this case, a two-step procedure is recommended. First, calculate the curvature of the PES for your current geometry (Setup: Calculations, calculate Energy, and check IR box). Second, restart the optimization (Setup: Calculations, calculate Equilibrium geometry or Transition state). If the PES is really flat, you might need to repeat this two-step procedure several times.