- Maryland has a clear mission – to stop deaths and injuries on our roads. Many steps have been taken toward meeting this goal, but there are still challenges. Reaching our goal of zero deaths and injuries means working together with partners as well as the public.
- — There are two questions up for a vote on in the Maryland state election. 'Question 1' deals with redistributing budgeting power within the state and the other authorizes sports.
- Files for jax-md, version 0.1.6; Filename, size File type Python version Upload date Hashes; Filename, size jaxmd-0.1.6-py2.py3-none-any.whl (52.1 kB) File type Wheel Python version py2.py3 Upload date Jun 11, 2020 Hashes View.
Combining automated deployment, instant hosting & collaborative editing, Glitch gets you straight to coding so you can build full-stack web apps, fast.
The new European data protection law requires us to inform you of the following before you use our website:
Para 1 0 1 1
We use cookies and other technologies to customize your experience, perform analytics and deliver personalized advertising on our sites, apps and newsletters and across the Internet based on your interests. By clicking 'I agree' below, you consent to the use by us and our third-party partners of cookies and data gathered from your use of our platforms. See our Privacy Policy and Third Party Partners to learn more about the use of data and your rights. You also agree to our Terms of Service.
Latest versionReleased: Screens 4 6 6 – access your computer remotely working.
Differentiable, Hardware Accelerated, Molecular Dynamics
Project description
Accelerated, Differentiable, Molecular Dynamics
Quickstart| Reference docs
Molecular dynamics is a workhorse of modern computational condensed matterphysics. It is frequently used to simulate materials to observe how small scaleinteractions can give rise to complex large-scale phenomenology. Most moleculardynamics packages (e.g. HOOMD Blue or LAMMPS) are complicated, specializedpieces of code that are many thousands of lines long. They typically involvesignificant code duplication to allow for running simulations on CPU and GPU.Additionally, large amounts of code is often devoted to taking derivativesof quantities to compute functions of interest (e.g. gradients of energiesto compute forces).
However, recent work in machine learning has led to significant softwaredevelopments that might make it possible to write more concisemolecular dynamics simulations that offer a range of benefits. Here we targetJAX, which allows us to write python code that gets compiled to XLA and allowsus to run on CPU, GPU, or TPU. Moreover, JAX allows us to take derivatives ofpython code. Thus, not only is this molecular dynamics simulation automaticallyhardware accelerated, it is also end-to-end differentiable. This shouldallow for some interesting experiments that we're excited to explore.
JAX, MD is a research project that is currently under development. Expectsharp edges and possibly some API breaking changes as we continue to supporta broader set of simulations. JAX MD is a functional and data driven library. Data is stored in arrays or tuples of arrays and functions transform data from one state to another.
Getting Started
To get started playing around with JAX MD check out the following colab notebooks on Google Cloud without needing to install anything. For a very simple introduction, I would recommend the Minimization example. For an example of a bunch of the features of JAX MD, check out the JAX MD cookbook.
You can install JAX MD locally with pip,
If you want to build the latest version then you can grab the most recent version from head,
We now summarize the main components of the library.
Spaces (space.py
)
In general we must have a way of computing the pairwise distance between atoms.We must also have efficient strategies for moving atoms in some space that mayor may not be globally isomorphic to R^N. For example, periodic boundaryconditions are commonplace in simulations and must be respected. Spaces are defined as a pair of functions, (displacement_fn, shift_fn)
. Given two points displacement_fn(R_1, R_2)
computes the displacement vector between the two points. If you would like to compute displacement vectors between all pairs of points in a given (N, dim)
matrix the function space.map_product
appropriately vectorizes displacement_fn
. It is often useful to define a metric instead of a displcement function in which case you can use the helper function space.metric
to convert a displacement function to a metric function. Given a point and a shift shift_fn(R, dR)
displaces the point R
by an amount dR
.
The following spaces are currently supported: Opera 63 0 3368 66 rd.
space.free()
specifies a space with free boundary conditions.space.periodic(box_size)
specifies a space with periodic boundary conditions of side lengthbox_size
.space.periodic_general(T)
specifies a space as a periodic parellelopiped formed by transforming the unit cube by an affine transformationT
. Note thatT
can be a time dependent functionT(t)
that is useful for simulating systems under strain.
Example:
Potential Energy (energy.py
)
In the simplest case, molecular dynamics calculations are often based on a pairpotential that is defined by a user. This then is used to compute a total energywhose negative gradient gives forces. One of the very nice things about JAX isthat we get forces for free! The second part of the code is devoted to computingenergies.
We provide the following classical potentials:
energy.soft_sphere
a soft sphere whose energy incrases as the overlap of the spheres to some power,alpha
.energy.lennard_jones
a standard 12-6 lennard-jones potential.energy.morse
a morse potential.energy.eam
embedded atom model potential with ability to load parameters from LAMMPS files.
We also provide the following neural network potentials:
energy.behler_parrinello
a widely used fixed-feature neural network architecture for molecular systems.energy.graph_network
a deep graph neural network designed for energy fitting.
For finite-ranged potentials it is often useful to consider only interactions within a certain neighborhood. We include the _neighbor_list
modifier to the above potentials that uses a list of neighbors (see below) for optimization.
Example:
Dynamics (simulate.py
, minimize.py
)
Given an energy function and a system, there are a number of dynamics are usefulto simulate. The simulation code is based on the structure of the optimizersfound in JAX. In particular, each simulation function returns an initializationfunction and an update function. The initialization function takes a set ofpositions and creates the necessary dynamical state variables. The updatefunction does a single step of dynamics to the dynamical state variables andreturns an updated state.
We include a several different kinds of dynamics. However, there is certainly roomto add more for e.g. constaint strain simulations.
It is often desirable to find an energy minimum of the system. We providetwo methods to do this. We provide simple gradient descent minimization. This ismostly for pedagogical purposes, since it often performs poorly. We additionallyinclude the FIRE algorithm which often sees significantly faster convergence. Moreover a common experiment to run in the context of molecular dynamics is to simulate a system with a fixed volume and temperature.
We provide the following dynamics:
simulate.nve
Constant energy simulation; numerically integrates Newton's laws directly.simulate.nvt_nose_hoover
Uses Nose-Hoover chain to simulate a constant temperature system.simulate.nvt_langevin
Simulates a system by numerically integrating the Langevin stochistic differential equation.simulate.brownian
Simulates brownian motion.minimize.gradient_descent
Mimimizes a system using gradient descent.minimize.fire_descent
Minimizes a system using the fast inertial relaxation engine.
Example:
Spatial Partitioning (partition.py
)
In many applications, it is useful to construct spatial partitions of particles / objects in a simulation.
We provide the following methods:
partition.cell_list
Partitions objects (and metadata) into a grid of cells.partition.neighbor_list
Constructs a set of neighbors within some cutoff distance for each object in a simulation.
Cell List Example:
Neighbor List Example:
JAX MD is under active development. We have very limited development resources and so we typically focus on adding features that will have high impact to researchers using JAX MD (including us). Please don't hesitate to open feature requests to help us guide development. We more than welcome contributions!
Technical gotchas
GPU
You must follow JAX's GPU installation instructions to enable GPU support.
64-bit precision
To enable 64-bit precision, set the respective JAX flag before importing jax_md
(see the JAX guide), for example:
If you use the code in a publication, please cite the repo using the .bib,
Release historyRelease notifications | RSS feed
Md 11046
0.1.8
0.1.7
0.1.6
0.1.5
0.1.3
0.1.2
0.1.1
0.1.0 Submerge 3 1 download free.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size jax_md-0.1.8-py2.py3-none-any.whl (54.1 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes |
Filename, size jax-md-0.1.8.tar.gz (43.7 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for jax_md-0.1.8-py2.py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 803799cbee9dd4366d10e4875fde15dc682eaf3e99abd46488ce57f49b3ad164 |
MD5 | 6c482dde37ed5e8ca983fb441b3e45c9 |
BLAKE2-256 | dec0985530b93390bb3a677f1dcfe56fc3fee9635625d08059c040431983f471 |
Hashes for jax-md-0.1.8.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 970f7b64a2cbbd8e7f7206984c5c0e74bdb9ace2a1203c4f57edfdeabe21ba07 |
MD5 | 1e5ca83d45bd704fcd2ea6815ff135b3 |
BLAKE2-256 | 2e75f51875b8ead6d181029a6b6668b991e90b262f34af52ab3d8db3012d9849 |