mxtaltools.common.ellipsoid_ops

mxtaltools.common.ellipsoid_ops.compute_cosine_similarity_matrix(e1, e2)[source]

compute the row-to-row dot products for batches of ellipsoids [n, i, j] returns the [n, i, i] matrix of dot products between rows in e1 and e2

permuting the order of e1, e2, results in transposition of the overlap matrix :param e1: :param e2: :return:

mxtaltools.common.ellipsoid_ops.compute_ellipsoid_overlap(e1, e2, v1_true, v2_true, r, num_probes: int = 100000, eps: float = 0.001, max_iters: int = 1000, min_iters: int = 10, show_tqdm: bool = False)[source]

Compute the volume of the overlapping region between ellipsoids defined by e1, e2 Done by random resampling until satisfactory convergence is achieved

probe the region occupied by both ellipsoids, and check if points are within each :param num_probes: :param min_iters: :param eps: :param max_iters: :param e1: [i, j] of row-wise eigenvectors defining ellipsoid 1 :param e2: [i, j] of row-wise eigenvectors defining ellipsoid 1 :param r: separation vector between e1 centroids and e2 centroids :return:

mxtaltools.common.ellipsoid_ops.generate_random_eigenvalues(num_samples, device)[source]

Generate ellipsoid eigenvector lengths according to the rule 1 <= a <= b <= c :return:

mxtaltools.common.ellipsoid_ops.generate_random_rotations(num_samples, device)[source]
mxtaltools.common.ellipsoid_ops.llipsoid_volume(e)[source]
mxtaltools.common.ellipsoid_ops.sample_triangular_right(n_samples, start, stop, device='cpu')[source]

sample from the CDF of a uniform distribution the right-aligned triangular distribution

mxtaltools.common.ellipsoid_ops.trailing_relative_diffs(record, eps: float = 1e-05)[source]