stfc / janus-core

Tools for machine learnt interatomic potentials
https://stfc.github.io/janus-core/
BSD 3-Clause "New" or "Revised" License
15 stars 8 forks source link

Add velocity observables #262

Open harveydevereux opened 2 months ago

harveydevereux commented 2 months ago

A velocity observable can be added to correlate atom velocities during simulation. These should be constructable from components and atom ranges. The velocity auto-correlation function (VAF) is $\langle v{i}\cdot v{i} \rangle$.

This opens a general point about observables that we may want to average over multiple atoms and or components.

To that end a general observable could be constructable as

def __init__(self, components: List[str], atoms: List[int]):
    ....

So the vaf above might be something like,

Velocity(components=["x", "y", "z"], atoms=range(len(structure)))

Where the janus_core.helper.correlator.correlations could be extended to spawn correlators for zip'd components and atoms of a and b. Meaning e.g. a pair of observables both equal to Velocity(components=["x", "y", "z"], atoms=[1,2,3]) results in 9 total correlations (atom $1$ $x-x$, atom $1$ y-y, ..., atom $3$ z-z), which are then automatically averaged to a single set of data (the VAF). Sensible defaults leading to the full VAF.

A user could then fully control the atoms and components correlated.


Questions