Alasdair gave in his blog post Interlaced eigenvalues a small Matlab/Octave example around the following beautiful result due to Cauchy:
Let
be an
Hermitian matrix with eigenvalues
and let the matrix
be obtained from
by removing the
th row and the
th column for some
. Then the eigenvalues of
![]()
satisfy the interlacing
.
Alasdair gave a little Matlab/Octave experiment to illiustrate this and we reproduce it here using SAGE (sticking to his notation for comparison).
sage: n = 4
sage: D = diagonal_matrix(range(1,n+1))
sage: D
[1 0 0 0]
[0 2 0 0]
[0 0 3 0]
[0 0 0 4]
sage: R = random_matrix(RR,n)
sage: R
[ 0.778692495501054 -0.135208587751857 0.257223918336617 0.774429743108338]
[ 0.423676053284628 0.417711760181128 0.241748509057067 0.961897138926902]
[ 0.761841048992683 0.728238125048413 -0.919597769483716 0.778538514077347]
[-0.459693778794198 -0.349046725059769 -0.969387932465504 -0.922931517520695]
sage: S = R - R.transpose()
sage: Q = (S-identity_matrix(n)).inverse()*(S+identity_matrix(n))
sage: M = Q*D*Q.transpose()
sage: M
[ 1.95237691577229 0.231093937356808 0.216951816905018 0.296266773415154]
[ 0.231093937356808 2.92188071228280 0.263114531184218 0.0747380763688735]
[ 0.216951816905018 0.263114531184218 2.90749330981640 -1.36941012136363]
[ 0.296266773415154 0.0747380763688735 -1.36941012136363 2.21824906212850]
sage: M.eigenvalues()
[3.99999999999999, 3.00000000000003, 1.99999999999998, 1.00000000000000]
sage: x = range(n)
sage: x.remove(randint(0,3)
sage: N = M.matrix_from_rows_and_columns(x,x)
sage: N
[ 1.95237691577229 0.216951816905018 0.296266773415154]
[0.216951816905018 2.90749330981640 -1.36941012136363]
[0.296266773415154 -1.36941012136363 2.21824906212850]
sage: N.eigenvalues()
[3.97504068833705, 2.09499000737375, 1.00808859200640]
Footnote: We had to take a little detour to delete some rows and columns from a matrix. It turns out, that this feature is already Ticket #11528 on the trac server of sage.
