Git Product home page Git Product logo

Comments (6)

leeping avatar leeping commented on August 17, 2024

Hi there,

The gradients of thermodynamic properties are determined in npt.py. After the simulation is finished, ForceBalance writes out a parameter file with perturbed parameters (i.e. one of the mvals is changed by finite_difference_h) and recalculates the potential for every simulation snapshot, thus getting the energy derivative by finite difference (i.e. dE/dp = [E(p+h)-E(p)]/h. dE/dp is then contracted with the property to get the derivative, like this: d(rho)/dp = -Beta*[<dE/dp rho> - <dE/dp>*<rho.> ].

The main point here is that ForceBalance is mostly agnostic to the physical meaning of the parameter. If changing the parameter affects the potential energy, then ForceBalance should be able to calculate a property derivative from that. I would start troubleshooting by testing whether changing the c6, c8, c10, c12 parameters in the force field file actually affects the energies of your water box. It's possible these parameters are not being used in the simulation for example.

Thanks,

  • Lee-Ping

from forcebalance.

mohebifar avatar mohebifar commented on August 17, 2024

Thank you very much for your prompt response and the great explanation.

I tried printing out the energy derivatives in npt.py and I obviously got 0.0, however, by printing out the positions from the State, I noticed this all belongs to the gas phase which in my case, it totally makes sense for C12 not to make any effect on the potential energy of the system. C12 is basically for the repulsive term in LJ (C12/r12) and since Hydrogen's C12 is set to 0 and there is only one Oxygen in the gas system, it wouldn't have any effect on the energy. Is there a way to tell ForceBalance to use the liquid phase for energy derivatives?

from forcebalance.

leeping avatar leeping commented on August 17, 2024

from forcebalance.

leeping avatar leeping commented on August 17, 2024

from forcebalance.

mohebifar avatar mohebifar commented on August 17, 2024

Thank you very much for your response.

My assumption about the issue with writing the XML file was invalid. The variable name was a bit misleading, it's actually the position of the XML element in the Tree not the "line number" which should be consistent for any XML formatting.

Finally, I figured it out. I had not implemented the copyParametersToContext method properly in my OpenMM code, hence it wasn't able to update the parameters. I'm still surprised that initializing parameters in OpenMM happens in a separate routine versus updating them (duplicate code).

from forcebalance.

adw62 avatar adw62 commented on August 17, 2024

Apologies for opening an old issue, I'm also interested in calculating gradients w.r.t force field parameters for thermodynamic integration.

Please may I ask. Does ForceBalance still calculate the gradient as described here?

Would the getEnergyParameterDerivatives function in OpenMM work for this purpose or are there disadvantages to this?

I would be interested in any input on this.

Thanks,
Alex

from forcebalance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.