# Order Module¶

Module for the computation of ordering.

These are tools and utilities for calculating the ordering of local structures.

sdanalysis.order.compute_neighbours(box, position, max_radius=3.5, max_neighbours=8)[source]

Compute the neighbours of each molecule.

Parameters
Return type

ndarray

Returns

An array containing the index of the neighbours of each molecule. Each molecule will have max_neighbours listed, with the value 2 ** 32 - 1 indicating a missing value.

sdanalysis.order.compute_voronoi_neighs(box, position)[source]
Return type

ndarray

sdanalysis.order.create_ml_ordering(model)[source]

Create a machine learning initialised from a pickled model.

This reads a machine learning model from a file, creating a function to classify the ordering of a configuration.

Parameters

model (Path) – The path to a file containing a pickled model to be loaded using joblib

Return type
Returns

A function to classify the ordering within a configuration.

sdanalysis.order.create_neigh_ordering(neighbours)[source]
Return type
sdanalysis.order.create_orient_ordering(threshold)[source]
Return type
sdanalysis.order.num_neighbours(box, position, max_radius=3.5)[source]

Calculate the number of neighbours of each molecule.

This function is optimised to quickly calculate the number of nearest neighbours each particle has.

Parameters
Return type

ndarray

sdanalysis.order.orientational_order(box, position, orientation, max_radius=3.5, max_neighbours=8)[source]

Compute the orientational order parameter for a given input.

The orientational order parameter compares the orientation of a particle with that of all it’s neighbours, using the relation

..math:

Theta = sum_{i=1}^N cos^2((theta_i - theta))

taking the orientation of each of the neighbouring particles compared to the current particle. The square ensures that the angles which are both parallel and antiparallel contribute to the ordering.

Parameters
Return type

ndarray

sdanalysis.order.relative_distances(box, position, max_radius=3.5, max_neighbours=8)[source]

Compute the distance to each neighbour.

Parameters
Return type

ndarray

Returns

The distance to each neighbour in a numpy array. Values which correspond to missing neighbours are represented by the value -1.

sdanalysis.order.relative_orientations(box, position, orientation, max_radius=3.5, max_neighbours=8)[source]

Find the relative orientations of each neighbouring particle.

This finds each of the nearest neighbours for each particle and computes the orientation of those neighbours relative to the orientation of the central particle.

Parameters
Return type

ndarray

sdanalysis.order.setup_neighbours(box, position, max_radius=3.5, max_neighbours=8, is_2D=True)[source]
Return type

NearestNeighbors