Schur decomposition

Report a typo

As you have learned from the topic, SciPy has many advanced linear algebra functions. Let's look at another problem that takes advantage of those cool features.

Your task is to find Schur decomposition of the matrix A=ZTZHA = Z T Z^H

A=(022212101)A = \begin{pmatrix} 0 & 2 & 2\\ 2 & 1 & 2 \\ 1 & 0 & 1 \end{pmatrix}You can find the needed function in scipy.linalg. After you've calculated the decomposition, find the traces of matrices TT and ZZ, and print their sum. You can use numpy.trace or scipy.trace to get the traces of matrices.

Tip: Don't forget to import scipy.linalg!

Write a program in Python 3
import scipy
import numpy as np


A = np.array([[0, 2, 2], [2, 1, 2], [1, 0, 1]])

# your code here
___

Create a free account to access the full topic