Action: NEIGHBORS

Module adjmat
Description Usage
Build a matrix with ones in for the N nearest neighbours of an atom used in 0 tutorialsused in 0 eggs
output value type
a matrix in which the ij element is one if the ij-element of the input matrix is one of the NLOWEST/NHIGHEST elements on that row of the input matrix and zero otherwise matrix

Input

The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.

Keyword Type Description
ARG matrix the label of an adjacency/distance matrix that will be used to find the nearest neighbors

Further details and examples

Build a matrix with ones in for the N nearest neighbours of an atom

The following input illustrates how to use this action in tandem with DISTANCE_MATRIX to find the six nearest atoms to each of the first 100 atoms in the input file:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d1: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-100
n: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action has hidden defaults. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=d1 NLOWEST in each row of the output matrix set the elements that correspond to the n lowest elements in each row of the input matrix equal to one=6

Alternatively, if you would like to use a CONTACT_MATRIX to do something similar you would do the following:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c1: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=0.5}
n: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action has hidden defaults. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=c1 NHIGHEST in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one=6

This command is useful for implementing alternatives to the symmatry functions that are defined by the shortcuts in the module symfunc. For example, suppose that you want to calculate a variant on the TETRAHEDRAL symmetry function. In this variant on the CV the coordination sphere around each central atom is not defined using a switching function. Instad this coordination sphere contains only the four nearest atoms. You can implement this CV by using the following input:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d1: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-100 COMPONENTS also calculate the components of the vectors connecting the atoms in the contact matrix
n: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action has hidden defaults. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=d1.w NLOWEST in each row of the output matrix set the elements that correspond to the n lowest elements in each row of the input matrix equal to one=4
f: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=n,d1.x,d1.y,d1.z,d1.w VARthe names to give each of the arguments in the function=w,x,y,z,r PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO FUNCthe function you wish to evaluate=w*(((x+y+z)/r)^3+((x-y-z)/r)^3+((-x+y-z)/r)^3+((-x-y+z)/r)^3)
ones: ONESCreate a constant vector with all elements equal to one This action is a shortcut. More details SIZEthe number of ones that you would like to create=100
ucv: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=f,ones
cv: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ucv PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO FUNCthe function you wish to evaluate=x/4

Syntax

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
ARG input none the label of an adjacency/distance matrix that will be used to find the nearest neighbors
NLOWEST compulsory 0 in each row of the output matrix set the elements that correspond to the n lowest elements in each row of the input matrix equal to one
NHIGHEST compulsory 0 in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one
SERIAL optional false do the calculation in serial