-
Notifications
You must be signed in to change notification settings - Fork 85
[WIP] Added bitwise-reversible velocity Verlet integrator #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… to off to enable bitwise-reversible tests.
There is more information on how to implement this correctly in a patent filing from DESRES: I'll digest this and take another stab at this soon. |
I tried to implement the scheme from the DESRES patent, but the rounding applied to the position kick in this line doesn't seem to give me bitwise-reversibility. Only my scheme with the precision-degraded timestep and no rounding on the position update seems to work, though I am still worried that this scheme will continue to accumulate significant bits of precision each timestep and quickly overwhelm even double precision position and velocity accumulators. I suspect this might be due to the use of |
I am not a lawyer, but shouldn't we be avoiding this patent with a 10 foot pole? I thought even reading the patent puts us at risk of a civil lawsuit where they claim we are using patented technology without a license. Our lawyer friend @rmcgibbo might have some insight on the matter. The extent of my knowledge is from quora: http://www.quora.com/Is-it-illegal-to-implement-a-patented-algorithm |
I realize that the "clean room" stuff is more for copyright infringement, but still AFAIK we can't implement and distribute their patented algorithm. |
|
Amusingly, the patent contains so many typos that it nowhere describes a valid scheme. I wonder if that was intentional. Technically speaking, we cannot actually implement the scheme described in the patent. |
Sounds good. Sometimes it's better to be safe than sorry with these things, if only as a way to avoid having to deal with legal headaches / timesinks. |
Fair enough. To be clear:
|
Maybe we should patent the correct algorithm so they need to license it from us to run Desmond... |
… minimized starting conditions. Increased number of steps for test.
The issue is the amount of time and money required in order to fight the I would argue that in most cases, a bitwise reversible integrator isn't |
My suspicion is that it is necessary to make Metropolized integration work correctly for these single-precision GPU-based force calculations. Just working toward testing that hypothesis right now. |
…e-integrator Conflicts: openmmtools/integrators.py openmmtools/testsystems.py
…e-integrator Conflicts: openmmtools/testsystems.py
…penmmtools into bitwise-reversible-integrator
…penmmtools into bitwise-reversible-integrator
I've added a draft of a bitwise-reversible velocity Verlet integrator along with a battery of tests to make sure that the positions end up back where they started after 10 steps of integration, velocity reversal, and 10 steps of integration.
Using the integrator looks like this:
There is control over two kinds of precision:
The quantity
precision_nbits
is the number of bits of precision retained in the quantity0.5*dt*f/m
accumulated in the velocity of velocity Verlet. This is done crudely via the truncationwhere
scale = 2**precision_nbits
, which means that quantities smaller than2**-precision_nbits
in natural OpenMM velocity units (9.5e-7 nm/ps
in this example) are lost. Note that this transformation does not really retainprecision_nbits
bits in the mantissa, and is more appropriate to fixed-point or integer arithmetic.The quantity
timestep_precision_nbits
is used to round the specified timestep to retain only this number of bits in the floating-point mantissa. If you want a timestep of 1 fs, for example, the best representation with 5 bits of mantissa precision (~0.000977 ps) will be retained. This is done so that the position update step of velocity Verletwill not accumulate too many bits of precision during integration.
Note that this scheme is not ideal, as I fear it is possible to accumulate
timestep_precision_nbits
bits of precision in the positions and velocities each timestep. Even with double precision accumulation, this could quickly overwhelm the number of available bits of precision. I'm working on finding a way to rework the velocity-explicit velocity Verlet scheme to avoid this issue.There are some limitations on what kinds of systems and platforms are supported:
mixed
anddouble
) are supported