Hi. I am not a CHARMM developer. However, I did find an unexpected result when calculating the covariance matrix of a trajectory using:
coor covariance -
firstu 10 nunit 1 begin @begin stop @stop skip @skip -
select all end -
select all end -
unit 1 resi 2
The 'resi 2' option converts the large Natom x Natom covariance matrix to a smaller Nres x Nres matrix by averaging over the residues. The values in the cells in the larger matrix, which have the same two residue numbers, are averaged, and the result is placed in the smaller matrix. For instance, suppose residue 2 has 10 atoms and residue 3 has 5 atoms. Then there are 5*10=50 corresponding covariances in the larger atom-atom matrix. These 50 values reside in two 25-cell blocks in the larger matrix. These two blocks are symmetric about the diagonal. One block contains the same values as the other block. So each value is listed twice. To get the residue average, the 50 values are added and the total is divided by 50.
The problem arises when the residues are the same. For instance, in the example above, atoms of residue 3 and atoms of residue 3 result in 5*5=25 corresponding covariances. These 25 values reside in a single square block on the diagonal of the larger atom-atom matrix. The diagonal elements, which equal 1, are only listed once. However, when calculating the residue average, CHARMM counts the off-diagonal elements twice, but the diagonal elements once. It adds the 25 values and divides by 25 to get the res-res average. In other words, CHARMM gives more weight to the off-diagonal elements. This slightly lowers the value. Why are the off-diagonal elements counted twice, but the diagonal elements only counted once? Should not each type of value in the larger matrix only be counted once.
It is just a small issue. It may not even be a bug, but it was 'unexpected'. I discovered it after attempting to reproduce the covariance data generated by CHARMM.