rascaline
rascaline copied to clipboard
Naming of gradients
Hello, I wonder if we should switch the way we name gradients, because at the moment the metadata for the components is not so descriptive. For the positions gradients it is obvious that the three components correspond to x y z in that order, but for cell gradients I think it would be useful to be more descriptive. Here the stress could be stored in Voigt notation or as a matrix. Sure one can always check the documentation for that or do a educative guess, but since we already have the metadata feature, then we can make use out of it and make it more user friendly. I use the forces for examples, but I am thinking that this change is more useful for the stress.
One could do reshape the components to have a name for each one
# Gradient of TensorBlock would look like this
data=array of shape (n_samples, 1, 1, 1, n_properties)
components=[
Labels(["x"], np.array([[0]], dtype=np.int32)),
Labels(["y"], np.array([[0]], dtype=np.int32)),
Labels(["z"], np.array([[0]], dtype=np.int32))
]
but it probably simplifies the usability if we keep the forces in one dimension, therefore I thought about just changing the name
# Gradient of TensorBlock would look like this
components=[Labels(["direction (x y z)"], np.array([[0], [1], [2]], dtype=np.int32))],
What do you think?
EDIT: Okay just realized that "direction (x y z)" is not a valid Label name. One could also use "direction_x_y_z", but I am not sure if there are better solutions for this.