pyxtal.descriptor module¶
Module for crystal packing descriptor from energy decomposition
-
pyxtal.descriptor.
cart2sph
(x, y, z)[source]¶ convert the x, y, z to spherical coordinates (phi, theta, r) phi: [-pi, pi] theta: [-pi/2, pi/2]
-
pyxtal.descriptor.
correlation
(coef1, coef2, angle=None, s=0)[source]¶ Compute the correlation between to sph coefs
Parameters: - coef1 – sph coefficients 1
- coef2 – sph coefficients 2
- angle – [alpha, beta, gamma]
- s – starting index of coefs
Returns: distance scaled in [0, 1]
-
pyxtal.descriptor.
correlation_go
(coef1, coef2, M=6, s=0, d_cut=0.92)[source]¶ global optimization of two coefs based on quasi random sampling
Parameters: - coef1 – sph coefficients 1
- coef2 – sph coefficients 2
- M – 2^M sampling points
- s – starting index of coefs
Returns: distance scaled in [0, 1]
-
pyxtal.descriptor.
correlation_opt
(coef1, coef2, angle, s=0)[source]¶ Compute the correlation between two sph coefs
Parameters: - coef1 – sph coefficients 1
- coef2 – sph coefficients 2
- angle – [alpha, beta, gamma]
- s – starting index of coefs
Returns: distance scaled in [0, 1]
-
pyxtal.descriptor.
fibonacci_sphere
(N=1000)[source]¶ Sampling the sphere grids
Parameters: N – number of pts to generate Returns: 3D points array in Cartesian coordinates
-
pyxtal.descriptor.
get_alignment
(pts, degrees=True)[source]¶ Here we define the equator is the plane with three most important neighbors. Get the required rotation angles to get that representation.
Parameters: important points (pts;) – Returns: [alpha, beta, gamma] Return type: angles
-
class
pyxtal.descriptor.
orientation_order
(xtal, max_CN=14)[source]¶ Bases:
object
Computes the Steinhardt orientation order parameters
Parameters: - xtal – pyxtal structure
- max_d – maximum intermolecular distances
- lmax – maximum bandwidth for spherical harmonic expansion
-
get_neighbors
()[source]¶ get neighboring molecules
Returns: [N, 3] array, (theta, phi, eng) Return type: pts
-
get_parameters
(ls=[4, 6])[source]¶ Computes :param center: center xyz coordinate :param neighbors: a list of neighboring xyz coordinates :param weights: a list of weights for each neighbor
Returns: - numpy array(complex128), the complex vector qlm normalized
- by the number of nearest neighbors
Return type: q
-
pyxtal.descriptor.
sph2cart
(phi, theta, r)[source]¶ convert spherical coordinates (phi, theta, r) to Cartesian (x, y, z)
-
class
pyxtal.descriptor.
spherical_image
(xtal, model='molecule', max_d=10, factor=2.2, lmax=13, sigma=0.1, N=10000)[source]¶ Bases:
object
A class to handle the crystal packing descriptor from spherical image
Parameters: - xtal – pyxtal structure
- model – ‘molecule’ or ‘contact’
- max_d – maximum intermolecular distances
- lmax – maximum bandwidth for spherical harmonic expansion
- sigma – Gaussian width to project into the unit sphere
- N – number of grid points on the unit sphere
-
align
(M=6)[source]¶ Align spherical image in a way that three most important contributions are parallel to the equatorial plane. Experimental stage now!
Parameters: M – number of power in quasi random sampling
-
get_contacts
()[source]¶ Compute the spherical images from the neighboring distances
Returns: [N, 3] array, (theta, phi, eng) Return type: pts
-
get_molecules
()[source]¶ compute the spherical images from neighboring molecules
Returns: [N, 3] array, (theta, phi, eng) Return type: pts
-
get_similarity
(sph2, M=6, cutoff=0.95)[source]¶ Compute the similarity matrix between two sphs
Parameters: - sph2 – the 2nd sph class
- M – number of power in quasi random sampling
- cutoff – cutoff similarity to terminate search early