remncomm.m
Removes from the Hermitian operator A the part that does not commute with the Hermitian operator B.
Syntax
C=remncomm(A,EvB)
Arguments
A - a square matrix
EvB - a square matrix containing eigenvectors
of B in columns
Outputs
C - a square matrix
Notes
When the matrix B is diagonal, the part of A that commutes with it is the diagonal part, so just use diag(diag(A)).
See also
Version 2.5, authors: Ilya Kuprov