Python Forum
The twelfth root of a matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The twelfth root of a matrix
#6
Here is how I was able to do it for a particular matrix
import numpy as np
from numpy import linalg as la

A = np.array([
    [0.94328, 0.04779, 0.00892658],
    [0.367962, 0.52199275, 0.1100448852],
    [0, 0, 1],
    ])
# compute the eigenvalues and eigenvectors of A
w, v = la.eig(A)
# We are lucky, A is diagonalizable and its
# eigenvalues (the components of w) are non negative
# Aa = np.dot(v, np.dot(np.diag(w), la.inv(v)))
ww = w ** (1/12)
B = np.dot(v, np.dot(np.diag(ww), la.inv(v)))
Aaa = la.matrix_power(B, 12)
print(Aaa - A)
Output:
[[ -1.44328993e-15 -1.73472348e-16 -1.35308431e-16] [ -6.66133815e-16 -3.33066907e-16 1.80411242e-16] [ 0.00000000e+00 0.00000000e+00 0.00000000e+00]]
You need to figure out what to do if there are complex eigenvalues or if A is not diagonalizable. Usually, there won't be a unique matrix B solution of this problem, and usually the matrix B will be complex.

In the three matrices shown in the original post, the third line is 0, 0, 1. If this is always the case, it makes the problem simpler because 1 is always an eigenvalue, and we're basically working in dimension 2.
Reply


Messages In This Thread
The twelfth root of a matrix - by Arduinol - Nov-25-2018, 03:43 PM
RE: The twelfth root of a matrix - by Arduinol - Nov-27-2018, 06:17 PM
RE: The twelfth root of a matrix - by micseydel - Nov-27-2018, 06:34 PM
RE: The twelfth root of a matrix - by Gribouillis - Nov-27-2018, 06:49 PM
RE: The twelfth root of a matrix - by Arduinol - Nov-27-2018, 07:18 PM
RE: The twelfth root of a matrix - by Gribouillis - Nov-28-2018, 07:03 AM
RE: The twelfth root of a matrix - by Arduinol - Nov-28-2018, 08:50 AM
RE: The twelfth root of a matrix - by Gribouillis - Nov-28-2018, 09:33 AM
RE: The twelfth root of a matrix - by Arduinol - Nov-28-2018, 11:09 AM
RE: The twelfth root of a matrix - by Gribouillis - Nov-28-2018, 11:36 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020