Let us consider the operator :
To verify that it is a Hermitian matrix, we can verify its conjugate transpose:
Its eigenvalues are:
And the corresponding eigenvectors (each column is an eigenvector) are
We have then that eigenvalue 1 is degenerate. We can reconstruct matrix by spectral decomposition:
We have now defined a Hermitian matrix :
We can verify that they commute, that is, :
In the simplest case, we then have a subspace of only one dimension for eigenvalue 2. We can see that , with :
Now for eigenvalue 1, we have a two-dimensional subspace formed by the vectors
All non-null vectors in this subspace continue to be eigenvectors of with the same eigenvalue 1.
If we denote the two eigenvectors by and use them as a basis, any non-null vector that is a linear combination of them,
is also an eigenvector of . In fact,
Now applying to the first eigenvector, we can see that it is a linear combination of the other two vectors in the subspace and is not a eigenvector:
That is, even though these two eigenvectors associated with 1 are a basis for this subspace, they do not form a common eigenvector basis. But we can build one.
Since all non-null vectors in this subspace are eigenvectors of , we only need to find those who are also eigenvectors of .
In this two-dimensional space, ’s action on the vectors of the space is given by:
Its eigenvalues are
And the corresponding eigenvectors (each column is an eigenvector) are:
Combining with the previous results, we can have a new basis given by the eigenvectors (where each column corresponds to a vector of the new basis):
We can test by applying to the vectors of the new basis:
With the corresponding eigenvalues:
We can test by applying to the vectors of the new basis:
With the corresponding eigenvalues:
zdef printa():
import numpy as np
np.set_printoptions(suppress=True, precision=2)
print("Vamos considerar o operador A:")
A = np.array([
[1, 0, 0],
[0, 1, 0],
[0, 0, 2]
])
print(A)
print("\nPara verificar que é uma matriz hermitiana, podemos verificar seu transposto conjugado:")
m=A.T
m=m.conj()
print(m)
autovalores, autovetores = np.linalg.eig(A)
print("\nSeus autovalores são:")
print(autovalores)
print("\nE os correspondentes autovetores (cada coluna é um autovetor) são")
print(autovetores)
print("\nTemos então que o autovalor 1 é degenerado. Podemos reconstruir a matriz A pela decomposição espectral:")
av1=autovetores[:, 0].reshape(-1, 1)
av2=autovetores[:, 1].reshape(-1, 1)
av3=autovetores[:, 2].reshape(-1, 1)
m=autovalores[0]*av1@av1.T+autovalores[1]*av2@av2.T+autovalores[2]*av3@av3.T
print(m)
print("\nDefinimos agora uma matriz hermitiana B:")
B = np.array([
[3, 1, 0],
[1, 4, 0],
[0, 0, 5]
])
print(B)
print("\nPodemos verificar que eles comutam, isto é, AB-BA=0:")
print(A@B-B@A)
print("\nNo caso mais simples, temos então um subespaço de apenas uma dimensão para o autovalor 2. Podemos conferir que Bv=bv, sendo b=5")
v=B@av3
print(v)
print("\nAgora para o autovalor 1, temos um subespaço de duas dimensões formada pelos vetores")
print(autovetores[:, :2])
print("\nTodos vetores não nulos neste subespaço continuam a serem autovetores de A com o mesmo autovalor (c).")
print("Se denotamos os dois autovetores calculados por (v1,v2) e os utilzarmos como base, qualquer vetor não nulo que seja uma combinação linear deles u=av1+bv2 também é um autovetor de A. De fato Au=aAv1+bAv2 =acv1+bcv2=c(av1+bv2)=cu.")
print("Agora aplicando B ao primeiro autovetor, podemos ver que ele é uma combinação linear dos outros 2 vetores do espaço e não é um autovetor de B:")
v=B@av1
print(v)
print("Ou seja, ainda que esses dois autovetores associados a 1 sejam uma base para esse subespaço, eles não formam uma base de autovetores comum. Mas podemos construir uma.")
print("Como todos vetores não nulos neste subespaço são autovetores de A, só precisamos encontrar aqueles que também são autovetores de B.")
print("Neste espaço bidimensional, atuação de B sobre os vetores do espaço é dada apenas por:")
B2 = np.array([
[3, 1],
[1, 4]])
print(B2)
autovaloresB2, autovetoresB2 = np.linalg.eig(B2)
print("\nSeus autovalores são")
print(autovaloresB2)
print("\nE os correspondentes autovetores (cada coluna é um autovetor) são:")
print(autovetoresB2)
print("\nCombinando então com resultados anteriores, podemos ter nova base dada pelos autovetores comuns(onde cada coluna corresponde a um vetor da nova base):")
base = np.array([[-0.85065081,-0.52573111,0],
[ 0.52573111,-0.85065081,0],
[ 0,0,1],])
print(base)
autovaloresA, autovetoresA = np.linalg.eig(A)
autovaloresB, autovetoresB = np.linalg.eig(B)
av1=base[:, 0].reshape(-1, 1)
av2=base[:, 1].reshape(-1, 1)
av3=base[:, 2].reshape(-1, 1)
print("Podemos testar aplicando A aos vetores da nova base:")
print(A@av1/autovaloresA[0])
print(A@av2/autovaloresA[1])
print(A@av3/autovaloresA[2])
print("Onde dividimos cada vetor já pelo correspondente autovalor:")
print(autovaloresA)
print("Podemos testar aplicando B aos vetores da nova base:")
print(B@av1/autovaloresB[0])
print(B@av2/autovaloresB[1])
print(B@av3/autovaloresB[2])
print("Onde dividimos cada vetor já pelo correspondente autovalor:")
print(autovaloresB)