LoginSignup
0
0

More than 5 years have passed since last update.

sympyで「行列の平方根の数値計算(Square root of a matrix)」をやってみた

Last updated at Posted at 2018-12-07

(参考)行列の平方根の数値計算
https://qiita.com/Kgm1500/items/b3bb1a3246ae4bdfb1ab
(参考)Square root of a matrix
https://en.wikipedia.org/wiki/Square_root_of_a_matrix

fullscript.py
from sympy import *
from mpmath import *
A=Matrix([[5,4,1],
          [4,6,4],
          [1,4,5]])
print(A)
print(sqrtm(A))
# Matrix([[5, 4, 1], [4, 6, 4], [1, 4, 5]])
# [                 2.0  1.0  3.33606965638267e-20]
# [                 1.0  2.0                   1.0]
# [3.34095591577049e-20  1.0                   2.0]

2019-01-03

本家stackoverflowでsqrtmを教えてもらった

How to round Matrix sqrtm in sympy?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0