SOAPify.analysis
Module that contains various analysis routines
Functions
|
Shortcut to extract the timeSOAP from large datasets. |
|
produce a per frame list of the neighbours, atom per atom |
|
return, listed per each atoms the parameters used in the LENS analysis |
|
performs the 'timeSOAP' analysis on the given SOAP trajectory |
|
performs the 'timeSOAP' analysis on the given normalized SOAP trajectory |
- SOAPify.analysis.getTimeSOAPSimple(soapDataset, window=1, stride=None, backward=False)[source]
Shortcut to extract the timeSOAP from large datasets.
This function is the equivalent to:
loading a chunk of the trajectory from a h5py.Dataset with a SOAP fingerprints trajectory
filling the vector with
SOAPify.utils.fillSOAPVectorFromdscribe()normalizing it with
SOAPify.utils.normalizeArray()calculating the timeSOAP with
timeSOAPsimple()
and then returning timeSOAP and the derivative
- Parameters
soapDataset (h5py.Dataset) – the dataset with the SOAP fingerprints
window (int) – the dimension of the windows between each state confrontations. See
timeSOAPsimple()Defaults to 1.stride (int) – the stride in frames between each state confrontation. See
timeSOAPsimple()Defaults to None.backward (bool) – If true the soap distance is referred to the previous frame. See
timeSOAPsimple(). Defaulst to True.
- Returns
timedSOAP the timeSOAP values, shape(frames-1,natoms)
deltaTimedSOAP the derivatives of timeSOAP, shape(natoms, frames-2)
- Return type
- SOAPify.analysis.listNeighboursAlongTrajectory(inputUniverse, cutOff, trajSlice=slice(None, None, None))[source]
produce a per frame list of the neighbours, atom per atom
Original author: Martina Crippa
Mantainer: Daniele Rapetti
- Parameters
- Returns
list of AtomGroup wint the neighbours of each atom for each frame
- Return type
- SOAPify.analysis.neighbourChangeInTime(nnListPerFrame)[source]
return, listed per each atoms the parameters used in the LENS analysis
Original author: Martina Crippa
Mantainer: Daniele Rapetti
- Parameters
nnListPerFrame (list[list[AtomGroup]]) – a frame by frame list of the neighbours of each atom: output of :func:`listNeighboursAlongTrajectory
- Returns
lensArray The calculated LENS parameter
numberOfNeighs the count of neighbours per frame
lensNumerators the numerators used for calculating LENS parameter
lensDenominators the denominators used for calculating LENS parameter
- Return type
tuple[numpy.ndarray,numpy.ndarray,numpy.ndarray,numpy.ndarray]
- SOAPify.analysis.timeSOAP(SOAPTrajectory, window=1, stride=None, backward=False, returnDiff=True, distanceFunction=<function simpleSOAPdistance>)[source]
performs the ‘timeSOAP’ analysis on the given SOAP trajectory
Original author: Cristina Caruso
Mantainer: Daniele Rapetti
- Parameters
SOAPTrajectory (int) – a trajectory of SOAP fingerprints, should have shape (nFrames,nAtoms,SOAPlenght)
window (int) – the dimension of the windows between each state confrontations. Defaults to 1.
stride (int) – the stride in frames between each state confrontation. NOT IN USE. Defaults to None.
backward (bool) –
- If true the soap distance is referred to the previous frame.
NOT IN USE. Defaulst to True.
returnDiff (bool) – If true returns also the first derivative of timeSOAP. Defaults to True.
distanceFunction (callable, optional) – the function that define the distance. Defaults to
SOAPify.distances.simpleSOAPdistance().
- Returns
timedSOAP the timeSOAP values, shape(frames-1,natoms)
deltaTimedSOAP the derivatives of timeSOAP, shape(natoms, frames-2)
- Return type
- SOAPify.analysis.timeSOAPsimple(SOAPTrajectory, window=1, stride=None, backward=False, returnDiff=True)[source]
performs the ‘timeSOAP’ analysis on the given normalized SOAP trajectory
this is optimized to use
SOAPify.distances.simpleSOAPdistance(), without calling it.Warning
this function works only with normalized numpy.float64 soap vectors!
The SOAP distance is calculated with
\[d(\vec{a},\vec{b})=\sqrt{2-2\frac{\vec{a}\cdot\vec{b}}{\left\|\vec{a}\right\|\left\|\vec{b}\right\|}}\]That is equivalent to
\[ \begin{align}\begin{aligned}d(\vec{a},\vec{b})=\sqrt{2-2\hat{a}\cdot\hat{b}} = \sqrt{\hat{a}\cdot\hat{a}+\hat{b}\cdot\hat{b}-2\hat{a}\cdot\hat{b}} =\\\sqrt{(\hat{a}-\hat{b})\cdot(\hat{a}-\hat{b})}\end{aligned}\end{align} \]That is the euclidean distance between the versors
Original author: Cristina Caruso
Mantainer: Daniele Rapetti
- Parameters
SOAPTrajectory (int) – a **normalize ** trajectory of SOAP fingerprints, should have shape (nFrames,nAtoms,SOAPlenght)
window (int) – the dimension of the windows between each state confrontations. Defaults to 1.
stride (int) – the stride in frames between each state confrontation. NOT IN USE. Defaults to None.
backward (bool) –
- If true the soap distance is referred to the previous frame.
NOT IN USE. Defaulst to True.
returnDiff (bool) – If true returns also the first derivative of timeSOAP. Defaults to True.
- Returns
timedSOAP the timeSOAP values, shape(frames-1,natoms)
deltaTimedSOAP the derivatives of timeSOAP, shape(natoms, frames-2)
- Return type