hpmc.compute
Overview
Compute the free volume available to a test particle. 

Compute the scale distribution function. 
Details
Compute properties of hard particle configurations.
 class hoomd.hpmc.compute.FreeVolume(test_particle_type, num_samples)
Compute the free volume available to a test particle.
 Parameters
FreeVolume
computes the free volume in the simulation state available to a given test particle using Monte Carlo integration. It must be used in combination with an HPMC integrator, which defines the particle shape parameters.FreeVolume
generatesnum_samples
uniform random test particle placements (position and orientation) inside the box and counts the number of times these test placements overlap with the particles in the simulation state. It then computes the free volume with:\[V_\mathrm{free} = \left( \frac{n_\mathrm{samples}  n_\mathrm{overlaps}} {n_\mathrm{samples}} \right) V_\mathrm{box}\]where \(V_\mathrm{free}\) is the estimated free volume
free_volume
, \(n_\mathrm{samples}\) is the number of samplesnum_samples
, \(n_\mathrm{overlaps}\) is the number of overlapping test placements, and \(V_\mathrm{box}\) is the volume of the simulation box.Note
The test particle type must exist in the simulation state and its shape parameters must be set in the simulation’s HPMC integrator. Particles with this type may or may not be present in the simulation state.
Note
FreeVolume
respects theinteraction_matrix
set in the HPMC integrator.Examples:
fv = hoomd.hpmc.compute.FreeVolume(test_particle_type='B', num_samples=1000)
 class hoomd.hpmc.compute.SDF(xmax, dx)
Compute the scale distribution function.
 Parameters
SDF
computes a distribution function of parameter \(x\). For each pair of particles, it scales the particle separation vector by \(1+x\) and records the smallest \(x\) that would cause the particles to touch in the histogram \(s(x)\). The histogram is discrete and \(s(x_i) = s[i]\) where \(x_i = i \cdot dx + dx/2\).The extrapolation of \(s(x)\) to \(x = 0\), \(s(0+)\) is related to the pressure
\[\beta P = \rho \left(1 + \frac{s(0+)}{2d} \right)\]where \(d\) is the dimensionality of the system, \(\rho\) is the number density, and \(\beta = \frac{1}{kT}\). This measurement of the pressure is inherently noisy due to the nature of the sampling. Average
betaP
over many timesteps to obtain accurate results.Assuming particle diameters are ~1, these paramater values typically achieve good results:
xmax = 0.02
dx = 1e4
In systems near densest packings,
dx=1e5
may be needed along with smallerxmax
. Check that \(\sum_i s(x_i) \cdot dx \approx 0.5\).Warning
SDF
does not compute correct pressures for simulations with concave particles or enthalpic interactions.Note
SDF
runs on the CPU even in GPU simulations. property betaP
Beta times pressure in NVT simulations \(\left[ \mathrm{length}^{d} \right]\).
Use a polynomial curve fit of degree 5 to estimate \(s(0+)\) and compute the pressure via:
\[\beta P = \rho \left(1 + \frac{s(0+)}{2d} \right)\]where \(d\) is the dimensionality of the system, \(\rho\) is the number density, and \(\beta = \frac{1}{kT}\).
Attention
In MPI parallel execution,
betaP
is available on rank 0 only.betaP
isNone
on ranks >= 1.(
Loggable
: category=”scalar”) Type