Action: DIAGONALIZE
Module | matrixtools |
---|---|
Description | Usage |
Calculate the eigenvalues and eigenvectors of a square matrix |
Output components
This action calculates the values in the following table. 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 | Description |
---|---|---|
vals | scalar | the eigevalues of the input matrix |
vecs | vector | the eigenvectors of the input 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 input matrix |
Further details and examples
Calculate the eigenvalues and eigenvectors of a square matrix
This action allows you to use the dsyevr function from the LAPACK library to calculate the eigenvalues and eigenvectors of a real symmetric matrix. For example, the following input can be used to calculate and print all four eigenvalues of the input DISTANCE_MATRIX.
dDISTANCE_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-4 : diagDIAGONALIZECalculate the eigenvalues and eigenvectors of a square matrix This action has hidden defaults. More details ARGthe input matrix=d : PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=diag.vals-1,diag.vals-2,diag.vals-3,diag.vals-4 FILEthe name of the file on which to output these quantities=colvar
If you wish to calculate only a subset of the eigenvalues and eigenvectors you would use an input like the one shown below. This input calculates and outputs the largest eigenvalue and its corresponding eigenvector.
dDISTANCE_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-4 : diag : DIAGONALIZECalculate the eigenvalues and eigenvectors of a square matrix More details ARGthe input matrix=d VECTORS the eigenvalues and vectors that you would like to calculate=1 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=diag.vals-1,diag.vecs-1 FILEthe name of the file on which to output these quantities=colvar
Syntax
The following table describes the keywords and options that can be used with this action
Keyword | Type | Default | Description |
---|---|---|---|
ARG | input | none | the input matrix |
VECTORS | compulsory | all | the eigenvalues and vectors that you would like to calculate |
MATRIX | optional | not used | the input matrix (can use ARG instead) |