scipy.linalg.

polar#

scipy.linalg.polar(a, side='right')[Quelle]#

Berechnet die Polare Zerlegung.

Gibt die Faktoren der Polaren Zerlegung [1] u und p zurück, so dass a = up (wenn side "right" ist) oder a = pu (wenn side "left" ist), wobei p positiv semidefinit ist. Abhängig von der Form von a sind entweder die Zeilen oder Spalten von u orthonormal. Wenn a ein quadratisches Array ist, ist u ein quadratisches unitäres Array. Wenn a nicht quadratisch ist, wird die "kanonische Polare Zerlegung" [2] berechnet.

Die Dokumentation wurde unter der Annahme verfasst, dass die Array-Argumente bestimmte „Kern“-Formen haben. Array-Argumente dieser Funktion können jedoch zusätzliche „Batch“-Dimensionen vorangestellt haben. In diesem Fall wird das Array als Stapel von niedrigdimensionalen Schnitten behandelt; siehe Gestapelte lineare Operationen für Details.

Parameter:
a(m, n) array_like

Das zu zerlegende Array.

side{‘left’, ‘right’}, optional

Bestimmt, ob eine rechte oder linke Polare Zerlegung berechnet wird. Wenn side "right" ist, dann a = up. Wenn side "left" ist, dann a = pu. Der Standardwert ist "right".

Rückgabe:
u(m, n) ndarray

Wenn a quadratisch ist, dann ist u unitär. Wenn m > n, dann sind die Spalten von a orthonormal, und wenn m < n, dann sind die Zeilen von u orthonormal.

pndarray

p ist hermitesch und positiv semidefinit. Wenn a nichtsingulär ist, ist p positiv definit. Die Form von p ist (n, n) oder (m, m), abhängig davon, ob side "right" oder "left" ist.

Referenzen

[1]

R. A. Horn und C. R. Johnson, „Matrix Analysis“, Cambridge University Press, 1985.

[2]

N. J. Higham, „Functions of Matrices: Theory and Computation“, SIAM, 2008.

Beispiele

>>> import numpy as np
>>> from scipy.linalg import polar
>>> a = np.array([[1, -1], [2, 4]])
>>> u, p = polar(a)
>>> u
array([[ 0.85749293, -0.51449576],
       [ 0.51449576,  0.85749293]])
>>> p
array([[ 1.88648444,  1.2004901 ],
       [ 1.2004901 ,  3.94446746]])

Ein nicht-quadratisches Beispiel, mit m < n

>>> b = np.array([[0.5, 1, 2], [1.5, 3, 4]])
>>> u, p = polar(b)
>>> u
array([[-0.21196618, -0.42393237,  0.88054056],
       [ 0.39378971,  0.78757942,  0.4739708 ]])
>>> p
array([[ 0.48470147,  0.96940295,  1.15122648],
       [ 0.96940295,  1.9388059 ,  2.30245295],
       [ 1.15122648,  2.30245295,  3.65696431]])
>>> u.dot(p)   # Verify the decomposition.
array([[ 0.5,  1. ,  2. ],
       [ 1.5,  3. ,  4. ]])
>>> u.dot(u.T)   # The rows of u are orthonormal.
array([[  1.00000000e+00,  -2.07353665e-17],
       [ -2.07353665e-17,   1.00000000e+00]])

Ein weiteres nicht-quadratisches Beispiel, mit m > n

>>> c = b.T
>>> u, p = polar(c)
>>> u
array([[-0.21196618,  0.39378971],
       [-0.42393237,  0.78757942],
       [ 0.88054056,  0.4739708 ]])
>>> p
array([[ 1.23116567,  1.93241587],
       [ 1.93241587,  4.84930602]])
>>> u.dot(p)   # Verify the decomposition.
array([[ 0.5,  1.5],
       [ 1. ,  3. ],
       [ 2. ,  4. ]])
>>> u.T.dot(u)  # The columns of u are orthonormal.
array([[  1.00000000e+00,  -1.26363763e-16],
       [ -1.26363763e-16,   1.00000000e+00]])