##QR decomposition

import numpy as np
A=np.array([[5,-2],[-2,8]])
q,r= np.linalg.qr(A)
print(q,r)

##for eigenvalue using QR decomposition
j=A

for k in range(50):
  i=j
  q,r=np.linalg.qr(i)
  j=np.dot(r,q)

print(j)


##Eigenvalues using numpy
z=np.linalg.eigh(A)
print("eigenvalues",z)

b50b09e9f643d17c38c0506bec25e6290b787a9d
<mask token>

<mask token>
print(q, r)
<mask token>
for k in range(50):
    i = j
    q, r = np.linalg.qr(i)
    j = np.dot(r, q)
print(j)
<mask token>
print('eigenvalues', z)

<mask token>
A = np.array([[5, -2], [-2, 8]])
q, r = np.linalg.qr(A)
print(q, r)
j = A
for k in range(50):
    i = j
    q, r = np.linalg.qr(i)
    j = np.dot(r, q)
print(j)
z = np.linalg.eigh(A)
print('eigenvalues', z)

import numpy as np
A = np.array([[5, -2], [-2, 8]])
q, r = np.linalg.qr(A)
print(q, r)
j = A
for k in range(50):
    i = j
    q, r = np.linalg.qr(i)
    j = np.dot(r, q)
print(j)
z = np.linalg.eigh(A)
print('eigenvalues', z)

##QR decomposition

import numpy as np
A=np.array([[5,-2],[-2,8]])
q,r= np.linalg.qr(A)
print(q,r)

##for eigenvalue using QR decomposition
j=A

for k in range(50):
  i=j
  q,r=np.linalg.qr(i)
  j=np.dot(r,q)

print(j)


##Eigenvalues using numpy
z=np.linalg.eigh(A)
print("eigenvalues",z)
