Datalens.ai
← All algorithms

DECOMPOSITION

ordqz

QZ decomposition for a pair of matrices with reordering.

Example of usage

Factorise a labelled industrial sensor calibration matrix and verify reconstruction.

Usage / limitations

+Use when: Separate stable and unstable generalized eigenmodes.

−Limitations: Matrix shape, symmetry, conditioning and numerical precision constrain validity.

Mathematical formula

QᵀAZ = S and QᵀBZ = T, reordered.
Sample dataShow
{
  "variable": "measurement_matrix",
  "domain": "Industrial sensor calibration",
  "feature_names": [
    "temperature_c",
    "vibration_mm_s"
  ],
  "matrix": [
    [
      -2.0,
      0.0
    ],
    [
      0.0,
      3.0
    ]
  ],
  "reference_matrix": [
    [
      1.0,
      0.0
    ],
    [
      0.0,
      1.0
    ]
  ]
}

Code example (Python)

# DataLens.ai example
# Factorise the named two- or three-sensor calibration matrix.
from scipy.linalg import ordqz
AA, BB, alpha, beta, Q, Z = ordqz(A, B, sort='lhp')
assert np.allclose(Q @ AA @ Z.T, A) and np.allclose(Q @ BB @ Z.T, B)
print("Expected output verified")