hoomd.hpmc.nec.integrate

Overview

ConvexPolyhedron

HPMC integration for convex polyhedra (3D) with nec.

HPMCNECIntegrator

HPMC Chain Integrator base class.

Sphere

HPMC chain integration for spheres (2D/3D).

Details

Newtonain Event-Chain Integrators for Hard Particle Monte Carlo.

class hoomd.hpmc.nec.integrate.ConvexPolyhedron(default_d=0.1, default_a=0.1, chain_probability=0.5, chain_time=0.5, update_fraction=0.5, nselect=1)

Bases: HPMCNECIntegrator

HPMC integration for convex polyhedra (3D) with nec.

Parameters
  • default_d (float, optional) – Default colission search distance \([\mathrm{length}]\), defaults to 0.1.

  • default_a (float, optional) – Default maximum size of rotation trial moves \([\mathrm{dimensionless}]\), defaults to 0.1.

  • chain_probability (float, optional) – Probability of making a chain move instead of a rotation move, defaults to 0.5.

  • chain_time (float, optional) – Length of a chain \([\mathrm{time}]\), defaults to 0.5.

  • update_fraction (float, optional) – Number of chains to be done as fraction of N, defaults to 0.5.

  • nselect (int, optional) – Number of repeated updates for the cell/system, defaults to 1.

Perform Newtonian event chain Monte Carlo integration of convex polyhedra.

Wall support.

ConvexPolyhedron supports no hoomd.wall geometries.

Potential support.

ConvexPolyhedron does not support pair_potential or external_potential.

Attention

ConvexPolyhedron does not support execution on GPUs.

Attention

ConvexPolyhedron does not support MPI parallel simulations.

Example:

mc = hoomd.hpmc.nec.integrate.ConvexPolyhedron(d=1.0, a=0.05,
    chain_probability=0.1, nselect=10)
mc.shape['A'] = dict(vertices=[[1,1,1], [1,1,-1], [1,-1,1], [1,-1,-1],
    [-1,1,1], [-1,1,-1], [-1,-1,1], [-1,-1,-1]])
chain_probability

Probability of making a chain move instead of a rotation move.

Type

float

chain_time

Length of a chain \([\mathrm{time}]\).

Type

float

update_fraction

Number of chains to be done as fraction of N.

Type

float

shape

The shape parameters for each particle type. The dictionary has the following keys.

  • vertices (list [tuple [float, float, float]], required) - vertices of the polyhedron \([\mathrm{length}]\).

    • The origin MUST be contained within the polyhedron.

    • The origin centered sphere that encloses all vertices should be of minimal size for optimal performance.

  • ignore_statistics (bool, default: False) - set to True to ignore tracked statistics.

  • sweep_radius (float, default: 0.0) - Ignored, but present because ConvexPolyhedron shares data structures with ConvexSpheropolyhedron \([\mathrm{length}]\).

Warning

HPMC does not check that all vertex requirements are met. Undefined behavior will result when they are violated.

Type

TypeParameter [particle type, dict]

property type_shapes

Description of shapes in type_shapes format.

Example

>>> mc.type_shapes()
[{'type': 'ConvexPolyhedron', 'sweep_radius': 0,
  'vertices': [[0.5, 0.5, 0.5], [0.5, -0.5, -0.5],
               [-0.5, 0.5, -0.5], [-0.5, -0.5, 0.5]]}]

(Loggable: category=”object”)

Type

list[dict]

class hoomd.hpmc.nec.integrate.HPMCNECIntegrator(default_d=0.1, default_a=0.1, chain_probability=0.5, chain_time=0.5, update_fraction=0.5, nselect=1)

Bases: HPMCIntegrator

HPMC Chain Integrator base class.

HPMCNECIntegrator is the base class for all HPMC Newtonian event chain integrators. The attributes documented here are available to all HPMC integrators.

Warning

This class should not be instantiated by users. The class can be used for isinstance or issubclass checks.

property chains_in_space

rate of chain events that did neither collide nor end.

Note

The statistics are reset at every hoomd.Simulation.run.

(Loggable: category=”scalar”)

Type

float

property nec_counters

Trial move counters.

The counter object has the following attributes:

  • chain_start_count: int Number of chains

  • chain_at_collision_count: int Number of collisions

  • chain_no_collision_count: int Number of chain events that are no collision (i.e. no collision partner found or end of chain)

  • distance_queries: int Number of sweep distances calculated

  • overlap_errors: int Number of errors during sweep calculations

Note

The counts are reset to 0 at the start of each hoomd.Simulation.run.

property particles_per_chain

particles per chain.

Note

The statistics are reset at every hoomd.Simulation.run.

(Loggable: category=”scalar”)

Type

float

property virial_pressure

virial pressure.

Note

The statistics are reset at every timestep.

(Loggable: category=”scalar”)

Type

float

class hoomd.hpmc.nec.integrate.Sphere(default_d=0.1, chain_time=0.5, update_fraction=0.5, nselect=1)

Bases: HPMCNECIntegrator

HPMC chain integration for spheres (2D/3D).

Parameters
  • default_d (float, optional) – Default colission search distance \([\mathrm{length}]\), defaults to 0.1.

  • chain_time (float, optional) – Length of a chain \([\mathrm{time}]\), defaults to 0.5.

  • update_fraction (float, optional) – Number of chains to be done as fraction of N, defaults to 0.5.

  • nselect (int, optional) – The number of repeated updates to perform in each cell, defaults to 1.

Perform Newtonian event chain Monte Carlo integration of spheres.

Wall support.

Sphere supports no hoomd.wall geometries.

Potential support.

Sphere does not support pair_potential or external_potential.

Attention

Sphere does not support execution on GPUs.

Attention

Sphere does not support MPI parallel simulations.

Example:

mc = hoomd.hpmc.integrate.nec.Sphere(d=0.05, update_fraction=0.05)
mc.chain_time = 0.05
chain_time

Length of a chain \([\mathrm{time}]\).

Type

float

update_fraction

Number of chains to be done as fraction of N.

Type

float

shape

The shape parameters for each particle type. The dictionary has the following keys:

  • diameter (float, required) - Sphere diameter \([\mathrm{length}]\).

  • ignore_statistics (bool, default: False) - set to True to ignore tracked statistics.

  • orientable (bool, default: False) - set to True to allow rotation moves on this particle type.

Type

TypeParameter [particle type, dict]

property type_shapes

Description of shapes in type_shapes format.

Examples

The types will be ‘Sphere’ regardless of dimensionality.

>>> mc.type_shapes
[{'type': 'Sphere', 'diameter': 1},
 {'type': 'Sphere', 'diameter': 2}]

(Loggable: category=”object”)

Type

list[dict]