Bidiagonal Matrix Checker
Check whether a square matrix has non-zero entries only on the main diagonal and the diagonal directly above it.
Check whether a square matrix has non-zero entries only on the main diagonal and the diagonal directly above it.
How Bidiagonal Matrix Checker Works
This is a relaxed version of the diagonal test — it allows one extra band of non-zero values directly above the main diagonal (the superdiagonal), while every other position must still be zero.
Who Uses Bidiagonal Matrix Checker and Why
- Checking whether an intermediate matrix from a QR algorithm or SVD reduction step has actually reached bidiagonal form.
- Verifying a homework problem on relaxed diagonal structures that allow one extra non-zero band.
- Confirming a matrix meets the bidiagonal precondition before applying a specialized numerical algorithm that expects it.
- Distinguishing a genuinely bidiagonal matrix from a fully diagonal one.
Mistakes to Avoid
- Confusing bidiagonal (main diagonal plus the superdiagonal directly above it) with tridiagonal, which also allows the subdiagonal below the main diagonal — bidiagonal is stricter, one-sided.
- Assuming any diagonal matrix will fail this check — the opposite is true, since a diagonal matrix already satisfies the looser bidiagonal condition automatically.
- Submitting a non-square matrix, since this property, like diagonal and triangular checks, is only defined for square matrices.
Tips for Best Results
- Remember every diagonal matrix automatically passes the bidiagonal test, since diagonal is simply a stricter special case of it.
- Use the Lower Bidiagonal Matrix Checker instead if you specifically need the subdiagonal (below the main diagonal) version of this test.
Fixing Common Problems
My matrix fails but seems close to bidiagonal. — Check for a stray non-zero entry below the main diagonal or beyond the superdiagonal band — even one disqualifies it.
I'm not sure whether to test the upper or lower version. — Use this checker for a non-zero band above the main diagonal (superdiagonal); use the Lower Bidiagonal Matrix Checker for a band below it (subdiagonal) instead.
Terms Explained
Superdiagonal: The diagonal band of entries directly above the main diagonal.
Bidiagonal form: A matrix structure allowing non-zero values only on the main diagonal and one adjacent diagonal band.