scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
ordqz(A, B, sort='lhp', output='real', overwrite_a=False, overwrite_b=False, check_finite=True)

Notes

On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N , will be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i and BETA(j),j=1,...,N are the diagonals of the complex Schur form (S,T) that would result if the 2-by-2 diagonal blocks of the real generalized Schur form of (A,B) were further reduced to triangular form using complex unitary transformations. If ALPHAI(j) is zero, then the jth eigenvalue is real; if positive, then the j``th and ``(j+1)``st eigenvalues are a complex conjugate pair, with ``ALPHAI(j+1) negative.

versionadded

Parameters

A : (N, N) array_like

2-D array to decompose

B : (N, N) array_like

2-D array to decompose

sort : {callable, 'lhp', 'rhp', 'iuc', 'ouc'}, optional

Specifies whether the upper eigenvalues should be sorted. A callable may be passed that, given an ordered pair (alpha, beta) representing the eigenvalue x = (alpha/beta) , returns a boolean denoting whether the eigenvalue should be sorted to the top-left (True). For the real matrix pairs beta is real while alpha can be complex, and for complex matrix pairs both alpha and beta can be complex. The callable must be able to accept a NumPy array. Alternatively, string parameters may be used:

  • 'lhp' Left-hand plane (x.real < 0.0)

  • 'rhp' Right-hand plane (x.real > 0.0)

  • 'iuc' Inside the unit circle (x*x.conjugate() < 1.0)

  • 'ouc' Outside the unit circle (x*x.conjugate() > 1.0)

With the predefined sorting functions, an infinite eigenvalue (i.e., alpha != 0 and beta = 0 ) is considered to lie in neither the left-hand nor the right-hand plane, but it is considered to lie outside the unit circle. For the eigenvalue (alpha, beta) = (0, 0) , the predefined sorting functions all return :None:None:`False`.

output : str {'real','complex'}, optional

Construct the real or complex QZ decomposition for real matrices. Default is 'real'.

overwrite_a : bool, optional

If True, the contents of A are overwritten.

overwrite_b : bool, optional

If True, the contents of B are overwritten.

check_finite : bool, optional

If true checks the elements of A and B are finite numbers. If false does no checking and passes matrix through to underlying algorithm.

Returns

AA : (N, N) ndarray

Generalized Schur form of A.

BB : (N, N) ndarray

Generalized Schur form of B.

alpha : (N,) ndarray

alpha = alphar + alphai * 1j. See notes.

beta : (N,) ndarray

See notes.

Q : (N, N) ndarray

The left Schur vectors.

Z : (N, N) ndarray

The right Schur vectors.

QZ decomposition for a pair of matrices with reordering.

See Also

qz

Examples

>>> from scipy.linalg import ordqz
... A = np.array([[2, 5, 8, 7], [5, 2, 2, 8], [7, 5, 6, 6], [5, 4, 4, 8]])
... B = np.array([[0, 6, 0, 0], [5, 0, 2, 1], [5, 2, 6, 6], [4, 7, 7, 7]])
... AA, BB, alpha, beta, Q, Z = ordqz(A, B, sort='lhp')

Since we have sorted for left half plane eigenvalues, negatives come first

>>> (alpha/beta).real < 0
array([ True,  True, False, False], dtype=bool)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.linalg._decomp_qz.ordqz scipy.linalg._decomp_qz.qz

Local connectivity graph

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


GitHub : /scipy/linalg/_decomp_qz.py#264
type: <class 'function'>
Commit: