pele.mindist.optimize_permutations#

pele.mindist.optimize_permutations(X1, X2, permlist=None, user_algorithm=None, recalculate_distance=<function _cartesian_distance>, box_lengths=None, **kwargs)[source]#

return the best alignment of the structures X1 and X2 after optimizing permutations

Parameters:
X1, X2

the structures to align. X1 will be left unchanged.

permlista list of lists

A list of lists of atoms which are interchangable. e.g. for a 50/50 binary mixture:

permlist = [range(1,natoms/2), range(natoms/2,natoms)]
user_algoriithmNone or callable

you can optionally pass which algorithm to use to optimize the permutations the structures

gen_cost_matrixNone or callable

user function to generate the cost matrix

recalculate_distancecallable

function to compute the distance of the optimized coords. If None is passed then the distance is not recalculated and the returned distance is unreliable.

reshapeboolean

shall coordinate reshaping be performed.

box_lengthsfloat array

array of floats giving the box lengths for periodic boundary conditions. Set to None for no periodic boundary conditions.

Returns:
distfloat

the minimum distance

X1, X2new:

the optimized coordinates

See also

find_best_permutation

use this function to find the optimized permutation without changing the coordinates.