HOOMD-blue¶
HOOMD-blue is a Python package that runs simulations of particle systems on CPUs and GPUs. It performs hard particle Monte Carlo simulations of a variety of shape classes and molecular dynamics simulations of particles with a range of pair, bond, angle, and other potentials. Many features are targeted at the soft matter research community, though the code is general and capable of many types of particle simulations.
Resources¶
GitHub Repository: Source code and issue tracker.
Citing HOOMD-blue: How to cite the code.
Installation guide: Instructions for installing HOOMD-blue binaries.
Compilation guide: Instructions for compiling HOOMD-blue.
hoomd-users mailing list: Send messages to the HOOMD-blue user community.
HOOMD-blue website: Additional information and publications.
HOOMD-blue benchmark scripts: Scripts to evaluate the performance of HOOMD-blue simulations.
HOOMD-blue validation tests: Scripts to validate that HOOMD-blue performs accurate simulations.
Example scripts¶
These examples demonstrate some of the Python API.
Hard particle Monte Carlo:
import hoomd
mc = hoomd.hpmc.integrate.ConvexPolyhedron()
mc.shape['octahedron'] = dict(vertices=[
(-0.5, 0, 0),
(0.5, 0, 0),
(0, -0.5, 0),
(0, 0.5, 0),
(0, 0, -0.5),
(0, 0, 0.5),
])
cpu = hoomd.device.CPU()
sim = hoomd.Simulation(device=cpu, seed=20)
sim.operations.integrator = mc
# The tutorial describes how to construct an initial configuration 'init.gsd'.
sim.create_state_from_gsd(filename='init.gsd')
sim.run(1e5)
Molecular dynamics:
import hoomd
cell = hoomd.md.nlist.Cell()
lj = hoomd.md.pair.LJ(nlist=cell)
lj.params[('A', 'A')] = dict(epsilon=1, sigma=1)
lj.r_cut[('A', 'A')] = 2.5
integrator = hoomd.md.Integrator(dt=0.005)
integrator.forces.append(lj)
nvt = hoomd.md.methods.NVT(kT=1.5, filter=hoomd.filter.All(), tau=1.0)
integrator.methods.append(nvt)
gpu = hoomd.device.GPU()
sim = hoomd.Simulation(device=gpu)
sim.operations.integrator = integrator
# The tutorial describes how to construct an initial configuration 'init.gsd'.
sim.create_state_from_gsd(filename='init.gsd')
sim.state.thermalize_particle_momenta(filter=hoomd.filter.All(), kT=1.5)
sim.run(1e5)
Getting started
Tutorials
How to guides
Python API
- hoomd
Box
Operations
Operations.__contains__()
Operations.__getstate__()
Operations.__iadd__()
Operations.__isub__()
Operations.__iter__()
Operations.__len__()
Operations.add()
Operations.computes
Operations.integrator
Operations.is_tuning_complete
Operations.remove()
Operations.tune_kernel_parameters()
Operations.tuners
Operations.updaters
Operations.writers
Simulation
Simulation.always_compute_pressure
Simulation.create_state_from_gsd()
Simulation.create_state_from_snapshot()
Simulation.device
Simulation.final_timestep
Simulation.initial_timestep
Simulation.loggables
Simulation.operations
Simulation.run()
Simulation.seed
Simulation.state
Simulation.timestep
Simulation.tps
Simulation.walltime
Snapshot
State
State.N_angles
State.N_bonds
State.N_constraints
State.N_dihedrals
State.N_impropers
State.N_particles
State.N_special_pairs
State.angle_types
State.bond_types
State.box
State.cpu_local_snapshot
State.dihedral_types
State.domain_decomposition
State.domain_decomposition_split_fractions
State.get_snapshot()
State.gpu_local_snapshot
State.improper_types
State.particle_types
State.replicate()
State.set_box()
State.set_snapshot()
State.special_pair_types
State.thermalize_particle_momenta()
State.types
State.update_group_dof()
- hoomd.box
- hoomd.communicator
- hoomd.custom
- hoomd.data
- hoomd.device
- hoomd.error
- hoomd.filter
- hoomd.logging
- hoomd.mesh
- hoomd.operation
- hoomd.trigger
- hoomd.tune
- hoomd.update
- hoomd.variant
- hoomd.version
- hoomd.wall
- hoomd.write
- hoomd.hpmc
- hoomd.md
Developer guide