nlesc-nano / auto-FOX

A library for analyzing potential energy surfaces (PESs) and using the resulting PES descriptors for constructing forcefield parameters.
GNU Lesser General Public License v3.0
9 stars 8 forks source link

PBC and Angle Distribution Function #163

Closed lindasheila closed 3 years ago

lindasheila commented 3 years ago

Dear auto-FOX team,

I am a new user. I would to plot the Adf using the *.xyz file which contains atomic coordinates. I am wondering how to take into account the cell parameters to the following piece of code https://auto-fox.readthedocs.io/en/latest/1_rdf.html. Or it is not necessary to evaluate the ADF and the RDF?

Thank you Linda

BvB93 commented 3 years ago

Hi Linda,

With the talking of "cell parameters" I assume that you're dealing with a periodic system? Unfortunately the support for periodic systems is minimal, mostly due to a lack of user-demand up to this point. While this might change in the future, it is currently not possible to calculate the RDF/ADF as such.

Regards, Bas

BvB93 commented 3 years ago

Hi @lindasheila,

As of https://github.com/nlesc-nano/auto-FOX/pull/225 periodic calculations are now fully supported for both RDF and ADF calculations. If one is interested in performing such calculations then two things have to be done:

Examples

from FOX import MultiMolecule
import numpy as np

mol = MultiMolecule.from_xyz(...)
mol.lattice = np.array(...)  # A `3, 3` or `n, 3, 3` array with lattice vectors

# `xyz` means periodic along both the x, y and z axes
rdf = mol.init_rdf(periodic="xyz")
adf = mol.init_adf(periodic="xyz")