Shape

class hoomd.hpmc.update.Shape(trigger, shape_move, pretend=False, type_select=1, nsweeps=1)

Bases: Updater

Apply shape updates to the shape definitions defined in the integrator.

See also

hoomd.hpmc.shape_move describes the shape alchemy algorithm.

Parameters:
  • trigger (hoomd.trigger.trigger_like) – Call the updater on triggered time steps.

  • shape_move (ShapeMove) – Type of shape move to apply when updating shape definitions

  • pretend (bool, optional) – When True the updater will not actually update the shape definitions. Instead, moves will be proposed and the acceptance statistics will be updated correctly (default: False).

  • type_select (int, optional) – Number of types to change every time the updater is called (default: 1).

  • nsweeps (int, optional) – Number of times to update shape definitions during each triggered timesteps (default: 1).

Shape support.

See hoomd.hpmc.shape_move for supported shapes.

Example:

mc = hoomd.hpmc.integrate.ConvexPolyhedron()
mc.shape["A"] = dict(
    vertices=numpy.asarray(
        [
            (1, 1, 1),
            (-1, -1, 1),
            (1, -1, -1),
            (-1, 1, -1),
        ]
    )
)
vertex_move = hoomd.hpmc.shape_move.Vertex(
    stepsize={"A": 0.01}, param_ratio=0.2, volume=1.0
)
updater = hoomd.hpmc.update.Shape(
    shape_move=vertex_move,
    trigger=hoomd.trigger.Periodic(1),
    type_select=1,
    nsweeps=1,
)

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members inherited from Integrator:

trigger

The trigger to activate this operation. Read more...


Members defined in Shape:

shape_move

Type of shape move to apply when updating shape definitions

Type:

ShapeMove

pretend

When True the updater will not actually update the shape definitions, instead moves will be proposed and the acceptance statistics will be updated correctly.

Type:

bool

type_select

Number of types to change every time the updater is called.

Type:

int

nsweeps

Number of times to update shape definitions during each triggered timesteps.

Type:

int

property particle_volumes

Volume of a single particle for each type.

(Loggable: category=”scalar”)

Type:

list[float]

property shape_move_energy

Energy penalty due to shape changes.

(Loggable: category=”scalar”)

Type:

float

property shape_moves

Count of the accepted and rejected shape moves.

(Loggable: category=”sequence”)

Type:

tuple[int, int]