Code Monkey home page Code Monkey logo

hoomd-mimse's Introduction

hoomd-mimse

Usage

# setup simulation

# Setup FIRE sim with Mimse force
fire = hoomd.md.minimize.FIRE(1e-2, 1e-7, 1.0, 1e-7)

nve = hoomd.md.methods.ConstantVolume(filter=hoomd.filter.All())
mimse_force = mimse.Mimse(1.0, 1.0)
fire.forces.append(mimse_force)
# create and append any additional forces 

fire.methods.append(nve)
sim.operations.integrator = fire

# run fire until converged
while not fire.converged:
    sim.run(1000)

# then perform MIMSE protocol for some number of iterations
n_iter = 10

for _ in range(n_iter):
    # place new bias and kick the system in some direction
    bias_pos = sim.state.get_snapshot().particles.position
    mimse_force.push_back(bias_pos)
    mimse_force.random_kick(0.1)

    # now converge to minima
    fire.reset()
    while not fire.converged:
        sim.run(1000)

Development

Dependencies

  • HOOMD-blue >= 4.6.0
  • CUDA >= 12.0

Setup

First, setup a python environment with conda (or some alternative, I like micromamba). Follow the instructions in extern/README.md to create a python environment with the correct dependencies and install hoomd. You may need to install ninja using your package manager, or through some python environment (system or dev environment). We use ninja since it allows for easy incremental builds.

Build-loop

Now to build the project, ensure the python environment is activated and run the following commands:

./config-misme.sh
./build-mimse.sh
./install-mimse.sh

This will build the project and install it into the python environment. If you make changes to the source code, you can run the build and install scripts again.

Do not run ./config-mimse.sh again unless you want to start the build process againfrom scratch! This would only be necessary if you want to change cmake variables!

./build-mimse.sh && ./install-mimse.sh

Testing

With any recent changes built and installed to the development environment, you can run pytest on the mimse source folder

pytest mimse

Benchmarking

python3 -m benchmarks.mimse_lj --device GPU

Caveats ๐Ÿšง๐Ÿ‘ท

At the moment, this project absolutely does not work with MPI, and WILL GIVE WRONG RESULTS!

hoomd-mimse's People

Contributors

ianrgraham avatar conor-luppnow avatar

Watchers

 avatar Kostas Georgiou avatar  avatar

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.