polar(a, side='right')
Returns the factors of the polar decomposition u and p such that a = up
(if side is "right") or a = pu
(if side is "left"), where p is positive semidefinite. Depending on the shape of a, either the rows or columns of u are orthonormal. When a is a square array, u is a square unitary array. When a is not square, the "canonical polar decomposition" is computed.
Compute the polar decomposition.
import numpy as np
from scipy.linalg import polar
a = np.array([[1, -1], [2, 4]])
u, p = polar(a)
u
p
b = np.array([[0.5, 1, 2], [1.5, 3, 4]])
u, p = polar(b)
u
p
u.dot(p) # Verify the decomposition.
u.dot(u.T) # The rows of u are orthonormal.
c = b.T
u, p = polar(c)
u
p
u.dot(p) # Verify the decomposition.
u.T.dot(u) # The columns of u are orthonormal.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them