OpenFreeEnergy / cinnabar

Package for consistent reporting of relative free energy results
MIT License
37 stars 13 forks source link

Incorrect solutions obtained when a single node has absolute free energy defined #28

Open jchodera opened 4 years ago

jchodera commented 4 years ago

I'm trying to debug an odd issue in the newest Folding@home Sprint 5 dashboard where absolute compound free energies are coming out too negative.

I've traced the issue back to a peculiar issue: If we feed arsenic 0.1.0 a star map where only the central node has an absolute free energy specified, it comes back with an estimated free energy that is exactly 1.5 times more negative!

Any idea why this might be?

jchodera commented 4 years ago

I'm not quite sure why this is, but if I change this line from

            F[i, i] = df_ij[i, i]**(-2) - np.sum(F[i, :])

to

            F[i, i] = 2*df_ij[i, i]**(-2) - np.sum(F[i, :])

the discrepancy vanishes!

I'm not quite sure how this drops out of the mathematics, though. It's possible (though unlikely) the derivation contains an error, but perhaps we're incorrectly interpreting some symbols?

jchodera commented 4 years ago

Hold up---I may be wrong about this. Let me put together a minimal example and see if this actually reproduces the issue first.