I listed my code below. I am trying to prove that left-singular vectors are eigenvectors of AA* and right-singular vectors are eigenvectors of A*A, but I am getting weird negative signs that are throwing off my answer even though the absolute values are the same.

```
import torch
P = torch.tensor([[25, 2, -5.],
[3, -2, 1],
[5, 7, 4]])
# Verifying SVD process, works!
print(f"Verifying SVD process, works!\nOriginal matrix:\n{P}")
U, D, VT = torch.linalg.svd(P)
print(f"U:\n{U}\nD:\n{D}\nV:\n{VT.T}")
print(f"Getting orginal matrix from U, D, V values:\n{U@torch.diag(D)@VT}")
print("-"*25)
# Representing U, D, and V as eigenvectors/eigenvalues of P@P.T and P.T@P and verifying SVD process, doesn't work!
print(f"Representing U, D, and V as eigenvectors/eigenvalues of P@P.T and P.T@P and verifying SVD process, doesn't work!\nOriginal matrix:\n{P}")
e_val_1, e_vec_1 = torch.linalg.eig(P@P.T)
e_val_2, e_vec_2 = torch.linalg.eig(P.T@P)
e_vec_2 = e_vec_2[torch.tensor([0,1,2])][:,torch.tensor([0,2,1])].to(torch.float)
e_vec_1 = e_vec_1.to(torch.float)
srt, ind = torch.sort(torch.sqrt(e_val_2).to(torch.float),descending=True)
# U, D, V values are not the same as above, has same absolute values but different signs, but why?
print(f"(These values don't match original) U:\n{e_vec_1}\nD:\n{srt}\nV:\n{e_vec_2}")
print(f"Getting orginal matrix from U, D, V values:\n{e_vec_1.to(torch.float)@torch.diag(srt)@e_vec_2.to(torch.float).T}")
# Need to make following modifications to make code work, but why?
e_vec_2 = -e_vec_2
e_vec_1[:,1] = -e_vec_1[:,1]
print(f"After making modifications (listed in code):\n{e_vec_1.to(torch.float)@torch.diag(srt)@e_vec_2.to(torch.float).T}")
```