Question: Computer Science & Numerical Computation question. Python 3, JupyterNoteBook; fill the #your code here part. I will give thumb up, thank you! Please let me

Computer Science & Numerical Computation question. Python 3, JupyterNoteBook;

fill the #your code here part. I will give thumb up, thank you!

Please let me know if any information is missing.

Question and test case:

Computer Science & Numerical Computation question. Python 3, JupyterNoteBook; fill the #your

code here part. I will give thumb up, thank you! Please let

Tridiagonalization suppose we implement a sequence of transformations Oi Q. to introduce zeros in successive columns and rows. Then we'll have -... Q2Q 10010 Q 102 First, we note that the natural way to store O is as a list of reflector vectors . To check our results, we'd like to be able to make O as an explicit matrix. This function is a near copy of one in the Linear Algebra notebook. :def Qtimes_x(V, x): Apply orthogonal matrix Q represented as list of Householder reflectors yx.copy for v in reversed(V): --1en(v) y[-= 2 * v * (v @ y[:1) return y def Q as_explicit(V): Q = np.eye(m) for i, col in enumerate(Q.T) return I: def symtridiagonalize(A): "Reduce the symmetric matrix A to tridiagonal form using orthogonal transformation QATA Q B = A.copy() nlen (B) for i in range(n - 2): v = B[14:,].copy( ) # Turn v into a normalized vector representing # the reflection 1-2 v v^T # YOUR CODE HERE raise NotImplementedError() V.append(v) return B, Q_as_explicit(V) Ahat, Q symtridiagonalize(A) print(Ahat) # symmetric and tridiagonal print('Error:', np.linalg.norm(Q.Te A Q Ahat)) [ ] : Ahat, Q = symtridiagonalize(A) np.allclose(A, Q Ahat @ Q.T) Tridiagonalization suppose we implement a sequence of transformations Oi Q. to introduce zeros in successive columns and rows. Then we'll have -... Q2Q 10010 Q 102 First, we note that the natural way to store O is as a list of reflector vectors . To check our results, we'd like to be able to make O as an explicit matrix. This function is a near copy of one in the Linear Algebra notebook. :def Qtimes_x(V, x): Apply orthogonal matrix Q represented as list of Householder reflectors yx.copy for v in reversed(V): --1en(v) y[-= 2 * v * (v @ y[:1) return y def Q as_explicit(V): Q = np.eye(m) for i, col in enumerate(Q.T) return I: def symtridiagonalize(A): "Reduce the symmetric matrix A to tridiagonal form using orthogonal transformation QATA Q B = A.copy() nlen (B) for i in range(n - 2): v = B[14:,].copy( ) # Turn v into a normalized vector representing # the reflection 1-2 v v^T # YOUR CODE HERE raise NotImplementedError() V.append(v) return B, Q_as_explicit(V) Ahat, Q symtridiagonalize(A) print(Ahat) # symmetric and tridiagonal print('Error:', np.linalg.norm(Q.Te A Q Ahat)) [ ] : Ahat, Q = symtridiagonalize(A) np.allclose(A, Q Ahat @ Q.T)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!