Q2MM / q2mm

Quantum to Molecular Mechanics (Q2MM)
MIT License
24 stars 9 forks source link

Problems when exporting ridiculous parameter values to MM3* force field files #16

Open ericchansen opened 8 years ago

ericchansen commented 8 years ago

Some trial FFs parameter values can get to be absurd when parameter scaling isn't used. Reading and writing of parameters was improved in commit e63d98b4e35c1465bc, but this doesn't go far enough. To directly quote that commit message,

Sometimes unrestricted optimizations techniques generate absurd parameter values. If these values exceed what is allowed in the MM3* FF format (I'm not sure exactly what this is, but I think it's probably 999.9999), then the entire method of reading and writing FFs breaks down.

THIS IS A TEMPORARY FIX. In this commit, I simply prevent absurd values from being written.

Ideally, export_ff should raise an exception when attempting to write rediculous parameter values. This exception should then be handled appropriately in the various sections of the code that call upon export_ff.

peonor commented 8 years ago

Yes, this should be in as an mm3-specific fix. The limit is the F9.4 Fortran formatting, but the values go absurd long before that. This should remain in the file writing for extreme cases, but I would favor some kind of tethering, especially in the initial stages, or if we try to do global fitting of multiple parameter types. We have several possibilities: standard harmonic tethering, which is what we have used before; avoid-zero-tethering, which we have tried; flat-bottom constraints, which would be good but haven't been tried yet; and realted to this, optimization of selected parameters in log-space, which we have discussed but never implemented.

Note that a functioning SVD will do much in avoiding absurd values, if we use only that technique.

ericchansen commented 8 years ago

Let's keep things compartmentalized so we can actually start clearing up the issues. Direct discussion of parameter tethering to issue #18.

Let's keep this one strictly about dealing with times when the code tries to write parameter values that mess up the formatting of MM3* force field files.

Again, I think the key is to have export_ff raise appropriate exceptions, and having the optimization methods handle them reasonably.