Stress Tensor Autocorrelation Function

This module calculates the autocorrelation of the off-diagonal elements of the stess tensor \Pi_{\alpha\beta}:

C_{\alpha\beta}(t) = \frac{1}{N} \langle \Pi_{\alpha\beta}(t)  \Pi_{\alpha\beta}(0) \rangle
\, \text{.}

By normalisation with the particle number N, the result remains finite in the thermodynamic limit. The stress tensor is obtained from halmd.observables.thermodynamics.stress_tensor().

The shear viscosity \eta is found from this autocorrelation via the Green–Kubo relation

\eta = \frac{\rho}{k_B T} \int_0^\infty \! C_{\alpha\beta}(t) \, \mathrm{d}t \,
\text{.}

Note

The module returns the sum over all off-diagonal elements, \sum_{\alpha < \beta} C_{\alpha\beta}(t), analogously to halmd.observables.dynamics.mean_square_displacement.

class halmd.observables.dynamics.stress_tensor_autocorrelation(args)

Construct stress tensor autocorrelation function.

This module implements a halmd.observables.dynamics.correlation module.

Parameters:
acquire()

Acquire stress tensor

Returns:Stress tensor sample
correlate(first, second)

Correlate two stress tensor samples.

Parameters:
  • first – first phase space sample
  • second – second phase space sample
Returns:

stress tensor autocorrelation function between two samples.

desc

Module description.

connect(args)
Parameters:
  • args (table) – keyword arguments
  • args.every – sampling interval
Returns:

sequence of signal connections

Internal use only. This function is called upon registration by blocking_scheme:correlation().

Connect msv.group.particle:aux_enable() to the signal on_prepend_force of halmd.observables.sampler using the interval every.

class writer(args)

Construct file writer.

Parameters:
  • args (table) – keyword arguments
  • args.file – instance of file writer
  • args.location (string table) – location within file (optional)
Returns:

file writer as returned by file:writer().

The argument location specifies a path in a structured file format like H5MD given as a table of strings. It defaults to {"dynamics", self.label, "stress_tensor_autocorrelation"}.