Action: CONCATENATE
Module | valtools |
---|---|
Description | Usage |
Join vectors or matrices together | |
output value | type |
the concatenated vector/matrix that was constructed from the input values | vector/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 | scalar/vector | the values that should be concatenated together to form the output vector |
MATRIX | scalar/matrix | specify the matrices that you wish to join together into a single matrix |
Further details and examples
Join vectors or matrices together
This action can be used to join sets of scalars, vector or matrices together into a single output value. The following example shows how this works with vectors and scalars:
d1DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=3,4 ATOMS2the pair of atom that we are calculating the distance between=5,6 v : CONCATENATEJoin vectors or matrices together More details ARGthe values that should be concatenated together to form the output vector=d1,d2:
The output vector here, v
, has three components. The first of these is the distance between atoms 1 and 2 and the second
and third are the distances between atoms 3 and 4 and 5 and 6 respectively.
Concatenating two or more vectors is similarly straightfoward. Concatenating matrices is a little more difficult as the user must explain the axes that each matrix should be joined to. The following input should give some idea as to how the joining of matrices is done in practise. In this example, we define two groups of atoms and calculate the contact matrix between all the atoms in the two groups by first calculating three contact matrices that describe the inter and intra group contacts.
# Define two groups of atoms g : GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=1-5 h : GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=6-20 # Calculate the CONTACT_MATRIX for the atoms in group g cg : 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=g 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.1}
# Calculate the CONTACT_MATRIX for the atoms in group h ch : 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=h 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.2}
# Calculate the CONTACT_MATRIX between the atoms in group g and group h cgh : CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPAwhen you are calculating the adjacency matrix between two sets of atoms this keyword is used to specify the atoms along with the keyword GROUPB=g GROUPBwhen you are calculating the adjacency matrix between two sets of atoms this keyword is used to specify the atoms along with the keyword GROUPA=h 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.15}
# Now calculate the contact matrix between the atoms in group h and group h # Notice this is just the transpose of cgh cghT : TRANSPOSECalculate the transpose of a matrix More details ARGthe label of the vector or matrix that should be transposed=cgh # And concatenate the matrices together to construct the adjacency matrix between the # adjacency matrices m : CONCATENATEJoin vectors or matrices together More details ... MATRIX11specify the matrices that you wish to join together into a single matrix=cg MATRIX12specify the matrices that you wish to join together into a single matrix=cgh MATRIX21specify the matrices that you wish to join together into a single matrix=cghT MATRIX22specify the matrices that you wish to join together into a single matrix=ch ...
Syntax
The following table describes the keywords and options that can be used with this action
Keyword | Type | Default | Description |
---|---|---|---|
ARG | input | none | the values that should be concatenated together to form the output vector |
MATRIX | input | none | specify the matrices that you wish to join together into a single matrix |
NUMERICAL_DERIVATIVES | optional | false | calculate the derivatives for these quantities numerically |