sparks-baird / xtal2png

Encode/decode a crystal structure to/from a grayscale PNG image for direct use with image-based machine learning models such as Palette.
https://xtal2png.readthedocs.io/
MIT License
34 stars 3 forks source link

Maybe use `get_sites_in_sphere` to calculate pairwise distance matrix, so always 52 sites #11

Open sgbaird opened 2 years ago

sgbaird commented 2 years ago

Would be via get_all_neighbors(...) or probably preferably get_sites_in_sphere(...)

Pairwise distances could be calculated using get_distance(...) or by digging into how distance_matrix is calculated, which probably uses get_distance(...).

Better method would probably be to extract the Cartesian coordinates of each site from get_sites_in_sphere(...) and just use all_distance per what happens with distance_matrix.

kjappelbaum commented 2 years ago

a further option would be to encode just the connectivity (graph adjacency matrix)

sgbaird commented 2 years ago

Related from Grouped representation of interatomic distances as a similarity measure for crystal structures:

The procedure to calculate the GRID is as follows: 1) compute all pairwise distances up to an arbitrary cutoff (here 10Å) starting from each symmetry-unique atom(j) within the unit cell, taking periodic boundary conditions into account

Other related concepts:

I should probably make sure that the distance matrices are periodic distance matrices (EDIT: this seems to be the case).