Code Monkey home page Code Monkey logo

Comments (5)

jchodera avatar jchodera commented on June 16, 2024

As we discussed yesterday, we could also make this more efficient by recoding all forces as CustomForce classes and allowing atom contributions to be turned on one at a time. @pgrinaway would need to preenumerate the order in which atoms (or sets of atoms) should be turned on---not sure how hard this is. A Context parameter would then control how atom contributions are turned on.

Even more interesting could be to also make these additional atomic interactions alchemically switched on between integral values of this context parameter. This would be reasonably straightforward.

from perses.

pgrinaway avatar pgrinaway commented on June 16, 2024

Thanks!

Preenumeration is actually fairly straightforward--GeometryEngine v1 (in the attic) does that in an effort to reduce code duplication.

A major advantage (in addition to speedup) that I could imagine from the CustomForce approach is that it might actually be cleaner than the alternative approach.

Even more interesting could be to also make these additional atomic interactions alchemically switched on between integral values of this context parameter.

In this case, can we also get a two for one deal by using the same alchemically-modified system in the geometry proposal as we do in NCMC?

from perses.

jchodera avatar jchodera commented on June 16, 2024

In this case, can we also get a two for one deal by using the same alchemically-modified system in the geometry proposal as we do in NCMC?

That was my thinking.

I'm happy to code this up if you want to propose what the API should look like to fit in with the rest of perses. I have plenty of code I could borrow from to cobble this together.

from perses.

pgrinaway avatar pgrinaway commented on June 16, 2024

Hm, I'm not sure what the easiest way to do this would be (as I have a lot less experience with manipulating these custom forces than you do), but would giving each new atom a context parameter lambda_idx be a viable option? This would make the interface for perses look something like this:

#not sure if we want to use the AlchemicalEliminationEngine idea or something else
alchemical_system = AlchemicalEngine.create_system(unmodified_system, new_atoms, atom_proposal_order)

Then inside the GeometryEngine:

context = openmm.Context(alchemical_system, integrator, platform)
for atom_idx in atom_proposal_order:
    context.setParameter('lambda_%d' % atom_idx, 1.0)
    #do geometry stuff

Is achieving something like this reasonable? Or would this require adding a ridiculous amount of CustomForces?

I'm not sure how we'd combine that with the NCMC parts (maybe that would be too confusing with too many global variables), but at least for the geometry bits it would be easy.

from perses.

pgrinaway avatar pgrinaway commented on June 16, 2024

Done in #114

from perses.

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.