Skip to content

Shortcut: Q1

Module symfunc
Description Usage
Calculate 1st order Steinhardt parameters used in 1 tutorialsused in 0 eggs
output value type
the norms of the vectors of spherical harmonic coefficients vector

Details and examples

Calculate 1st order Steinhardt parameters

The 1st order Steinhardt parameters allow us to measure the degree to which the first coordination shell around an atom is ordered with the atoms aranged on a line. The Steinhardt parameter for atom, is complex vector whose components are calculated using the following formula:

where is one of the 1st order spherical harmonics so is a number that runs from to . The function is a switching function that acts on the distance between atoms and . The parameters of this function should be set so that it the function is equal to one when atom is in the first coordination sphere of atom and is zero otherwise.

As discussed on this page, the Steinhardt parameters can be used to measure the degree of order in the system in a variety of different ways. The simplest way of measuring whether or not the coordination sphere is ordered is to simply take the norm of the above vector i.e.

This norm is small when the coordination shell is disordered and larger when the coordination shell is ordered. The following input illustrates how by averaging the value of this norm over all the atoms in the system you can measure the global degree of order in the system:

Click on the labels of the actions for more information on what each action computes
tested on2.11
q1: Q1Calculate 1st order Steinhardt parameters This action is a shortcut and it has hidden defaults. More details SPECIESthe list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments=1-64 D_0 The d_0 parameter of the switching function=1.3 R_0The r_0 parameter of the switching function=0.2
q1_mean: MEANCalculate the arithmetic mean of the elements in a vector More details ARGthe vector/matrix/grid whose elements shuld be added together=q1 PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=q1_mean FILEthe name of the file on which to output these quantities=colvar

In the above input the rational switching function with the parameters above. We would recommend using SWITCH syntax rather than the syntax above when giving the parameters for the switching function as you can then use any of the switching functions described in the documentation for LESS_THAN. More importantly, however, using this syntax allows you to set the D_MAX parameter for the switching function as demonstrated below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
q1: Q1Calculate 1st order Steinhardt parameters This action is a shortcut. More details SPECIESthe list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments=1-64 SWITCHthe switching function that it used in the construction of the contact matrix. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL D_0=1.3 R_0=0.2 D_MAX=3.0}
q1_mean: MEANCalculate the arithmetic mean of the elements in a vector More details ARGthe vector/matrix/grid whose elements shuld be added together=q1 PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=q1_mean FILEthe name of the file on which to output these quantities=colvar

Setting the D_MAX can substantially improve PLUMED performance as it turns on the linked list algorithm that is discussed in the optimisation details part of the documentation for CONTACT_MATRIX.

Working with two types of atoms

The command below could be used to measure the Q1 parameters that describe the arrangement of chlorine ions around the sodium atoms in sodium chloride. The imagined system here is composed of 64 NaCl formula units and the atoms are arranged in the input with the 64 Na ions followed by the 64 Cl ions. Once again the average Q1 parameter is calculated and output to a file called colvar

Click on the labels of the actions for more information on what each action computes
tested on2.11
q1: Q1Calculate 1st order Steinhardt parameters This action is a shortcut and it has hidden defaults. More details SPECIESAthe list of atoms for which the symmetry function is being calculated=1-64 SPECIESBthe list of atoms that can be in the environments of each of the atoms for which the symmetry function is being calculated=65-128 D_0 The d_0 parameter of the switching function=1.3 R_0The r_0 parameter of the switching function=0.2
q1_mean: MEANCalculate the arithmetic mean of the elements in a vector More details ARGthe vector/matrix/grid whose elements shuld be added together=q1 PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=q1_mean FILEthe name of the file on which to output these quantities=colvar

If you simply want to examine the values of the Q1 parameters for each of the atoms in your system you can do so by exploiting the command DUMPATOMS as shown in the example below. The following output file will output a file in an extended xyz format called q1.xyz for each frame of the analyzed MD trajectory. The first column in this file will contain a dummy name for each of the atoms, columns 2-4 will then contain the x, y and z positions of the atoms, column 5 will contain the value of the Q1 parameter, columns 6-8 will contain the real parts of the director of the vector while columns 9-11 will contain the imaginary parts of this director.

Click on the labels of the actions for more information on what each action computes
tested on2.11
q1: Q1Calculate 1st order Steinhardt parameters This action is a shortcut and it has hidden defaults. More details SPECIESAthe list of atoms for which the symmetry function is being calculated=1-64 SPECIESBthe list of atoms that can be in the environments of each of the atoms for which the symmetry function is being calculated=65-128 D_0 The d_0 parameter of the switching function=1.3 R_0The r_0 parameter of the switching function=0.2 MEAN calculate the mean of all the quantities
DUMPATOMSDump selected atoms on a file. More details ATOMSthe atom indices whose positions you would like to print out=q1 ARGthe labels of vectors that should be output in the xyz file=q1 FILEfile on which to output coordinates; extension is automatically detected=q1.xyz

The MASK keyword

You can use the MASK keyword with this action in the same way that it is used with COORDINATIONNUMBER. This keyword thus expects a vector in input, which tells Q1 that it is safe not to calculate the Q1 parameter for some of the atoms. As illustrated below, this is useful if you are using functionality from the volumes module to calculate the average value of the Q1 parameter for only those atoms that lie in a certain part of the simulation box.

Click on the labels of the actions for more information on what each action computes
tested on2.11
# Fixed virtual atom which serves as the probe volume's center (pos. in nm)
center: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=2.5,2.5,2.5
# Vector in which element i is one if atom i is in sphere of interest and zero otherwise
sphere: INSPHEREThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ATOMSthe group of atoms that you would like to investigate=1-400 CENTERthe atom whose vicinity we are interested in examining=center RADIUSthe switching function that tells us the extent of the sphereical region of interest. Options for this keyword are explained in the documentation for LESS_THAN.={GAUSSIAN D_0=0.5 R_0=0.01 D_MAX=0.52}
# Calculate the fccubic parameter of the atoms
cc: Q1Calculate 1st order Steinhardt parameters This action is a shortcut. More details ...
  SPECIESthe list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments=1-400 MASKthe label for a vector that is used to determine which rows of the matrix are computed=sphere
  SWITCHthe switching function that it used in the construction of the contact matrix. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL D_0=3.0 R_0=1.5 D_MAX=6.0}
...
# Multiply fccubic parameters numbers by sphere vector
prod: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cc,sphere FUNCthe function you wish to evaluate=x*y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# Sum of coordination numbers for atoms that are in the sphere of interest
numer: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=prod PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# Number of atoms that are in sphere of interest
denom: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=sphere PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# Average coordination number for atoms in sphere of interest
av: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=numer,denom FUNCthe function you wish to evaluate=x/y PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# And print out final CV to a file
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=av FILEthe name of the file on which to output these quantities=colvar STRIDE the frequency with which the quantities of interest should be output=1

This input calculate the average value of the Q1 parameter for only those atoms that are within a spherical region that is centered on the point .

Deprecated syntax

More information on the deprecated keywords that are given below is available in the documentation for the DISTANCES command. Below is an example where these deprecated keywords are used to calculate the histogram of Q1 parameters for the 64 atoms in a box of Lennard Jones print them to a file called colvar:

Click on the labels of the actions for more information on what each action computes
tested on2.11
q1: Q1Calculate 1st order Steinhardt parameters This action is a shortcut and it has hidden defaults. More details SPECIESthe list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments=1-64 D_0 The d_0 parameter of the switching function=1.3 R_0The r_0 parameter of the switching function=0.2 HISTOGRAMcalculate a discretized histogram of the distribution of values={GAUSSIAN LOWER=0.0 UPPER=1.0 NBINS=20 SMEAR=0.1}
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=q1.* FILEthe name of the file on which to output these quantities=colvar

The following example illustrates how you can use VSUM to calculate a global vector of values as follows:

where the sum runs over all the atoms. You can then take these values and compute the following norm:

The VMEAN command that is also used in the input below performs a similar operations. The only difference is that we divide the sums in the first expression above by the number of atoms.

Click on the labels of the actions for more information on what each action computes
tested on2.11
q1: Q1Calculate 1st order Steinhardt parameters This action is a shortcut and it has hidden defaults. More details SPECIESthe list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments=1-64 D_0 The d_0 parameter of the switching function=1.3 R_0The r_0 parameter of the switching function=0.2 VMEAN calculate the norm of the mean vector VSUM calculate the norm of the sum of all the vectors
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=q1.* FILEthe name of the file on which to output these quantities=colvar

Input

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

Keyword Type Description
SPECIES atoms the list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments
SPECIESA atoms the list of atoms for which the symmetry function is being calculated
SPECIESB atoms the list of atoms that can be in the environments of each of the atoms for which the symmetry function is being calculated

Output components

This action can calculate the values in the following table when the associated keyword is included in the input for the action. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.

Name Type Keyword Description
lessthan scalar LESS_THAN the number of colvars that have a value less than a threshold
morethan scalar MORE_THAN the number of colvars that have a value more than a threshold
altmin scalar ALT_MIN the minimum value of the cv
min scalar MIN the minimum colvar
max scalar MAX the maximum colvar
between scalar BETWEEN the number of colvars that have a value that lies in a particular interval
highest scalar HIGHEST the largest of the colvars
lowest scalar LOWEST the smallest of the colvars
sum scalar SUM the sum of the colvars
mean scalar MEAN the mean of the colvars
_vmean scalar VMEAN the norm of the mean vector
_vsum scalar VSUM the norm of the mean vector

Full list of keywords

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

Keyword Type Default Description
SPECIES input none the list of atoms for which the symmetry function is being calculated and the atoms that can be in the environments
SPECIESA input none the list of atoms for which the symmetry function is being calculated
SPECIESB input none the list of atoms that can be in the environments of each of the atoms for which the symmetry function is being calculated
NN compulsory 6 The n parameter of the switching function
MM compulsory 0 The m parameter of the switching function; 0 implies 2*NN
D_0 compulsory 0.0 The d_0 parameter of the switching function
R_0 compulsory none The r_0 parameter of the switching function
SWITCH optional not used the switching function that it used in the construction of the contact matrix. Options for this keyword are explained in the documentation for LESS_THAN.
MASK optional not used the label for a vector that is used to determine which rows of the matrix are computed
VMEAN optional false calculate the norm of the mean vector
VSUM optional false calculate the norm of the sum of all the vectors
USEGPUThis keyword do not have examples optional false run part of this calculation on the GPU

deprecated keywords

The keywords in the following table can still be used with this action but have been deprecated

Keyword Description
LESS_THAN calculate the number of variables that are less than a certain target value
MORE_THAN calculate the number of variables that are more than a certain target value
ALT_MIN calculate the minimum value
MIN calculate the minimum value
MAX calculate the maximum value
BETWEEN calculate the number of values that are within a certain range
HIGHEST this flag allows you to recover the highest of these variables
HISTOGRAM calculate a discretized histogram of the distribution of values
LOWEST this flag allows you to recover the lowest of these variables
SUM calculate the sum of all the quantities
MEAN calculate the mean of all the quantities
LOWMEM Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only

References

More information about how this action can be used is available in the following articles: