hoomd.hpmc.nec.tune

Overview

ChainTime

Tunes HPMCNECIntegrator chain time to targeted mean particles per chain.

Details

Tune Newtonian event chain parameters.

class hoomd.hpmc.nec.tune.ChainTime(trigger, *args, **kwargs)

Tunes HPMCNECIntegrator chain time to targeted mean particles per chain.

Tip

For the most common creation of a ChainTime tuner see ChainTime.secant_solver and ChainTime.scale_solver respectively.

Parameters:
  • trigger (hoomd.trigger.trigger_like) – Trigger to determine when to run the tuner.

  • target (float) – The acceptance rate for trial moves that is desired. The value should be between 0 and 1.

  • solver (hoomd.tune.RootSolver) – A solver that tunes chain times to reach the specified target.

  • max_chain_time (float) – The maximum value of chain time to attempt.

trigger

Trigger to determine when to run the tuner.

Type:

hoomd.trigger.Trigger

target

The acceptance rate for trial moves that is desired. The value should be between 0 and 1.

Type:

float

solver

A solver that tunes move sizes to reach the specified target.

Type:

hoomd.tune.RootSolver

max_chain_time

The maximum value of chain time to attempt.

Type:

float

classmethod scale_solver(trigger, target, max_chain_time=None, max_scale=2.0, gamma=1.0, tol=0.01)

Create a ChainTime tuner with a hoomd.tune.ScaleSolver.

Parameters:
  • trigger (hoomd.trigger.trigger_like) – Trigger to determine when to run the tuner.

  • target (float) – The number of collisions in a chain that is desired.

  • max_chain_time (float) – The maximum value of chain time to attempt.

  • max_scale (float) – The maximum amount to scale the current chain_time value with.

  • gamma (float) – The value of gamma to pass through to hoomd.tune.ScaleSolver. Controls the size of corrections to the move size (larger values increase stability while increasing convergence time).

  • tol (float) – The absolute tolerance to allow between the current acceptance rate and the target before the move sizes are considered tuned. The tolerance should not be too much lower than the default of 0.01 as acceptance rates can vary significantly at typical tuning rates.

classmethod secant_solver(trigger, target, max_chain_time=None, gamma=0.8, tol=0.01)

Create a ChainTime tuner with a hoomd.tune.SecantSolver.

This solver can be faster than hoomd.tune.ScaleSolver, but depending on the system slightly less stable. In general, with the default value of gamma this should not be a problem.

Parameters:
  • trigger (hoomd.trigger.trigger_like) – Trigger to determine when to run the tuner.

  • target (float) – The number of collisions in a chain that is desired.

  • max_chain_time (float) – The maximum value of chain time to attempt, defaults to None which represents no maximum chain time.

  • gamma (float) – The value of gamma to pass through to hoomd.tune.SecantSolver. Controls the size of corrections to the move size (smaller values increase stability). Should be between 0 and 1, defaults to 0.8.

  • tol (float) – The absolute tolerance to allow between the current acceptance rate and the target before the move sizes are considered tuned. The tolerance should not be too much lower than the default of 0.01 as acceptance rates can vary significantly at typical tuning rates.

Note

Increasing gamma towards 1 does not necessarily speed up convergence and can slow it down. In addition, large values of gamma can make the solver unstable, especially when tuning frequently.